2019-12-06 15:16:41 +00:00
|
|
|
# This Makefile can be used with GNU Make or BSD Make
|
|
|
|
|
|
|
|
LIB=libdilithium2_avx2.a
|
|
|
|
|
|
|
|
SOURCES = fips202x4.c invntt.s nttconsts.c ntt.s packing.c pointwise.S poly.c \
|
|
|
|
polyvec.c reduce.s rejsample.c rounding.c sign.c stream.c
|
|
|
|
OBJECTS = fips202x4.o invntt.o nttconsts.o ntt.o packing.o pointwise.o poly.o \
|
|
|
|
polyvec.o reduce.o rejsample.o rounding.o sign.o stream.o
|
|
|
|
HEADERS = alignment.h api.h params.h sign.h polyvec.h poly.h packing.h ntt.h \
|
|
|
|
nttconsts.h reduce.h rounding.h rejsample.h symmetric.h stream.h \
|
|
|
|
fips202x4.h shuffle.inc
|
|
|
|
|
|
|
|
CFLAGS=-O3 -Wall -Wextra -Wpedantic -Wvla -Werror \
|
|
|
|
-Wmissing-prototypes -Wredundant-decls -std=c99 \
|
|
|
|
-Wcast-align \
|
|
|
|
-mavx2 -mbmi -mpopcnt -I../../../common $(EXTRAFLAGS)
|
|
|
|
|
|
|
|
all: $(LIB)
|
|
|
|
|
|
|
|
KECCAK4XDIR=../../../common/keccak4x
|
|
|
|
KECCAK4XOBJ=KeccakP-1600-times4-SIMD256.o
|
|
|
|
KECCAK4X=$(KECCAK4XDIR)/$(KECCAK4XOBJ)
|
|
|
|
|
|
|
|
%.o: %.c $(HEADERS)
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
%.o: %.S $(HEADERS)
|
2019-12-11 14:06:02 +00:00
|
|
|
$(CC) -c -o $@ $<
|
2019-12-06 15:16:41 +00:00
|
|
|
|
|
|
|
$(LIB): $(OBJECTS) $(KECCAK4X)
|
|
|
|
$(AR) -r $@ $^
|
|
|
|
|
|
|
|
$(KECCAK4X):
|
|
|
|
$(MAKE) -C $(KECCAK4XDIR) $(KECCAK4XOBJ)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) $(OBJECTS)
|
|
|
|
$(RM) $(LIB)
|
|
|
|
$(MAKE) -C $(KECCAK4XDIR) clean
|
|
|
|
|