From 75097f3e096e484cf42fdd64edabdc746c55cd2c Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 14 Oct 2025 16:41:27 -0700 Subject: [PATCH] Fix for improper sizing on `bench_rsa_helper` --- wolfcrypt/benchmark/benchmark.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 8e77f5800..b9d0f6c64 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -9003,12 +9003,12 @@ static void bench_rsa_helper(int useDeviceID, WC_DECLARE_VAR(message, byte, TEST_STRING_SZ, HEAP_HINT); #endif WC_DECLARE_HEAP_ARRAY(enc, byte, BENCH_MAX_PENDING, - rsaKeySz, HEAP_HINT); + rsaKeySz/8, HEAP_HINT); #if (!defined(WOLFSSL_RSA_VERIFY_INLINE) && \ !defined(WOLFSSL_RSA_PUBLIC_ONLY)) WC_DECLARE_HEAP_ARRAY(out, byte, BENCH_MAX_PENDING, - rsaKeySz, HEAP_HINT); + rsaKeySz/8, HEAP_HINT); #else byte* out[BENCH_MAX_PENDING]; #endif @@ -9016,12 +9016,12 @@ static void bench_rsa_helper(int useDeviceID, XMEMSET(out, 0, sizeof(out)); WC_ALLOC_HEAP_ARRAY(enc, byte, BENCH_MAX_PENDING, - rsaKeySz, HEAP_HINT); + rsaKeySz/8, HEAP_HINT); #if (!defined(WOLFSSL_RSA_VERIFY_INLINE) && \ !defined(WOLFSSL_RSA_PUBLIC_ONLY)) WC_ALLOC_HEAP_ARRAY(out, byte, BENCH_MAX_PENDING, - rsaKeySz, HEAP_HINT); + rsaKeySz/8, HEAP_HINT); if (out[0] == NULL) { ret = MEMORY_E; goto exit;