L4 HAL Drivers

Embed: (wiki syntax)

« Back to documentation index

AES extended processing functions

AES extended processing functions
[CRYPEx Exported Functions]

Extended processing functions. More...

Functions

HAL_StatusTypeDef HAL_CRYPEx_AES (CRYP_HandleTypeDef *hcryp, uint8_t *pInputData, uint16_t Size, uint8_t *pOutputData, uint32_t Timeout)
 Carry out in polling mode the ciphering or deciphering operation according to hcryp->Init structure fields, all operating modes (encryption, key derivation and/or decryption) and chaining modes ECB, CBC and CTR are managed by this function in polling mode.
HAL_StatusTypeDef HAL_CRYPEx_AES_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pInputData, uint16_t Size, uint8_t *pOutputData)
 Carry out in interrupt mode the ciphering or deciphering operation according to hcryp->Init structure fields, all operating modes (encryption, key derivation and/or decryption) and chaining modes ECB, CBC and CTR are managed by this function in interrupt mode.
HAL_StatusTypeDef HAL_CRYPEx_AES_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pInputData, uint16_t Size, uint8_t *pOutputData)
 Carry out in DMA mode the ciphering or deciphering operation according to hcryp->Init structure fields.
HAL_StatusTypeDef HAL_CRYPEx_AES_Auth (CRYP_HandleTypeDef *hcryp, uint8_t *pInputData, uint64_t Size, uint8_t *pOutputData, uint32_t Timeout)
 Carry out in polling mode the authentication tag generation as well as the ciphering or deciphering operation according to hcryp->Init structure fields.
HAL_StatusTypeDef HAL_CRYPEx_AES_Auth_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pInputData, uint64_t Size, uint8_t *pOutputData)
 Carry out in interrupt mode the authentication tag generation as well as the ciphering or deciphering operation according to hcryp->Init structure fields.
HAL_StatusTypeDef HAL_CRYPEx_AES_Auth_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pInputData, uint64_t Size, uint8_t *pOutputData)
 Carry out in DMA mode the authentication tag generation as well as the ciphering or deciphering operation according to hcryp->Init structure fields.

Detailed Description

Extended processing functions.

  ==============================================================================
                      ##### AES extended processing functions #####
  ==============================================================================  
    [..]  This section provides functions allowing to:
      (+) Encrypt plaintext or decrypt cipher text using AES algorithm in different chaining modes.
          Functions are generic (handles ECB, CBC and CTR and all modes) and are only differentiated
          based on the processing type. Three processing types are available:
          (++) Polling mode
          (++) Interrupt mode
          (++) DMA mode
      (+) Generate and authentication tag in addition to encrypt/decrypt a plain/cipher text using AES 
          algorithm in different chaining modes.
          Functions are generic (handles GCM, GMAC and CMAC) and process only one phase so that steps
          can be skipped if so required. Functions are only differentiated based on the processing type. 
          Three processing types are available:
          (++) Polling mode
          (++) Interrupt mode
          (++) DMA mode          


Function Documentation

HAL_StatusTypeDef HAL_CRYPEx_AES ( CRYP_HandleTypeDef *  hcryp,
uint8_t *  pInputData,
uint16_t  Size,
uint8_t *  pOutputData,
uint32_t  Timeout 
)

Carry out in polling mode the ciphering or deciphering operation according to hcryp->Init structure fields, all operating modes (encryption, key derivation and/or decryption) and chaining modes ECB, CBC and CTR are managed by this function in polling mode.

Parameters:
hcryp,:pointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
pInputData,:Pointer to the plain text in case of encryption or cipher text in case of decryption or key derivation+decryption. Parameter is meaningless in case of key derivation.
Size,:Length of the input data buffer in bytes, must be a multiple of 16. Parameter is meaningless in case of key derivation.
pOutputData,:Pointer to the cipher text in case of encryption or plain text in case of decryption/key derivation+decryption, or pointer to the derivative keys in case of key derivation only.
Timeout,:Specify Timeout value
Return values:
HALstatus

Definition at line 173 of file stm32l4xx_hal_cryp_ex.c.

HAL_StatusTypeDef HAL_CRYPEx_AES_Auth ( CRYP_HandleTypeDef *  hcryp,
uint8_t *  pInputData,
uint64_t  Size,
uint8_t *  pOutputData,
uint32_t  Timeout 
)

Carry out in polling mode the authentication tag generation as well as the ciphering or deciphering operation according to hcryp->Init structure fields.

Parameters:
hcryp,:pointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
pInputData,:Pointer to payload data in GCM payload phase, Parameter is meaningless in case of GCM/GMAC init, header and final phases, Pointer to B0 blocks in CMAC header phase, Pointer to C block in CMAC final phase.
Size,:Length of the input payload data buffer in bytes, must be a multiple of 16, Parameter is meaningless in case of GCM/GMAC init and header phases, Length of B blocks (in bytes, must be a multiple of 16) in CMAC header phase, Length of C block (in bytes) in CMAC final phase.
pOutputData,:Pointer to plain or cipher text in GCM payload phase, pointer to authentication tag in GCM/GMAC and CMAC final phases. Parameter is meaningless in case of GCM/GMAC init and header phases and in case of CMAC header phase.
Timeout,:Specify Timeout value
Note:
Supported operating modes are encryption and decryption, supported chaining modes are GCM, GMAC and CMAC.
Phases are singly processed according to hcryp->Init.GCMCMACPhase so that steps in these specific chaining modes can be skipped by the user if so required.
Return values:
HALstatus

