STM32F4 Standard Peripheral bibliotheek
1.0
ST Microelectronics bibliotheek documentatie voor de STM32F4 Standard Peripheral Library
|
HASH driver modules. More...
Modules | |
HASH_Exported_Constants | |
HASH_Private_Functions | |
Data Structures | |
struct | HASH_InitTypeDef |
HASH Init structure definition. More... | |
struct | HASH_MsgDigest |
HASH message digest result structure definition. More... | |
struct | HASH_Context |
HASH context swapping structure definition. More... | |
Macros | |
#define | MD5BUSY_TIMEOUT ((uint32_t) 0x00010000) |
#define | SHA1BUSY_TIMEOUT ((uint32_t) 0x00010000) |
Functions | |
void | HASH_DeInit (void) |
Deinitializes the HASH peripheral registers to their default reset values. More... | |
void | HASH_Init (HASH_InitTypeDef *HASH_InitStruct) |
Initializes the HASH peripheral according to the specified parameters in the HASH_InitStruct structure. More... | |
void | HASH_StructInit (HASH_InitTypeDef *HASH_InitStruct) |
Fills each HASH_InitStruct member with its default value. More... | |
void | HASH_Reset (void) |
Resets the HASH processor core, so that the HASH will be ready to compute the message digest of a new 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_SetLastWordValidBitsNbr (uint16_t ValidNumber) |
Configure the Number of valid bits in last word of the message. More... | |
void | HASH_StartDigest (void) |
Starts the message padding and calculation of the final message. More... | |
void | HASH_GetDigest (HASH_MsgDigest *HASH_MessageDigest) |
Provides the message digest result. More... | |
void | HASH_SaveContext (HASH_Context *HASH_ContextSave) |
Save the Hash peripheral Context. More... | |
void | HASH_RestoreContext (HASH_Context *HASH_ContextRestore) |
Restore the Hash peripheral Context. More... | |
void | HASH_DMACmd (FunctionalState NewState) |
Enables or disables the HASH DMA interface. More... | |
void | HASH_ITConfig (uint8_t HASH_IT, FunctionalState NewState) |
Enables or disables the specified HASH interrupts. More... | |
FlagStatus | HASH_GetFlagStatus (uint16_t HASH_FLAG) |
Checks whether the specified HASH flag is set or not. More... | |
void | HASH_ClearFlag (uint16_t HASH_FLAG) |
Clears the HASH flags. More... | |
ITStatus | HASH_GetITStatus (uint8_t HASH_IT) |
Checks whether the specified HASH interrupt has occurred or not. More... | |
void | HASH_ClearITPendingBit (uint8_t HASH_IT) |
Clears the HASH interrupt pending bit(s). More... | |
ErrorStatus | HASH_SHA1 (uint8_t *Input, uint32_t Ilen, uint8_t Output[20]) |
Compute the HASH SHA1 digest. More... | |
ErrorStatus | HMAC_SHA1 (uint8_t *Key, uint32_t Keylen, uint8_t *Input, uint32_t Ilen, uint8_t Output[20]) |
Compute the HMAC SHA1 digest. More... | |
ErrorStatus | HASH_MD5 (uint8_t *Input, uint32_t Ilen, uint8_t Output[16]) |
Compute the HASH MD5 digest. More... | |
ErrorStatus | HMAC_MD5 (uint8_t *Key, uint32_t Keylen, uint8_t *Input, uint32_t Ilen, uint8_t Output[16]) |
Compute the HMAC MD5 digest. More... | |
HASH driver modules.
void HASH_ClearFlag | ( | uint16_t | HASH_FLAG | ) |
Clears the HASH flags.
HASH_FLAG,: | specifies the flag to clear. This parameter can be any combination of the following values:
|
None |
void HASH_ClearITPendingBit | ( | uint8_t | HASH_IT | ) |
Clears the HASH interrupt pending bit(s).
HASH_IT,: | specifies the HASH interrupt pending bit(s) to clear. This parameter can be any combination of the following values:
|
None |
void HASH_DataIn | ( | uint32_t | Data | ) |
Writes data in the Data Input FIFO.
Data,: | new data of the message to be processed. |
None |
void HASH_DeInit | ( | void | ) |
Deinitializes the HASH peripheral registers to their default reset values.
None |
None |
void HASH_DMACmd | ( | FunctionalState | NewState | ) |
Enables or disables the HASH DMA interface.
NewState,: | new state of the selected HASH DMA transfer request. This parameter can be: ENABLE or DISABLE. |
None |
void HASH_GetDigest | ( | HASH_MsgDigest * | HASH_MessageDigest | ) |
Provides the message digest result.
HASH_MessageDigest,: | pointer to a HASH_MsgDigest structure which will hold the message digest result |
None |
FlagStatus HASH_GetFlagStatus | ( | uint16_t | HASH_FLAG | ) |
Checks whether the specified HASH flag is set or not.
HASH_FLAG,: | specifies the HASH flag to check. This parameter can be one of the following values:
|
The | new state of HASH_FLAG (SET or RESET) |
uint8_t HASH_GetInFIFOWordsNbr | ( | void | ) |
Returns the number of words already pushed into the IN FIFO.
None |
The | value of words already pushed into the IN FIFO. |
ITStatus HASH_GetITStatus | ( | uint8_t | HASH_IT | ) |
Checks whether the specified HASH interrupt has occurred or not.
HASH_IT,: | specifies the HASH interrupt source to check. This parameter can be one of the following values:
|
The | new state of HASH_IT (SET or RESET). |
void HASH_Init | ( | HASH_InitTypeDef * | HASH_InitStruct | ) |
Initializes the HASH peripheral according to the specified parameters in the HASH_InitStruct structure.
HASH_InitStruct,: | pointer to a HASH_InitTypeDef structure that contains the configuration information for the HASH peripheral. |
None |
void HASH_ITConfig | ( | uint8_t | HASH_IT, |
FunctionalState | NewState | ||
) |
Enables or disables the specified HASH interrupts.
HASH_IT,: | specifies the HASH interrupt source to be enabled or disabled. This parameter can be any combination of the following values:
|
NewState,: | new state of the specified HASH interrupt. This parameter can be: ENABLE or DISABLE. |
None |
ErrorStatus HASH_MD5 | ( | uint8_t * | Input, |
uint32_t | Ilen, | ||
uint8_t | Output[16] | ||
) |
Compute the HASH MD5 digest.
Input,: | pointer to the Input buffer to be treated. |
Ilen,: | length of the Input buffer. |
Output,: | the returned digest |
An | ErrorStatus enumeration value:
|
void HASH_Reset | ( | void | ) |
Resets the HASH processor core, so that the HASH will be ready to compute the message digest of a new message.
None |
None |
void HASH_RestoreContext | ( | HASH_Context * | HASH_ContextRestore | ) |
Restore the Hash peripheral Context.
HASH_ContextRestore,: | pointer to a HASH_Context structure that contains the repository for saved context. |
None |
void HASH_SaveContext | ( | HASH_Context * | HASH_ContextSave | ) |
Save the Hash peripheral Context.
HASH_ContextSave,: | pointer to a HASH_Context structure that contains the repository for current context. |
None |
void HASH_SetLastWordValidBitsNbr | ( | uint16_t | ValidNumber | ) |
Configure the Number of valid bits in last word of the message.
ValidNumber,: | Number of valid bits in last word of the message. This parameter must be a number between 0 and 0x1F.
|
None |
ErrorStatus HASH_SHA1 | ( | uint8_t * | Input, |
uint32_t | Ilen, | ||
uint8_t | Output[20] | ||
) |
Compute the HASH SHA1 digest.
Input,: | pointer to the Input buffer to be treated. |
Ilen,: | length of the Input buffer. |
Output,: | the returned digest |
An | ErrorStatus enumeration value:
|
void HASH_StartDigest | ( | void | ) |
Starts the message padding and calculation of the final message.
None |
None |
void HASH_StructInit | ( | HASH_InitTypeDef * | HASH_InitStruct | ) |
Fills each HASH_InitStruct member with its default value.
HASH_InitStruct | : pointer to a HASH_InitTypeDef structure which will be initialized. |
None |
ErrorStatus HMAC_MD5 | ( | uint8_t * | Key, |
uint32_t | Keylen, | ||
uint8_t * | Input, | ||
uint32_t | Ilen, | ||
uint8_t | Output[16] | ||
) |
Compute the HMAC MD5 digest.
Key,: | pointer to the Key used for HMAC. |
Keylen,: | length of the Key used for HMAC. |
Input,: | pointer to the Input buffer to be treated. |
Ilen,: | length of the Input buffer. |
Output,: | the returned digest |
An | ErrorStatus enumeration value:
|
ErrorStatus HMAC_SHA1 | ( | uint8_t * | Key, |
uint32_t | Keylen, | ||
uint8_t * | Input, | ||
uint32_t | Ilen, | ||
uint8_t | Output[20] | ||
) |
Compute the HMAC SHA1 digest.
Key,: | pointer to the Key used for HMAC. |
Keylen,: | length of the Key used for HMAC. |
Input,: | pointer to the Input buffer to be treated. |
Ilen,: | length of the Input buffer. |
Output,: | the returned digest |
An | ErrorStatus enumeration value:
|