STM32L443xx HAL User Manual
Functions
CRYPEx Private Functions
CRYPEx

Functions

static HAL_StatusTypeDef CRYP_ProcessData (CRYP_HandleTypeDef *hcryp, uint8_t *Input, uint16_t Ilength, uint8_t *Output, uint32_t Timeout)
 Write/read input/output data in polling mode.
static HAL_StatusTypeDef CRYP_ReadKey (CRYP_HandleTypeDef *hcryp, uint8_t *Output, uint32_t Timeout)
 Read derivative key in polling mode when CRYP hardware block is set in key derivation operating mode (mode 2).
static void CRYP_SetDMAConfig (CRYP_HandleTypeDef *hcryp, uint32_t inputaddr, uint16_t Size, uint32_t outputaddr)
 Set the DMA configuration and start the DMA transfer.
static void CRYP_Authentication_SetDMAConfig (CRYP_HandleTypeDef *hcryp, uint32_t inputaddr, uint16_t Size, uint32_t outputaddr)
 Set the DMA configuration and start the DMA transfer for GCM, GMAC, CCM or CMAC chaining modes.
static void CRYP_Authentication_DMAInCplt (DMA_HandleTypeDef *hdma)
 DMA CRYP Input Data process complete callback for GCM, GMAC, CCM or CMAC chaining modes.
static void CRYP_Authentication_DMAError (DMA_HandleTypeDef *hdma)
 DMA CRYP communication error callback for GCM, GMAC, CCM or CMAC chaining modes.
static void CRYP_Authentication_DMAOutCplt (DMA_HandleTypeDef *hdma)
 DMA CRYP Output Data process complete callback for GCM, GMAC, CCM or CMAC chaining modes.
static HAL_StatusTypeDef CRYP_WaitOnCCFlag (CRYP_HandleTypeDef const *const hcryp, uint32_t Timeout)
 Handle CRYP hardware block Timeout when waiting for CCF flag to be raised.
static HAL_StatusTypeDef CRYP_WaitOnBusyFlagReset (CRYP_HandleTypeDef const *const hcryp, uint32_t Timeout)
 Wait for Busy Flag to be reset during a GCM payload encryption process suspension.
static void CRYP_DMAInCplt (DMA_HandleTypeDef *hdma)
 DMA CRYP Input Data process complete callback.
static void CRYP_DMAOutCplt (DMA_HandleTypeDef *hdma)
 DMA CRYP Output Data process complete callback.
static void CRYP_DMAError (DMA_HandleTypeDef *hdma)
 DMA CRYP communication error callback.
static void CRYP_Padding (CRYP_HandleTypeDef *hcryp, uint32_t difflength, uint32_t polling)
 Last header or payload block padding when size is not a multiple of 128 bits.
HAL_StatusTypeDef CRYP_AES_Auth_IT (CRYP_HandleTypeDef *hcryp)
 Handle CRYP block input/output data handling under interruption for GCM, GMAC, CCM or CMAC chaining modes.

Function Documentation

HAL_StatusTypeDef CRYP_AES_Auth_IT ( CRYP_HandleTypeDef hcryp)

Handle CRYP block input/output data handling under interruption for GCM, GMAC, CCM or CMAC chaining modes.

Note:
The function is called under interruption only, once interruptions have been enabled by HAL_CRYPEx_AES_Auth_IT().
Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
Return values:
HALstatus

Definition at line 2234 of file stm32l4xx_hal_cryp_ex.c.

References __HAL_CRYP_CLEAR_FLAG, __HAL_CRYP_DISABLE, __HAL_CRYP_DISABLE_IT, __HAL_CRYP_SET_CHAININGMODE, CRYP_InitTypeDef::ChainingMode, __CRYP_HandleTypeDef::CompCpltCallback, CRYP_ALGOMODE_DECRYPT, CRYP_ALGOMODE_ENCRYPT, CRYP_CCF_CLEAR, CRYP_CHAINMODE_AES_CMAC, CRYP_CHAINMODE_AES_CTR, CRYP_CHAINMODE_AES_GCM_GMAC, CRYP_FINAL_PHASE, CRYP_HEADER_PHASE, CRYP_INIT_PHASE, CRYP_IT_CCFIE, CRYP_IT_ERRIE, CRYP_PAYLOAD_PHASE, __CRYP_HandleTypeDef::CrypInCount, __CRYP_HandleTypeDef::CrypOutCount, CRYP_InitTypeDef::DataType, CRYP_InitTypeDef::GCMCMACPhase, HAL_CRYP_PHASE_FINAL_OVER, HAL_CRYP_PHASE_HEADER_OVER, HAL_CRYP_PHASE_HEADER_SUSPENDED, HAL_CRYP_PHASE_INIT_OVER, HAL_CRYP_PHASE_PAYLOAD_OVER, HAL_CRYP_PHASE_PAYLOAD_SUSPENDED, HAL_CRYP_STATE_BUSY, HAL_CRYP_STATE_ERROR, HAL_CRYP_STATE_READY, HAL_CRYP_STATE_SUSPENDED, HAL_CRYP_SUSPEND, HAL_CRYP_SUSPEND_NONE, HAL_CRYPEx_ComputationCpltCallback(), CRYP_InitTypeDef::Header, CRYP_InitTypeDef::HeaderSize, __CRYP_HandleTypeDef::Init, __CRYP_HandleTypeDef::Instance, CRYP_InitTypeDef::OperatingMode, __CRYP_HandleTypeDef::pCrypInBuffPtr, __CRYP_HandleTypeDef::pCrypOutBuffPtr, __CRYP_HandleTypeDef::Phase, __CRYP_HandleTypeDef::State, and __CRYP_HandleTypeDef::SuspendRequest.

