Classes | Macros | Typedefs | Enumerations | Functions
gr55xx_hal_aes.h File Reference

Header file containing functions prototypes of AES HAL library. More...

`#include "gr55xx_ll_aes.h"`
`#include "gr55xx_hal_def.h"`
Include dependency graph for gr55xx_hal_aes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
struct | _aes_init
| AES Init Structure definition. More...
struct | _aes_handle
| AES handle Structure definition. More...
struct | _aes_callback
| HAL AES Callback function definition. More...

## Macros
#define | HAL_AES_ERROR_NONE ((uint32_t)0x00000000)
| No error More...
#define | HAL_AES_ERROR_TIMEOUT ((uint32_t)0x00000001)
| Timeout error More...
#define | HAL_AES_ERROR_TRANSFER ((uint32_t)0x00000002)
| Transfer error More...
#define | HAL_AES_ERROR_INVALID_PARAM ((uint32_t)0x00000004)
| Invalid parameters error. More...
#define | AES_KEYSIZE_128BITS LL_AES_KEY_SIZE_128
| 128 bits More...
#define | AES_KEYSIZE_192BITS LL_AES_KEY_SIZE_192
| 192 bits More...
#define | AES_KEYSIZE_256BITS LL_AES_KEY_SIZE_256
| 256 bits More...
#define | AES_BLOCK_MAX (2048)
| Block max size More...
#define | AES_BLOCKSIZE_BITS (128)
| Block size in bits More...
#define | AES_BLOCKSIZE_BYTES (AES_BLOCKSIZE_BITS >> 3)
| Block size in bytes More...
#define | AES_BLOCKSIZE_WORDS (AES_BLOCKSIZE_BYTES >> 2)
| Block size in words More...
#define | AES_OPERATION_MODE_ENCRYPT (1)
| Encrypt operation mode. More...
#define | AES_OPERATION_MODE_DECRYPT (0)
| Decrypt operation mode. More...
#define | AES_CHAININGMODE_ECB LL_AES_OPERATION_MODE_ECB
| ECB chaining mode. More...
#define | AES_CHAININGMODE_CBC LL_AES_OPERATION_MODE_CBC
| CBC chaining mode. More...
#define | AES_FLAG_DATAREADY LL_AES_FLAG_DATAREADY
| Data ready flag More...
#define | AES_FLAG_DMA_DONE LL_AES_FLAG_DMA_DONE
| DMA transfer done flag More...
#define | AES_FLAG_DMA_ERR LL_AES_FLAG_DMA_ERR
| DMA transfer error flag More...
#define | AES_FLAG_KEY_VALID LL_AES_FLAG_KEY_VALID
| Key valid flag More...
#define | AES_IT_DONE ((uint32_t)0x00000001)
| AES Encrypted or Decrypted Data Done Interrupt source. More...
#define | HAL_AES_TIMEOUT_DEFAULT_VALUE ((uint32_t)5000)
| 5s More...
#define | __HAL_AES_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->state = HAL_AES_STATE_RESET)
| Reset AES handle states. More...
#define | __HAL_AES_ENABLE(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->CTRL, AES_CTRL_ENABLE)
| Enable the specified AES peripheral. More...
#define | __HAL_AES_DISABLE(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->CTRL, AES_CTRL_ENABLE)
| Disable the specified AES peripheral. More...
#define | __HAL_AES_ENABLE_IT(__HANDLE__) ll_aes_enable_it_done((__HANDLE__)->p_instance)
| Enable the AES interrupt. More...
#define | __HAL_AES_DISABLE_IT(__HANDLE__) ll_aes_disable_it_done((__HANDLE__)->p_instance)
| Disable the AES interrupt. More...
#define | __HAL_AES_GET_FLAG_IT(__HANDLE__, __FLAG__) (READ_BITS((__HANDLE__)->p_instance->INTERRUPT, (__FLAG__)) == (__FLAG__))
| Check whether the specified AES interrupt flag is set or not. More...
#define | __HAL_AES_CLEAR_FLAG_IT(__HANDLE__, __FLAG__) SET_BITS((__HANDLE__)->p_instance->INTERRUPT, (__FLAG__))
| Clear the specified AES interrupt flag. More...
#define | __HAL_AES_GET_FLAG(__HANDLE__, __FLAG__) ((READ_BITS((__HANDLE__)->p_instance->STATUS, (__FLAG__)) != 0) ? SET : RESET)
| Check whether the specified AES flag is set or not. More...
#define | IS_AES_KEY_SIZE(__SIZE__)
| Check if AES Key Size is valid. More...
#define | IS_AES_OPERATION_MODE(__MODE__)
| Check if AES Operation Mode is valid. More...
#define | IS_AES_CHAININGMODE(__MODE__)
| Check if AES Chaining Mode is valid. More...

## Typedefs
typedef struct _aes_init | aes_init_t
| AES Init Structure definition. More...
typedef struct _aes_handle | aes_handle_t
| AES handle Structure definition. More...
typedef struct _aes_callback | aes_callback_t
| HAL AES Callback function definition. More...

## Enumerations
enum | hal_aes_state_t { HAL_AES_STATE_RESET = 0x00, HAL_AES_STATE_READY = 0x01, HAL_AES_STATE_BUSY = 0x02, HAL_AES_STATE_ERROR = 0x03, HAL_AES_STATE_TIMEOUT = 0x04, HAL_AES_STATE_SUSPENDED = 0x05 }
| HAL AES State Enumerations definition. More...

## Functions
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 associated handle. More...
hal_status_t | hal_aes_deinit (aes_handle_t *p_aes)
| De-initialize the AES peripheral. More...
void | hal_aes_msp_init (aes_handle_t *p_aes)
| Initialize the AES MSP. More...
void | hal_aes_msp_deinit (aes_handle_t *p_aes)
| De-initialize the AES MSP. More...
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. More...
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. More...
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. More...
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. More...
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. More...
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. More...
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. More...
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. More...
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. More...
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. More...
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. More...
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. More...
void | hal_aes_irq_handler (aes_handle_t *p_aes)
| Handle AES interrupt request. More...
void | hal_aes_done_callback (aes_handle_t *p_aes)
| Encrypt or decrypt Done callback. More...
void | hal_aes_error_callback (aes_handle_t *p_aes)
| AES error callback. More...
hal_aes_state_t | hal_aes_get_state (aes_handle_t *p_aes)
| Return the AES handle state. More...
uint32_t | hal_aes_get_error (aes_handle_t *p_aes)
| Return the AES error code. More...
void | hal_aes_set_timeout (aes_handle_t *p_aes, uint32_t timeout)
| Set the AES internal process timeout value. More...
hal_status_t | hal_aes_suspend_reg (aes_handle_t *p_aes)
| Suspend some registers related to AES configuration before sleep. More...
hal_status_t | hal_aes_resume_reg (aes_handle_t *p_aes)
| Restore some registers related to AES configuration after sleep. More...

## Detailed Description

Header file containing functions prototypes of AES HAL library.

Author
  BLE Driver Team

Attention

  ##### Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file gr55xx_hal_aes.h.