cc2538: aes: Add support for generic operations
Add generic AES functions that should be able to support all the modes of operation of the hardware AES crypto engine, i.e. ECB, CBC, CTR, CBC-MAC, GCM, and CCM. This makes it possible to easily implement these modes of operation without duplicating code. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
This commit is contained in:
parent
ca919ab0b0
commit
baef75752e
4 changed files with 291 additions and 341 deletions
|
@ -54,12 +54,6 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** \name AES-CCM driver return codes
|
||||
* @{
|
||||
*/
|
||||
#define CCM_AUTHENTICATION_FAILED 7
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** \name AES-CCM functions
|
||||
* @{
|
||||
*/
|
||||
|
@ -86,7 +80,7 @@ uint8_t ccm_auth_encrypt_start(uint8_t len_len, uint8_t key_area,
|
|||
* \retval false Result not yet available, and no error occurred
|
||||
* \retval true Result available, or error occurred
|
||||
*/
|
||||
uint8_t ccm_auth_encrypt_check_status(void);
|
||||
#define ccm_auth_encrypt_check_status aes_auth_crypt_check_status
|
||||
|
||||
/** \brief Gets the result of the CCM authentication and encryption operation
|
||||
* \param mic Pointer to authentication field, or \c NULL
|
||||
|
@ -118,7 +112,7 @@ uint8_t ccm_auth_decrypt_start(uint8_t len_len, uint8_t key_area,
|
|||
* \retval false Result not yet available, and no error occurred
|
||||
* \retval true Result available, or error occurred
|
||||
*/
|
||||
uint8_t ccm_auth_decrypt_check_status(void);
|
||||
#define ccm_auth_decrypt_check_status aes_auth_crypt_check_status
|
||||
|
||||
/** \brief Gets the result of the CCM authentication checking and decryption operation
|
||||
* \param cdata Pointer to encrypted and authenticated message
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue