60 #define SHA1BUSY_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;
106 nbvalidbitsdata = 8 * (Ilen % 4);
121 for(i=0; i<Ilen; i+=4)
137 if (busystatus !=
RESET)
145 *(uint32_t*)(outputaddr) = __REV(SHA1_MessageDigest.
Data[0]);
147 *(uint32_t*)(outputaddr) = __REV(SHA1_MessageDigest.
Data[1]);
149 *(uint32_t*)(outputaddr) = __REV(SHA1_MessageDigest.
Data[2]);
151 *(uint32_t*)(outputaddr) = __REV(SHA1_MessageDigest.
Data[3]);
153 *(uint32_t*)(outputaddr) = __REV(SHA1_MessageDigest.
Data[4]);
170 uint32_t Ilen, uint8_t Output[20])
174 __IO uint16_t nbvalidbitsdata = 0;
175 __IO uint16_t nbvalidbitskey = 0;
177 __IO uint32_t counter = 0;
178 uint32_t busystatus = 0;
180 uint32_t keyaddr = (uint32_t)Key;
181 uint32_t inputaddr = (uint32_t)Input;
182 uint32_t outputaddr = (uint32_t)Output;
185 nbvalidbitsdata = 8 * (Ilen % 4);
188 nbvalidbitskey = 8 * (Keylen % 4);
213 for(i=0; i<Keylen; i+=4)
229 if (busystatus !=
RESET)
239 for(i=0; i<Ilen; i+=4)
257 if (busystatus !=
RESET)
267 keyaddr = (uint32_t)Key;
268 for(i=0; i<Keylen; i+=4)
285 if (busystatus !=
RESET)
293 *(uint32_t*)(outputaddr) = __REV(SHA1_MessageDigest.
Data[0]);
295 *(uint32_t*)(outputaddr) = __REV(SHA1_MessageDigest.
Data[1]);
297 *(uint32_t*)(outputaddr) = __REV(SHA1_MessageDigest.
Data[2]);
299 *(uint32_t*)(outputaddr) = __REV(SHA1_MessageDigest.
Data[3]);
301 *(uint32_t*)(outputaddr) = __REV(SHA1_MessageDigest.
Data[4]);
#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.
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
ErrorStatus HMAC_SHA1(uint8_t *Key, uint32_t Keylen, uint8_t *Input, uint32_t Ilen, uint8_t Output[20])
Compute the HMAC SHA1 digest.
This file contains all the functions prototypes for the HASH firmware library.
void HASH_SetLastWordValidBitsNbr(uint16_t ValidNumber)
Configure the Number of valid bits in last word of the message.
ErrorStatus HASH_SHA1(uint8_t *Input, uint32_t Ilen, uint8_t Output[20])
Compute the HASH SHA1 digest.
void HASH_DeInit(void)
De-initializes the HASH peripheral registers to their default reset values.
#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.
#define HASH_AlgoSelection_SHA1
HASH Init structure definition.