From db6b1388cebcf6c0b23025591d58868f4e8b3174 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Wed, 1 May 2024 09:57:13 +1000 Subject: [PATCH] Benchmark, SM3: fix full hash testing Test now has an array of hashes. Use only first hash when testing full digest operation. --- wolfcrypt/benchmark/benchmark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index f48bf3a21..16fafeddd 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -7475,12 +7475,12 @@ void bench_sm3(int useDeviceID) bench_stats_start(&count, &start); do { for (times = 0; times < numBlocks; times++) { - ret = wc_InitSm3(hash, HEAP_HINT, + ret = wc_InitSm3(hash[0], HEAP_HINT, useDeviceID ? devId: INVALID_DEVID); if (ret == 0) - ret = wc_Sm3Update(hash, bench_plain, bench_size); + ret = wc_Sm3Update(hash[0], bench_plain, bench_size); if (ret == 0) - ret = wc_Sm3Final(hash, digest[0]); + ret = wc_Sm3Final(hash[0], digest[0]); if (ret != 0) goto exit_sm3; RECORD_MULTI_VALUE_STATS();