Lines Matching defs:ctx

33 isc_hmacsha1_init(isc_hmacsha1_t *ctx, const unsigned char *key,
36 ctx->ctx = HMAC_CTX_new();
37 RUNTIME_CHECK(ctx->ctx != NULL);
38 RUNTIME_CHECK(HMAC_Init_ex(ctx->ctx, (const void *) key,
43 isc_hmacsha1_invalidate(isc_hmacsha1_t *ctx) {
44 if (ctx->ctx == NULL)
46 HMAC_CTX_free(ctx->ctx);
47 ctx->ctx = NULL;
51 isc_hmacsha1_update(isc_hmacsha1_t *ctx, const unsigned char *buf,
54 RUNTIME_CHECK(HMAC_Update(ctx->ctx, buf, (int) len) == 1);
58 isc_hmacsha1_sign(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len) {
63 RUNTIME_CHECK(HMAC_Final(ctx->ctx, newdigest, NULL) == 1);
64 HMAC_CTX_free(ctx->ctx);
65 ctx->ctx = NULL;
71 isc_hmacsha224_init(isc_hmacsha224_t *ctx, const unsigned char *key,
74 ctx->ctx = HMAC_CTX_new();
75 RUNTIME_CHECK(ctx->ctx != NULL);
76 RUNTIME_CHECK(HMAC_Init_ex(ctx->ctx, (const void *) key,
81 isc_hmacsha224_invalidate(isc_hmacsha224_t *ctx) {
82 if (ctx->ctx == NULL)
84 HMAC_CTX_free(ctx->ctx);
85 ctx->ctx = NULL;
89 isc_hmacsha224_update(isc_hmacsha224_t *ctx, const unsigned char *buf,
92 RUNTIME_CHECK(HMAC_Update(ctx->ctx, buf, (int) len) == 1);
96 isc_hmacsha224_sign(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len) {
101 RUNTIME_CHECK(HMAC_Final(ctx->ctx, newdigest, NULL) == 1);
102 HMAC_CTX_free(ctx->ctx);
103 ctx->ctx = NULL;
109 isc_hmacsha256_init(isc_hmacsha256_t *ctx, const unsigned char *key,
112 ctx->ctx = HMAC_CTX_new();
113 RUNTIME_CHECK(ctx->ctx != NULL);
114 RUNTIME_CHECK(HMAC_Init_ex(ctx->ctx, (const void *) key,
119 isc_hmacsha256_invalidate(isc_hmacsha256_t *ctx) {
120 if (ctx->ctx == NULL)
122 HMAC_CTX_free(ctx->ctx);
123 ctx->ctx = NULL;
127 isc_hmacsha256_update(isc_hmacsha256_t *ctx, const unsigned char *buf,
130 RUNTIME_CHECK(HMAC_Update(ctx->ctx, buf, (int) len) == 1);
134 isc_hmacsha256_sign(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len) {
139 RUNTIME_CHECK(HMAC_Final(ctx->ctx, newdigest, NULL) == 1);
140 HMAC_CTX_free(ctx->ctx);
141 ctx->ctx = NULL;
147 isc_hmacsha384_init(isc_hmacsha384_t *ctx, const unsigned char *key,
150 ctx->ctx = HMAC_CTX_new();
151 RUNTIME_CHECK(ctx->ctx != NULL);
152 RUNTIME_CHECK(HMAC_Init_ex(ctx->ctx, (const void *) key,
157 isc_hmacsha384_invalidate(isc_hmacsha384_t *ctx) {
158 if (ctx->ctx == NULL)
160 HMAC_CTX_free(ctx->ctx);
161 ctx->ctx = NULL;
165 isc_hmacsha384_update(isc_hmacsha384_t *ctx, const unsigned char *buf,
168 RUNTIME_CHECK(HMAC_Update(ctx->ctx, buf, (int) len) == 1);
172 isc_hmacsha384_sign(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len) {
177 RUNTIME_CHECK(HMAC_Final(ctx->ctx, newdigest, NULL) == 1);
178 HMAC_CTX_free(ctx->ctx);
179 ctx->ctx = NULL;
185 isc_hmacsha512_init(isc_hmacsha512_t *ctx, const unsigned char *key,
188 ctx->ctx = HMAC_CTX_new();
189 RUNTIME_CHECK(ctx->ctx != NULL);
190 RUNTIME_CHECK(HMAC_Init_ex(ctx->ctx, (const void *) key,
195 isc_hmacsha512_invalidate(isc_hmacsha512_t *ctx) {
196 if (ctx->ctx == NULL)
198 HMAC_CTX_free(ctx->ctx);
199 ctx->ctx = NULL;
203 isc_hmacsha512_update(isc_hmacsha512_t *ctx, const unsigned char *buf,
206 RUNTIME_CHECK(HMAC_Update(ctx->ctx, buf, (int) len) == 1);
210 isc_hmacsha512_sign(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len) {
215 RUNTIME_CHECK(HMAC_Final(ctx->ctx, newdigest, NULL) == 1);
216 HMAC_CTX_free(ctx->ctx);
217 ctx->ctx = NULL;
227 isc_hmacsha1_verify(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len) {
231 isc_hmacsha1_sign(ctx, newdigest, ISC_SHA1_DIGESTLENGTH);
240 isc_hmacsha224_verify(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len) {
244 isc_hmacsha224_sign(ctx, newdigest, ISC_SHA224_DIGESTLENGTH);
253 isc_hmacsha256_verify(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len) {
257 isc_hmacsha256_sign(ctx, newdigest, ISC_SHA256_DIGESTLENGTH);
266 isc_hmacsha384_verify(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len) {
270 isc_hmacsha384_sign(ctx, newdigest, ISC_SHA384_DIGESTLENGTH);
279 isc_hmacsha512_verify(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len) {
283 isc_hmacsha512_sign(ctx, newdigest, ISC_SHA512_DIGESTLENGTH);