Driver for the cc2538 AES-CCM mode of the security core.
More...
|
file | ccm.c |
| Implementation of the cc2538 AES-CCM driver.
|
|
file | ccm.h |
| Header file for the cc2538 AES-CCM driver.
|
|
|
#define | CCM_FLAGS_LEN 1 |
|
#define | CCM_NONCE_LEN_LEN (AES_IV_LEN - CCM_FLAGS_LEN) |
|
#define | CCM_MIC_MAX_LEN AES_TAG_LEN |
|
|
uint8_t | ccm_auth_encrypt_start (uint8_t len_len, uint8_t key_area, const void *nonce, const void *adata, uint16_t adata_len, const void *pdata, uint16_t pdata_len, void *cdata, uint8_t mic_len, struct process *process) |
| Starts a CCM authentication and encryption operation. More...
|
|
uint8_t | ccm_auth_encrypt_get_result (void *mic, uint8_t mic_len) |
| Gets the result of the CCM authentication and encryption operation. More...
|
|
uint8_t | ccm_auth_decrypt_start (uint8_t len_len, uint8_t key_area, const void *nonce, const void *adata, uint16_t adata_len, const void *cdata, uint16_t cdata_len, void *pdata, uint8_t mic_len, struct process *process) |
| Starts a CCM authentication checking and decryption operation. More...
|
|
uint8_t | ccm_auth_decrypt_get_result (const void *cdata, uint16_t cdata_len, void *mic, uint8_t mic_len) |
| Gets the result of the CCM authentication checking and decryption operation. More...
|
|
#define | ccm_auth_encrypt_check_status aes_auth_crypt_check_status |
| Checks the status of the CCM authentication and encryption operation. More...
|
|
#define | ccm_auth_decrypt_check_status aes_auth_crypt_check_status |
| Checks the status of the CCM authentication checking and decryption operation. More...
|
|
Driver for the cc2538 AES-CCM mode of the security core.
◆ ccm_auth_decrypt_check_status
Checks the status of the CCM authentication checking and decryption operation.
- Return values
-
false | Result not yet available, and no error occurred |
true | Result available, or error occurred |
Definition at line 137 of file ccm.h.
◆ ccm_auth_encrypt_check_status
Checks the status of the CCM authentication and encryption operation.
- Return values
-
false | Result not yet available, and no error occurred |
true | Result available, or error occurred |
Definition at line 98 of file ccm.h.
◆ ccm_auth_decrypt_get_result()
uint8_t ccm_auth_decrypt_get_result |
( |
const void * |
cdata, |
|
|
uint16_t |
cdata_len, |
|
|
void * |
mic, |
|
|
uint8_t |
mic_len |
|
) |
| |
Gets the result of the CCM authentication checking and decryption operation.
- Parameters
-
cdata | Pointer to encrypted and authenticated message |
cdata_len | Length of encrypted and authenticated message in octets |
mic | Pointer to authentication field, or NULL |
mic_len | Number of octets in authentication field (even value between 0 and CCM_MIC_MAX_LEN ) |
- Returns
CRYPTO_SUCCESS
if successful, or CRYPTO/AES/CCM error code
- Note
- This function must be called only after
ccm_auth_decrypt_start()
.
◆ ccm_auth_decrypt_start()
uint8_t ccm_auth_decrypt_start |
( |
uint8_t |
len_len, |
|
|
uint8_t |
key_area, |
|
|
const void * |
nonce, |
|
|
const void * |
adata, |
|
|
uint16_t |
adata_len, |
|
|
const void * |
cdata, |
|
|
uint16_t |
cdata_len, |
|
|
void * |
pdata, |
|
|
uint8_t |
mic_len, |
|
|
struct process * |
process |
|
) |
| |
Starts a CCM authentication checking and decryption operation.
- Parameters
-
len_len | Number of octets in length field (2, 4, or 8) |
key_area | Area in Key RAM where the key is stored (0 to AES_KEY_AREAS - 1) |
nonce | Pointer to nonce (CCM_NONCE_LEN_LEN - len_len octets) |
adata | Pointer to additional authenticated data in SRAM, or NULL |
adata_len | Length of additional authenticated data in octets, or 0 |
cdata | Pointer to encrypted and authenticated message in SRAM |
cdata_len | Length of encrypted and authenticated message in octets |
pdata | Pointer to decrypted message in SRAM (may be cdata ), or NULL |
mic_len | Number of octets in authentication field (even value between 0 and CCM_MIC_MAX_LEN ) |
process | Process to be polled upon completion of the operation, or NULL |
- Returns
CRYPTO_SUCCESS
if successful, or CRYPTO/AES/CCM error code
Definition at line 126 of file ccm.c.
◆ ccm_auth_encrypt_get_result()
uint8_t ccm_auth_encrypt_get_result |
( |
void * |
mic, |
|
|
uint8_t |
mic_len |
|
) |
| |
Gets the result of the CCM authentication and encryption operation.
- Parameters
-
mic | Pointer to authentication field, or NULL |
mic_len | Number of octets in authentication field (even value between 0 and CCM_MIC_MAX_LEN ) |
- Returns
CRYPTO_SUCCESS
if successful, or CRYPTO/AES/CCM error code
- Note
- This function must be called only after
ccm_auth_encrypt_start()
.
Definition at line 120 of file ccm.c.
◆ ccm_auth_encrypt_start()
uint8_t ccm_auth_encrypt_start |
( |
uint8_t |
len_len, |
|
|
uint8_t |
key_area, |
|
|
const void * |
nonce, |
|
|
const void * |
adata, |
|
|
uint16_t |
adata_len, |
|
|
const void * |
pdata, |
|
|
uint16_t |
pdata_len, |
|
|
void * |
cdata, |
|
|
uint8_t |
mic_len, |
|
|
struct process * |
process |
|
) |
| |
Starts a CCM authentication and encryption operation.
- Parameters
-
len_len | Number of octets in length field (2, 4, or 8) |
key_area | Area in Key RAM where the key is stored (0 to AES_KEY_AREAS - 1) |
nonce | Pointer to nonce (CCM_NONCE_LEN_LEN - len_len octets) |
adata | Pointer to additional authenticated data in SRAM, or NULL |
adata_len | Length of additional authenticated data in octets, or 0 |
pdata | Pointer to message to authenticate and encrypt in SRAM, or NULL |
pdata_len | Length of message to authenticate and encrypt in octets, or 0 |
cdata | Pointer to encrypted message in SRAM (may be pdata ), or NULL |
mic_len | Number of octets in authentication field (even value between 0 and CCM_MIC_MAX_LEN ) |
process | Process to be polled upon completion of the operation, or NULL |
- Returns
CRYPTO_SUCCESS
if successful, or CRYPTO/AES/CCM error code
Definition at line 110 of file ccm.c.