diff --git a/CMakeLists.txt b/CMakeLists.txt index b9b3def1..7d5dc74a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,6 +102,10 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(MACOSX TRUE) endif() +if (${PQC_NO_ASM}) + set(NO_ASM TRUE) +endif() + if(CMAKE_C_COMPILER_ID MATCHES "Clang") # Additional flags only useful when compiling with clang string(APPEND PQC_CMAKE_C_CXX_FLAGS " -Wconditional-uninitialized -Wno-missing-variable-declarations -Wno-unused-command-line-argument") diff --git a/src/capi/pqapi.c b/src/capi/pqapi.c index 11189a1b..c0d0fc90 100644 --- a/src/capi/pqapi.c +++ b/src/capi/pqapi.c @@ -148,5 +148,7 @@ uint32_t pqc_private_key_bsz(const pqc_ctx_t *p) { void static_initialization(void) __attribute__((constructor)); void static_initialization(void) { +#ifdef PQC_ASM CPU_CAPS = GetX86Info().features; +#endif } diff --git a/src/kem/sike/CMakeLists.txt b/src/kem/sike/CMakeLists.txt index f5543d67..bd736a75 100644 --- a/src/kem/sike/CMakeLists.txt +++ b/src/kem/sike/CMakeLists.txt @@ -6,7 +6,7 @@ set( p434/params.c p434/sike.c) -if(${ARCH} STREQUAL "ARCH_x86_64") +if(${ARCH} STREQUAL "ARCH_x86_64" AND NOT ${NO_ASM}) add_definitions(-DPQC_ASM=1) set( SRC_CLEAN_SIKE_P434