Definition at line 427 of file stm32l4xx_hal_cryp_ex.c.

HAL_StatusTypeDef HAL_CRYPEx_AES_Auth_DMA ( CRYP_HandleTypeDef *  hcryp,
uint8_t *  pInputData,
uint64_t  Size,
uint8_t *  pOutputData 
)

Carry out in DMA mode the authentication tag generation as well as the ciphering or deciphering operation according to hcryp->Init structure fields.

Parameters:
hcryp,:pointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
pInputData,:Pointer to payload data in GCM payload phase, Parameter is meaningless in case of GCM/GMAC init, header and final phases, Pointer to B0 blocks in CMAC header phase, Pointer to C block in CMAC final phase.
Size,:Length of the input payload data buffer in bytes, must be a multiple of 16, Parameter is meaningless in case of GCM/GMAC init and header phases, Length of B blocks (in bytes, must be a multiple of 16) in CMAC header phase, Length of C block (in bytes) in CMAC final phase.
pOutputData,:Pointer to plain or cipher text in GCM payload phase, pointer to authentication tag in GCM/GMAC and CMAC final phases. Parameter is meaningless in case of GCM/GMAC init and header phases and in case of CMAC header phase.
Note:
Supported operating modes are encryption and decryption, supported chaining modes are GCM, GMAC and CMAC.
Phases are singly processed according to hcryp->Init.GCMCMACPhase so that steps in these specific chaining modes can be skipped by the user if so required.
pInputData and pOutputData buffers must be 32-bit aligned to ensure a correct DMA transfer to and from the IP.
Return values:
HALstatus

Definition at line 1131 of file stm32l4xx_hal_cryp_ex.c.

HAL_StatusTypeDef HAL_CRYPEx_AES_Auth_IT ( CRYP_HandleTypeDef *  hcryp,
uint8_t *  pInputData,
uint64_t  Size,
uint8_t *  pOutputData 
)

Carry out in interrupt mode the authentication tag generation as well as the ciphering or deciphering operation according to hcryp->Init structure fields.

Parameters:
hcryp,:pointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
pInputData,:Pointer to payload data in GCM payload phase, Parameter is meaningless in case of GCM/GMAC init, header and final phases, Pointer to B0 blocks in CMAC header phase, Pointer to C block in CMAC final phase.
Size,:Length of the input payload data buffer in bytes, must be a multiple of 16, Parameter is meaningless in case of GCM/GMAC init and header phases, Length of B blocks (in bytes, must be a multiple of 16) in CMAC header phase, Length of C block (in bytes) in CMAC final phase.
pOutputData,:Pointer to plain or cipher text in GCM payload phase, pointer to authentication tag in GCM/GMAC and CMAC final phases. Parameter is meaningless in case of GCM/GMAC init and header phases and in case of CMAC header phase.
Note:
Supported operating modes are encryption and decryption, supported chaining modes are GCM, GMAC and CMAC.
Phases are singly processed according to hcryp->Init.GCMCMACPhase so that steps in these specific chaining modes can be skipped by the user if so required.
Return values:
HALstatus

Definition at line 846 of file stm32l4xx_hal_cryp_ex.c.

HAL_StatusTypeDef HAL_CRYPEx_AES_DMA ( CRYP_HandleTypeDef *  hcryp,
uint8_t *  pInputData,
uint16_t  Size,
uint8_t *  pOutputData 
)

Carry out in DMA mode the ciphering or deciphering operation according to hcryp->Init structure fields.

Parameters:
hcryp,:pointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
pInputData,:Pointer to the plain text in case of encryption or cipher text in case of decryption or key derivation+decryption.
Size,:Length of the input data buffer in bytes, must be a multiple of 16.
pOutputData,:Pointer to the cipher text in case of encryption or plain text in case of decryption/key derivation+decryption.
Note:
Chaining modes ECB, CBC and CTR are managed by this function in DMA mode.
Supported operating modes are encryption, decryption and key derivation with decryption.
No DMA channel is provided for key derivation only and therefore, access to AES_KEYRx registers must be done by software.
This API is not applicable to key derivation only; for such a mode, access to AES_KEYRx registers must be done by software thru HAL_CRYPEx_AES() or HAL_CRYPEx_AES_IT() APIs.
pInputData and pOutputData buffers must be 32-bit aligned to ensure a correct DMA transfer to and from the IP.
Return values:
HALstatus

Definition at line 352 of file stm32l4xx_hal_cryp_ex.c.

HAL_StatusTypeDef HAL_CRYPEx_AES_IT ( CRYP_HandleTypeDef *  hcryp,
uint8_t *  pInputData,
uint16_t  Size,
uint8_t *  pOutputData 
)

Carry out in interrupt mode the ciphering or deciphering operation according to hcryp->Init structure fields, all operating modes (encryption, key derivation and/or decryption) and chaining modes ECB, CBC and CTR are managed by this function in interrupt mode.

Parameters:
hcryp,:pointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
pInputData,:Pointer to the plain text in case of encryption or cipher text in case of decryption or key derivation+decryption. Parameter is meaningless in case of key derivation.
Size,:Length of the input data buffer in bytes, must be a multiple of 16. Parameter is meaningless in case of key derivation.
pOutputData,:Pointer to the cipher text in case of encryption or plain text in case of decryption/key derivation+decryption, or pointer to the derivative keys in case of key derivation only.
Return values:
HALstatus

Definition at line 253 of file stm32l4xx_hal_cryp_ex.c.