STM32F439xx HAL User Manual
Functions
Extended AES processing functions
CRYPEx Exported Functions

Extended processing functions. More...

Functions

HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout)
 Initializes the CRYP peripheral in AES CCM encryption mode then encrypt pPlainData.
HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout)
 Initializes the CRYP peripheral in AES GCM encryption mode then encrypt pPlainData.
HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout)
 Initializes the CRYP peripheral in AES GCM decryption mode then decrypted pCypherData.
HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Finish (CRYP_HandleTypeDef *hcryp, uint32_t Size, uint8_t *AuthTag, uint32_t Timeout)
 Computes the authentication TAG.
HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Finish (CRYP_HandleTypeDef *hcryp, uint8_t *AuthTag, uint32_t Timeout)
 Computes the authentication TAG for AES CCM mode.
HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout)
 Initializes the CRYP peripheral in AES CCM decryption mode then decrypted pCypherData.
HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in AES GCM encryption mode using IT.
HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in AES CCM encryption mode using interrupt.
HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in AES GCM decryption mode using IT.
HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in AES CCM decryption mode using interrupt then decrypted pCypherData.
HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in AES GCM encryption mode using DMA.
HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in AES CCM encryption mode using interrupt.
HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in AES GCM decryption mode using DMA.
HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in AES CCM decryption mode using DMA then decrypted pCypherData.

Detailed Description

Extended processing functions.

  ==============================================================================
              ##### Extended AES processing functions #####
  ==============================================================================  
    [..]  This section provides functions allowing to:
      (+) Encrypt plaintext using AES-128/192/256 using GCM and CCM chaining modes
      (+) Decrypt cyphertext using AES-128/192/256 using GCM and CCM chaining modes
      (+) Finish the processing. This function is available only for GCM and CCM
    [..]  Three processing methods are available:
      (+) Polling mode
      (+) Interrupt mode
      (+) DMA mode


Function Documentation

HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt ( CRYP_HandleTypeDef hcryp,
uint8_t *  pCypherData,
uint16_t  Size,
uint8_t *  pPlainData,
uint32_t  Timeout 
)

Initializes the CRYP peripheral in AES CCM decryption mode then decrypted pCypherData.

The cypher data are available in pPlainData.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
pPlainDataPointer to the plaintext buffer
SizeLength of the plaintext buffer, must be a multiple of 16
pCypherDataPointer to the cyphertext buffer
TimeoutTimeout duration
Return values:
HALstatus

Definition at line 1152 of file stm32f4xx_hal_cryp_ex.c.

References CRYP_InitTypeDef::Header, CRYP_InitTypeDef::HeaderSize, and CRYP_HandleTypeDef::Init.

HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt_DMA ( CRYP_HandleTypeDef hcryp,
uint8_t *  pCypherData,
uint16_t  Size,
uint8_t *  pPlainData 
)
HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt_IT ( CRYP_HandleTypeDef hcryp,
uint8_t *  pCypherData,
uint16_t  Size,
uint8_t *  pPlainData 
)

Initializes the CRYP peripheral in AES CCM decryption mode using interrupt then decrypted pCypherData.

The cypher data are available in pPlainData.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
pCypherDataPointer to the cyphertext buffer
SizeLength of the plaintext buffer, must be a multiple of 16
pPlainDataPointer to the plaintext buffer
Return values:
HALstatus

Definition at line 2001 of file stm32f4xx_hal_cryp_ex.c.

References CRYP_InitTypeDef::Header, CRYP_InitTypeDef::HeaderSize, and CRYP_HandleTypeDef::Init.

Referenced by HAL_CRYPEx_GCMCCM_IRQHandler().

HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt ( CRYP_HandleTypeDef hcryp,
uint8_t *  pPlainData,
uint16_t  Size,
uint8_t *  pCypherData,
uint32_t  Timeout 
)

Initializes the CRYP peripheral in AES CCM encryption mode then encrypt pPlainData.

The cypher data are available in pCypherData.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
pPlainDataPointer to the plaintext buffer
SizeLength of the plaintext buffer, must be a multiple of 16
pCypherDataPointer to the cyphertext buffer
TimeoutTimeout duration
Return values:
HALstatus

Definition at line 504 of file stm32f4xx_hal_cryp_ex.c.

References CRYP_InitTypeDef::Header, CRYP_InitTypeDef::HeaderSize, and CRYP_HandleTypeDef::Init.

HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_DMA ( CRYP_HandleTypeDef hcryp,
uint8_t *  pPlainData,
uint16_t  Size,
uint8_t *  pCypherData 
)
HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_IT ( CRYP_HandleTypeDef hcryp,
uint8_t *  pPlainData,
uint16_t  Size,
uint8_t *  pCypherData 
)

Initializes the CRYP peripheral in AES CCM encryption mode using interrupt.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
pPlainDataPointer to the plaintext buffer
SizeLength of the plaintext buffer, must be a multiple of 16
pCypherDataPointer to the cyphertext buffer
Return values:
HALstatus

