diff --git a/wolfssl/wolfcrypt/wc_lms.h b/wolfssl/wolfcrypt/wc_lms.h index 8726a7b4cb..18a13c8697 100644 --- a/wolfssl/wolfcrypt/wc_lms.h +++ b/wolfssl/wolfcrypt/wc_lms.h @@ -95,6 +95,12 @@ #include #include +/* When hash struct internals are not accessible (hardware SHA acceleration), + * fall back to full hash API calls. */ +#if defined(WOLFSSL_NO_HASH_RAW) && !defined(WC_LMS_FULL_HASH) + #define WC_LMS_FULL_HASH +#endif + #ifdef WOLFSSL_LMS_MAX_LEVELS /* Maximum number of levels of trees supported by implementation. */ #define LMS_MAX_LEVELS WOLFSSL_LMS_MAX_LEVELS diff --git a/wolfssl/wolfcrypt/wc_xmss.h b/wolfssl/wolfcrypt/wc_xmss.h index db7ba44167..c9b4265805 100644 --- a/wolfssl/wolfcrypt/wc_xmss.h +++ b/wolfssl/wolfcrypt/wc_xmss.h @@ -34,6 +34,12 @@ #include #include +/* When hash struct internals are not accessible (hardware SHA acceleration), + * fall back to full hash API calls. */ +#if defined(WOLFSSL_NO_HASH_RAW) && !defined(WC_XMSS_FULL_HASH) + #define WC_XMSS_FULL_HASH +#endif + #if !defined(WOLFSSL_WC_XMSS) #error "This code is incompatible with external implementation of XMSS." #endif