Signed-off-by: Dmitry Eremin-Solenikov dbaryshkov@gmail.com --- hmac-sha224.c | 4 ++-- hmac-sha256.c | 6 +++--- hmac.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/hmac-sha224.c b/hmac-sha224.c index c5bc8750a054..303337fe257f 100644 --- a/hmac-sha224.c +++ b/hmac-sha224.c @@ -41,12 +41,12 @@ void hmac_sha224_set_key(struct hmac_sha224_ctx *ctx, size_t key_length, const uint8_t *key) { - HMAC_SET_KEY(ctx, &nettle_sha224, key_length, key); + HMAC_BLOCK_SET_KEY(ctx, &nettle_bctx_sha224, key_length, key); }
void hmac_sha224_digest(struct hmac_sha224_ctx *ctx, size_t length, uint8_t *digest) { - HMAC_DIGEST(ctx, &nettle_sha224, length, digest); + HMAC_BLOCK_DIGEST(ctx, &nettle_bctx_sha224, length, digest); } diff --git a/hmac-sha256.c b/hmac-sha256.c index af5cc0f1cbef..25263bdcd36b 100644 --- a/hmac-sha256.c +++ b/hmac-sha256.c @@ -41,19 +41,19 @@ void hmac_sha256_set_key(struct hmac_sha256_ctx *ctx, size_t key_length, const uint8_t *key) { - HMAC_SET_KEY(ctx, &nettle_sha256, key_length, key); + HMAC_BLOCK_SET_KEY(ctx, &nettle_bctx_sha256, key_length, key); }
void hmac_sha256_update(struct hmac_sha256_ctx *ctx, size_t length, const uint8_t *data) { - sha256_update(&ctx->state, length, data); + sha256_block_update(&ctx->state, (struct block_ctx *)&ctx->block, length, data); }
void hmac_sha256_digest(struct hmac_sha256_ctx *ctx, size_t length, uint8_t *digest) { - HMAC_DIGEST(ctx, &nettle_sha256, length, digest); + HMAC_BLOCK_DIGEST(ctx, &nettle_bctx_sha256, length, digest); } diff --git a/hmac.h b/hmac.h index 117de3262857..445d7c95e03f 100644 --- a/hmac.h +++ b/hmac.h @@ -175,7 +175,7 @@ hmac_sha1_digest(struct hmac_sha1_ctx *ctx, size_t length, uint8_t *digest);
/* hmac-sha256 */ -struct hmac_sha256_ctx HMAC_CTX(struct sha256_ctx); +struct hmac_sha256_ctx HMAC_BLOCK_CTX(struct sha256_state, SHA256_BLOCK_SIZE);
void hmac_sha256_set_key(struct hmac_sha256_ctx *ctx,