Referenced by HAL_CRYP_IRQHandler().

static void CRYP_Authentication_DMAError ( DMA_HandleTypeDef hdma) [static]

DMA CRYP communication error callback for GCM, GMAC, CCM or CMAC chaining modes.

Parameters:
hdmaDMA handle
Return values:
None

Definition at line 2208 of file stm32l4xx_hal_cryp_ex.c.

References __HAL_CRYP_CLEAR_FLAG, CRYP_ERR_CLEAR, __CRYP_HandleTypeDef::ErrorCallback, __CRYP_HandleTypeDef::ErrorCode, HAL_CRYP_DMA_ERROR, HAL_CRYP_ErrorCallback(), HAL_CRYP_STATE_ERROR, and __CRYP_HandleTypeDef::State.

Referenced by CRYP_Authentication_SetDMAConfig().

static void CRYP_Authentication_DMAInCplt ( DMA_HandleTypeDef hdma) [static]

DMA CRYP Input Data process complete callback for GCM, GMAC, CCM or CMAC chaining modes.

Note:
Specific setting of hcryp fields are required only in the case of header phase where no output data DMA transfer is on-going (only input data transfer is enabled in such a case).
Parameters:
hdmaDMA handle.
Return values:
None

Definition at line 2124 of file stm32l4xx_hal_cryp_ex.c.

References CRYP_HEADER_PHASE, CRYP_Padding(), CRYP_POLLING_OFF, __CRYP_HandleTypeDef::CrypInCount, CRYP_InitTypeDef::GCMCMACPhase, HAL_CRYP_InCpltCallback(), HAL_CRYP_PHASE_HEADER_OVER, HAL_CRYP_STATE_READY, __CRYP_HandleTypeDef::InCpltCallback, __CRYP_HandleTypeDef::Init, __CRYP_HandleTypeDef::Instance, __CRYP_HandleTypeDef::Phase, and __CRYP_HandleTypeDef::State.

Referenced by CRYP_Authentication_SetDMAConfig().

static void CRYP_Authentication_DMAOutCplt ( DMA_HandleTypeDef hdma) [static]

DMA CRYP Output Data process complete callback for GCM, GMAC, CCM or CMAC chaining modes.

Note:
This callback is called only in the payload phase.
Parameters:
hdmaDMA handle.
Return values:
None

Definition at line 2168 of file stm32l4xx_hal_cryp_ex.c.

References __HAL_CRYP_CLEAR_FLAG, CRYP_CCF_CLEAR, CRYP_Padding(), CRYP_POLLING_ON, __CRYP_HandleTypeDef::CrypInCount, HAL_CRYP_OutCpltCallback(), HAL_CRYP_PHASE_PAYLOAD_OVER, HAL_CRYP_STATE_READY, __CRYP_HandleTypeDef::Instance, __CRYP_HandleTypeDef::OutCpltCallback, __CRYP_HandleTypeDef::Phase, and __CRYP_HandleTypeDef::State.

Referenced by CRYP_Authentication_SetDMAConfig().

static void CRYP_Authentication_SetDMAConfig ( CRYP_HandleTypeDef hcryp,
uint32_t  inputaddr,
uint16_t  Size,
uint32_t  outputaddr 
) [static]

Set the DMA configuration and start the DMA transfer for GCM, GMAC, CCM or CMAC chaining modes.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module.
inputaddrAddress of the Input buffer.
SizeSize of the Input buffer un bytes, must be a multiple of 16.
outputaddrAddress of the Output buffer, null pointer when no output DMA stream has to be configured.
Return values:
None

