STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
HASH Private Functions
Collaboration diagram for HASH Private Functions:

Functions

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.
 
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.
 

Detailed Description

Function Documentation

◆ HASH_Start()

HAL_StatusTypeDef HASH_Start ( HASH_HandleTypeDef * hhash,
uint8_t * pInBuffer,
uint32_t Size,
uint8_t * pOutBuffer,
uint32_t Timeout,
uint32_t Algorithm )

#include <stm32f4xx_hal_hash.h>

Initialize the HASH peripheral, next process pInBuffer then read the computed digest.

Note
Digest is available in pOutBuffer.
Parameters
hhashHASH handle.
pInBufferpointer to the input buffer (buffer to be hashed).
Sizelength of the input buffer in bytes.
pOutBufferpointer to the computed digest.
TimeoutTimeout value.
AlgorithmHASH algorithm.
Return values
HALstatus

Definition at line 2507 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_SET_NBVALIDBITS, __HAL_HASH_START_DIGEST, __HAL_LOCK, __HAL_UNLOCK, HAL_BUSY, HAL_ERROR, HAL_HASH_PHASE_PROCESS, HAL_HASH_PHASE_READY, HAL_HASH_STATE_BUSY, HAL_HASH_STATE_READY, HAL_HASH_STATE_SUSPENDED, HAL_OK, HAL_TIMEOUT, HASH_DIGEST_LENGTH, HASH_FLAG_DCIS, HASH_GetDigest(), HASH_WaitOnFlagUntilTimeout(), HASH_WriteData(), HASH_HandleTypeDef::HashInCount, HASH_HandleTypeDef::Phase, HASH_HandleTypeDef::pHashInBuffPtr, HASH_HandleTypeDef::State, and HASH_HandleTypeDef::Status.

Referenced by HAL_HASH_MD5_Accmlt_End(), HAL_HASH_MD5_Start(), HAL_HASH_SHA1_Accmlt_End(), HAL_HASH_SHA1_Start(), HAL_HASHEx_SHA224_Accmlt_End(), HAL_HASHEx_SHA224_Start(), HAL_HASHEx_SHA256_Accmlt_End(), and HAL_HASHEx_SHA256_Start().

◆ HASH_Accumulate()

HAL_StatusTypeDef HASH_Accumulate ( HASH_HandleTypeDef * hhash,
uint8_t * pInBuffer,
uint32_t Size,
uint32_t Algorithm )

#include <stm32f4xx_hal_hash.h>

If not already done, initialize the HASH peripheral then processes pInBuffer.

Note
Field hhash->Phase of HASH handle is tested to check whether or not the Peripheral has already been initialized.
The input buffer size (in bytes) must be a multiple of 4 otherwise, the HASH digest computation is corrupted.
Parameters
hhashHASH handle.
pInBufferpointer to the input buffer (buffer to be hashed).
Sizelength of the input buffer in bytes, must be a multiple of 4.
AlgorithmHASH algorithm.
Return values
HALstatus

Definition at line 2644 of file stm32f4xx_hal_hash.c.

References __HAL_LOCK, __HAL_UNLOCK, HAL_BUSY, HAL_ERROR, HAL_HASH_PHASE_PROCESS, HAL_HASH_PHASE_READY, HAL_HASH_STATE_BUSY, HAL_HASH_STATE_READY, HAL_HASH_STATE_SUSPENDED, HAL_OK, HASH_WriteData(), HASH_HandleTypeDef::HashInCount, HASH_HandleTypeDef::Phase, HASH_HandleTypeDef::pHashInBuffPtr, HASH_HandleTypeDef::State, and HASH_HandleTypeDef::Status.

Referenced by HAL_HASH_MD5_Accmlt(), HAL_HASH_SHA1_Accmlt(), HAL_HASHEx_SHA224_Accmlt(), and HAL_HASHEx_SHA256_Accmlt().

◆ HASH_Accumulate_IT()

HAL_StatusTypeDef HASH_Accumulate_IT ( HASH_HandleTypeDef * hhash,
uint8_t * pInBuffer,
uint32_t Size,
uint32_t Algorithm )

#include <stm32f4xx_hal_hash.h>

If not already done, initialize the HASH peripheral then processes pInBuffer in interruption mode.

