STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
Multi-buffer HMAC extended processing functions in DMA mode

HMAC extended processing functions in multi-buffer DMA mode. More...

Collaboration diagram for Multi-buffer HMAC extended processing functions in DMA mode:

Functions

HAL_StatusTypeDef HAL_HMACEx_MD5_Step1_2_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 MD5 HMAC step 1 completion and step 2 start in multi-buffer DMA mode.
 
HAL_StatusTypeDef HAL_HMACEx_MD5_Step2_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 MD5 HMAC step 2 in multi-buffer DMA mode.
 
HAL_StatusTypeDef HAL_HMACEx_MD5_Step2_3_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 MD5 HMAC step 2 wrap-up and step 3 completion in multi-buffer DMA mode.
 
HAL_StatusTypeDef HAL_HMACEx_SHA1_Step1_2_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 SHA1 HMAC step 1 completion and step 2 start in multi-buffer DMA mode.
 
HAL_StatusTypeDef HAL_HMACEx_SHA1_Step2_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 SHA1 HMAC step 2 in multi-buffer DMA mode.
 
HAL_StatusTypeDef HAL_HMACEx_SHA1_Step2_3_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 SHA1 HMAC step 2 wrap-up and step 3 completion in multi-buffer DMA mode.
 
HAL_StatusTypeDef HAL_HMACEx_SHA224_Step1_2_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 SHA224 HMAC step 1 completion and step 2 start in multi-buffer DMA mode.
 
HAL_StatusTypeDef HAL_HMACEx_SHA224_Step2_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 SHA224 HMAC step 2 in multi-buffer DMA mode.
 
HAL_StatusTypeDef HAL_HMACEx_SHA224_Step2_3_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 SHA224 HMAC step 2 wrap-up and step 3 completion in multi-buffer DMA mode.
 
HAL_StatusTypeDef HAL_HMACEx_SHA256_Step1_2_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 SHA256 HMAC step 1 completion and step 2 start in multi-buffer DMA mode.
 
HAL_StatusTypeDef HAL_HMACEx_SHA256_Step2_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 SHA256 HMAC step 2 in multi-buffer DMA mode.
 
HAL_StatusTypeDef HAL_HMACEx_SHA256_Step2_3_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 SHA256 HMAC step 2 wrap-up and step 3 completion in multi-buffer DMA mode.
 

Detailed Description

HMAC extended processing functions in multi-buffer DMA mode.

 ===============================================================================
      ##### Multi-buffer DMA mode HMAC extended processing functions #####
 ===============================================================================
    [..]  This section provides functions to manage HMAC multi-buffer
          DMA-based processing for MD5, SHA1, SHA224 and SHA256 algorithms.
      (+) MD5
         (++) HAL_HMACEx_MD5_Step1_2_DMA()
         (++) HAL_HMACEx_MD5_Step2_DMA()
         (++) HAL_HMACEx_MD5_Step2_3_DMA()
      (+) SHA1
         (++) HAL_HMACEx_SHA1_Step1_2_DMA()
         (++) HAL_HMACEx_SHA1_Step2_DMA()
         (++) HAL_HMACEx_SHA1_Step2_3_DMA()

      (+) SHA256
         (++) HAL_HMACEx_SHA224_Step1_2_DMA()
         (++) HAL_HMACEx_SHA224_Step2_DMA()
         (++) HAL_HMACEx_SHA224_Step2_3_DMA()
      (+) SHA256
         (++) HAL_HMACEx_SHA256_Step1_2_DMA()
         (++) HAL_HMACEx_SHA256_Step2_DMA()
         (++) HAL_HMACEx_SHA256_Step2_3_DMA()

    [..]  User must first start-up the multi-buffer DMA-based HMAC computation in
          calling HAL_HMACEx_xxx_Step1_2_DMA(). This carries out HMAC step 1 and
          intiates step 2 with the first input buffer.

    [..]  The following buffers are next fed to the Peripheral with a call to the API
          HAL_HMACEx_xxx_Step2_DMA(). There may be several consecutive calls
          to this API.

    [..]  Multi-buffer DMA-based HMAC computation is wrapped up by a call to
          HAL_HMACEx_xxx_Step2_3_DMA(). This finishes step 2 in feeding the last input
          buffer to the Peripheral then carries out step 3.

    [..]  Digest is retrieved by a call to HAL_HASH_xxx_Finish() for MD-5 or
          SHA-1, to HAL_HASHEx_xxx_Finish() for SHA-224 or SHA-256.

    [..]  If only two buffers need to be consecutively processed, a call to
          HAL_HMACEx_xxx_Step1_2_DMA() followed by a call to HAL_HMACEx_xxx_Step2_3_DMA()
          is sufficient.

