AES_CMAC

Implementation of the AES CMAC hashing function. More...

Detailed Description

Implementation of the AES CMAC hashing function.

Files

file  cmac.h
 AES_CMAC interface definition.
 

Data Structures

struct  cmac_context_t
 AES_CMAC calculation context. More...
 

Macros

#define CMAC_BLOCK_SIZE   16
 Length of AES_CMAC block in bytes.
 

Functions

int cmac_init (cmac_context_t *ctx, const uint8_t *key, uint8_t key_size)
 Initialize CMAC message digest context. More...
 
void cmac_update (cmac_context_t *ctx, const void *data, size_t len)
 Update the CMAC context with a portion of the message being hashed. More...
 
void cmac_final (cmac_context_t *ctx, void *digest)
 Finalizes the CMAC message digest. More...
 

Function Documentation

◆ cmac_final()

void cmac_final ( cmac_context_t ctx,
void *  digest 
)

Finalizes the CMAC message digest.

Parameters
[in]ctxPointer to the CMAC context
[out]digestResult location

◆ cmac_init()

int cmac_init ( cmac_context_t ctx,
const uint8_t *  key,
uint8_t  key_size 
)

Initialize CMAC message digest context.

Parameters
[in]ctxPointer to the CMAC context to initialize
[in]keyKey to be set
[in]key_sizeSize of the key
Returns
CIPHER_INIT_SUCCESS if the initialization was successful. CIPHER_ERR_INVALID_KEY_SIZE if the key size is not valid.

◆ cmac_update()

void cmac_update ( cmac_context_t ctx,
const void *  data,
size_t  len 
)

Update the CMAC context with a portion of the message being hashed.

Parameters
[in]ctxPointer to the CMAC context to update
[in]dataInput data
[in]lenLength of data