Note
Field hhash->Phase of HASH handle is tested to check whether or not the Peripheral has already been initialized.
The input buffer size (in bytes) must be a multiple of 4 otherwise, the HASH digest computation is corrupted.
Parameters
hhashHASH handle.
pInBufferpointer to the input buffer (buffer to be hashed).
Sizelength of the input buffer in bytes, must be a multiple of 4.
AlgorithmHASH algorithm.
Return values
HALstatus

Definition at line 2747 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_ENABLE_IT, __HAL_HASH_GET_FLAG, __HAL_LOCK, __HAL_UNLOCK, HASH_HandleTypeDef::Accumulation, HAL_BUSY, HAL_ERROR, HAL_HASH_PHASE_PROCESS, HAL_HASH_PHASE_READY, HAL_HASH_STATE_BUSY, HAL_HASH_STATE_READY, HAL_HASH_STATE_SUSPENDED, HAL_OK, HASH_FLAG_DINIS, HASH_IT_DINI, HASH_HandleTypeDef::HashInCount, HASH_HandleTypeDef::HashITCounter, HASH_HandleTypeDef::Phase, HASH_HandleTypeDef::pHashInBuffPtr, and HASH_HandleTypeDef::State.

Referenced by HAL_HASH_MD5_Accmlt_IT(), HAL_HASH_SHA1_Accmlt_IT(), HAL_HASHEx_SHA224_Accmlt_IT(), and HAL_HASHEx_SHA256_Accmlt_IT().

◆ HASH_Start_IT()

HAL_StatusTypeDef HASH_Start_IT ( HASH_HandleTypeDef * hhash,
uint8_t * pInBuffer,
uint32_t Size,
uint8_t * pOutBuffer,
uint32_t Algorithm )

#include <stm32f4xx_hal_hash.h>

Initialize the HASH peripheral, next process pInBuffer then read the computed digest in interruption mode.

Note
Digest is available in pOutBuffer.
Parameters
hhashHASH handle.
pInBufferpointer to the input buffer (buffer to be hashed).
Sizelength of the input buffer in bytes.
pOutBufferpointer to the computed digest.
AlgorithmHASH algorithm.
Return values
HALstatus

Definition at line 2869 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_ENABLE_IT, __HAL_HASH_GET_FLAG, __HAL_HASH_SET_NBVALIDBITS, __HAL_HASH_START_DIGEST, __HAL_LOCK, __HAL_UNLOCK, HAL_BUSY, HAL_ERROR, HAL_HASH_PHASE_PROCESS, HAL_HASH_PHASE_READY, HAL_HASH_STATE_BUSY, HAL_HASH_STATE_READY, HAL_HASH_STATE_SUSPENDED, HAL_OK, HASH_FLAG_DINIS, HASH_IT_DCI, HASH_IT_DINI, HASH_HandleTypeDef::HashInCount, HASH_HandleTypeDef::HashITCounter, HASH_HandleTypeDef::Phase, HASH_HandleTypeDef::pHashInBuffPtr, HASH_HandleTypeDef::pHashOutBuffPtr, and HASH_HandleTypeDef::State.

Referenced by HAL_HASH_MD5_Accmlt_End_IT(), HAL_HASH_MD5_Start_IT(), HAL_HASH_SHA1_Accmlt_End_IT(), HAL_HASH_SHA1_Start_IT(), HAL_HASHEx_SHA224_Accmlt_End_IT(), HAL_HASHEx_SHA224_Start_IT(), HAL_HASHEx_SHA256_Accmlt_End_IT(), and HAL_HASHEx_SHA256_Start_IT().

◆ HASH_Start_DMA()

HAL_StatusTypeDef HASH_Start_DMA ( HASH_HandleTypeDef * hhash,
uint8_t * pInBuffer,
uint32_t Size,
uint32_t Algorithm )

#include <stm32f4xx_hal_hash.h>

Initialize the HASH peripheral then initiate a DMA transfer to feed the input buffer to the Peripheral.

Note
If MDMAT bit is set before calling this function (multi-buffer HASH processing case), the input buffer size (in bytes) must be a multiple of 4 otherwise, the HASH digest computation is corrupted. For the processing of the last buffer of the thread, MDMAT bit must be reset and the buffer length (in bytes) doesn't have to be a multiple of 4.
Parameters
hhashHASH handle.
pInBufferpointer to the input buffer (buffer to be hashed).
Sizelength of the input buffer in bytes.
AlgorithmHASH algorithm.
Return values
HALstatus

