From b4fa08753fdcbd8fb67e475ea5b2eb5053bb199f Mon Sep 17 00:00:00 2001 From: night1rider Date: Sat, 11 Jul 2026 22:29:35 -0600 Subject: [PATCH] Clamp benchmark numBlocks to at least 1 so large block sizes still run. --- wolfcrypt/benchmark/benchmark.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index c8b5bf834f..7f7379b300 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -17064,6 +17064,10 @@ void benchmark_configure(word32 block_size) /* must be greater than 0 */ if (block_size > 0) { numBlocks = (int)((word32)numBlocks * bench_size / block_size); + /* integer division can truncate to 0 for large block sizes; keep at + * least one block so the algorithm actually runs. */ + if (numBlocks < 1) + numBlocks = 1; bench_size = block_size; } }