Lines Matching refs:context

161 void SHAPrintContext(SHA1_CTX *context, char *msg)  in SHAPrintContext()  argument
165 context->count[0], context->count[1], in SHAPrintContext()
166 context->state[0], in SHAPrintContext()
167 context->state[1], in SHAPrintContext()
168 context->state[2], in SHAPrintContext()
169 context->state[3], in SHAPrintContext()
170 context->state[4]); in SHAPrintContext()
234 void SHA1Init(SHA1_CTX* context) in SHA1Init() argument
237 context->state[0] = 0x67452301; in SHA1Init()
238 context->state[1] = 0xEFCDAB89; in SHA1Init()
239 context->state[2] = 0x98BADCFE; in SHA1Init()
240 context->state[3] = 0x10325476; in SHA1Init()
241 context->state[4] = 0xC3D2E1F0; in SHA1Init()
242 context->count[0] = context->count[1] = 0; in SHA1Init()
248 void SHA1Update(SHA1_CTX* context, const void *_data, u32 len) in SHA1Update() argument
254 SHAPrintContext(context, "before"); in SHA1Update()
256 j = (context->count[0] >> 3) & 63; in SHA1Update()
257 if ((context->count[0] += len << 3) < (len << 3)) in SHA1Update()
258 context->count[1]++; in SHA1Update()
259 context->count[1] += (len >> 29); in SHA1Update()
261 os_memcpy(&context->buffer[j], data, (i = 64-j)); in SHA1Update()
262 SHA1Transform(context->state, context->buffer); in SHA1Update()
264 SHA1Transform(context->state, &data[i]); in SHA1Update()
269 os_memcpy(&context->buffer[j], &data[i], len - i); in SHA1Update()
271 SHAPrintContext(context, "after "); in SHA1Update()
278 void SHA1Final(unsigned char digest[20], SHA1_CTX* context) in SHA1Final() argument
285 ((context->count[(i >= 4 ? 0 : 1)] >> in SHA1Final()
288 SHA1Update(context, (unsigned char *) "\200", 1); in SHA1Final()
289 while ((context->count[0] & 504) != 448) { in SHA1Final()
290 SHA1Update(context, (unsigned char *) "\0", 1); in SHA1Final()
292 SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() in SHA1Final()
296 ((context->state[i >> 2] >> ((3 - (i & 3)) * 8)) & in SHA1Final()
300 os_memset(context->buffer, 0, 64); in SHA1Final()
301 os_memset(context->state, 0, 20); in SHA1Final()
302 os_memset(context->count, 0, 8); in SHA1Final()