60 #define MD5BUSY_TIMEOUT ((uint32_t) 0x00010000) 97 __IO uint16_t nbvalidbitsdata = 0;
99 __IO uint32_t counter = 0;
100 uint32_t busystatus = 0;
102 uint32_t inputaddr = (uint32_t)Input;
103 uint32_t outputaddr = (uint32_t)Output;
107 nbvalidbitsdata = 8 * (Ilen % 4);
122 for(i=0; i<Ilen; i+=4)
138 if (busystatus !=
RESET)
146 *(uint32_t*)(outputaddr) = __REV(MD5_MessageDigest.
Data[0]);
148 *(uint32_t*)(outputaddr) = __REV(MD5_MessageDigest.
Data[1]);
150 *(uint32_t*)(outputaddr) = __REV(MD5_MessageDigest.
Data[2]);
152 *(uint32_t*)(outputaddr) = __REV(MD5_MessageDigest.
Data[3]);
169 uint32_t Ilen, uint8_t Output[16])
173 __IO uint16_t nbvalidbitsdata = 0;
174 __IO uint16_t nbvalidbitskey = 0;
176 __IO uint32_t counter = 0;
177 uint32_t busystatus = 0;
179 uint32_t keyaddr = (uint32_t)Key;
180 uint32_t inputaddr = (uint32_t)Input;
181 uint32_t outputaddr = (uint32_t)Output;
184 nbvalidbitsdata = 8 * (Ilen % 4);
187 nbvalidbitskey = 8 * (Keylen % 4);
212 for(i=0; i<Keylen; i+=4)
228 if (busystatus !=
RESET)
238 for(i=0; i<Ilen; i+=4)
255 if (busystatus !=
RESET)
265 keyaddr = (uint32_t)Key;
266 for(i=0; i<Keylen; i+=4)
283 if (busystatus !=
RESET)
291 *(uint32_t*)(outputaddr) = __REV(MD5_MessageDigest.
Data[0]);
293 *(uint32_t*)(outputaddr) = __REV(MD5_MessageDigest.
Data[1]);
295 *(uint32_t*)(outputaddr) = __REV(MD5_MessageDigest.
Data[2]);
297 *(uint32_t*)(outputaddr) = __REV(MD5_MessageDigest.
Data[3]);
#define HASH_AlgoMode_HMAC
#define HASH_HMACKeyType_LongKey
uint32_t HASH_HMACKeyType
FlagStatus HASH_GetFlagStatus(uint32_t HASH_FLAG)
Checks whether the specified HASH flag is set or not.
void HASH_GetDigest(HASH_MsgDigest *HASH_MessageDigest)
Provides the message digest result.
ErrorStatus HMAC_MD5(uint8_t *Key, uint32_t Keylen, uint8_t *Input, uint32_t Ilen, uint8_t Output[16])
Compute the HMAC MD5 digest.
uint32_t HASH_AlgoSelection
void HASH_Init(HASH_InitTypeDef *HASH_InitStruct)
Initializes the HASH peripheral according to the specified parameters in the HASH_InitStruct structur...
static volatile uint8_t * status
This file contains all the functions prototypes for the HASH firmware library.
#define HASH_AlgoSelection_MD5
void HASH_SetLastWordValidBitsNbr(uint16_t ValidNumber)
Configure the Number of valid bits in last word of the message.
void HASH_DeInit(void)
De-initializes the HASH peripheral registers to their default reset values.
ErrorStatus HASH_MD5(uint8_t *Input, uint32_t Ilen, uint8_t Output[16])
Compute the HASH MD5 digest.
#define HASH_AlgoMode_HASH
void HASH_DataIn(uint32_t Data)
Writes data in the Data Input FIFO.
HASH message digest result structure definition.
#define HASH_HMACKeyType_ShortKey
void HASH_StartDigest(void)
Starts the message padding and calculation of the final message.
HASH Init structure definition.