Definition at line 2716 of file stm32l4xx_hal_cryp_ex.c.

References __HAL_CRYP_ENABLE, CRYP_Authentication_DMAError(), CRYP_Authentication_DMAInCplt(), CRYP_Authentication_DMAOutCplt(), __CRYP_HandleTypeDef::ErrorCallback, HAL_CRYP_ErrorCallback(), HAL_DMA_Start_IT(), __CRYP_HandleTypeDef::hdmain, __CRYP_HandleTypeDef::hdmaout, __CRYP_HandleTypeDef::Instance, __DMA_HandleTypeDef::XferCpltCallback, and __DMA_HandleTypeDef::XferErrorCallback.

Referenced by HAL_CRYPEx_AES_Auth_DMA().

static void CRYP_DMAError ( DMA_HandleTypeDef hdma) [static]

DMA CRYP communication error callback.

Parameters:
hdmaDMA handle.
Return values:
None

Definition at line 3057 of file stm32l4xx_hal_cryp_ex.c.

References __HAL_CRYP_CLEAR_FLAG, CRYP_ERR_CLEAR, __CRYP_HandleTypeDef::ErrorCallback, __CRYP_HandleTypeDef::ErrorCode, HAL_CRYP_DMA_ERROR, HAL_CRYP_ErrorCallback(), HAL_CRYP_STATE_ERROR, and __CRYP_HandleTypeDef::State.

Referenced by CRYP_SetDMAConfig().

static void CRYP_DMAInCplt ( DMA_HandleTypeDef hdma) [static]

DMA CRYP Input Data process complete callback.

Parameters:
hdmaDMA handle.
Return values:
None

Definition at line 3008 of file stm32l4xx_hal_cryp_ex.c.

References HAL_CRYP_InCpltCallback(), __CRYP_HandleTypeDef::InCpltCallback, and __CRYP_HandleTypeDef::Instance.

Referenced by CRYP_SetDMAConfig().

static void CRYP_DMAOutCplt ( DMA_HandleTypeDef hdma) [static]

DMA CRYP Output Data process complete callback.

Parameters:
hdmaDMA handle.
Return values:
None

Definition at line 3028 of file stm32l4xx_hal_cryp_ex.c.

References __HAL_CRYP_CLEAR_FLAG, __HAL_CRYP_DISABLE, CRYP_CCF_CLEAR, HAL_CRYP_OutCpltCallback(), HAL_CRYP_STATE_READY, __CRYP_HandleTypeDef::Instance, __CRYP_HandleTypeDef::OutCpltCallback, and __CRYP_HandleTypeDef::State.

Referenced by CRYP_SetDMAConfig().

static void CRYP_Padding ( CRYP_HandleTypeDef hcryp,
uint32_t  difflength,
uint32_t  polling 
) [static]

Last header or payload block padding when size is not a multiple of 128 bits.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module.
difflengthsize remainder after having fed all complete 128-bit blocks.
pollingspecifies whether or not polling on CCF must be done after having entered a complete block.
Return values:
None

Definition at line 3081 of file stm32l4xx_hal_cryp_ex.c.

References __HAL_CRYP_CLEAR_FLAG, __HAL_CRYP_SET_CHAININGMODE, CRYP_ALGOMODE_DECRYPT, CRYP_ALGOMODE_ENCRYPT, CRYP_CCF_CLEAR, CRYP_CCF_TIMEOUTVALUE, CRYP_CHAINMODE_AES_CTR, CRYP_CHAINMODE_AES_GCM_GMAC, CRYP_FINAL_PHASE, CRYP_PAYLOAD_PHASE, CRYP_POLLING_ON, CRYP_WaitOnCCFlag(), CRYP_InitTypeDef::DataType, __CRYP_HandleTypeDef::ErrorCallback, CRYP_InitTypeDef::GCMCMACPhase, HAL_CRYP_ErrorCallback(), HAL_CRYP_STATE_READY, __CRYP_HandleTypeDef::Init, __CRYP_HandleTypeDef::Instance, CRYP_InitTypeDef::OperatingMode, __CRYP_HandleTypeDef::pCrypInBuffPtr, __CRYP_HandleTypeDef::pCrypOutBuffPtr, and __CRYP_HandleTypeDef::State.

Referenced by CRYP_Authentication_DMAInCplt(), CRYP_Authentication_DMAOutCplt(), HAL_CRYPEx_AES_Auth(), and HAL_CRYPEx_AES_Auth_DMA().

