STM32L4xx_HAL_Driver  1.14.0
HASH extended processing functions in interrupt mode

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

Functions

HAL_StatusTypeDef HAL_HASHEx_SHA224_Start_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer)
 Initialize the HASH peripheral in SHA224 mode, next process pInBuffer then read the computed digest in interruption mode. More...
 
HAL_StatusTypeDef HAL_HASHEx_SHA224_Accumulate_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 If not already done, initialize the HASH peripheral in SHA224 mode then processes pInBuffer in interruption mode. More...
 
HAL_StatusTypeDef HAL_HASHEx_SHA256_Start_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer)
 Initialize the HASH peripheral in SHA256 mode, next process pInBuffer then read the computed digest in interruption mode. More...
 
HAL_StatusTypeDef HAL_HASHEx_SHA256_Accumulate_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 If not already done, initialize the HASH peripheral in SHA256 mode then processes pInBuffer in interruption mode. More...
 

Detailed Description

HASH extended processing functions using interrupt mode.

 ===============================================================================
          ##### Interruption mode HASH extended processing functions #####
 ===============================================================================
    [..]  This section provides functions allowing to calculate in interrupt mode
          the hash value using one of the following algorithms:
      (+) SHA224
         (++) HAL_HASHEx_SHA224_Start_IT()
      (+) SHA256
         (++) HAL_HASHEx_SHA256_Start_IT()

Function Documentation

◆ HAL_HASHEx_SHA224_Accumulate_IT()

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

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

Note
Consecutive calls to HAL_HASHEx_SHA224_Accumulate_IT() 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_Start_IT().
Field hhash->Phase of HASH handle is tested to check whether or not the Peripheral has already been initialized.
The input buffer size (in bytes) must be a multiple of 4 otherwise, the HASH digest computation is corrupted. Only HAL_HASHEx_SHA224_Start_IT() 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 276 of file stm32l4xx_hal_hash_ex.c.

277 {
278  return HASH_Accumulate_IT(hhash, pInBuffer, Size,HASH_ALGOSELECTION_SHA224);
279 }
HAL_StatusTypeDef HASH_Accumulate_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm)
If not already done, initialize the HASH peripheral then processes pInBuffer in interruption mode...

◆ HAL_HASHEx_SHA224_Start_IT()

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

Initialize the HASH peripheral in SHA224 mode, next process pInBuffer then read the computed digest in interruption mode.

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.
Return values
HALstatus

Definition at line 253 of file stm32l4xx_hal_hash_ex.c.

254 {
255  return HASH_Start_IT(hhash, pInBuffer, Size, pOutBuffer,HASH_ALGOSELECTION_SHA224);
256 }
HAL_StatusTypeDef HASH_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Algorithm)
Initialize the HASH peripheral, next process pInBuffer then read the computed digest in interruption ...

◆ HAL_HASHEx_SHA256_Accumulate_IT()

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

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

Note
Consecutive calls to HAL_HASHEx_SHA256_Accumulate_IT() 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_Start_IT().
Field hhash->Phase of HASH handle is tested to check whether or not the Peripheral has already been initialized.
The input buffer size (in bytes) must be a multiple of 4 otherwise, the HASH digest computation is corrupted. Only HAL_HASHEx_SHA256_Start_IT() 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 314 of file stm32l4xx_hal_hash_ex.c.

315 {
316  return HASH_Accumulate_IT(hhash, pInBuffer, Size,HASH_ALGOSELECTION_SHA256);
317 }
HAL_StatusTypeDef HASH_Accumulate_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm)
If not already done, initialize the HASH peripheral then processes pInBuffer in interruption mode...

◆ HAL_HASHEx_SHA256_Start_IT()

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

Initialize the HASH peripheral in SHA256 mode, next process pInBuffer then read the computed digest in interruption mode.

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.
Return values
HALstatus

Definition at line 291 of file stm32l4xx_hal_hash_ex.c.

292 {
293  return HASH_Start_IT(hhash, pInBuffer, Size, pOutBuffer,HASH_ALGOSELECTION_SHA256);
294 }
HAL_StatusTypeDef HASH_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Algorithm)
Initialize the HASH peripheral, next process pInBuffer then read the computed digest in interruption ...