Message Digest generation functions.
More...
Message Digest generation functions.
===============================================================================
##### Message Digest generation functions #####
===============================================================================
[..] This section provides functions allowing the generation of message digest:
(+) Push data in the IN FIFO : using HASH_DataIn()
(+) Get the number of words set in IN FIFO, use HASH_GetInFIFOWordsNbr()
(+) set the last word valid bits number using HASH_SetLastWordValidBitsNbr()
(+) start digest calculation : using HASH_StartDigest()
(+) Get the Digest message : using HASH_GetDigest()
void HASH_DataIn |
( |
uint32_t |
Data | ) |
|
Writes data in the Data Input FIFO.
- Parameters
-
Data | new data of the message to be processed. |
- Return values
-
Definition at line 306 of file stm32f4xx_hash.c.
Provides the message digest result.
- Note
- In MD5 mode, Data[7] to Data[4] filed of HASH_MsgDigest structure is not used and is read as zero. In SHA-1 mode, Data[7] to Data[5] filed of HASH_MsgDigest structure is not used and is read as zero. In SHA-224 mode, Data[7] filed of HASH_MsgDigest structure is not used and is read as zero.
- Parameters
-
HASH_MessageDigest | pointer to a HASH_MsgDigest structure which will hold the message digest result |
- Return values
-
Definition at line 335 of file stm32f4xx_hash.c.
uint8_t HASH_GetInFIFOWordsNbr |
( |
void |
| ) |
|
Returns the number of words already pushed into the IN FIFO.
- Parameters
-
- Return values
-
The | value of words already pushed into the IN FIFO. |
Definition at line 317 of file stm32f4xx_hash.c.
void HASH_SetLastWordValidBitsNbr |
( |
uint16_t |
ValidNumber | ) |
|
Configure the Number of valid bits in last word of the message.
- Parameters
-
ValidNumber | Number of valid bits in last word of the message. This parameter must be a number between 0 and 0x1F.
- 0x00: All 32 bits of the last data written are valid
- 0x01: Only bit [0] of the last data written is valid
- 0x02: Only bits[1:0] of the last data written are valid
- 0x03: Only bits[2:0] of the last data written are valid
- ...
- 0x1F: Only bits[30:0] of the last data written are valid
|
- Note
- The Number of valid bits must be set before to start the message digest competition (in Hash and HMAC) and key treatment(in HMAC).
- Return values
-
Definition at line 291 of file stm32f4xx_hash.c.
void HASH_StartDigest |
( |
void |
| ) |
|
Starts the message padding and calculation of the final message.
- Parameters
-
- Return values
-
Definition at line 353 of file stm32f4xx_hash.c.