Function Documentation

◆ HAL_HMACEx_MD5_Step1_2_DMA()

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

#include <stm32f4xx_hal_hash_ex.h>

MD5 HMAC step 1 completion and step 2 start in multi-buffer DMA mode.

Note
Step 1 consists in writing the inner hash function key in the Peripheral, step 2 consists in writing the message text.
The API carries out the HMAC step 1 then starts step 2 with the first buffer entered to the Peripheral. DCAL bit is not automatically set after the message buffer feeding, allowing other messages DMA transfers to occur.
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.
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 (message buffer).
Sizelength of the input buffer in bytes.
Return values
HALstatus

Definition at line 762 of file stm32f4xx_hal_hash_ex.c.

References HASH_HandleTypeDef::DigestCalculationDisable, HASH_ALGOSELECTION_MD5, and HMAC_Start_DMA().

◆ HAL_HMACEx_MD5_Step2_DMA()

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

#include <stm32f4xx_hal_hash_ex.h>

MD5 HMAC step 2 in multi-buffer DMA mode.

Note
Step 2 consists in writing the message text in the Peripheral.
The API carries on the HMAC step 2, applied to the buffer entered as input parameter. DCAL bit is not automatically set after the message buffer feeding, allowing other messages DMA transfers to occur.
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.
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 (message buffer).
Sizelength of the input buffer in bytes.
Return values
HALstatus

Definition at line 783 of file stm32f4xx_hal_hash_ex.c.

References HASH_HandleTypeDef::DigestCalculationDisable, HAL_ERROR, HASH_ALGOSELECTION_MD5, and HMAC_Start_DMA().

◆ HAL_HMACEx_MD5_Step2_3_DMA()

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

#include <stm32f4xx_hal_hash_ex.h>

MD5 HMAC step 2 wrap-up and step 3 completion in multi-buffer DMA mode.

Note
Step 2 consists in writing the message text in the Peripheral, step 3 consists in writing the outer hash function key.
The API wraps up the HMAC step 2 in processing the buffer entered as input parameter (the input buffer must be the last one of the multi-buffer thread) then carries out HMAC step 3.
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.
Once the DMA transfers are finished (indicated by hhash->State set back to HAL_HASH_STATE_READY), HAL_HASHEx_SHA256_Finish() API must be called to retrieve the computed digest.
Parameters
hhashHASH handle.
pInBufferpointer to the input buffer (message buffer).
Sizelength of the input buffer in bytes.
Return values
HALstatus

Definition at line 809 of file stm32f4xx_hal_hash_ex.c.

References HASH_HandleTypeDef::DigestCalculationDisable, HASH_ALGOSELECTION_MD5, and HMAC_Start_DMA().

◆ HAL_HMACEx_SHA1_Step1_2_DMA()

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

#include <stm32f4xx_hal_hash_ex.h>

SHA1 HMAC step 1 completion and step 2 start in multi-buffer DMA mode.

