Loading...
Searching...
No Matches
aes128_cmac.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Fundación Inria Chile
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
20
21#include <stdio.h>
22#include "crypto/ciphers.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
31#define AES128_CMAC_BLOCK_SIZE 16
32
46
58 const uint8_t *key, uint8_t key_size);
59
69 const void *data, size_t len);
70
80
81#ifdef __cplusplus
82}
83#endif
84
Headers for the packet encryption class.
int aes128_cmac_init(aes128_cmac_context_t *ctx, const uint8_t *key, uint8_t key_size)
Initialize AES128 CMAC message digest context.
void aes128_cmac_final(aes128_cmac_context_t *ctx, void *digest)
Finalizes the CMAC message digest.
void aes128_cmac_update(aes128_cmac_context_t *ctx, const void *data, size_t len)
Update the AES128 CMAC context with a portion of the message being hashed.
#define AES128_CMAC_BLOCK_SIZE
Length of AES128_CMAC block in bytes.
Definition aes128_cmac.h:31
AES128_CMAC calculation context.
Definition aes128_cmac.h:36
uint32_t M_n
last byte in last block
Definition aes128_cmac.h:44
uint8_t X[AES128_CMAC_BLOCK_SIZE]
auxiliary array for CMAC calculations
Definition aes128_cmac.h:40
uint8_t M_last[AES128_CMAC_BLOCK_SIZE]
current last block
Definition aes128_cmac.h:42
cipher_t aes128_ctx
AES128 context.
Definition aes128_cmac.h:38
basic struct for using block ciphers contains the cipher interface and the context
Definition ciphers.h:115