Browse Source

Fix undesirable kyber dependencies when not building kyber

kaleb-himes 1 year ago
parent
commit
d672f10f7e
2 changed files with 4 additions and 1 deletions
  1. 1 1
      wolfcrypt/src/ext_kyber.c
  2. 3 0
      wolfssl/wolfcrypt/ext_kyber.h

+ 1 - 1
wolfcrypt/src/ext_kyber.c

@@ -24,7 +24,6 @@
 #endif
 
 #include <wolfssl/wolfcrypt/settings.h>
-#include <wolfssl/wolfcrypt/ext_kyber.h>
 #include <wolfssl/wolfcrypt/error-crypt.h>
 
 #if defined(WOLFSSL_KYBER_90S) && defined(HAVE_PQM4)
@@ -32,6 +31,7 @@
 #endif
 
 #ifdef WOLFSSL_HAVE_KYBER
+#include <wolfssl/wolfcrypt/ext_kyber.h>
 
 #ifdef NO_INLINE
     #include <wolfssl/wolfcrypt/misc.h>

+ 3 - 0
wolfssl/wolfcrypt/ext_kyber.h

@@ -22,6 +22,8 @@
 #ifndef EXT_KYBER_H
 #define EXT_KYBER_H
 
+
+#ifdef WOLFSSL_HAVE_KYBER
 #include <wolfssl/wolfcrypt/kyber.h>
 
 #if !defined(HAVE_LIBOQS) && !defined(HAVE_PQM4)
@@ -59,4 +61,5 @@ struct KyberKey {
     byte pub[EXT_KYBER_MAX_PUB_SZ];
 };
 
+#endif /* WOLFSSL_HAVE_KYBER */
 #endif /* EXT_KYBER_H */