Definition at line 3027 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_SET_NBVALIDBITS, __HAL_LOCK, __HAL_UNLOCK, assert_param, HAL_BUSY, HAL_DMA_Start_IT(), HAL_ERROR, HAL_HASH_PHASE_PROCESS, HAL_HASH_PHASE_READY, HAL_HASH_STATE_BUSY, HAL_HASH_STATE_ERROR, HAL_HASH_STATE_READY, HAL_HASH_STATE_SUSPENDED, HAL_OK, HASH_DMAError(), HASH_DMAXferCplt(), HASH_NBW_PUSHED, HASH_HandleTypeDef::HashInCount, HASH_HandleTypeDef::hdmain, IS_HASH_DMA_MULTIBUFFER_SIZE, IS_HASH_PROCESSING, HASH_HandleTypeDef::NbWordsAlreadyPushed, HASH_HandleTypeDef::Phase, HASH_HandleTypeDef::pHashInBuffPtr, HASH_HandleTypeDef::State, __DMA_HandleTypeDef::XferCpltCallback, and __DMA_HandleTypeDef::XferErrorCallback.

Referenced by HAL_HASH_MD5_Start_DMA(), HAL_HASH_SHA1_Start_DMA(), HAL_HASHEx_SHA224_Start_DMA(), and HAL_HASHEx_SHA256_Start_DMA().

◆ HASH_Finish()

HAL_StatusTypeDef HASH_Finish ( HASH_HandleTypeDef * hhash,
uint8_t * pOutBuffer,
uint32_t Timeout )

#include <stm32f4xx_hal_hash.h>

Return the computed digest.

Note
The API waits for DCIS to be set then reads the computed digest.
Parameters
hhashHASH handle.
pOutBufferpointer to the computed digest.
TimeoutTimeout value.
Return values
HALstatus

Definition at line 3143 of file stm32f4xx_hal_hash.c.

References __HAL_LOCK, __HAL_UNLOCK, HAL_BUSY, HAL_ERROR, HAL_HASH_PHASE_READY, HAL_HASH_STATE_BUSY, HAL_HASH_STATE_READY, HAL_OK, HAL_TIMEOUT, HASH_DIGEST_LENGTH, HASH_FLAG_DCIS, HASH_GetDigest(), HASH_WaitOnFlagUntilTimeout(), HASH_HandleTypeDef::Phase, and HASH_HandleTypeDef::State.

Referenced by HAL_HASH_MD5_Finish(), HAL_HASH_SHA1_Finish(), HAL_HASHEx_SHA224_Finish(), and HAL_HASHEx_SHA256_Finish().

◆ HMAC_Start()

HAL_StatusTypeDef HMAC_Start ( HASH_HandleTypeDef * hhash,
uint8_t * pInBuffer,
uint32_t Size,
uint8_t * pOutBuffer,
uint32_t Timeout,
uint32_t Algorithm )

#include <stm32f4xx_hal_hash.h>

Initialize the HASH peripheral in HMAC mode, next process pInBuffer then read the computed digest.

Note
Digest is available in pOutBuffer.
Same key is used for the inner and the outer hash functions; pointer to key and key size are respectively stored in hhash->Init.pKey and hhash->Init.KeySize.
Parameters
hhashHASH handle.
pInBufferpointer to the input buffer (buffer to be hashed).
Sizelength of the input buffer in bytes.
pOutBufferpointer to the computed digest.
TimeoutTimeout value.
AlgorithmHASH algorithm.
Return values
HALstatus

Definition at line 3204 of file stm32f4xx_hal_hash.c.

References __HAL_LOCK, HAL_BUSY, HAL_ERROR, HAL_HASH_PHASE_HMAC_STEP_1, HAL_HASH_PHASE_READY, HAL_HASH_STATE_BUSY, HAL_HASH_STATE_READY, HAL_HASH_STATE_SUSPENDED, HASH_ALGOMODE_HMAC, HASH_HMAC_KEYTYPE_LONGKEY, HASH_HandleTypeDef::HashBuffSize, HASH_HandleTypeDef::HashInCount, HASH_HandleTypeDef::HashKeyCount, HMAC_Processing(), HASH_HandleTypeDef::Init, HASH_InitTypeDef::KeySize, HASH_HandleTypeDef::Phase, HASH_HandleTypeDef::pHashInBuffPtr, HASH_HandleTypeDef::pHashKeyBuffPtr, HASH_HandleTypeDef::pHashOutBuffPtr, HASH_InitTypeDef::pKey, and HASH_HandleTypeDef::State.

