STM32F479xx HAL User Manual
|
Header file of HASH HAL module. More...
Go to the source code of this file.
Data Structures | |
struct | HASH_InitTypeDef |
HASH Configuration Structure definition. More... | |
struct | __HASH_HandleTypeDef |
HASH Handle Structure definition. More... | |
Defines | |
#define | HASH_ALGOSELECTION_SHA1 0x00000000U |
#define | HASH_ALGOSELECTION_MD5 HASH_CR_ALGO_0 |
#define | HASH_ALGOSELECTION_SHA224 HASH_CR_ALGO_1 |
#define | HASH_ALGOSELECTION_SHA256 HASH_CR_ALGO |
#define | HASH_ALGOMODE_HASH 0x00000000U |
#define | HASH_ALGOMODE_HMAC HASH_CR_MODE |
#define | HASH_DATATYPE_32B 0x00000000U |
#define | HASH_DATATYPE_16B HASH_CR_DATATYPE_0 |
#define | HASH_DATATYPE_8B HASH_CR_DATATYPE_1 |
#define | HASH_DATATYPE_1B HASH_CR_DATATYPE |
#define | HASH_HMAC_KEYTYPE_SHORTKEY 0x00000000U |
#define | HASH_HMAC_KEYTYPE_LONGKEY HASH_CR_LKEY |
#define | HASH_FLAG_DINIS HASH_SR_DINIS |
#define | HASH_FLAG_DCIS HASH_SR_DCIS |
#define | HASH_FLAG_DMAS HASH_SR_DMAS |
#define | HASH_FLAG_BUSY HASH_SR_BUSY |
#define | HASH_FLAG_DINNE HASH_CR_DINNE |
#define | HASH_IT_DINI HASH_IMR_DINIE |
#define | HASH_IT_DCI HASH_IMR_DCIE |
#define | HAL_HASH_ERROR_NONE 0x00000000U |
#define | HAL_HASH_ERROR_IT 0x00000001U |
#define | HAL_HASH_ERROR_DMA 0x00000002U |
#define | HAL_HASH_ERROR_INVALID_CALLBACK 0x00000004U |
#define | __HAL_HASH_GET_FLAG(__FLAG__) |
Check whether or not the specified HASH flag is set. | |
#define | __HAL_HASH_CLEAR_FLAG(__FLAG__) CLEAR_BIT(HASH->SR, (__FLAG__)) |
Clear the specified HASH flag. | |
#define | __HAL_HASH_ENABLE_IT(__INTERRUPT__) SET_BIT(HASH->IMR, (__INTERRUPT__)) |
Enable the specified HASH interrupt. | |
#define | __HAL_HASH_DISABLE_IT(__INTERRUPT__) CLEAR_BIT(HASH->IMR, (__INTERRUPT__)) |
Disable the specified HASH interrupt. | |
#define | __HAL_HASH_RESET_HANDLE_STATE(__HANDLE__) |
Reset HASH handle state. | |
#define | __HAL_HASH_RESET_HANDLE_STATUS(__HANDLE__) ((__HANDLE__)->Status = HAL_OK) |
Reset HASH handle status. | |
#define | __HAL_HASH_SET_MDMAT() SET_BIT(HASH->CR, HASH_CR_MDMAT) |
Enable the multi-buffer DMA transfer mode. | |
#define | __HAL_HASH_RESET_MDMAT() CLEAR_BIT(HASH->CR, HASH_CR_MDMAT) |
Disable the multi-buffer DMA transfer mode. | |
#define | __HAL_HASH_START_DIGEST() SET_BIT(HASH->STR, HASH_STR_DCAL) |
Start the digest computation. | |
#define | __HAL_HASH_SET_NBVALIDBITS(__SIZE__) MODIFY_REG(HASH->STR, HASH_STR_NBLW, 8U * ((__SIZE__) % 4U)) |
Set the number of valid bits in the last word written in data register DIN. | |
#define | __HAL_HASH_INIT() SET_BIT(HASH->CR, HASH_CR_INIT) |
Reset the HASH core. | |
#define | HASH_DIGEST_LENGTH() |
Return digest length in bytes. | |
#define | HASH_NBW_PUSHED() ((READ_BIT(HASH->CR, HASH_CR_NBW)) >> 8U) |
Return number of words already pushed in the FIFO. | |
#define | IS_HASH_DATATYPE(__DATATYPE__) |
Ensure that HASH input data type is valid. | |
#define | IS_HASH_DMA_MULTIBUFFER_SIZE(__SIZE__) ((READ_BIT(HASH->CR, HASH_CR_MDMAT) == 0U) || (((__SIZE__) % 4U) == 0U)) |
Ensure that input data buffer size is valid for multi-buffer HASH processing in DMA mode. | |
#define | IS_HMAC_DMA_MULTIBUFFER_SIZE(__HANDLE__, __SIZE__) |
Ensure that input data buffer size is valid for multi-buffer HMAC processing in DMA mode. | |
#define | IS_HASH_PROCESSING(__HANDLE__) ((__HANDLE__)->Phase == HAL_HASH_PHASE_PROCESS) |
Ensure that handle phase is set to HASH processing. | |
#define | IS_HMAC_PROCESSING(__HANDLE__) |
Ensure that handle phase is set to HMAC processing. | |
Typedefs | |
typedef struct __HASH_HandleTypeDef | HASH_HandleTypeDef |
HASH Handle Structure definition. | |
typedef void(* | pHASH_CallbackTypeDef )(HASH_HandleTypeDef *hhash) |
HAL HASH Callback pointer definition. | |
Enumerations | |
enum | HAL_HASH_StateTypeDef { HAL_HASH_STATE_RESET = 0x00U, HAL_HASH_STATE_READY = 0x01U, HAL_HASH_STATE_BUSY = 0x02U, HAL_HASH_STATE_TIMEOUT = 0x06U, HAL_HASH_STATE_ERROR = 0x07U, HAL_HASH_STATE_SUSPENDED = 0x08U } |
HAL State structures definition. More... | |
enum | HAL_HASH_PhaseTypeDef { HAL_HASH_PHASE_READY = 0x01U, HAL_HASH_PHASE_PROCESS = 0x02U, HAL_HASH_PHASE_HMAC_STEP_1 = 0x03U, HAL_HASH_PHASE_HMAC_STEP_2 = 0x04U, HAL_HASH_PHASE_HMAC_STEP_3 = 0x05U } |
HAL phase structures definition. More... | |
enum | HAL_HASH_SuspendTypeDef { HAL_HASH_SUSPEND_NONE = 0x00U, HAL_HASH_SUSPEND = 0x01U } |
HAL HASH mode suspend definitions. More... | |
enum | HAL_HASH_CallbackIDTypeDef { HAL_HASH_MSPINIT_CB_ID = 0x00U, HAL_HASH_MSPDEINIT_CB_ID = 0x01U, HAL_HASH_INPUTCPLT_CB_ID = 0x02U, HAL_HASH_DGSTCPLT_CB_ID = 0x03U, HAL_HASH_ERROR_CB_ID = 0x04U } |
HAL HASH common Callback ID enumeration definition. More... | |
Functions | |
HAL_StatusTypeDef | HAL_HASH_Init (HASH_HandleTypeDef *hhash) |
Initialize the HASH according to the specified parameters in the HASH_HandleTypeDef and create the associated handle. | |
HAL_StatusTypeDef | HAL_HASH_DeInit (HASH_HandleTypeDef *hhash) |
DeInitialize the HASH peripheral. | |
__weak void | HAL_HASH_MspInit (HASH_HandleTypeDef *hhash) |
Initialize the HASH MSP. | |
__weak void | HAL_HASH_MspDeInit (HASH_HandleTypeDef *hhash) |
DeInitialize the HASH MSP. | |
__weak void | HAL_HASH_InCpltCallback (HASH_HandleTypeDef *hhash) |
Input data transfer complete call back. | |
__weak void | HAL_HASH_DgstCpltCallback (HASH_HandleTypeDef *hhash) |
Digest computation complete call back. | |
__weak void | HAL_HASH_ErrorCallback (HASH_HandleTypeDef *hhash) |
Error callback. | |
HAL_StatusTypeDef | HAL_HASH_RegisterCallback (HASH_HandleTypeDef *hhash, HAL_HASH_CallbackIDTypeDef CallbackID, pHASH_CallbackTypeDef pCallback) |
Register a User HASH Callback To be used instead of the weak (surcharged) predefined callback. | |
HAL_StatusTypeDef | HAL_HASH_UnRegisterCallback (HASH_HandleTypeDef *hhash, HAL_HASH_CallbackIDTypeDef CallbackID) |
Unregister a HASH Callback HASH Callback is redirected to the weak (surcharged) predefined callback. | |
HAL_StatusTypeDef | HAL_HASH_SHA1_Start (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout) |
Initialize the HASH peripheral in SHA1 mode, next process pInBuffer then read the computed digest. | |
HAL_StatusTypeDef | HAL_HASH_MD5_Start (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout) |
Initialize the HASH peripheral in MD5 mode, next process pInBuffer then read the computed digest. | |
HAL_StatusTypeDef | HAL_HASH_MD5_Accmlt (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size) |
If not already done, initialize the HASH peripheral in MD5 mode then processes pInBuffer. | |
HAL_StatusTypeDef | HAL_HASH_SHA1_Accmlt (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size) |
If not already done, initialize the HASH peripheral in SHA1 mode then processes pInBuffer. | |
HAL_StatusTypeDef | HAL_HASH_MD5_Accmlt_End (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout) |
End computation of a single HASH signature after several calls to HAL_HASH_MD5_Accmlt() API. | |
HAL_StatusTypeDef | HAL_HASH_SHA1_Accmlt_End (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout) |
End computation of a single HASH signature after several calls to HAL_HASH_SHA1_Accmlt() API. | |
HAL_StatusTypeDef | HAL_HASH_SHA1_Start_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer) |
Initialize the HASH peripheral in SHA1 mode, next process pInBuffer then read the computed digest in interruption mode. | |
HAL_StatusTypeDef | HAL_HASH_SHA1_Accmlt_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size) |
If not already done, initialize the HASH peripheral in SHA1 mode then processes pInBuffer in interruption mode. | |
HAL_StatusTypeDef | HAL_HASH_SHA1_Accmlt_End_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer) |
End computation of a single HASH signature after several calls to HAL_HASH_SHA1_Accmlt_IT() API. | |
HAL_StatusTypeDef | HAL_HASH_MD5_Start_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer) |
Initialize the HASH peripheral in MD5 mode, next process pInBuffer then read the computed digest in interruption mode. | |
HAL_StatusTypeDef | HAL_HASH_MD5_Accmlt_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size) |
If not already done, initialize the HASH peripheral in MD5 mode then processes pInBuffer in interruption mode. | |
HAL_StatusTypeDef | HAL_HASH_MD5_Accmlt_End_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer) |
End computation of a single HASH signature after several calls to HAL_HASH_MD5_Accmlt_IT() API. | |
void | HAL_HASH_IRQHandler (HASH_HandleTypeDef *hhash) |
Handle HASH interrupt request. | |
HAL_StatusTypeDef | HAL_HASH_SHA1_Start_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size) |
Initialize the HASH peripheral in SHA1 mode then initiate a DMA transfer to feed the input buffer to the Peripheral. | |
HAL_StatusTypeDef | HAL_HASH_SHA1_Finish (HASH_HandleTypeDef *hhash, uint8_t *pOutBuffer, uint32_t Timeout) |
Return the computed digest in SHA1 mode. | |
HAL_StatusTypeDef | HAL_HASH_MD5_Start_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size) |
Initialize the HASH peripheral in MD5 mode then initiate a DMA transfer to feed the input buffer to the Peripheral. | |
HAL_StatusTypeDef | HAL_HASH_MD5_Finish (HASH_HandleTypeDef *hhash, uint8_t *pOutBuffer, uint32_t Timeout) |
Return the computed digest in MD5 mode. | |
HAL_StatusTypeDef | HAL_HMAC_SHA1_Start (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout) |
Initialize the HASH peripheral in HMAC SHA1 mode, next process pInBuffer then read the computed digest. | |
HAL_StatusTypeDef | HAL_HMAC_MD5_Start (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout) |
Initialize the HASH peripheral in HMAC MD5 mode, next process pInBuffer then read the computed digest. | |
HAL_StatusTypeDef | HAL_HMAC_MD5_Start_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer) |
Initialize the HASH peripheral in HMAC MD5 mode, next process pInBuffer then read the computed digest in interrupt mode. | |
HAL_StatusTypeDef | HAL_HMAC_SHA1_Start_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer) |
Initialize the HASH peripheral in HMAC SHA1 mode, next process pInBuffer then read the computed digest in interrupt mode. | |
HAL_StatusTypeDef | HAL_HMAC_SHA1_Start_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size) |
Initialize the HASH peripheral in HMAC SHA1 mode then initiate the required DMA transfers to feed the key and the input buffer to the Peripheral. | |
HAL_StatusTypeDef | HAL_HMAC_MD5_Start_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size) |
Initialize the HASH peripheral in HMAC MD5 mode then initiate the required DMA transfers to feed the key and the input buffer to the Peripheral. | |
HAL_HASH_StateTypeDef | HAL_HASH_GetState (HASH_HandleTypeDef *hhash) |
Return the HASH handle state. | |
HAL_StatusTypeDef | HAL_HASH_GetStatus (HASH_HandleTypeDef *hhash) |
Return the HASH HAL status. | |
void | HAL_HASH_ContextSaving (HASH_HandleTypeDef *hhash, uint8_t *pMemBuffer) |
Save the HASH context in case of processing suspension. | |
void | HAL_HASH_ContextRestoring (HASH_HandleTypeDef *hhash, uint8_t *pMemBuffer) |
Restore the HASH context in case of processing resumption. | |
void | HAL_HASH_SwFeed_ProcessSuspend (HASH_HandleTypeDef *hhash) |
Initiate HASH processing suspension when in polling or interruption mode. | |
HAL_StatusTypeDef | HAL_HASH_DMAFeed_ProcessSuspend (HASH_HandleTypeDef *hhash) |
Suspend the HASH processing when in DMA mode. | |
uint32_t | HAL_HASH_GetError (HASH_HandleTypeDef *hhash) |
Return the HASH handle error code. | |
HAL_StatusTypeDef | HASH_Start (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout, uint32_t Algorithm) |
Initialize the HASH peripheral, next process pInBuffer then read the computed digest. | |
HAL_StatusTypeDef | HASH_Accumulate (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm) |
If not already done, initialize the HASH peripheral then processes pInBuffer. | |
HAL_StatusTypeDef | HASH_Accumulate_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm) |
If not already done, initialize the HASH peripheral then processes pInBuffer in interruption mode. | |
HAL_StatusTypeDef | HASH_Start_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Algorithm) |
Initialize the HASH peripheral, next process pInBuffer then read the computed digest in interruption mode. | |
HAL_StatusTypeDef | HASH_Start_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm) |
Initialize the HASH peripheral then initiate a DMA transfer to feed the input buffer to the Peripheral. | |
HAL_StatusTypeDef | HASH_Finish (HASH_HandleTypeDef *hhash, uint8_t *pOutBuffer, uint32_t Timeout) |
Return the computed digest. | |
HAL_StatusTypeDef | HMAC_Start (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout, uint32_t Algorithm) |
Initialize the HASH peripheral in HMAC mode, next process pInBuffer then read the computed digest. | |
HAL_StatusTypeDef | HMAC_Start_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Algorithm) |
Initialize the HASH peripheral in HMAC mode, next process pInBuffer then read the computed digest in interruption mode. | |
HAL_StatusTypeDef | HMAC_Start_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm) |
Initialize the HASH peripheral in HMAC mode then initiate the required DMA transfers to feed the key and the input buffer to the Peripheral. |
Header file of HASH HAL module.
This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause
Definition in file stm32f4xx_hal_hash.h.