Definition at line 1554 of file stm32f4xx_hal_cryp_ex.c.

References CRYP_InitTypeDef::Header, CRYP_InitTypeDef::HeaderSize, and CRYP_HandleTypeDef::Init.

Referenced by HAL_CRYPEx_GCMCCM_IRQHandler().

HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Finish ( CRYP_HandleTypeDef hcryp,
uint8_t *  AuthTag,
uint32_t  Timeout 
)

Computes the authentication TAG for AES CCM mode.

Note:
This API is called after HAL_AES_CCM_Encrypt()/HAL_AES_CCM_Decrypt()
Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
AuthTagPointer to the authentication buffer
TimeoutTimeout duration
Return values:
HALstatus

Definition at line 1058 of file stm32f4xx_hal_cryp_ex.c.

References CRYP_HandleTypeDef::Init, and CRYP_InitTypeDef::pScratch.

HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt ( CRYP_HandleTypeDef hcryp,
uint8_t *  pCypherData,
uint16_t  Size,
uint8_t *  pPlainData,
uint32_t  Timeout 
)

Initializes the CRYP peripheral in AES GCM decryption mode then decrypted pCypherData.

The cypher data are available in pPlainData.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
pCypherDataPointer to the cyphertext buffer
SizeLength of the cyphertext buffer, must be a multiple of 16
pPlainDataPointer to the plaintext buffer
TimeoutTimeout duration
Return values:
HALstatus

Definition at line 858 of file stm32f4xx_hal_cryp_ex.c.

References __HAL_CRYP_DISABLE, __HAL_CRYP_ENABLE, __HAL_CRYP_FIFO_FLUSH, __HAL_CRYP_SET_MODE, __HAL_CRYP_SET_PHASE, CRYP_CR_ALGOMODE_AES_GCM_DECRYPT, CRYP_PHASE_PAYLOAD, CRYPEx_GCMCCM_ProcessData(), CRYPEx_GCMCCM_SetHeaderPhase(), CRYPEx_GCMCCM_SetInitVector(), CRYPEx_GCMCCM_SetKey(), HAL_CRYP_PHASE_PROCESS, HAL_CRYP_PHASE_READY, HAL_CRYP_STATE_BUSY, HAL_CRYP_STATE_READY, HAL_CRYP_STATE_TIMEOUT, HAL_GetTick(), CRYP_InitTypeDef::Header, CRYP_InitTypeDef::HeaderSize, CRYP_HandleTypeDef::Init, CRYP_InitTypeDef::KeySize, CRYP_HandleTypeDef::Phase, CRYP_InitTypeDef::pInitVect, CRYP_InitTypeDef::pKey, and CRYP_HandleTypeDef::State.

HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt_DMA ( CRYP_HandleTypeDef hcryp,
uint8_t *  pCypherData,
uint16_t  Size,
uint8_t *  pPlainData 
)

Initializes the CRYP peripheral in AES GCM decryption mode using DMA.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
pCypherDataPointer to the cyphertext buffer.
SizeLength of the cyphertext buffer, must be a multiple of 16
pPlainDataPointer to the plaintext buffer
Return values:
HALstatus

Definition at line 2642 of file stm32f4xx_hal_cryp_ex.c.

References __HAL_CRYP_DISABLE, __HAL_CRYP_ENABLE, __HAL_CRYP_SET_MODE, __HAL_CRYP_SET_PHASE, CRYP_CR_ALGOMODE_AES_GCM_DECRYPT, CRYP_PHASE_PAYLOAD, CRYPEx_GCMCCM_SetDMAConfig(), CRYPEx_GCMCCM_SetHeaderPhase(), CRYPEx_GCMCCM_SetInitVector(), CRYPEx_GCMCCM_SetKey(), CRYPEx_TIMEOUT_VALUE, HAL_CRYP_PHASE_PROCESS, HAL_CRYP_PHASE_READY, HAL_CRYP_STATE_BUSY, HAL_CRYP_STATE_READY, HAL_CRYP_STATE_TIMEOUT, HAL_GetTick(), CRYP_InitTypeDef::Header, CRYP_InitTypeDef::HeaderSize, CRYP_HandleTypeDef::Init, CRYP_InitTypeDef::KeySize, CRYP_HandleTypeDef::Phase, CRYP_InitTypeDef::pInitVect, CRYP_InitTypeDef::pKey, and CRYP_HandleTypeDef::State.

HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt_IT ( CRYP_HandleTypeDef hcryp,
uint8_t *  pCypherData,
uint16_t  Size,
uint8_t *  pPlainData 
)
HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt ( CRYP_HandleTypeDef hcryp,
uint8_t *  pPlainData,
uint16_t  Size,
uint8_t *  pCypherData,
uint32_t  Timeout 
)