Note
Step 1 consists in writing the inner hash function key in the Peripheral, step 2 consists in writing the message text.
The API carries out the HMAC step 1 then starts step 2 with the first buffer entered to the Peripheral. DCAL bit is not automatically set after the message buffer feeding, allowing other messages DMA transfers to occur.
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.
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 (message buffer).
Sizelength of the input buffer in bytes.
Return values
HALstatus

Definition at line 832 of file stm32f4xx_hal_hash_ex.c.

References HASH_HandleTypeDef::DigestCalculationDisable, HASH_ALGOSELECTION_SHA1, and HMAC_Start_DMA().

◆ HAL_HMACEx_SHA1_Step2_DMA()

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

#include <stm32f4xx_hal_hash_ex.h>

SHA1 HMAC step 2 in multi-buffer DMA mode.

Note
Step 2 consists in writing the message text in the Peripheral.
The API carries on the HMAC step 2, applied to the buffer entered as input parameter. DCAL bit is not automatically set after the message buffer feeding, allowing other messages DMA transfers to occur.
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.
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 (message buffer).
Sizelength of the input buffer in bytes.
Return values
HALstatus

Definition at line 853 of file stm32f4xx_hal_hash_ex.c.

References HASH_HandleTypeDef::DigestCalculationDisable, HAL_ERROR, HASH_ALGOSELECTION_SHA1, and HMAC_Start_DMA().

◆ HAL_HMACEx_SHA1_Step2_3_DMA()

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

#include <stm32f4xx_hal_hash_ex.h>

SHA1 HMAC step 2 wrap-up and step 3 completion in multi-buffer DMA mode.

Note
Step 2 consists in writing the message text in the Peripheral, step 3 consists in writing the outer hash function key.
The API wraps up the HMAC step 2 in processing the buffer entered as input parameter (the input buffer must be the last one of the multi-buffer thread) then carries out HMAC step 3.
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.
Once the DMA transfers are finished (indicated by hhash->State set back to HAL_HASH_STATE_READY), HAL_HASHEx_SHA256_Finish() API must be called to retrieve the computed digest.
Parameters
hhashHASH handle.
pInBufferpointer to the input buffer (message buffer).
Sizelength of the input buffer in bytes.
Return values
HALstatus

Definition at line 879 of file stm32f4xx_hal_hash_ex.c.

References HASH_HandleTypeDef::DigestCalculationDisable, HASH_ALGOSELECTION_SHA1, and HMAC_Start_DMA().

◆ HAL_HMACEx_SHA224_Step1_2_DMA()

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

#include <stm32f4xx_hal_hash_ex.h>

SHA224 HMAC step 1 completion and step 2 start in multi-buffer DMA mode.

Note
Step 1 consists in writing the inner hash function key in the Peripheral, step 2 consists in writing the message text.
The API carries out the HMAC step 1 then starts step 2 with the first buffer entered to the Peripheral. DCAL bit is not automatically set after the message buffer feeding, allowing other messages DMA transfers to occur.
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.
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 (message buffer).
Sizelength of the input buffer in bytes.
Return values
HALstatus

Definition at line 901 of file stm32f4xx_hal_hash_ex.c.

References HASH_HandleTypeDef::DigestCalculationDisable, HASH_ALGOSELECTION_SHA224, and HMAC_Start_DMA().

◆ HAL_HMACEx_SHA224_Step2_DMA()

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

#include <stm32f4xx_hal_hash_ex.h>

SHA224 HMAC step 2 in multi-buffer DMA mode.

Note
Step 2 consists in writing the message text in the Peripheral.
The API carries on the HMAC step 2, applied to the buffer entered as input parameter. DCAL bit is not automatically set after the message buffer feeding, allowing other messages DMA transfers to occur.
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.
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 (message buffer).
Sizelength of the input buffer in bytes.
Return values
HALstatus

Definition at line 922 of file stm32f4xx_hal_hash_ex.c.

