Skip to content

Commit 4bd0658

Browse files
committed
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.
1 parent b02ddde commit 4bd0658

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

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 hash struct internals are not accessible (hardware SHA acceleration),
99+
* fall back to 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 hash struct internals are not accessible (hardware SHA acceleration),
38+
* fall back to 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)