From 9f5c588832945db5048420e847928539cf094909 Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Thu, 3 Jul 2025 23:35:55 +1200 Subject: [PATCH] sha256: avoid an unused variable warning when building for mbedtls --- src/internal.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/internal.c b/src/internal.c index 6cb4786a6..5fec53d50 100644 --- a/src/internal.c +++ b/src/internal.c @@ -198,8 +198,6 @@ int wally_sha256(const unsigned char *bytes, size_t bytes_len, static void sha256_midstate(struct sha256_ctx *ctx, struct sha256 *res) { - size_t i; - #ifdef CCAN_CRYPTO_SHA256_USE_MBEDTLS #ifndef CONFIG_MBEDTLS_HARDWARE_SHA #define SHA_CTX_STATE c.MBEDTLS_PRIVATE(state) @@ -215,7 +213,7 @@ static void sha256_midstate(struct sha256_ctx *ctx, struct sha256 *res) /* HW: Already big endian */ memcpy(res->u.u32, ctx->SHA_CTX_STATE, sizeof(ctx->SHA_CTX_STATE)); #else - for (i = 0; i < NUM_ELEMS(ctx->SHA_CTX_STATE); i++) + for (size_t i = 0; i < NUM_ELEMS(ctx->SHA_CTX_STATE); i++) res->u.u32[i] = cpu_to_be32(ctx->SHA_CTX_STATE[i]); #endif