Lines Matching refs:context
178 /* Copy context->state[] to working vars */
214 /* Add the working vars back into context.state[] */
229 * isc_sha1_init - Initialize new context
232 isc_sha1_init(isc_sha1_t *context)
234 INSIST(context != NULL);
237 context->state[0] = 0x67452301;
238 context->state[1] = 0xEFCDAB89;
239 context->state[2] = 0x98BADCFE;
240 context->state[3] = 0x10325476;
241 context->state[4] = 0xC3D2E1F0;
242 context->count[0] = 0;
243 context->count[1] = 0;
247 isc_sha1_invalidate(isc_sha1_t *context) {
248 memset(context, 0, sizeof(isc_sha1_t));
255 isc_sha1_update(isc_sha1_t *context, const unsigned char *data,
260 INSIST(context != 0);
263 j = context->count[0];
264 if ((context->count[0] += len << 3) < j)
265 context->count[1] += (len >> 29) + 1;
268 (void)memmove(&context->buffer[j], data, (i = 64 - j));
269 transform(context->state, context->buffer);
271 transform(context->state, &data[i]);
277 (void)memmove(&context->buffer[j], &data[i], len - i);
289 isc_sha1_final(isc_sha1_t *context, unsigned char *digest) {
294 INSIST(context != 0);
299 ((context->count[(i >= 4 ? 0 : 1)]
303 isc_sha1_update(context, &final_200, 1);
304 while ((context->count[0] & 504) != 448)
305 isc_sha1_update(context, &final_0, 1);
307 isc_sha1_update(context, finalcount, 8);
312 ((context->state[i >> 2]
316 memset(context, 0, sizeof(isc_sha1_t));