Functions
IO operation functions
Peripheral Driver » HAL Driver » AES » Functions

AES Encrypt/Decrypt functions. More...

## Functions
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...
hal_status_t | hal_aes_abort (aes_handle_t *p_aes)
| Abort the current encryption or decryption. More...
hal_status_t | hal_aes_abort_it (aes_handle_t *p_aes)
| Abort the current encryption or decryption (non-blocking function) More...

## Detailed Description

AES Encrypt/Decrypt functions.

     ===============================================================================
                          ##### IO operation functions #####
     ===============================================================================
        This subsection provides a set of functions allowing to manage the AES encrypt or decrypt.

        (#) There are two mode of transfer:
           (++) Blocking mode: The communication is performed in polling mode.
               The HAL status of all data processing are returned by the same function
               after finishing transfer.
           (++) Non-Blocking mode: The communication is performed using Interrupts
               or DMA. These API return the HAL status.
               The end of the data processing will be indicated through the
               dedicated AES IRQ when using Interrupt mode or the DMA IRQ when
               using DMA mode.
               The hal_aes_done_callback() user callbacks will be executed respectively
               at the end of the encrypt or decrypt process
               The hal_aes_error_callback() user callback will be executed when a error is detected

        (#) Blocking mode API's are :
            (++) hal_aes_ecb_encrypt()
            (++) hal_aes_ecb_decrypt()
            (++) hal_aes_cbc_encrypt()
            (++) hal_aes_cbc_decrypt()

        (#) Non-Blocking mode API's with Interrupt are :
            (++) hal_aes_ecb_encrypt_it()
            (++) hal_aes_ecb_decrypt_it()
            (++) hal_aes_cbc_encrypt_it()
            (++) hal_aes_cbc_decrypt_it()

        (#) Non-Blocking mode API's with DMA are :
            (++) hal_aes_ecb_encrypt_dma()
            (++) hal_aes_ecb_decrypt_dma()
            (++) hal_aes_cbc_encrypt_dma()
            (++) hal_aes_cbc_decrypt_dma()

        (#) A set of encrypt or decrypt Callbacks are provided in Non_Blocking mode:
            (++) hal_aes_done_callback()
            (++) hal_aes_error_callback()

        (#) Non-Blocking mode transfers could be aborted using Abort API's :
            (++) hal_aes_abort()
            (++) hal_aes_abort_it()

        (#) For Abort services based on interrupts (hal_aes_abort_xxx_it), Abort Complete Callback is provided:
            (++) hal_aes_abort_cplt_callback()

## Function Documentation

## ◆ hal_aes_abort()

hal_status_t hal_aes_abort | ( | aes_handle_t * | p_aes | ) |

Abort the current encryption or decryption.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_aes_abort_it()

hal_status_t hal_aes_abort_it | ( | aes_handle_t * | p_aes | ) |

Abort the current encryption or decryption (non-blocking function)

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_aes_cbc_decrypt()

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.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.
  [in] | p_cypher_data | Pointer to cypher data buffer
  [in] | number | Amount of data to be decrypted in bytes
  [out] | p_plain_data | Pointer to plain data buffer
  [in] | timeout | Timeout duration

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_aes_cbc_decrypt_dma()

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.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.
  [in] | p_cypher_data | Pointer to cypher data buffer
  [in] | number | Amount of data to be decrypted in bytes
  [out] | p_plain_data | Pointer to plain data buffer

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_aes_cbc_decrypt_it()

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.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.
  [in] | p_cypher_data | Pointer to cypher data buffer
  [in] | number | Amount of data to be decrypted in bytes
  [out] | p_plain_data | Pointer to plain data buffer

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_aes_cbc_encrypt()

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.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.
  [in] | p_plain_data | Pointer to plain data buffer
  [in] | number | Amount of data to be decrypted in bytes
  [out] | p_cypher_data | Pointer to cypher data buffer
  [in] | timeout | Timeout duration

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_aes_cbc_encrypt_dma()

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.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.
  [in] | p_plain_data | Pointer to plain data buffer
  [in] | number | Amount of data to be decrypted in bytes
  [out] | p_cypher_data | Pointer to cypher data buffer

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_aes_cbc_encrypt_it()

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.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.
  [in] | p_plain_data | Pointer to plain data buffer
  [in] | number | Amount of data to be decrypted in bytes
  [out] | p_cypher_data | Pointer to cypher data buffer

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_aes_ecb_decrypt()

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.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.
  [in] | p_cypher_data | Pointer to cypher data buffer
  [in] | number | Amount of data to be decrypted in bytes
  [out] | p_plain_data | Pointer to plain data buffer
  [in] | timeout | Timeout duration

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_aes_ecb_decrypt_dma()

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.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.
  [in] | p_cypher_data | Pointer to cypher data buffer
  [in] | number | Amount of data to be decrypted in bytes
  [out] | p_plain_data | Pointer to plain data buffer

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_aes_ecb_decrypt_it()

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.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.
  [in] | p_cypher_data | Pointer to cypher data buffer
  [in] | number | Amount of data to be decrypted in bytes
  [out] | p_plain_data | Pointer to plain data buffer

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_aes_ecb_encrypt()

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.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.
  [in] | p_plain_data | Pointer to plain data buffer
  [in] | number | Amount of data to be decrypted in bytes
  [out] | p_cypher_data | Pointer to cypher data buffer
  [in] | timeout | Timeout duration

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_aes_ecb_encrypt_dma()

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.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.
  [in] | p_plain_data | Pointer to plain data buffer
  [in] | number | Amount of data to be decrypted in bytes
  [out] | p_cypher_data | Pointer to cypher data buffer

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_aes_ecb_encrypt_it()

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.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.
  [in] | p_plain_data | Pointer to plain data buffer
  [in] | number | Amount of data to be decrypted in bytes
  [out] | p_cypher_data | Pointer to cypher data buffer

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.