Skip to content

Commit 0157530

Browse files
committed
fix errors on make NOCRYPTO=1
1 parent 3f38f56 commit 0157530

30 files changed

+108
-45
lines changed

benchmark/bench_modules/wh_bench_mod_aes.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@
2121
#include "wolfhsm/wh_client.h"
2222
#include "wolfhsm/wh_client_crypto.h"
2323

24+
#if !defined(WOLFHSM_CFG_NO_CRYPTO) && defined(WOLFHSM_CFG_BENCH_ENABLE)
2425
#include "wolfssl/wolfcrypt/aes.h"
2526

26-
#if defined(WOLFHSM_CFG_BENCH_ENABLE)
27-
2827
#if defined(WOLFHSM_CFG_DMA) && defined(WOLFHSM_CFG_TEST_POSIX)
2928
#include "port/posix/posix_transport_shm.h"
3029
#endif /* WOLFHSM_CFG_DMA && WOLFHSM_CFG_TEST_POSIX */

benchmark/bench_modules/wh_bench_mod_cmac.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@
2121
#include "wolfhsm/wh_error.h"
2222
#include "wolfhsm/wh_client_crypto.h"
2323

24+
#if !defined(WOLFHSM_CFG_NO_CRYPTO) && defined(WOLFHSM_CFG_BENCH_ENABLE)
2425
#include "wolfssl/wolfcrypt/cmac.h"
2526

26-
#if defined(WOLFHSM_CFG_BENCH_ENABLE)
27-
2827
#if defined(WOLFSSL_CMAC) && !defined(NO_AES) && defined(WOLFSSL_AES_DIRECT)
2928