static HAL_StatusTypeDef CRYP_ProcessData ( CRYP_HandleTypeDef hcryp,
uint8_t *  Input,
uint16_t  Ilength,
uint8_t *  Output,
uint32_t  Timeout 
) [static]

Write/read input/output data in polling mode.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module.
InputPointer to the Input buffer.
IlengthLength of the Input buffer in bytes, must be a multiple of 16.
OutputPointer to the returned buffer.
TimeoutSpecify Timeout value.
Return values:
HALstatus

Definition at line 2778 of file stm32l4xx_hal_cryp_ex.c.

References __HAL_CRYP_CLEAR_FLAG, CRYP_CCF_CLEAR, CRYP_WaitOnCCFlag(), __CRYP_HandleTypeDef::CrypInCount, HAL_CRYP_STATE_READY, HAL_CRYP_STATE_SUSPENDED, HAL_CRYP_SUSPEND, HAL_CRYP_SUSPEND_NONE, __CRYP_HandleTypeDef::Instance, __CRYP_HandleTypeDef::pCrypInBuffPtr, __CRYP_HandleTypeDef::pCrypOutBuffPtr, __CRYP_HandleTypeDef::State, and __CRYP_HandleTypeDef::SuspendRequest.

Referenced by HAL_CRYPEx_AES().

static HAL_StatusTypeDef CRYP_ReadKey ( CRYP_HandleTypeDef hcryp,
uint8_t *  Output,
uint32_t  Timeout 
) [static]

Read derivative key in polling mode when CRYP hardware block is set in key derivation operating mode (mode 2).

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module.
OutputPointer to the returned buffer.
TimeoutSpecify Timeout value.
Return values:
HALstatus

Definition at line 2857 of file stm32l4xx_hal_cryp_ex.c.

References __HAL_CRYP_CLEAR_FLAG, CRYP_CCF_CLEAR, CRYP_KEYSIZE_256B, CRYP_WaitOnCCFlag(), HAL_CRYP_STATE_READY, __CRYP_HandleTypeDef::Init, __CRYP_HandleTypeDef::Instance, CRYP_InitTypeDef::KeySize, and __CRYP_HandleTypeDef::State.

Referenced by HAL_CRYPEx_AES().

static void CRYP_SetDMAConfig ( CRYP_HandleTypeDef hcryp,
uint32_t  inputaddr,
uint16_t  Size,
uint32_t  outputaddr 
) [static]

Set the DMA configuration and start the DMA transfer.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module.
inputaddrAddress of the Input buffer.
SizeSize of the Input buffer in bytes, must be a multiple of 16.
outputaddrAddress of the Output buffer.
Return values:
None

Definition at line 2906 of file stm32l4xx_hal_cryp_ex.c.

References __HAL_CRYP_ENABLE, CRYP_DMAError(), CRYP_DMAInCplt(), CRYP_DMAOutCplt(), __CRYP_HandleTypeDef::ErrorCallback, HAL_CRYP_ErrorCallback(), HAL_DMA_Start_IT(), __CRYP_HandleTypeDef::hdmain, __CRYP_HandleTypeDef::hdmaout, __CRYP_HandleTypeDef::Instance, __DMA_HandleTypeDef::XferCpltCallback, and __DMA_HandleTypeDef::XferErrorCallback.

Referenced by HAL_CRYPEx_AES_DMA().

static HAL_StatusTypeDef CRYP_WaitOnBusyFlagReset ( CRYP_HandleTypeDef const *const  hcryp,
uint32_t  Timeout 
) [static]

Wait for Busy Flag to be reset during a GCM payload encryption process suspension.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module.
TimeoutTimeout duration.
Return values:
HALstatus

Definition at line 2981 of file stm32l4xx_hal_cryp_ex.c.

References HAL_GetTick(), and __CRYP_HandleTypeDef::Instance.

Referenced by HAL_CRYPEx_AES_Auth(), and HAL_CRYPEx_Read_SuspendRegisters().

static HAL_StatusTypeDef CRYP_WaitOnCCFlag ( CRYP_HandleTypeDef const *const  hcryp,
uint32_t  Timeout 
) [static]

Handle CRYP hardware block Timeout when waiting for CCF flag to be raised.

Parameters:
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module.
TimeoutTimeout duration.
Return values:
HALstatus

Definition at line 2953 of file stm32l4xx_hal_cryp_ex.c.

References HAL_GetTick(), and __CRYP_HandleTypeDef::Instance.

Referenced by CRYP_Padding(), CRYP_ProcessData(), CRYP_ReadKey(), HAL_CRYPEx_AES_Auth(), and HAL_CRYPEx_AES_Auth_DMA().