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

HASH processing functions using DMA mode. More...

Collaboration diagram for HASH processing functions in DMA mode:

Functions

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.
 

Detailed Description

HASH processing functions using DMA mode.

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

    [..]  When resorting to DMA mode to enter the data in the Peripheral, user must resort
          to  HAL_HASH_xxx_Start_DMA() then read the resulting digest with
          HAL_HASH_xxx_Finish().
    [..]  In case of multi-buffer HASH processing, MDMAT bit must first be set before
          the successive calls to HAL_HASH_xxx_Start_DMA(). Then, MDMAT bit needs to be
          reset before the last call to HAL_HASH_xxx_Start_DMA(). Digest is finally
          retrieved thanks to HAL_HASH_xxx_Finish().

Function Documentation

◆ HAL_HASH_SHA1_Start_DMA()

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

#include <stm32f4xx_hal_hash.h>

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

Note
Once the DMA transfer is finished, HAL_HASH_SHA1_Finish() API must be called to retrieve the computed digest.
Parameters
hhashHASH handle.
pInBufferpointer to the input buffer (buffer to be hashed).
Sizelength of the input buffer in bytes.
Return values
HALstatus

Definition at line 1112 of file stm32f4xx_hal_hash.c.

References HASH_ALGOSELECTION_SHA1, and HASH_Start_DMA().

◆ HAL_HASH_SHA1_Finish()

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

#include <stm32f4xx_hal_hash.h>

Return the computed digest in SHA1 mode.

Note
The API waits for DCIS to be set then reads the computed digest.
HAL_HASH_SHA1_Finish() can be used as well to retrieve the digest in HMAC SHA1 mode.
Parameters
hhashHASH handle.
pOutBufferpointer to the computed digest. Digest size is 20 bytes.
TimeoutTimeout value.
Return values
HALstatus

Definition at line 1128 of file stm32f4xx_hal_hash.c.

References HASH_Finish().

◆ HAL_HASH_MD5_Start_DMA()

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

#include <stm32f4xx_hal_hash.h>

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

Note
Once the DMA transfer is finished, HAL_HASH_MD5_Finish() API must be called to retrieve the computed digest.
Parameters
hhashHASH handle.
pInBufferpointer to the input buffer (buffer to be hashed).
Sizelength of the input buffer in bytes.
Return values
HALstatus

Definition at line 1082 of file stm32f4xx_hal_hash.c.

References HASH_ALGOSELECTION_MD5, and HASH_Start_DMA().

◆ HAL_HASH_MD5_Finish()

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

#include <stm32f4xx_hal_hash.h>

Return the computed digest in MD5 mode.

Note
The API waits for DCIS to be set then reads the computed digest.
HAL_HASH_MD5_Finish() can be used as well to retrieve the digest in HMAC MD5 mode.
Parameters
hhashHASH handle.
pOutBufferpointer to the computed digest. Digest size is 16 bytes.
TimeoutTimeout value.
Return values
HALstatus

Definition at line 1097 of file stm32f4xx_hal_hash.c.

References HASH_Finish().