Referenced by HAL_HMAC_MD5_Start(), HAL_HMAC_SHA1_Start(), HAL_HMACEx_SHA224_Start(), and HAL_HMACEx_SHA256_Start().

◆ HMAC_Start_IT()

HAL_StatusTypeDef HMAC_Start_IT ( HASH_HandleTypeDef * hhash,
uint8_t * pInBuffer,
uint32_t Size,
uint8_t * pOutBuffer,
uint32_t Algorithm )

#include <stm32f4xx_hal_hash.h>

Initialize the HASH peripheral in HMAC mode, next process pInBuffer then read the computed digest in interruption mode.

Note
Digest is available in pOutBuffer.
Same key is used for the inner and the outer hash functions; pointer to key and key size are respectively stored in hhash->Init.pKey and hhash->Init.KeySize.
Parameters
hhashHASH handle.
pInBufferpointer to the input buffer (buffer to be hashed).
Sizelength of the input buffer in bytes.
pOutBufferpointer to the computed digest.
AlgorithmHASH algorithm.
Return values
HALstatus

Definition at line 3282 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_ENABLE_IT, __HAL_HASH_SET_NBVALIDBITS, __HAL_LOCK, __HAL_UNLOCK, HAL_BUSY, HAL_ERROR, HAL_HASH_PHASE_HMAC_STEP_1, HAL_HASH_PHASE_HMAC_STEP_2, HAL_HASH_PHASE_HMAC_STEP_3, HAL_HASH_PHASE_READY, HAL_HASH_STATE_BUSY, HAL_HASH_STATE_READY, HAL_HASH_STATE_SUSPENDED, HAL_OK, HASH_ALGOMODE_HMAC, HASH_HMAC_KEYTYPE_LONGKEY, HASH_IT_DCI, HASH_IT_DINI, HASH_HandleTypeDef::HashBuffSize, HASH_HandleTypeDef::HashInCount, HASH_HandleTypeDef::HashITCounter, HASH_HandleTypeDef::Init, HASH_InitTypeDef::KeySize, HASH_HandleTypeDef::Phase, HASH_HandleTypeDef::pHashInBuffPtr, HASH_HandleTypeDef::pHashKeyBuffPtr, HASH_HandleTypeDef::pHashMsgBuffPtr, HASH_HandleTypeDef::pHashOutBuffPtr, HASH_InitTypeDef::pKey, and HASH_HandleTypeDef::State.

Referenced by HAL_HMAC_MD5_Start_IT(), HAL_HMAC_SHA1_Start_IT(), HAL_HMACEx_SHA224_Start_IT(), and HAL_HMACEx_SHA256_Start_IT().

◆ HMAC_Start_DMA()

HAL_StatusTypeDef HMAC_Start_DMA ( HASH_HandleTypeDef * hhash,
uint8_t * pInBuffer,
uint32_t Size,
uint32_t Algorithm )

#include <stm32f4xx_hal_hash.h>

Initialize the HASH peripheral in HMAC mode then initiate the required DMA transfers to feed the key and the input buffer to the Peripheral.

Note
Same key is used for the inner and the outer hash functions; pointer to key and key size are respectively stored in hhash->Init.pKey and hhash->Init.KeySize.
In case of multi-buffer HMAC processing, the input buffer size (in bytes) must be a multiple of 4 otherwise, the HASH digest computation is corrupted. Only the length of the last buffer of the thread doesn't have to be a multiple of 4.
Parameters
hhashHASH handle.
pInBufferpointer to the input buffer (buffer to be hashed).
Sizelength of the input buffer in bytes.
AlgorithmHASH algorithm.
Return values
HALstatus