References HASH_HandleTypeDef::DigestCalculationDisable, HAL_ERROR, HASH_ALGOSELECTION_SHA224, and HMAC_Start_DMA().

◆ HAL_HMACEx_SHA224_Step2_3_DMA()

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

#include <stm32f4xx_hal_hash_ex.h>

SHA224 HMAC step 2 wrap-up and step 3 completion in multi-buffer DMA mode.

Note
Step 2 consists in writing the message text in the Peripheral, step 3 consists in writing the outer hash function key.
The API wraps up the HMAC step 2 in processing the buffer entered as input parameter (the input buffer must be the last one of the multi-buffer thread) then carries out HMAC step 3.
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.
Once the DMA transfers are finished (indicated by hhash->State set back to HAL_HASH_STATE_READY), HAL_HASHEx_SHA256_Finish() API must be called to retrieve the computed digest.
Parameters
hhashHASH handle.
pInBufferpointer to the input buffer (message buffer).
Sizelength of the input buffer in bytes.
Return values
HALstatus

Definition at line 948 of file stm32f4xx_hal_hash_ex.c.

References HASH_HandleTypeDef::DigestCalculationDisable, HASH_ALGOSELECTION_SHA224, and HMAC_Start_DMA().

◆ HAL_HMACEx_SHA256_Step1_2_DMA()

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

#include <stm32f4xx_hal_hash_ex.h>

SHA256 HMAC step 1 completion and step 2 start in multi-buffer DMA mode.

Note
Step 1 consists in writing the inner hash function key in the Peripheral, step 2 consists in writing the message text.
The API carries out the HMAC step 1 then starts step 2 with the first buffer entered to the Peripheral. DCAL bit is not automatically set after the message buffer feeding, allowing other messages DMA transfers to occur.
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.
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 (message buffer).
Sizelength of the input buffer in bytes.
Return values
HALstatus

Definition at line 970 of file stm32f4xx_hal_hash_ex.c.

References HASH_HandleTypeDef::DigestCalculationDisable, HASH_ALGOSELECTION_SHA256, and HMAC_Start_DMA().

◆ HAL_HMACEx_SHA256_Step2_DMA()

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

#include <stm32f4xx_hal_hash_ex.h>

SHA256 HMAC step 2 in multi-buffer DMA mode.

Note
Step 2 consists in writing the message text in the Peripheral.
The API carries on the HMAC step 2, applied to the buffer entered as input parameter. DCAL bit is not automatically set after the message buffer feeding, allowing other messages DMA transfers to occur.
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.
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 (message buffer).
Sizelength of the input buffer in bytes.
Return values
HALstatus

Definition at line 991 of file stm32f4xx_hal_hash_ex.c.

References HASH_HandleTypeDef::DigestCalculationDisable, HAL_ERROR, HASH_ALGOSELECTION_SHA256, and HMAC_Start_DMA().

◆ HAL_HMACEx_SHA256_Step2_3_DMA()

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

#include <stm32f4xx_hal_hash_ex.h>

SHA256 HMAC step 2 wrap-up and step 3 completion in multi-buffer DMA mode.

Note
Step 2 consists in writing the message text in the Peripheral, step 3 consists in writing the outer hash function key.
The API wraps up the HMAC step 2 in processing the buffer entered as input parameter (the input buffer must be the last one of the multi-buffer thread) then carries out HMAC step 3.
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.
Once the DMA transfers are finished (indicated by hhash->State set back to HAL_HASH_STATE_READY), HAL_HASHEx_SHA256_Finish() API must be called to retrieve the computed digest.
Parameters
hhashHASH handle.
pInBufferpointer to the input buffer (message buffer).
Sizelength of the input buffer in bytes.
Return values
HALstatus

Definition at line 1017 of file stm32f4xx_hal_hash_ex.c.

References HASH_HandleTypeDef::DigestCalculationDisable, HASH_ALGOSELECTION_SHA256, and HMAC_Start_DMA().