STM32F4 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F4 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
Message Digest generation functions

Message Digest generation functions. More...

Functions

void HASH_SetLastWordValidBitsNbr (uint16_t ValidNumber)
 Configure the Number of valid bits in last word of the message. More...
 
void HASH_DataIn (uint32_t Data)
 Writes data in the Data Input FIFO. More...
 
uint8_t HASH_GetInFIFOWordsNbr (void)
 Returns the number of words already pushed into the IN FIFO. More...
 
void HASH_GetDigest (HASH_MsgDigest *HASH_MessageDigest)
 Provides the message digest result. More...
 
void HASH_StartDigest (void)
 Starts the message padding and calculation of the final message. More...
 

Detailed Description

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()

Function Documentation

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
None
void HASH_GetDigest ( HASH_MsgDigest HASH_MessageDigest)

Provides the message digest result.

Note
In MD5 mode, Data[4] 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
None
uint8_t HASH_GetInFIFOWordsNbr ( void  )

Returns the number of words already pushed into the IN FIFO.

Parameters
None
Return values
Thevalue of words already pushed into the IN FIFO.
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
None
void HASH_StartDigest ( void  )

Starts the message padding and calculation of the final message.

Parameters
None
Return values
None