Definition at line 3393 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_RESET_MDMAT, __HAL_HASH_SET_NBVALIDBITS, __HAL_LOCK, __HAL_UNLOCK, assert_param, HASH_HandleTypeDef::DigestCalculationDisable, HAL_BUSY, HAL_DMA_Start_IT(), HAL_ERROR, HAL_HASH_PHASE_HMAC_STEP_1, HAL_HASH_PHASE_HMAC_STEP_2, HAL_HASH_PHASE_READY, HAL_HASH_STATE_BUSY, HAL_HASH_STATE_ERROR, HAL_HASH_STATE_READY, HAL_HASH_STATE_SUSPENDED, HAL_OK, HASH_ALGOMODE_HMAC, HASH_DMAError(), HASH_DMAXferCplt(), HASH_HMAC_KEYTYPE_LONGKEY, HASH_NBW_PUSHED, HASH_HandleTypeDef::HashBuffSize, HASH_HandleTypeDef::HashInCount, HASH_HandleTypeDef::hdmain, HASH_HandleTypeDef::Init, IS_HMAC_DMA_MULTIBUFFER_SIZE, IS_HMAC_PROCESSING, HASH_InitTypeDef::KeySize, HASH_HandleTypeDef::NbWordsAlreadyPushed, HASH_HandleTypeDef::Phase, HASH_HandleTypeDef::pHashInBuffPtr, HASH_HandleTypeDef::pHashKeyBuffPtr, HASH_HandleTypeDef::pHashMsgBuffPtr, HASH_InitTypeDef::pKey, HASH_HandleTypeDef::State, __DMA_HandleTypeDef::XferCpltCallback, and __DMA_HandleTypeDef::XferErrorCallback.

Referenced by HAL_HMAC_MD5_Start_DMA(), HAL_HMAC_SHA1_Start_DMA(), HAL_HMACEx_MD5_Step1_2_DMA(), HAL_HMACEx_MD5_Step2_3_DMA(), HAL_HMACEx_MD5_Step2_DMA(), HAL_HMACEx_SHA1_Step1_2_DMA(), HAL_HMACEx_SHA1_Step2_3_DMA(), HAL_HMACEx_SHA1_Step2_DMA(), HAL_HMACEx_SHA224_Start_DMA(), HAL_HMACEx_SHA224_Step1_2_DMA(), HAL_HMACEx_SHA224_Step2_3_DMA(), HAL_HMACEx_SHA224_Step2_DMA(), HAL_HMACEx_SHA256_Start_DMA(), HAL_HMACEx_SHA256_Step1_2_DMA(), HAL_HMACEx_SHA256_Step2_3_DMA(), and HAL_HMACEx_SHA256_Step2_DMA().

◆ HASH_DMAXferCplt()

◆ HASH_DMAError()

static void HASH_DMAError ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_hash.c>

DMA HASH communication error callback.

Parameters
hdmaDMA handle.
Note
HASH_DMAError() callback invokes HAL_HASH_ErrorCallback() that can contain user code to manage the error.
Return values
None

Definition at line 1799 of file stm32f4xx_hal_hash.c.

References HASH_HandleTypeDef::ErrorCode, HAL_ERROR, HAL_HASH_ERROR_DMA, HAL_HASH_ErrorCallback(), HAL_HASH_STATE_READY, HAL_HASH_STATE_SUSPENDED, HAL_OK, HASH_HandleTypeDef::State, and HASH_HandleTypeDef::Status.

Referenced by HASH_Start_DMA(), and HMAC_Start_DMA().

◆ HASH_GetDigest()

static void HASH_GetDigest ( uint8_t * pMsgDigest,
uint8_t Size )
static

#include <stm32f4xx_hal_hash.c>

Retrieve the message digest.

Parameters
pMsgDigestpointer to the computed digest.
Sizemessage digest size in bytes.
Return values
None

Definition at line 1952 of file stm32f4xx_hal_hash.c.

Referenced by HASH_Finish(), HASH_IT(), HASH_Start(), and HMAC_Processing().

◆ HASH_WaitOnFlagUntilTimeout()

static HAL_StatusTypeDef HASH_WaitOnFlagUntilTimeout ( HASH_HandleTypeDef * hhash,
uint32_t Flag,
FlagStatus Status,
uint32_t Timeout )
static

#include <stm32f4xx_hal_hash.c>

Handle HASH processing Timeout.

Parameters
hhashHASH handle.
Flagspecifies the HASH flag to check.
Statusthe Flag status (SET or RESET).
TimeoutTimeout duration.
Return values
HALstatus

Definition at line 2030 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_GET_FLAG, __HAL_UNLOCK, HAL_GetTick(), HAL_HASH_STATE_READY, HAL_MAX_DELAY, HAL_OK, HAL_TIMEOUT, HASH_HandleTypeDef::State, and HASH_HandleTypeDef::Status.

Referenced by HAL_HASH_DMAFeed_ProcessSuspend(), HASH_Finish(), HASH_IT(), HASH_Start(), HASH_WriteData(), and HMAC_Processing().

◆ HASH_WriteData()

static HAL_StatusTypeDef HASH_WriteData ( HASH_HandleTypeDef * hhash,
uint8_t * pInBuffer,
uint32_t Size )
static

