STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
HASH extended processing functions in polling mode

HASH extended processing functions using polling mode. More...

Collaboration diagram for HASH extended processing functions in polling mode:

Functions

HAL_StatusTypeDef HAL_HASHEx_SHA224_Start (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout)
 Initialize the HASH peripheral in SHA224 mode, next process pInBuffer then read the computed digest.
 
HAL_StatusTypeDef HAL_HASHEx_SHA224_Accmlt (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 If not already done, initialize the HASH peripheral in SHA224 mode then processes pInBuffer.
 
HAL_StatusTypeDef HAL_HASHEx_SHA224_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_HASHEx_SHA224_Accmlt() API.
 
HAL_StatusTypeDef HAL_HASHEx_SHA256_Start (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout)
 Initialize the HASH peripheral in SHA256 mode, next process pInBuffer then read the computed digest.
 
HAL_StatusTypeDef HAL_HASHEx_SHA256_Accmlt (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 If not already done, initialize the HASH peripheral in SHA256 mode then processes pInBuffer.
 
HAL_StatusTypeDef HAL_HASHEx_SHA256_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_HASHEx_SHA256_Accmlt() API.
 

Detailed Description

HASH extended processing functions using polling mode.

 ===============================================================================
               ##### Polling mode HASH extended processing functions #####
 ===============================================================================
    [..]  This section provides functions allowing to calculate in polling mode
          the hash value using one of the following algorithms:
      (+) SHA224
         (++) HAL_HASHEx_SHA224_Start()
         (++) HAL_HASHEx_SHA224_Accmlt()
         (++) HAL_HASHEx_SHA224_Accmlt_End()
      (+) SHA256
         (++) HAL_HASHEx_SHA256_Start()
         (++) HAL_HASHEx_SHA256_Accmlt()
         (++) HAL_HASHEx_SHA256_Accmlt_End()

    [..] For a single buffer to be hashed, user can resort to HAL_HASH_xxx_Start().

    [..]  In case of multi-buffer HASH processing (a single digest is computed while
          several buffers are fed to the Peripheral), the user can resort to successive calls
          to HAL_HASHEx_xxx_Accumulate() and wrap-up the digest computation by a call
          to HAL_HASHEx_xxx_Accumulate_End().

Function Documentation

◆ HAL_HASHEx_SHA224_Start()

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

#include <stm32f4xx_hal_hash_ex.h>

Initialize the HASH peripheral in SHA224 mode, 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. Digest size is 28 bytes.
TimeoutTimeout value
Return values
HALstatus

Definition at line 151 of file stm32f4xx_hal_hash_ex.c.

References HASH_ALGOSELECTION_SHA224, and HASH_Start().

◆ HAL_HASHEx_SHA224_Accmlt()

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

#include <stm32f4xx_hal_hash_ex.h>

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

Note
Consecutive calls to HAL_HASHEx_SHA224_Accmlt() can be used to feed several input buffers back-to-back to the Peripheral that will yield a single HASH signature once all buffers have been entered. Wrap-up of input buffers feeding and retrieval of digest is done by a call to HAL_HASHEx_SHA224_Accmlt_End().
Field hhash->Phase of HASH handle is tested to check whether or not the Peripheral has already been initialized.
Digest is not retrieved by this API, user must resort to HAL_HASHEx_SHA224_Accmlt_End() to read it, feeding at the same time the last input buffer to the Peripheral.
The input buffer size (in bytes) must be a multiple of 4 otherwise, the HASH digest computation is corrupted. Only HAL_HASHEx_SHA224_Accmlt_End() is able to manage the ending buffer with a length in bytes not a multiple of 4.
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.
Return values
HALstatus

Definition at line 177 of file stm32f4xx_hal_hash_ex.c.

References HASH_Accumulate(), and HASH_ALGOSELECTION_SHA224.

◆ HAL_HASHEx_SHA224_Accmlt_End()

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

#include <stm32f4xx_hal_hash_ex.h>

End computation of a single HASH signature after several calls to HAL_HASHEx_SHA224_Accmlt() API.

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. Digest size is 28 bytes.
TimeoutTimeout value
Return values
HALstatus

Definition at line 192 of file stm32f4xx_hal_hash_ex.c.

References HASH_ALGOSELECTION_SHA224, and HASH_Start().

◆ HAL_HASHEx_SHA256_Start()

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

#include <stm32f4xx_hal_hash_ex.h>

Initialize the HASH peripheral in SHA256 mode, 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. Digest size is 32 bytes.
TimeoutTimeout value
Return values
HALstatus

Definition at line 209 of file stm32f4xx_hal_hash_ex.c.

References HASH_ALGOSELECTION_SHA256, and HASH_Start().

◆ HAL_HASHEx_SHA256_Accmlt()

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

#include <stm32f4xx_hal_hash_ex.h>

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

Note
Consecutive calls to HAL_HASHEx_SHA256_Accmlt() can be used to feed several input buffers back-to-back to the Peripheral that will yield a single HASH signature once all buffers have been entered. Wrap-up of input buffers feeding and retrieval of digest is done by a call to HAL_HASHEx_SHA256_Accmlt_End().
Field hhash->Phase of HASH handle is tested to check whether or not the Peripheral has already been initialized.
Digest is not retrieved by this API, user must resort to HAL_HASHEx_SHA256_Accmlt_End() to read it, feeding at the same time the last input buffer to the Peripheral.
The input buffer size (in bytes) must be a multiple of 4 otherwise, the HASH digest computation is corrupted. Only HAL_HASHEx_SHA256_Accmlt_End() is able to manage the ending buffer with a length in bytes not a multiple of 4.
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.
Return values
HALstatus

Definition at line 235 of file stm32f4xx_hal_hash_ex.c.

References HASH_Accumulate(), and HASH_ALGOSELECTION_SHA256.

◆ HAL_HASHEx_SHA256_Accmlt_End()

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

#include <stm32f4xx_hal_hash_ex.h>

End computation of a single HASH signature after several calls to HAL_HASHEx_SHA256_Accmlt() API.

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. Digest size is 32 bytes.
TimeoutTimeout value
Return values
HALstatus

Definition at line 250 of file stm32f4xx_hal_hash_ex.c.

References HASH_ALGOSELECTION_SHA256, and HASH_Start().