HASH extended processing functions using DMA mode.
More...
HASH extended processing functions using DMA mode.
===============================================================================
##### DMA mode HASH extended processing functionss #####
===============================================================================
[..] This section provides functions allowing to calculate in DMA mode
the hash value using one of the following algorithms:
(+) SHA224
(++) HAL_HASHEx_SHA224_Start_DMA()
(++) HAL_HASHEx_SHA224_Finish()
(+) SHA256
(++) HAL_HASHEx_SHA256_Start_DMA()
(++) HAL_HASHEx_SHA256_Finish()
[..] When resorting to DMA mode to enter the data in the Peripheral, user must resort
to HAL_HASHEx_xxx_Start_DMA() then read the resulting digest with
HAL_HASHEx_xxx_Finish().
[..] In case of multi-buffer HASH processing, MDMAT bit must first be set before
the successive calls to HAL_HASHEx_xxx_Start_DMA(). Then, MDMAT bit needs to be
reset before the last call to HAL_HASHEx_xxx_Start_DMA(). Digest is finally
retrieved thanks to HAL_HASHEx_xxx_Finish().
◆ HAL_HASHEx_SHA224_Finish()
| HAL_StatusTypeDef HAL_HASHEx_SHA224_Finish |
( |
HASH_HandleTypeDef * |
hhash, |
|
|
uint8_t * |
pOutBuffer, |
|
|
uint32_t |
Timeout |
|
) |
| |
Return the computed digest in SHA224 mode.
- Note
- The API waits for DCIS to be set then reads the computed digest.
-
HAL_HASHEx_SHA224_Finish() can be used as well to retrieve the digest in HMAC SHA224 mode.
- Parameters
-
| hhash | HASH handle. |
| pOutBuffer | pointer to the computed digest. Digest size is 28 bytes. |
| Timeout | Timeout value. |
- Return values
-
Definition at line 380 of file stm32l4xx_hal_hash_ex.c.
HAL_StatusTypeDef HASH_Finish(HASH_HandleTypeDef *hhash, uint8_t *pOutBuffer, uint32_t Timeout)
Return the computed digest.
◆ HAL_HASHEx_SHA224_Start_DMA()
| HAL_StatusTypeDef HAL_HASHEx_SHA224_Start_DMA |
( |
HASH_HandleTypeDef * |
hhash, |
|
|
uint8_t * |
pInBuffer, |
|
|
uint32_t |
Size |
|
) |
| |
Initialize the HASH peripheral in SHA224 mode then initiate a DMA transfer to feed the input buffer to the Peripheral.
- Note
- Once the DMA transfer is finished, HAL_HASHEx_SHA224_Finish() API must be called to retrieve the computed digest.
- Parameters
-
| hhash | HASH handle. |
| pInBuffer | pointer to the input buffer (buffer to be hashed). |
| Size | length of the input buffer in bytes. |
- Return values
-
Definition at line 365 of file stm32l4xx_hal_hash_ex.c.
367 return HASH_Start_DMA(hhash, pInBuffer, Size, HASH_ALGOSELECTION_SHA224);
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 Periphera...
◆ HAL_HASHEx_SHA256_Finish()
| HAL_StatusTypeDef HAL_HASHEx_SHA256_Finish |
( |
HASH_HandleTypeDef * |
hhash, |
|
|
uint8_t * |
pOutBuffer, |
|
|
uint32_t |
Timeout |
|
) |
| |
Return the computed digest in SHA256 mode.
- Note
- The API waits for DCIS to be set then reads the computed digest.
-
HAL_HASHEx_SHA256_Finish() can be used as well to retrieve the digest in HMAC SHA256 mode.
- Parameters
-
| hhash | HASH handle. |
| pOutBuffer | pointer to the computed digest. Digest size is 32 bytes. |
| Timeout | Timeout value. |
- Return values
-
Definition at line 410 of file stm32l4xx_hal_hash_ex.c.
HAL_StatusTypeDef HASH_Finish(HASH_HandleTypeDef *hhash, uint8_t *pOutBuffer, uint32_t Timeout)
Return the computed digest.
◆ HAL_HASHEx_SHA256_Start_DMA()
| HAL_StatusTypeDef HAL_HASHEx_SHA256_Start_DMA |
( |
HASH_HandleTypeDef * |
hhash, |
|
|
uint8_t * |
pInBuffer, |
|
|
uint32_t |
Size |
|
) |
| |
Initialize the HASH peripheral in SHA256 mode then initiate a DMA transfer to feed the input buffer to the Peripheral.
- Note
- Once the DMA transfer is finished, HAL_HASHEx_SHA256_Finish() API must be called to retrieve the computed digest.
- Parameters
-
| hhash | HASH handle. |
| pInBuffer | pointer to the input buffer (buffer to be hashed). |
| Size | length of the input buffer in bytes. |
- Return values
-
Definition at line 395 of file stm32l4xx_hal_hash_ex.c.
397 return HASH_Start_DMA(hhash, pInBuffer, Size, HASH_ALGOSELECTION_SHA256);
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 Periphera...