STM32F439xx HAL User Manual
Functions
HASH processing functions using polling mode
HASH Exported Functions

processing functions using polling mode More...

Functions

HAL_StatusTypeDef HAL_HASH_MD5_Start (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout)
 Initializes the HASH peripheral in MD5 mode then processes pInBuffer.
HAL_StatusTypeDef HAL_HASH_MD5_Accumulate (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 Initializes the HASH peripheral in MD5 mode then writes the pInBuffer.
HAL_StatusTypeDef HAL_HASH_SHA1_Start (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout)
 Initializes the HASH peripheral in SHA1 mode then processes pInBuffer.
HAL_StatusTypeDef HAL_HASH_SHA1_Accumulate (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 Initializes the HASH peripheral in SHA1 mode then processes pInBuffer.

Detailed Description

processing functions using polling mode

 ===============================================================================
              ##### HASH processing using polling mode functions#####
 ===============================================================================  
    [..]  This section provides functions allowing to calculate in polling mode
          the hash value using one of the following algorithms:
      (+) MD5
      (+) SHA1


Function Documentation

HAL_StatusTypeDef HAL_HASH_MD5_Accumulate ( HASH_HandleTypeDef hhash,
uint8_t *  pInBuffer,
uint32_t  Size 
)

Initializes the HASH peripheral in MD5 mode then writes the pInBuffer.

Parameters:
hhashpointer to a HASH_HandleTypeDef structure that contains the configuration information for HASH module
pInBufferPointer to the input buffer (buffer to be hashed).
SizeLength of the input buffer in bytes. If the Size is multiple of 64 bytes, appending the input buffer is possible. If the Size is not multiple of 64 bytes, the padding is managed by hardware and appending the input buffer is no more possible.
Return values:
HALstatus

Definition at line 607 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_SET_NBVALIDBITS, HAL_HASH_PHASE_PROCESS, HAL_HASH_PHASE_READY, HAL_HASH_STATE_BUSY, HAL_HASH_STATE_READY, HASH_ALGOSELECTION_MD5, HASH_WriteData(), HASH_HandleTypeDef::Phase, and HASH_HandleTypeDef::State.

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

Initializes the HASH peripheral in MD5 mode then processes pInBuffer.

The digest is available in pOutBuffer.

Parameters:
hhashpointer to a HASH_HandleTypeDef structure that contains the configuration information for HASH module
pInBufferPointer to the input buffer (buffer to be hashed).
SizeLength of the input buffer in bytes. If the Size is multiple of 64 bytes, appending the input buffer is possible. If the Size is not multiple of 64 bytes, the padding is managed by hardware and appending the input buffer is no more possible.
pOutBufferPointer to the computed digest. Its size must be 16 bytes.
TimeoutTimeout value
Return values:
HALstatus

Definition at line 532 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_SET_NBVALIDBITS, __HAL_HASH_START_DIGEST, HAL_GetTick(), HAL_HASH_PHASE_PROCESS, HAL_HASH_PHASE_READY, HAL_HASH_STATE_BUSY, HAL_HASH_STATE_READY, HAL_HASH_STATE_TIMEOUT, HASH_ALGOSELECTION_MD5, HASH_FLAG_BUSY, HASH_GetDigest(), HASH_WriteData(), HASH_HandleTypeDef::Phase, and HASH_HandleTypeDef::State.

HAL_StatusTypeDef HAL_HASH_SHA1_Accumulate ( HASH_HandleTypeDef hhash,
uint8_t *  pInBuffer,
uint32_t  Size 
)

Initializes the HASH peripheral in SHA1 mode then processes pInBuffer.

Parameters:
hhashpointer to a HASH_HandleTypeDef structure that contains the configuration information for HASH module
pInBufferPointer to the input buffer (buffer to be hashed).
SizeLength of the input buffer in bytes. If the Size is not multiple of 64 bytes, the padding is managed by hardware.
Note:
Input buffer size in bytes must be a multiple of 4 otherwise the digest computation is corrupted.
Return values:
HALstatus

Definition at line 728 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_SET_NBVALIDBITS, assert_param, HAL_HASH_PHASE_PROCESS, HAL_HASH_PHASE_READY, HAL_HASH_STATE_BUSY, HAL_HASH_STATE_READY, HASH_ALGOSELECTION_SHA1, HASH_WriteData(), IS_HASH_SHA1_BUFFER_SIZE, HASH_HandleTypeDef::Phase, and HASH_HandleTypeDef::State.

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

Initializes the HASH peripheral in SHA1 mode then processes pInBuffer.

The digest is available in pOutBuffer.

Parameters:
hhashpointer to a HASH_HandleTypeDef structure that contains the configuration information for HASH module
pInBufferPointer to the input buffer (buffer to be hashed).
SizeLength of the input buffer in bytes. If the Size is not multiple of 64 bytes, the padding is managed by hardware.
pOutBufferPointer to the computed digest. Its size must be 20 bytes.
TimeoutTimeout value
Return values:
HALstatus

Definition at line 654 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_SET_NBVALIDBITS, __HAL_HASH_START_DIGEST, HAL_GetTick(), HAL_HASH_PHASE_PROCESS, HAL_HASH_PHASE_READY, HAL_HASH_STATE_BUSY, HAL_HASH_STATE_READY, HAL_HASH_STATE_TIMEOUT, HASH_ALGOSELECTION_SHA1, HASH_FLAG_BUSY, HASH_GetDigest(), HASH_WriteData(), HASH_HandleTypeDef::Phase, and HASH_HandleTypeDef::State.