From 9b2345dc8e2c31a23af5f563aaca0d23ac253753 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Fri, 21 Jul 2023 09:57:53 +1000 Subject: [PATCH] SM3 ASM file: protect with check for WOLFSSL_SM3 Protect sm3_asm.S with check for WOLFSSL_SM3. Change configure.ac to define WOLFSSL_SM3 in ASM flags when SM3 enabled and enabling intelasm. --- configure.ac | 1 + wolfcrypt/src/sm3_asm.S | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/configure.ac b/configure.ac index ee29445bcc..bb5ac620e9 100644 --- a/configure.ac +++ b/configure.ac @@ -2733,6 +2733,7 @@ then esac fi AS_IF([test "x$ENABLED_AESGCM" != "xno"],[AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_AESGCM"]) + AS_IF([test "x$ENABLED_SM3" != "xno"],[AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SM3"]) fi if test "$ENABLED_INTELASM" = "yes" diff --git a/wolfcrypt/src/sm3_asm.S b/wolfcrypt/src/sm3_asm.S index 62c3ed8118..60adc9dd24 100644 --- a/wolfcrypt/src/sm3_asm.S +++ b/wolfcrypt/src/sm3_asm.S @@ -1,3 +1,13 @@ +#ifdef HAVE_CONFIG_H + #include +#endif + +#include + +#ifdef WOLFSSL_SM3 + #error "Contact wolfSSL to get the implementation of this file" +#endif +