Initializes the CRYP peripheral in AES GCM encryption mode then encrypt pPlainData.

The cypher data are available in pCypherData.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
pPlainDataPointer to the plaintext buffer
SizeLength of the plaintext buffer, must be a multiple of 16
pCypherDataPointer to the cyphertext buffer
TimeoutTimeout duration
Return values:
HALstatus

Definition at line 760 of file stm32f4xx_hal_cryp_ex.c.

References __HAL_CRYP_DISABLE, __HAL_CRYP_ENABLE, __HAL_CRYP_FIFO_FLUSH, __HAL_CRYP_SET_MODE, __HAL_CRYP_SET_PHASE, CRYP_CR_ALGOMODE_AES_GCM_ENCRYPT, CRYP_PHASE_PAYLOAD, CRYPEx_GCMCCM_ProcessData(), CRYPEx_GCMCCM_SetHeaderPhase(), CRYPEx_GCMCCM_SetInitVector(), CRYPEx_GCMCCM_SetKey(), HAL_CRYP_PHASE_PROCESS, HAL_CRYP_PHASE_READY, HAL_CRYP_STATE_BUSY, HAL_CRYP_STATE_READY, HAL_CRYP_STATE_TIMEOUT, HAL_GetTick(), CRYP_InitTypeDef::Header, CRYP_InitTypeDef::HeaderSize, CRYP_HandleTypeDef::Init, CRYP_InitTypeDef::KeySize, CRYP_HandleTypeDef::Phase, CRYP_InitTypeDef::pInitVect, CRYP_InitTypeDef::pKey, and CRYP_HandleTypeDef::State.

HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt_DMA ( CRYP_HandleTypeDef hcryp,
uint8_t *  pPlainData,
uint16_t  Size,
uint8_t *  pCypherData 
)

Initializes the CRYP peripheral in AES GCM encryption mode using DMA.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
pPlainDataPointer to the plaintext buffer
SizeLength of the plaintext buffer, must be a multiple of 16
pCypherDataPointer to the cyphertext buffer
Return values:
HALstatus

Definition at line 2291 of file stm32f4xx_hal_cryp_ex.c.

References __HAL_CRYP_DISABLE, __HAL_CRYP_ENABLE, __HAL_CRYP_FIFO_FLUSH, __HAL_CRYP_SET_MODE, __HAL_CRYP_SET_PHASE, CRYP_CR_ALGOMODE_AES_GCM_ENCRYPT, CRYP_PHASE_PAYLOAD, CRYPEx_GCMCCM_SetDMAConfig(), CRYPEx_GCMCCM_SetHeaderPhase(), CRYPEx_GCMCCM_SetInitVector(), CRYPEx_GCMCCM_SetKey(), CRYPEx_TIMEOUT_VALUE, HAL_CRYP_PHASE_PROCESS, HAL_CRYP_PHASE_READY, HAL_CRYP_STATE_BUSY, HAL_CRYP_STATE_READY, HAL_CRYP_STATE_TIMEOUT, HAL_GetTick(), CRYP_InitTypeDef::Header, CRYP_InitTypeDef::HeaderSize, CRYP_HandleTypeDef::Init, CRYP_InitTypeDef::KeySize, CRYP_HandleTypeDef::Phase, CRYP_InitTypeDef::pInitVect, CRYP_InitTypeDef::pKey, and CRYP_HandleTypeDef::State.

HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt_IT ( CRYP_HandleTypeDef hcryp,
uint8_t *  pPlainData,
uint16_t  Size,
uint8_t *  pCypherData 
)
HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Finish ( CRYP_HandleTypeDef hcryp,
uint32_t  Size,
uint8_t *  AuthTag,
uint32_t  Timeout 
)

Computes the authentication TAG.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
SizeTotal length of the plain/cyphertext buffer
AuthTagPointer to the authentication buffer
TimeoutTimeout duration
Return values:
HALstatus

Definition at line 950 of file stm32f4xx_hal_cryp_ex.c.

References __HAL_CRYP_DISABLE, __HAL_CRYP_ENABLE, __HAL_CRYP_SET_PHASE, CRYP_DATATYPE_16B, CRYP_DATATYPE_1B, CRYP_DATATYPE_32B, CRYP_DATATYPE_8B, CRYP_FLAG_OFNE, CRYP_PHASE_FINAL, CRYP_InitTypeDef::DataType, HAL_CRYP_PHASE_FINAL, HAL_CRYP_PHASE_PROCESS, HAL_CRYP_STATE_BUSY, HAL_CRYP_STATE_READY, HAL_CRYP_STATE_TIMEOUT, HAL_GetTick(), CRYP_InitTypeDef::HeaderSize, CRYP_HandleTypeDef::Init, CRYP_HandleTypeDef::Instance, CRYP_HandleTypeDef::Phase, and CRYP_HandleTypeDef::State.