Go to the documentation of this file.
52 #ifndef __GR5XX_HAL_AES_H__
53 #define __GR5XX_HAL_AES_H__
183 #define HAL_AES_ERROR_NONE ((uint32_t)0x00000000)
184 #define HAL_AES_ERROR_BUSY ((uint32_t)0x00000001)
185 #define HAL_AES_ERROR_TIMEOUT ((uint32_t)0x00000002)
186 #define HAL_AES_ERROR_TRANSFER ((uint32_t)0x00000004)
187 #define HAL_AES_ERROR_INVALID_PARAM ((uint32_t)0x00000008)
193 #define AES_OPERATION_MODE_ENCRYPT (1U)
194 #define AES_OPERATION_MODE_DECRYPT (0U)
200 #define AES_CHAININGMODE_ECB LL_AES_OPERATION_MODE_ECB
201 #define AES_CHAININGMODE_CBC LL_AES_OPERATION_MODE_CBC
207 #define AES_ENDIAN_MODE_BIG (1U)
208 #define AES_ENDIAN_MODE_SMALL (0U)
214 #define AES_KEY_TYPE_MCU LL_AES_KEYTYPE_MCU
215 #define AES_KEY_TYPE_AHB LL_AES_KEYTYPE_AHB
216 #define AES_KEY_TYPE_KEYRAM LL_AES_KEYTYPE_KRAM
222 #define AES_KEY_MODE_NORMAL LL_AES_KEYMODE_NORMAL
223 #define AES_KEY_MODE_KEYWRAP LL_AES_KEYMODE_KEYWRAP
229 #define AES_KEYSIZE_128BITS LL_AES_KEY_SIZE_128
230 #define AES_KEYSIZE_192BITS LL_AES_KEY_SIZE_192
231 #define AES_KEYSIZE_256BITS LL_AES_KEY_SIZE_256
237 #define AES_DPA_MODE_ENABLE (1U)
238 #define AES_DPA_MODE_DISABLE (0U)
244 #define AES_BLOCK_MAX (2048U)
245 #define AES_BLOCKSIZE_BITS (128U)
246 #define AES_BLOCKSIZE_BYTES (AES_BLOCKSIZE_BITS >> 3)
247 #define AES_BLOCKSIZE_WORDS (AES_BLOCKSIZE_BYTES >> 2)
253 #define AES_FLAG_DATAREADY LL_AES_FLAG_DATAREADY
254 #define AES_FLAG_DMA_DONE LL_AES_FLAG_DMA_DONE
255 #define AES_FLAG_DMA_ERR LL_AES_FLAG_DMA_ERR
256 #define AES_FLAG_KEY_VALID LL_AES_FLAG_KEY_VALID
262 #define AES_IT_DONE ((uint32_t)0x00000001)
279 #define __HAL_AES_GET_FLAG_IT(__HANDLE__, __FLAG__) (READ_BITS((__HANDLE__)->p_instance->INT, (__FLAG__)) == (__FLAG__))
288 #define __HAL_AES_CLEAR_FLAG_IT(__HANDLE__, __FLAG__) SET_BITS((__HANDLE__)->p_instance->INT, (__FLAG__))
300 #define __HAL_AES_GET_FLAG(__HANDLE__, __FLAG__) ((READ_BITS((__HANDLE__)->p_instance->STAT, (__FLAG__)) != 0U) ? SET : RESET)
void hal_aes_msp_deinit(aes_handle_t *p_aes)
De-initialize the AES MSP.
Header file containing functions prototypes of MISC LL library.
void(* aes_msp_deinit)(aes_handle_t *p_aes)
void(* aes_msp_init)(aes_handle_t *p_aes)
void(* aes_done_callback)(aes_handle_t *p_aes)
hal_status_t hal_aes_ecb_encrypt_it(aes_handle_t *p_aes, uint32_t *p_plain_data, uint32_t number, uint32_t *p_cypher_data)
Encrypted an amount of data in non-blocking mode with Interrupt in ECB mode.
uint32_t hal_aes_get_error(aes_handle_t *p_aes)
Return the AES error code.
struct _aes_handle aes_handle_t
AES handle Structure definition.
struct _hal_aes_callback hal_aes_callback_t
HAL AES Callback function definition.
hal_status_t hal_aes_ecb_encrypt(aes_handle_t *p_aes, uint32_t *p_plain_data, uint32_t number, uint32_t *p_cypher_data, uint32_t timeout)
Encrypted an amount of data in blocking mode in ECB mode.
void hal_aes_msp_init(aes_handle_t *p_aes)
Initialize the AES MSP.
hal_status_t hal_aes_cbc_encrypt_dma(aes_handle_t *p_aes, uint32_t *p_plain_data, uint32_t number, uint32_t *p_cypher_data)
Encrypted an amount of data in non-blocking mode with DMA in CBC mode.
hal_status_t hal_aes_init(aes_handle_t *p_aes)
Initialize the AES according to the specified parameters in the aes_init_t and initialize the associa...
void hal_aes_irq_handler(aes_handle_t *p_aes)
Handle AES interrupt request.
hal_status_t hal_aes_cbc_encrypt_it(aes_handle_t *p_aes, uint32_t *p_plain_data, uint32_t number, uint32_t *p_cypher_data)
Encrypted an amount of data in non-blocking mode with Interrupt in CBC mode.
hal_aes_state_t hal_aes_get_state(aes_handle_t *p_aes)
Return the AES handle state.
AES Init Structure definition.
__IO hal_aes_state_t state
hal_status_t hal_aes_cbc_decrypt(aes_handle_t *p_aes, uint32_t *p_cypher_data, uint32_t number, uint32_t *p_plain_data, uint32_t timeout)
Decrypted an amount of data in blocking mode in CBC mode.
struct _aes_init aes_init_t
AES Init Structure definition.
hal_status_t hal_aes_ecb_decrypt(aes_handle_t *p_aes, uint32_t *p_cypher_data, uint32_t number, uint32_t *p_plain_data, uint32_t timeout)
Decrypted an amount of data in blocking mode in ECB mode.
void(* aes_abort_cplt_callback)(aes_handle_t *p_aes)
hal_status_t hal_aes_ecb_encrypt_dma(aes_handle_t *p_aes, uint32_t *p_plain_data, uint32_t number, uint32_t *p_cypher_data)
Encrypted an amount of data in non-blocking mode with DMA in ECB mode.
HAL AES Callback function definition.
hal_status_t
HAL Status structures definition.
This file contains HAL common definitions, enumeration, macros and structures definitions.
AES handle Structure definition.
hal_status_t hal_aes_cbc_decrypt_dma(aes_handle_t *p_aes, uint32_t *p_cypher_data, uint32_t number, uint32_t *p_plain_data)
Decrypted an amount of data in non-blocking mode with DMA in CBC mode.
hal_status_t hal_aes_deinit(aes_handle_t *p_aes)
De-initialize the AES peripheral.
hal_status_t hal_aes_ecb_decrypt_dma(aes_handle_t *p_aes, uint32_t *p_cypher_data, uint32_t number, uint32_t *p_plain_data)
Decrypted an amount of data in non-blocking mode with DMA in ECB mode.
hal_aes_state_t
HAL AES State Enumerations definition.
hal_status_t hal_aes_cbc_encrypt(aes_handle_t *p_aes, uint32_t *p_plain_data, uint32_t number, uint32_t *p_cypher_data, uint32_t timeout)
Encrypted an amount of data in blocking mode in CBC mode.
uint32_t * p_cryp_output_buffer
hal_status_t hal_aes_ecb_decrypt_it(aes_handle_t *p_aes, uint32_t *p_cypher_data, uint32_t number, uint32_t *p_plain_data)
Decrypted an amount of data in non-blocking mode with Interrupt in ECB mode.
void(* aes_error_callback)(aes_handle_t *p_aes)
void hal_aes_error_callback(aes_handle_t *p_aes)
AES error callback.
uint32_t * p_cryp_input_buffer
void hal_aes_done_callback(aes_handle_t *p_aes)
Encrypt or decrypt Done callback.
hal_status_t hal_aes_cbc_decrypt_it(aes_handle_t *p_aes, uint32_t *p_cypher_data, uint32_t number, uint32_t *p_plain_data)
Decrypted an amount of data in non-blocking mode with Interrupt in CBC mode.
Header file containing functions prototypes of AES LL library.