Skip to content

Commit 3e820e5

Browse files
authored
Merge pull request #9946 from LinuxJedi/lms-xmss-flags
Automatically turn on LMS / XMSS full hash
2 parents 5b9d0a1 + 4cdb979 commit 3e820e5

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

.wolfssl_known_macro_extras

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,6 @@ WC_DILITHIUM_FIXED_ARRAY
639639
WC_DISABLE_RADIX_ZERO_PAD
640640
WC_FLAG_DONT_USE_AESNI
641641
WC_FORCE_LINUXKM_FORTIFY_SOURCE
642-
WC_LMS_FULL_HASH
643642
WC_NO_ASYNC_SLEEP
644643
WC_NO_RNG_SIMPLE
645644
WC_NO_STATIC_ASSERT
@@ -659,7 +658,6 @@ WC_SSIZE_TYPE
659658
WC_STRICT_SIG
660659
WC_USE_PIE_FENCEPOSTS_FOR_FIPS
661660
WC_WANT_FLAG_DONT_USE_VECTOR_OPS
662-
WC_XMSS_FULL_HASH
663661
WIFIESPAT
664662
WIFI_101
665663
WIFI_AVAILABLE

wolfssl/wolfcrypt/wc_lms.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@
9595
#include <wolfssl/wolfcrypt/lms.h>
9696
#include <wolfssl/wolfcrypt/sha256.h>
9797

98+
/* When raw hash access APIs are disabled or unavailable (WOLFSSL_NO_HASH_RAW),
99+
* fall back to using the full hash API calls. */
100+
#if defined(WOLFSSL_NO_HASH_RAW) && !defined(WC_LMS_FULL_HASH)
101+
#define WC_LMS_FULL_HASH
102+
#endif
103+
98104
#ifdef WOLFSSL_LMS_MAX_LEVELS
99105
/* Maximum number of levels of trees supported by implementation. */
100106
#define LMS_MAX_LEVELS WOLFSSL_LMS_MAX_LEVELS

wolfssl/wolfcrypt/wc_xmss.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
#include <wolfssl/wolfcrypt/sha512.h>
3535
#include <wolfssl/wolfcrypt/sha3.h>
3636

37+
/* When raw hash access APIs are disabled or unavailable (WOLFSSL_NO_HASH_RAW),
38+
* fall back to using the full hash API calls. */
39+
#if defined(WOLFSSL_NO_HASH_RAW) && !defined(WC_XMSS_FULL_HASH)
40+
#define WC_XMSS_FULL_HASH
41+
#endif
42+
3743
#if !defined(WOLFSSL_WC_XMSS)
3844
#error "This code is incompatible with external implementation of XMSS."
3945
#endif

0 commit comments

Comments
 (0)