From 8f1b773e5fc937da7eb37d99bf02683e1f0840ef Mon Sep 17 00:00:00 2001 From: Lucas Gabriel Vuotto Date: Sun, 9 Jun 2024 14:25:05 +0000 Subject: [PATCH] auth/hmac: rename BLOCKSZ to BLOCKLEN --- auth_hmac.c | 6 +++--- impl_hmac.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/auth_hmac.c b/auth_hmac.c index 61660f3..3be9ab0 100644 --- a/auth_hmac.c +++ b/auth_hmac.c @@ -34,7 +34,7 @@ static int hmac_common_init(void *arg, const uint8_t *key, size_t keylen) { struct hmac_ctx *ctx = arg; - uint8_t ikeypad[HMAC_BLOCKSZ_MAX]; + uint8_t ikeypad[HMAC_BLOCKLEN_MAX]; size_t i, olen; if (keylen > ctx->blocksz) { @@ -92,8 +92,8 @@ hmac_final(void *arg, uint8_t *out, size_t *outlen) { struct hmac_ctx *ctx = arg; struct lc_hash_ctx *hctx; - uint8_t m[HMAC_BLOCKSZ_MAX], - okeypad[HMAC_BLOCKSZ_MAX]; + uint8_t m[HMAC_BLOCKLEN_MAX], + okeypad[HMAC_BLOCKLEN_MAX]; size_t i, olen; int rc; diff --git a/impl_hmac.h b/impl_hmac.h index ce96b24..cded119 100644 --- a/impl_hmac.h +++ b/impl_hmac.h @@ -20,11 +20,11 @@ #include "lilcrypto.h" -#define HMAC_BLOCKSZ_MAX 128 +#define HMAC_BLOCKLEN_MAX LC_SHA512_BLOCKLEN struct hmac_ctx { struct lc_hash_ctx *hctx; size_t blocksz; - uint8_t key[HMAC_BLOCKSZ_MAX]; + uint8_t key[HMAC_BLOCKLEN_MAX]; };