Lines Matching refs:context

87 int SHA1Reset(SHA1Context *context)  in SHA1Reset()  argument
89 if (!context) in SHA1Reset()
94 context->Length_Low = 0; in SHA1Reset()
95 context->Length_High = 0; in SHA1Reset()
96 context->Message_Block_Index = 0; in SHA1Reset()
98 context->Intermediate_Hash[0] = 0x67452301; in SHA1Reset()
99 context->Intermediate_Hash[1] = 0xEFCDAB89; in SHA1Reset()
100 context->Intermediate_Hash[2] = 0x98BADCFE; in SHA1Reset()
101 context->Intermediate_Hash[3] = 0x10325476; in SHA1Reset()
102 context->Intermediate_Hash[4] = 0xC3D2E1F0; in SHA1Reset()
104 context->Computed = 0; in SHA1Reset()
105 context->Corrupted = 0; in SHA1Reset()
128 int SHA1Result( SHA1Context *context, in SHA1Result() argument
133 if (!context || !Message_Digest) in SHA1Result()
138 if (context->Corrupted) in SHA1Result()
140 return context->Corrupted; in SHA1Result()
143 if (!context->Computed) in SHA1Result()
145 SHA1PadMessage(context); in SHA1Result()
149 context->Message_Block[i] = 0; in SHA1Result()
151 context->Length_Low = 0; /* and clear length */ in SHA1Result()
152 context->Length_High = 0; in SHA1Result()
153 context->Computed = 1; in SHA1Result()
158 Message_Digest[i] = context->Intermediate_Hash[i>>2] in SHA1Result()
185 int SHA1Input( SHA1Context *context, in SHA1Input() argument
194 if (!context || !message_array) in SHA1Input()
199 if (context->Computed) in SHA1Input()
201 context->Corrupted = shaStateError; in SHA1Input()
205 if (context->Corrupted) in SHA1Input()
207 return context->Corrupted; in SHA1Input()
209 while(length-- && !context->Corrupted) in SHA1Input()
211 context->Message_Block[context->Message_Block_Index++] = in SHA1Input()
214 context->Length_Low += 8; in SHA1Input()
215 if (context->Length_Low == 0) in SHA1Input()
217 context->Length_High++; in SHA1Input()
218 if (context->Length_High == 0) in SHA1Input()
221 context->Corrupted = 1; in SHA1Input()
225 if (context->Message_Block_Index == 64) in SHA1Input()
227 SHA1ProcessMessageBlock(context); in SHA1Input()
256 void SHA1ProcessMessageBlock(SHA1Context *context) in SHA1ProcessMessageBlock() argument
274 W[t] = context->Message_Block[t * 4] << 24; in SHA1ProcessMessageBlock()
275 W[t] |= context->Message_Block[t * 4 + 1] << 16; in SHA1ProcessMessageBlock()
276 W[t] |= context->Message_Block[t * 4 + 2] << 8; in SHA1ProcessMessageBlock()
277 W[t] |= context->Message_Block[t * 4 + 3]; in SHA1ProcessMessageBlock()
285 A = context->Intermediate_Hash[0]; in SHA1ProcessMessageBlock()
286 B = context->Intermediate_Hash[1]; in SHA1ProcessMessageBlock()
287 C = context->Intermediate_Hash[2]; in SHA1ProcessMessageBlock()
288 D = context->Intermediate_Hash[3]; in SHA1ProcessMessageBlock()
289 E = context->Intermediate_Hash[4]; in SHA1ProcessMessageBlock()
333 context->Intermediate_Hash[0] += A; in SHA1ProcessMessageBlock()
334 context->Intermediate_Hash[1] += B; in SHA1ProcessMessageBlock()
335 context->Intermediate_Hash[2] += C; in SHA1ProcessMessageBlock()
336 context->Intermediate_Hash[3] += D; in SHA1ProcessMessageBlock()
337 context->Intermediate_Hash[4] += E; in SHA1ProcessMessageBlock()
339 context->Message_Block_Index = 0; in SHA1ProcessMessageBlock()
366 void SHA1PadMessage(SHA1Context *context) in SHA1PadMessage() argument
374 if (context->Message_Block_Index > 55) in SHA1PadMessage()
376 context->Message_Block[context->Message_Block_Index++] = 0x80; in SHA1PadMessage()
377 while(context->Message_Block_Index < 64) in SHA1PadMessage()
379 context->Message_Block[context->Message_Block_Index++] = 0; in SHA1PadMessage()
382 SHA1ProcessMessageBlock(context); in SHA1PadMessage()
384 while(context->Message_Block_Index < 56) in SHA1PadMessage()
386 context->Message_Block[context->Message_Block_Index++] = 0; in SHA1PadMessage()
391 context->Message_Block[context->Message_Block_Index++] = 0x80; in SHA1PadMessage()
392 while(context->Message_Block_Index < 56) in SHA1PadMessage()
394 context->Message_Block[context->Message_Block_Index++] = 0; in SHA1PadMessage()
401 context->Message_Block[56] = context->Length_High >> 24; in SHA1PadMessage()
402 context->Message_Block[57] = context->Length_High >> 16; in SHA1PadMessage()
403 context->Message_Block[58] = context->Length_High >> 8; in SHA1PadMessage()
404 context->Message_Block[59] = context->Length_High; in SHA1PadMessage()
405 context->Message_Block[60] = context->Length_Low >> 24; in SHA1PadMessage()
406 context->Message_Block[61] = context->Length_Low >> 16; in SHA1PadMessage()
407 context->Message_Block[62] = context->Length_Low >> 8; in SHA1PadMessage()
408 context->Message_Block[63] = context->Length_Low; in SHA1PadMessage()
410 SHA1ProcessMessageBlock(context); in SHA1PadMessage()