Skip to content

Commit 9f5c588

Browse files
committed
sha256: avoid an unused variable warning when building for mbedtls
1 parent 9170785 commit 9f5c588

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/internal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ int wally_sha256(const unsigned char *bytes, size_t bytes_len,
198198

199199
static void sha256_midstate(struct sha256_ctx *ctx, struct sha256 *res)
200200
{
201-
size_t i;
202-
203201
#ifdef CCAN_CRYPTO_SHA256_USE_MBEDTLS
204202
#ifndef CONFIG_MBEDTLS_HARDWARE_SHA
205203
#define SHA_CTX_STATE c.MBEDTLS_PRIVATE(state)
@@ -215,7 +213,7 @@ static void sha256_midstate(struct sha256_ctx *ctx, struct sha256 *res)
215213
/* HW: Already big endian */
216214
memcpy(res->u.u32, ctx->SHA_CTX_STATE, sizeof(ctx->SHA_CTX_STATE));
217215
#else
218-
for (i = 0; i < NUM_ELEMS(ctx->SHA_CTX_STATE); i++)
216+
for (size_t i = 0; i < NUM_ELEMS(ctx->SHA_CTX_STATE); i++)
219217
res->u.u32[i] = cpu_to_be32(ctx->SHA_CTX_STATE[i]);
220218
#endif
221219

0 commit comments

Comments
 (0)