#include <stm32f4xx_hal_hash.c>

Feed the input buffer to the HASH Peripheral.

Parameters
hhashHASH handle.
pInBufferpointer to input buffer.
Sizethe size of input buffer in bytes.
Note
HASH_WriteData() regularly reads hhash->SuspendRequest to check whether or not the HASH processing must be suspended. If this is the case, the processing is suspended when possible and the Peripheral feeding point reached at suspension time is stored in the handle for resumption later on.
Return values
HALstatus

Definition at line 1833 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_GET_FLAG, __HAL_UNLOCK, HASH_InitTypeDef::DataType, HAL_ERROR, HAL_HASH_PHASE_HMAC_STEP_1, HAL_HASH_PHASE_HMAC_STEP_2, HAL_HASH_PHASE_HMAC_STEP_3, HAL_HASH_PHASE_PROCESS, HAL_HASH_STATE_READY, HAL_HASH_STATE_SUSPENDED, HAL_HASH_SUSPEND, HAL_HASH_SUSPEND_NONE, HAL_OK, HAL_TIMEOUT, HASH_DATATYPE_16B, HASH_DATATYPE_1B, HASH_DATATYPE_8B, HASH_FLAG_BUSY, HASH_FLAG_DINIS, HASH_TIMEOUTVALUE, HASH_WaitOnFlagUntilTimeout(), HASH_HandleTypeDef::HashInCount, HASH_HandleTypeDef::HashKeyCount, HASH_HandleTypeDef::Init, HASH_HandleTypeDef::Phase, HASH_HandleTypeDef::pHashInBuffPtr, HASH_HandleTypeDef::pHashKeyBuffPtr, HASH_HandleTypeDef::State, and HASH_HandleTypeDef::SuspendRequest.

Referenced by HASH_Accumulate(), HASH_Start(), and HMAC_Processing().

◆ HASH_IT()

static HAL_StatusTypeDef HASH_IT ( HASH_HandleTypeDef * hhash)
static

#include <stm32f4xx_hal_hash.c>

HASH processing in interruption mode.

Parameters
hhashHASH handle.
Note
HASH_IT() regularly reads hhash->SuspendRequest to check whether or not the HASH processing must be suspended. If this is the case, the processing is suspended when possible and the Peripheral feeding point reached at suspension time is stored in the handle for resumption later on.
Return values
HALstatus

Definition at line 2093 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_DISABLE_IT, __HAL_HASH_ENABLE_IT, __HAL_HASH_GET_FLAG, __HAL_HASH_SET_NBVALIDBITS, HAL_BUSY, HAL_ERROR, HAL_HASH_DgstCpltCallback(), HAL_HASH_InCpltCallback(), HAL_HASH_PHASE_HMAC_STEP_1, HAL_HASH_PHASE_HMAC_STEP_2, HAL_HASH_PHASE_HMAC_STEP_3, HAL_HASH_PHASE_READY, HAL_HASH_STATE_BUSY, HAL_HASH_STATE_READY, HAL_HASH_STATE_SUSPENDED, HAL_HASH_SUSPEND, HAL_HASH_SUSPEND_NONE, HAL_OK, HAL_TIMEOUT, HASH_DIGEST_CALCULATION_STARTED, HASH_DIGEST_LENGTH, HASH_FLAG_BUSY, HASH_FLAG_DCIS, HASH_FLAG_DINIS, HASH_GetDigest(), HASH_IT_DCI, HASH_IT_DINI, HASH_TIMEOUTVALUE, HASH_WaitOnFlagUntilTimeout(), HASH_Write_Block_Data(), HASH_HandleTypeDef::HashBuffSize, HASH_HandleTypeDef::HashInCount, HASH_HandleTypeDef::HashITCounter, HASH_HandleTypeDef::Init, HASH_InitTypeDef::KeySize, HASH_HandleTypeDef::Phase, HASH_HandleTypeDef::pHashInBuffPtr, HASH_HandleTypeDef::pHashMsgBuffPtr, HASH_HandleTypeDef::pHashOutBuffPtr, HASH_InitTypeDef::pKey, HASH_HandleTypeDef::State, and HASH_HandleTypeDef::SuspendRequest.

Referenced by HAL_HASH_IRQHandler().

◆ HASH_Write_Block_Data()

static uint32_t HASH_Write_Block_Data ( HASH_HandleTypeDef * hhash)
static

◆ HMAC_Processing()