diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 41cf264de..136ab86bf 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -849,10 +849,12 @@ initDefaultName(); test_pass("SHAKE256 test passed!\n"); #endif +#ifndef NO_HASH_WRAPPER if ( (ret = hash_test()) != 0) return err_sys("Hash test failed!\n", ret); else test_pass("Hash test passed!\n"); +#endif #ifdef WOLFSSL_RIPEMD if ( (ret = ripemd_test()) != 0) @@ -3384,7 +3386,7 @@ exit: } #endif - +#ifndef NO_HASH_WRAPPER WOLFSSL_TEST_SUBROUTINE int hash_test(void) { wc_HashAlg hash; @@ -3689,6 +3691,7 @@ WOLFSSL_TEST_SUBROUTINE int hash_test(void) return 0; } +#endif /* !NO_HASH_WRAPPER */ #if !defined(NO_HMAC) && !defined(NO_MD5) WOLFSSL_TEST_SUBROUTINE int hmac_md5_test(void) diff --git a/wolfssl/wolfcrypt/hash.h b/wolfssl/wolfcrypt/hash.h index 73222cab9..44b505da4 100644 --- a/wolfssl/wolfcrypt/hash.h +++ b/wolfssl/wolfcrypt/hash.h @@ -88,7 +88,7 @@ enum wc_HashFlags { #endif }; - +#ifndef NO_HASH_WRAPPER typedef union { #ifndef NO_MD5 wc_Md5 md5; @@ -112,6 +112,7 @@ typedef union { wc_Sha3 sha3; #endif } wc_HashAlg; +#endif /* !NO_HASH_WRAPPER */ /* Find largest possible digest size Note if this gets up to the size of 80 or over check smallstack build */ @@ -151,6 +152,8 @@ WOLFSSL_API enum wc_HashType wc_OidGetHash(int oid); WOLFSSL_API enum wc_HashType wc_HashTypeConvert(int hashType); +#ifndef NO_HASH_WRAPPER + WOLFSSL_API int wc_HashGetDigestSize(enum wc_HashType hash_type); WOLFSSL_API int wc_HashGetBlockSize(enum wc_HashType hash_type); WOLFSSL_API int wc_Hash(enum wc_HashType hash_type, @@ -215,6 +218,8 @@ WOLFSSL_API int wc_Shake256Hash(const byte*, word32, byte*, word32); #endif #endif /* WOLFSSL_SHA3 */ +#endif /* !NO_HASH_WRAPPER */ + enum max_prf { #ifdef HAVE_FFDHE_8192 MAX_PRF_HALF = 516, /* Maximum half secret len */