From 5c3b929d90c6876c2e2b7ef00a558adc0034b179 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Wed, 13 Mar 2024 02:34:48 +0700 Subject: [PATCH] fix for benchmark build with sm2 --- wolfcrypt/benchmark/benchmark.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 3457b3f36..24bcc8690 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -10829,8 +10829,7 @@ void bench_sm2(int useDeviceID) #endif #if !defined(NO_ASN) && defined(HAVE_ECC_SIGN) #ifdef HAVE_ECC_VERIFY - WC_DECLARE_ARRAY(verify, int, BENCH_MAX_PENDING, - sizeof(int), HEAP_HINT); + int verify[BENCH_MAX_PENDING]; #endif #endif word32 x[BENCH_MAX_PENDING]; @@ -10967,10 +10966,10 @@ exit_ecdhe: for (i = 0; i < BENCH_MAX_PENDING; i++) { if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(genKey[i]), 1, ×, agreeTimes, &pending)) { - if (genKey[i].state == 0) + if (genKey[i]->state == 0) x[i] = ECC_MAX_SIG_SIZE; ret = wc_ecc_sm2_sign_hash(digest[i], (word32)keySize, - sig[i], x[i], &gRng, genKey[i]); + sig[i], &x[i], &gRng, genKey[i]); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(genKey[i]), 1, ×, &pending)) { @@ -11013,10 +11012,10 @@ exit_ecdsa_sign: for (i = 0; i < BENCH_MAX_PENDING; i++) { if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(genKey[i]), 1, ×, agreeTimes, &pending)) { - if (genKey[i].state == 0) + if (genKey[i]->state == 0) verify[i] = 0; ret = wc_ecc_sm2_verify_hash(sig[i], x[i], digest[i], - (word32)keySize, verify[i], genKey[i]); + (word32)keySize, &verify[i], genKey[i]); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(genKey[i]), 1, ×, &pending)) {