195 assert_param(IS_HASH_DATATYPE(HASH_InitStruct->
HASH_DataType));
196 assert_param(IS_HASH_ALGOMODE(HASH_InitStruct->
HASH_AlgoMode));
199 HASH->CR &= ~ (HASH_CR_ALGO | HASH_CR_DATATYPE | HASH_CR_MODE);
201 HASH_InitStruct->HASH_DataType | \
202 HASH_InitStruct->HASH_AlgoMode);
208 HASH->CR &= ~HASH_CR_LKEY;
214 HASH->CR |= HASH_CR_INIT;
252 HASH->CR |= HASH_CR_INIT;
294 assert_param(IS_HASH_VALIDBITSNUMBER(ValidNumber));
297 HASH->STR &= ~(HASH_STR_NBW);
298 HASH->STR |= ValidNumber;
320 return ((HASH->CR & HASH_CR_NBW) >> 8);
338 HASH_MessageDigest->
Data[0] = HASH->HR[0];
339 HASH_MessageDigest->
Data[1] = HASH->HR[1];
340 HASH_MessageDigest->
Data[2] = HASH->HR[2];
341 HASH_MessageDigest->
Data[3] = HASH->HR[3];
342 HASH_MessageDigest->
Data[4] = HASH->HR[4];
343 HASH_MessageDigest->
Data[5] = HASH_DIGEST->HR[5];
344 HASH_MessageDigest->
Data[6] = HASH_DIGEST->HR[6];
345 HASH_MessageDigest->
Data[7] = HASH_DIGEST->HR[7];
356 HASH->STR |= HASH_STR_DCAL;
401 HASH_ContextSave->HASH_IMR = HASH->IMR;
402 HASH_ContextSave->HASH_STR = HASH->STR;
403 HASH_ContextSave->HASH_CR = HASH->CR;
406 HASH_ContextSave->HASH_CSR[i] = HASH->CSR[i];
423 HASH->IMR = HASH_ContextRestore->HASH_IMR;
424 HASH->STR = HASH_ContextRestore->HASH_STR;
425 HASH->CR = HASH_ContextRestore->HASH_CR;
428 HASH->CR |= HASH_CR_INIT;
433 HASH->CSR[i] = HASH_ContextRestore->HASH_CSR[i];
468 assert_param(IS_FUNCTIONAL_STATE(NewState));
470 if (NewState != DISABLE)
473 HASH->CR &= ~HASH_CR_MDMAT;
478 HASH->CR |= HASH_CR_MDMAT;
492 assert_param(IS_FUNCTIONAL_STATE(NewState));
494 if (NewState != DISABLE)
497 HASH->CR |= HASH_CR_DMAE;
502 HASH->CR &= ~HASH_CR_DMAE;
584 assert_param(IS_HASH_IT(HASH_IT));
585 assert_param(IS_FUNCTIONAL_STATE(NewState));
587 if (NewState != DISABLE)
590 HASH->IMR |= HASH_IT;
595 HASH->IMR &= (uint32_t)(~HASH_IT);
612 FlagStatus bitstatus = RESET;
613 uint32_t tempreg = 0;
616 assert_param(IS_HASH_GET_FLAG(HASH_FLAG));
629 if ((tempreg & HASH_FLAG) != (uint32_t)RESET)
654 assert_param(IS_HASH_CLEAR_FLAG(HASH_FLAG));
657 HASH->SR = ~(uint32_t)HASH_FLAG;
669 ITStatus bitstatus = RESET;
673 assert_param(IS_HASH_GET_IT(HASH_IT));
679 if (((HASH->IMR & tmpreg) & HASH_IT) != RESET)
704 assert_param(IS_HASH_IT(HASH_IT));
707 HASH->SR = (uint32_t)(~HASH_IT);
This file contains all the functions prototypes for the RCC firmware library.
void HASH_Init(HASH_InitTypeDef *HASH_InitStruct)
Initializes the HASH peripheral according to the specified parameters in the HASH_InitStruct structur...
void HASH_ITConfig(uint32_t HASH_IT, FunctionalState NewState)
Enables or disables the specified HASH interrupts.
FlagStatus HASH_GetFlagStatus(uint32_t HASH_FLAG)
Checks whether the specified HASH flag is set or not.
void HASH_StartDigest(void)
Starts the message padding and calculation of the final message.
void HASH_DMACmd(FunctionalState NewState)
Enables or disables the HASH DMA interface.
#define HASH_HMACKeyType_ShortKey
void HASH_ClearFlag(uint32_t HASH_FLAG)
Clears the HASH flags.
void HASH_Reset(void)
Resets the HASH processor core, so that the HASH will be ready to compute the message digest of a new...
uint8_t HASH_GetInFIFOWordsNbr(void)
Returns the number of words already pushed into the IN FIFO.
void HASH_DataIn(uint32_t Data)
Writes data in the Data Input FIFO.
uint32_t HASH_AlgoSelection
#define HASH_AlgoMode_HMAC
HASH context swapping structure definition.
ITStatus HASH_GetITStatus(uint32_t HASH_IT)
Checks whether the specified HASH interrupt has occurred or not.
void HASH_SetLastWordValidBitsNbr(uint16_t ValidNumber)
Configure the Number of valid bits in last word of the message.
HASH message digest result structure definition.
This file contains all the functions prototypes for the HASH firmware library.
void HASH_StructInit(HASH_InitTypeDef *HASH_InitStruct)
Fills each HASH_InitStruct member with its default value.
void HASH_DeInit(void)
De-initializes the HASH peripheral registers to their default reset values.
void HASH_AutoStartDigest(FunctionalState NewState)
Enables or disables auto-start message padding and calculation of the final message digest at the end...
void HASH_SaveContext(HASH_Context *HASH_ContextSave)
Save the Hash peripheral Context.
#define HASH_AlgoMode_HASH
void HASH_RestoreContext(HASH_Context *HASH_ContextRestore)
Restore the Hash peripheral Context.
#define HASH_AlgoSelection_SHA1
void RCC_AHB2PeriphResetCmd(uint32_t RCC_AHB2Periph, FunctionalState NewState)
Forces or releases AHB2 peripheral reset.
#define HASH_DataType_32b
HASH Init structure definition.
void HASH_GetDigest(HASH_MsgDigest *HASH_MessageDigest)
Provides the message digest result.
void HASH_ClearITPendingBit(uint32_t HASH_IT)
Clears the HASH interrupt pending bit(s).
uint32_t HASH_HMACKeyType