diff --git a/mk/schemes.mk b/mk/schemes.mk index 6a4e7fec8..b51036611 100644 --- a/mk/schemes.mk +++ b/mk/schemes.mk @@ -13,6 +13,12 @@ MLKEM512_DIR = $(BUILD_DIR)/mlkem512 MLKEM768_DIR = $(BUILD_DIR)/mlkem768 MLKEM1024_DIR = $(BUILD_DIR)/mlkem1024 +# Even when link-time optimization is used for the rest of the code, +# make sure not to use it for verify.c: Those are functions which, when +# inlined, can be subject to variable-time compilation. +$(MLKEM768_DIR)/mlkem/verify.c.o: CPPFLAGS += "-fno-lto" +$(MLKEM1024_DIR)/mlkem/verify.c.o: CPPFLAGS += "-fno-lto" + $(MLKEM512_DIR)/bin/%: CPPFLAGS += -DMLKEM_K=2 $(ALL_TESTS:%=$(MLKEM512_DIR)/bin/%512):$(MLKEM512_DIR)/bin/%512: $(MLKEM512_DIR)/test/%.c.o $(call MAKE_OBJS,$(MLKEM512_DIR), $(SOURCES))