diff --git a/tests/api/test_she.c b/tests/api/test_she.c index 84e4dacf57..b4905772d2 100644 --- a/tests/api/test_she.c +++ b/tests/api/test_she.c @@ -146,7 +146,7 @@ int test_wc_SHE_ImportM1M2M3(void) { EXPECT_DECLS; #if defined(WOLFSSL_SHE) && !defined(NO_AES) && \ - (defined(WOLF_CRYPTO_CB) || !defined(NO_WC_SHE_IMPORT_M123)) + (defined(WOLF_CRYPTO_CB) && !defined(NO_WC_SHE_IMPORT_M123)) wc_SHE she; byte m1[WC_SHE_M1_SZ] = {0}; byte m2[WC_SHE_M2_SZ] = {0}; diff --git a/wolfcrypt/src/wc_she.c b/wolfcrypt/src/wc_she.c index a2a260383c..712e760a9b 100644 --- a/wolfcrypt/src/wc_she.c +++ b/wolfcrypt/src/wc_she.c @@ -359,7 +359,7 @@ int wc_SHE_SetKdfConstants(wc_SHE* she, #endif /* WOLFSSL_SHE_EXTENDED */ -#if defined(WOLF_CRYPTO_CB) || !defined(NO_WC_SHE_IMPORT_M123) +#if defined(WOLF_CRYPTO_CB) && !defined(NO_WC_SHE_IMPORT_M123) /* -------------------------------------------------------------------------- */ /* Import M1/M2/M3 */ /* */ @@ -384,7 +384,7 @@ int wc_SHE_ImportM1M2M3(wc_SHE* she, she->generated = 1; return 0; } -#endif /* WOLF_CRYPTO_CB || !NO_WC_SHE_IMPORT_M123 */ +#endif /* WOLF_CRYPTO_CB && !NO_WC_SHE_IMPORT_M123 */ /* -------------------------------------------------------------------------- */ /* Portable big-endian 32-bit store */ @@ -776,7 +776,7 @@ int wc_SHE_GenerateM4M5(wc_SHE* she, /* and frees the context. */ /* -------------------------------------------------------------------------- */ #ifndef NO_WC_SHE_LOADKEY -#if defined(WOLF_CRYPTO_CB) || !defined(NO_WC_SHE_IMPORT_M123) +#if defined(WOLF_CRYPTO_CB) && !defined(NO_WC_SHE_IMPORT_M123) static int wc_SHE_LoadKey_Internal(wc_SHE* she, const byte* m1, word32 m1Sz, const byte* m2, word32 m2Sz, @@ -1080,7 +1080,7 @@ int wc_SHE_LoadKey_Verify_Label( } #endif /* WOLF_PRIVATE_KEY_ID */ -#endif /* WOLF_CRYPTO_CB || !NO_WC_SHE_IMPORT_M123 */ +#endif /* WOLF_CRYPTO_CB && !NO_WC_SHE_IMPORT_M123 */ #endif /* !NO_WC_SHE_LOADKEY */ /* -------------------------------------------------------------------------- */ diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index aeab304d93..c4a6e5e5a2 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -56909,7 +56909,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t she_test(void) goto exit_SHE_Test; } -#if defined(WOLF_CRYPTO_CB) || !defined(NO_WC_SHE_IMPORT_M123) +#if defined(WOLF_CRYPTO_CB) && !defined(NO_WC_SHE_IMPORT_M123) /* ---- Import M1/M2/M3 and generate M4/M5 (only NewKey needed) ---- */ wc_SHE_Free(she); ret = wc_SHE_Init(she, HEAP_HINT, devId); @@ -56944,7 +56944,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t she_test(void) ret = WC_TEST_RET_ENC_NC; goto exit_SHE_Test; } -#endif /* WOLF_CRYPTO_CB || !NO_WC_SHE_IMPORT_M123 */ +#endif /* WOLF_CRYPTO_CB && !NO_WC_SHE_IMPORT_M123 */ /* ---- One-shot M1/M2/M3 ---- */ wc_SHE_Free(she); @@ -57062,7 +57062,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t she_test(void) } #if !defined(NO_WC_SHE_LOADKEY) && !defined(NO_WC_SHE_LOADKEY_TEST) && \ - (defined(WOLF_CRYPTO_CB) || !defined(NO_WC_SHE_IMPORT_M123)) + (defined(WOLF_CRYPTO_CB) && !defined(NO_WC_SHE_IMPORT_M123)) /* ---- LoadKey_Verify ---- */ /* Override WC_TEST_SHE_LOADKEY_VERIFY to use a platform-specific variant. * Platforms with hardware SHE (HSM/HSE) cannot use static test vectors diff --git a/wolfssl/wolfcrypt/wc_she.h b/wolfssl/wolfcrypt/wc_she.h index 836959469c..0381c114ef 100644 --- a/wolfssl/wolfcrypt/wc_she.h +++ b/wolfssl/wolfcrypt/wc_she.h @@ -108,7 +108,7 @@ typedef struct wc_SHE { byte m4pOverride; #endif -#if defined(WOLF_CRYPTO_CB) || !defined(NO_WC_SHE_IMPORT_M123) +#if defined(WOLF_CRYPTO_CB) && !defined(NO_WC_SHE_IMPORT_M123) byte m1[WC_SHE_M1_SZ]; byte m2[WC_SHE_M2_SZ]; byte m3[WC_SHE_M3_SZ]; @@ -227,7 +227,7 @@ WOLFSSL_API int wc_SHE_SetM4Header(wc_SHE* she, * m2Sz - must be WC_SHE_M2_SZ (32) * m3 - 16-byte M3 message (CMAC over M1|M2) * m3Sz - must be WC_SHE_M3_SZ (16) */ -#if defined(WOLF_CRYPTO_CB) || !defined(NO_WC_SHE_IMPORT_M123) +#if defined(WOLF_CRYPTO_CB) && !defined(NO_WC_SHE_IMPORT_M123) WOLFSSL_API int wc_SHE_ImportM1M2M3(wc_SHE* she, const byte* m1, word32 m1Sz, const byte* m2, word32 m2Sz, @@ -301,7 +301,7 @@ WOLFSSL_API int wc_SHE_GenerateM4M5(wc_SHE* she, * m1-m3 - input: externally-provided SHE key update messages * m4,m5 - output: verification messages returned by the HSM */ #ifndef NO_WC_SHE_LOADKEY -#if defined(WOLF_CRYPTO_CB) || !defined(NO_WC_SHE_IMPORT_M123) +#if defined(WOLF_CRYPTO_CB) && !defined(NO_WC_SHE_IMPORT_M123) WOLFSSL_API int wc_SHE_LoadKey( void* heap, int devId, const byte* m1, word32 m1Sz, @@ -371,7 +371,7 @@ WOLFSSL_API int wc_SHE_LoadKey_Verify_Label( const byte* m5Expected, word32 m5ExpectedSz); #endif /* WOLF_PRIVATE_KEY_ID */ -#endif /* WOLF_CRYPTO_CB || !NO_WC_SHE_IMPORT_M123 */ +#endif /* WOLF_CRYPTO_CB && !NO_WC_SHE_IMPORT_M123 */ #endif /* !NO_WC_SHE_LOADKEY */ /* Export a key from hardware in SHE loadable format (M1-M5).