Automatically turn on LMS / XMSS full hash

When WOLFSSL_NO_HASH_RAW is definied due to hardware hash offload, turn
on LMS anx XMSS full hash. Without this they will not compile
automatically when there is hardware SHA acceleration.
This commit is contained in:
Andrew Hutchings
2026-03-10 23:00:45 +01:00
parent b02ddde4f2
commit 4bd0658ce5
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -95,6 +95,12 @@
#include <wolfssl/wolfcrypt/lms.h>
#include <wolfssl/wolfcrypt/sha256.h>
/* 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
+6
View File
@@ -34,6 +34,12 @@
#include <wolfssl/wolfcrypt/sha512.h>
#include <wolfssl/wolfcrypt/sha3.h>
/* 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