STM32F479xx HAL User Manual
|
HASH HAL module driver. This file provides firmware functions to manage the following functionalities of the HASH peripheral: + Initialization and de-initialization methods + HASH or HMAC processing in polling mode + HASH or HMAC processing in interrupt mode + HASH or HMAC processing in DMA mode + Peripheral State methods + HASH or HMAC processing suspension/resumption. More...
#include "stm32f4xx_hal.h"
Go to the source code of this file.
Defines | |
#define | HASH_DIGEST_CALCULATION_NOT_STARTED ((uint32_t)0x00000000U) |
#define | HASH_DIGEST_CALCULATION_STARTED ((uint32_t)0x00000001U) |
#define | HASH_NUMBER_OF_CSR_REGISTERS 54U |
#define | HASH_TIMEOUTVALUE 1000U |
#define | HASH_DMA_SUSPENSION_WORDS_LIMIT 20U |
Functions | |
static void | HASH_DMAXferCplt (DMA_HandleTypeDef *hdma) |
DMA HASH Input Data transfer completion callback. | |
static void | HASH_DMAError (DMA_HandleTypeDef *hdma) |
DMA HASH communication error callback. | |
static void | HASH_GetDigest (uint8_t *pMsgDigest, uint8_t Size) |
Retrieve the message digest. | |
static HAL_StatusTypeDef | HASH_WaitOnFlagUntilTimeout (HASH_HandleTypeDef *hhash, uint32_t Flag, FlagStatus Status, uint32_t Timeout) |
Handle HASH processing Timeout. | |
static HAL_StatusTypeDef | HASH_WriteData (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size) |
Feed the input buffer to the HASH Peripheral. | |
static HAL_StatusTypeDef | HASH_IT (HASH_HandleTypeDef *hhash) |
HASH processing in interruption mode. | |
static uint32_t | HASH_Write_Block_Data (HASH_HandleTypeDef *hhash) |
Write a block of data in HASH Peripheral in interruption mode. | |
static HAL_StatusTypeDef | HMAC_Processing (HASH_HandleTypeDef *hhash, uint32_t Timeout) |
HMAC processing in polling mode. | |
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_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_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_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_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_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_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. | |
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. | |
void | HAL_HASH_IRQHandler (HASH_HandleTypeDef *hhash) |
Handle HASH interrupt request. | |
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_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_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_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_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_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_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_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. |
HASH HAL module driver. This file provides firmware functions to manage the following functionalities of the HASH peripheral: + Initialization and de-initialization methods + HASH or HMAC processing in polling mode + HASH or HMAC processing in interrupt mode + HASH or HMAC processing in DMA mode + Peripheral State methods + HASH or HMAC processing suspension/resumption.
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.c.