Contiki-NG
Files

Driver for the cc2538 AES-CBC-MAC mode of the security core. More...

Files

file  cbc-mac.c
 Implementation of the cc2538 AES-CBC-MAC driver.
 
file  cbc-mac.h
 Header file for the cc2538 AES-CBC-MAC driver.
 

AES-CBC-MAC constants

#define CBC_MAC_MAC_LEN   AES_TAG_LEN
 

AES-CBC-MAC functions

uint8_t cbc_mac_auth_start (uint8_t key_area, const void *mdata, uint16_t mdata_len, struct process *process)
 Starts a CBC-MAC authentication operation. More...
 
uint8_t cbc_mac_auth_get_result (const void *mac_in, void *mac_out)
 Gets the result of the CBC-MAC authentication operation. More...
 
#define cbc_mac_auth_check_status   aes_auth_crypt_check_status
 Checks the status of the CBC-MAC authentication operation. More...
 

Detailed Description

Driver for the cc2538 AES-CBC-MAC mode of the security core.

Macro Definition Documentation

◆ cbc_mac_auth_check_status

#define cbc_mac_auth_check_status   aes_auth_crypt_check_status

Checks the status of the CBC-MAC authentication operation.

Return values
falseResult not yet available, and no error occurred
trueResult available, or error occurred

Definition at line 81 of file cbc-mac.h.

Function Documentation

◆ cbc_mac_auth_get_result()

uint8_t cbc_mac_auth_get_result ( const void *  mac_in,
void *  mac_out 
)

Gets the result of the CBC-MAC authentication operation.

Parameters
mac_inPointer to 128-bit input MAC, or NULL
mac_outPointer to 128-bit output MAC, or NULL
Returns
CRYPTO_SUCCESS if successful, or CRYPTO/AES/CBC-MAC error code
Note
This function must be called only after cbc_mac_auth_start().

Definition at line 66 of file cbc-mac.c.

◆ cbc_mac_auth_start()

uint8_t cbc_mac_auth_start ( uint8_t  key_area,
const void *  mdata,
uint16_t  mdata_len,
struct process *  process 
)

Starts a CBC-MAC authentication operation.

Parameters
key_areaArea in Key RAM where the key is stored (0 to AES_KEY_AREAS - 1)
mdataPointer to message to authenticate in SRAM
mdata_lenLength of message to authenticate in octets
processProcess to be polled upon completion of the operation, or NULL
Returns
CRYPTO_SUCCESS if successful, or CRYPTO/AES/CBC-MAC error code
Warning
CBC-MAC is not secure for variable-length messages. There are a few workarounds that can be implemented by the caller, like prepending the message length to the first block of the message before passing it.

Definition at line 46 of file cbc-mac.c.