3029
static const uint8_t key128[] = {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae,

benchmark/bench_modules/wh_bench_mod_curve25519.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
#include "wolfhsm/wh_client.h"
2222
#include "wolfhsm/wh_client_crypto.h"
2323

24+
25+
#if !defined(WOLFHSM_CFG_NO_CRYPTO) && defined(WOLFHSM_CFG_BENCH_ENABLE)
2426
#include "wolfssl/wolfcrypt/settings.h"
2527
#include "wolfssl/wolfcrypt/random.h"
2628
#include "wolfssl/wolfcrypt/curve25519.h"
2729

28-
#if defined(WOLFHSM_CFG_BENCH_ENABLE)
29-
3030
#if defined(HAVE_CURVE25519)
3131

3232
uint8_t key1_der[] = {

benchmark/bench_modules/wh_bench_mod_ecc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121
#include "wolfhsm/wh_client.h"
2222
#include "wolfhsm/wh_client_crypto.h"
2323

24+
25+
#if !defined(WOLFHSM_CFG_NO_CRYPTO) && defined(WOLFHSM_CFG_BENCH_ENABLE)
26+
2427
#include "wolfssl/wolfcrypt/ecc.h"
2528
#include "wolfssl/wolfcrypt/random.h"
2629

27-
#if defined(WOLFHSM_CFG_BENCH_ENABLE)
28-
2930
#if defined(HAVE_ECC)
3031

3132
/* hardcoded DER-encoded ECC keys for benchmarking */

benchmark/bench_modules/wh_bench_mod_hkdf.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@
2020
#include "wh_bench_mod.h"
2121
#include "wolfhsm/wh_error.h"
2222

23+
#if !defined(WOLFHSM_CFG_NO_CRYPTO) && defined(WOLFHSM_CFG_BENCH_ENABLE)
2324
#include "wolfssl/wolfcrypt/hmac.h"
2425
#include "wolfssl/wolfcrypt/kdf.h"
2526
#include "wolfssl/wolfcrypt/sha256.h"
2627

27-
#if defined(WOLFHSM_CFG_BENCH_ENABLE)
28-
2928
#if defined(HAVE_HKDF)
3029

3130

@@ -93,4 +92,4 @@ int wh_Bench_Mod_HkdfSha256(whClientContext* client, whBenchOpContext* ctx,
9392

9493
#endif /* defined(HAVE_HKDF) */
9594

96-
#endif /* WOLFHSM_CFG_BENCH_ENABLE */
95+
#endif /* !WOLFHSM_CFG_NO_CRYPTO && WOLFHSM_CFG_BENCH_ENABLE */

benchmark/bench_modules/wh_bench_mod_hmac.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
#include "wh_bench_mod.h"
2020
#include "wolfhsm/wh_error.h"
2121

22+
#if !defined(WOLFHSM_CFG_NO_CRYPTO) && defined(WOLFHSM_CFG_BENCH_ENABLE)
2223
#include "wolfssl/wolfcrypt/hmac.h"
2324
#include "wolfssl/wolfcrypt/sha256.h"
2425

25-
#if defined(WOLFHSM_CFG_BENCH_ENABLE)
26-
2726
#if !defined(NO_HMAC)
2827

2928
#if !defined(NO_SHA256)

benchmark/bench_modules/wh_bench_mod_mldsa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
#include "wolfhsm/wh_client.h"
2222
#include "wolfhsm/wh_client_crypto.h"
2323

24+
25+
#if !defined(WOLFHSM_CFG_NO_CRYPTO) && defined(WOLFHSM_CFG_BENCH_ENABLE)
2426
#include "wolfssl/wolfcrypt/dilithium.h"
2527
#include "wolfssl/wolfcrypt/random.h"
2628

27-
#if defined(WOLFHSM_CFG_BENCH_ENABLE)
28-
2929
#if defined(HAVE_DILITHIUM)
3030

3131
#if !defined(WOLFSSL_DILITHIUM_NO_SIGN)

benchmark/bench_modules/wh_bench_mod_rng.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
*/
1919
#include "wh_bench_mod.h"
2020
#include "wolfhsm/wh_error.h"
21-
#include "wolfssl/wolfcrypt/random.h"
2221

23-
#if defined(WOLFHSM_CFG_BENCH_ENABLE)
22+
23+
#if !defined(WOLFHSM_CFG_NO_CRYPTO) && defined(WOLFHSM_CFG_BENCH_ENABLE)
24+
#include "wolfssl/wolfcrypt/random.h"
2425

2526
#if !defined(WC_NO_RNG)
2627

benchmark/bench_modules/wh_bench_mod_rsa.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@
2121
#include "wolfhsm/wh_client.h"
2222
#include "wolfhsm/wh_client_crypto.h"
2323

24+
#if !defined(WOLFHSM_CFG_NO_CRYPTO) && defined(WOLFHSM_CFG_BENCH_ENABLE)
2425
#include "wolfssl/wolfcrypt/rsa.h"
2526
#include "wolfssl/wolfcrypt/random.h"
2627

27-
#if defined(WOLFHSM_CFG_BENCH_ENABLE)
28-
2928
#if !defined(NO_RSA)
3029

3130
/* RSA 2048-bit key in DER format for benchmarking */

benchmark/bench_modules/wh_bench_mod_sha2.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@
2121
#include "wolfhsm/wh_error.h"
2222
#include "wolfhsm/wh_client_crypto.h"
2323

24+
#if !defined(WOLFHSM_CFG_NO_CRYPTO) && defined(WOLFHSM_CFG_BENCH_ENABLE)
2425
#include "wolfssl/wolfcrypt/hash.h"
2526
#include "wolfssl/wolfcrypt/sha256.h"
2627

27-
#if defined(WOLFHSM_CFG_BENCH_ENABLE)
28-
2928
#if defined(WOLFHSM_CFG_DMA) && defined(WOLFHSM_CFG_TEST_POSIX)
3029
#include "port/posix/posix_transport_shm.h"
3130
#endif /* WOLFHSM_CFG_DMA && WOLFHSM_CFG_POSIX_TRANSPORT */

0 commit comments

Comments
 (0)