Driver for the cc2538 AES-CBC-MAC mode of the security core.
More...
|
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.
|
|
|
#define | CBC_MAC_MAC_LEN AES_TAG_LEN |
|
Driver for the cc2538 AES-CBC-MAC mode of the security core.
◆ cbc_mac_auth_check_status
Checks the status of the CBC-MAC authentication operation.
- Return values
-
false | Result not yet available, and no error occurred |
true | Result available, or error occurred |
Definition at line 81 of file cbc-mac.h.
◆ 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_in | Pointer to 128-bit input MAC, or NULL |
mac_out | Pointer 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_area | Area in Key RAM where the key is stored (0 to AES_KEY_AREAS - 1) |
mdata | Pointer to message to authenticate in SRAM |
mdata_len | Length of message to authenticate in octets |
process | Process 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.