CARME-M4 BSP
V1.5
|
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) |
De-initializes 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_AutoStartDigest (FunctionalState NewState) |
Enables or disables auto-start message padding and calculation of the final message digest at the end of DMA transfer. 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 (uint32_t HASH_IT, FunctionalState NewState) |
Enables or disables the specified HASH interrupts. More... | |
FlagStatus | HASH_GetFlagStatus (uint32_t HASH_FLAG) |
Checks whether the specified HASH flag is set or not. More... | |
void | HASH_ClearFlag (uint32_t HASH_FLAG) |
Clears the HASH flags. More... | |
ITStatus | HASH_GetITStatus (uint32_t HASH_IT) |
Checks whether the specified HASH interrupt has occurred or not. More... | |
void | HASH_ClearITPendingBit (uint32_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_AutoStartDigest | ( | FunctionalState | NewState | ) |
Enables or disables auto-start message padding and calculation of the final message digest at the end of DMA transfer.
NewState | new state of the selected HASH DMA transfer request. This parameter can be: ENABLE or DISABLE. |
None |
Definition at line 465 of file stm32f4xx_hash.c.
void HASH_ClearFlag | ( | uint32_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 |
Definition at line 651 of file stm32f4xx_hash.c.
void HASH_ClearITPendingBit | ( | uint32_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 |
Definition at line 701 of file stm32f4xx_hash.c.
void HASH_DataIn | ( | uint32_t | Data | ) |
Writes data in the Data Input FIFO.
Data | new data of the message to be processed. |
None |
Definition at line 306 of file stm32f4xx_hash.c.
void HASH_DeInit | ( | void | ) |
De-initializes the HASH peripheral registers to their default reset values.
None |
None |
Definition at line 171 of file stm32f4xx_hash.c.
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 |
Definition at line 489 of file stm32f4xx_hash.c.
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 |
Definition at line 335 of file stm32f4xx_hash.c.
FlagStatus HASH_GetFlagStatus | ( | uint32_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) |
Definition at line 610 of file stm32f4xx_hash.c.
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. |
Definition at line 317 of file stm32f4xx_hash.c.
ITStatus HASH_GetITStatus | ( | uint32_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). |
Definition at line 667 of file stm32f4xx_hash.c.
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 |
Definition at line 191 of file stm32f4xx_hash.c.
void HASH_ITConfig | ( | uint32_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 |
Definition at line 581 of file stm32f4xx_hash.c.
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:
|
Definition at line 93 of file stm32f4xx_hash_md5.c.
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 |
Definition at line 249 of file stm32f4xx_hash.c.
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 |
Definition at line 418 of file stm32f4xx_hash.c.
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 |
Definition at line 396 of file stm32f4xx_hash.c.
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 |
Definition at line 291 of file stm32f4xx_hash.c.
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:
|
Definition at line 93 of file stm32f4xx_hash_sha1.c.
void HASH_StartDigest | ( | void | ) |
Starts the message padding and calculation of the final message.
None |
None |
Definition at line 353 of file stm32f4xx_hash.c.
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 |
Definition at line 225 of file stm32f4xx_hash.c.
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:
|
Definition at line 168 of file stm32f4xx_hash_md5.c.
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:
|
Definition at line 169 of file stm32f4xx_hash_sha1.c.