Lines Matching refs:context

46 #define EVP_MD_CTX_new() &(context->_ctx)
51 isc_sha1_init(isc_sha1_t *context)
53 INSIST(context != NULL);
55 context->ctx = EVP_MD_CTX_new();
56 RUNTIME_CHECK(context->ctx != NULL);
57 if (EVP_DigestInit(context->ctx, EVP_sha1()) != 1) {
63 isc_sha1_invalidate(isc_sha1_t *context) {
64 EVP_MD_CTX_free(context->ctx);
65 context->ctx = NULL;
69 isc_sha1_update(isc_sha1_t *context, const unsigned char *data,
72 INSIST(context != 0);
73 INSIST(context->ctx != 0);
76 RUNTIME_CHECK(EVP_DigestUpdate(context->ctx,
82 isc_sha1_final(isc_sha1_t *context, unsigned char *digest) {
84 INSIST(context != 0);
85 INSIST(context->ctx != 0);
87 RUNTIME_CHECK(EVP_DigestFinal(context->ctx, digest, NULL) == 1);
88 EVP_MD_CTX_free(context->ctx);
89 context->ctx = NULL;
270 /* Copy context->state[] to working vars */
306 /* Add the working vars back into context.state[] */
321 * isc_sha1_init - Initialize new context
324 isc_sha1_init(isc_sha1_t *context)
326 INSIST(context != NULL);
329 context->state[0] = 0x67452301;
330 context->state[1] = 0xEFCDAB89;
331 context->state[2] = 0x98BADCFE;
332 context->state[3] = 0x10325476;
333 context->state[4] = 0xC3D2E1F0;
334 context->count[0] = 0;
335 context->count[1] = 0;
339 isc_sha1_invalidate(isc_sha1_t *context) {
340 isc_safe_memwipe(context, sizeof(*context));
347 isc_sha1_update(isc_sha1_t *context, const unsigned char *data,
352 INSIST(context != 0);
355 j = context->count[0];
356 if ((context->count[0] += len << 3) < j)
357 context->count[1] += (len >> 29) + 1;
360 (void)memmove(&context->buffer[j], data, (i = 64 - j));
361 transform(context->state, context->buffer);
363 transform(context->state, &data[i]);
369 (void)memmove(&context->buffer[j], &data[i], len - i);
381 isc_sha1_final(isc_sha1_t *context, unsigned char *digest) {
386 INSIST(context != 0);
391 ((context->count[(i >= 4 ? 0 : 1)]
395 isc_sha1_update(context, &final_200, 1);
396 while ((context->count[0] & 504) != 448)
397 isc_sha1_update(context, &final_0, 1);
399 isc_sha1_update(context, finalcount, 8);
404 ((context->state[i >> 2]
408 isc_safe_memwipe(context, sizeof(*context));