From a023123adfc6e5f9ab6ed8ef5c2b6270a381c573 Mon Sep 17 00:00:00 2001 From: Will Childs-Klein Date: Thu, 9 Mar 2023 15:08:24 -0500 Subject: [PATCH] Add LC kyber trycompile check to s2n.mk --- s2n.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/s2n.mk b/s2n.mk index 4e1c06670c7..c17a70b71b4 100644 --- a/s2n.mk +++ b/s2n.mk @@ -231,6 +231,12 @@ ifeq ($(TRY_EVP_MD_CTX_SET_PKEY_CTX), 0) DEFAULT_CFLAGS += -DS2N_LIBCRYPTO_SUPPORTS_EVP_MD_CTX_SET_PKEY_CTX endif +# Determine if the Kyber 512 KEM API is available in libcrypto +TRY_LIBCRYPTO_SUPPORTS_KYBER512 := $(call try_compile,$(S2N_ROOT)/tests/features/evp_kem_kyber_512.c) +ifeq ($(TRY_LIBCRYPTO_SUPPORTS_KYBER512), 0) + DEFAULT_CFLAGS += -DS2N_LIBCRYPTO_SUPPORTS_KYBER512 +endif + # Determine if madvise() is available TRY_COMPILE_MADVISE := $(call try_compile,$(S2N_ROOT)/tests/features/madvise.c) ifeq ($(TRY_COMPILE_MADVISE), 0)