Lines Matching refs:context
144 /* Copy context->state[] to working vars */
180 /* Add the working vars back into context.state[] */
193 * SHA1Init - Initialize new context
195 void SHA1Init(context)
196 SHA1_CTX *context;
199 assert(context != 0);
202 context->state[0] = 0x67452301;
203 context->state[1] = 0xEFCDAB89;
204 context->state[2] = 0x98BADCFE;
205 context->state[3] = 0x10325476;
206 context->state[4] = 0xC3D2E1F0;
207 context->count[0] = context->count[1] = 0;
214 void SHA1Update(context, data, len)
215 SHA1_CTX *context;
221 assert(context != 0);
224 j = context->count[0];
225 if ((context->count[0] += len << 3) < j)
226 context->count[1] += (len>>29)+1;
229 (void)memcpy(&context->buffer[j], data, (i = 64-j));
230 SHA1Transform(context->state, context->buffer);
232 SHA1Transform(context->state, &data[i]);
237 (void)memcpy(&context->buffer[j], &data[i], len - i);
244 void SHA1Final(digest, context)
246 SHA1_CTX* context;
252 assert(context != 0);
255 finalcount[i] = (u_char)((context->count[(i >= 4 ? 0 : 1)]
258 SHA1Update(context, (const u_char *)"\200", 1);
259 while ((context->count[0] & 504) != 448)
260 SHA1Update(context, (const u_char *)"\0", 1);
261 SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */
266 ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);