transform:=@program_transform_name@
mandir:=@mandir@
-ALL_CFLAGS:=@DEFS@ -I$(srcdir) -I. $(CFLAGS) $(EXTRA_CFLAGS)
+ALL_CFLAGS:=@DEFS@ -I$(srcdir) -I. -Icat $(CFLAGS) $(EXTRA_CFLAGS)
CPPFLAGS:=@CPPFLAGS@ -DDATAROOTDIR='"$(datarootdir)"' $(EXTRA_CPPFLAGS)
LDFLAGS:=@LDFLAGS@ $(EXTRA_LDFLAGS)
LDLIBS:=@LIBS@ $(EXTRA_LDLIBS)
PYMODULES := ipaddrset.py argparseactionnoyes.py base91.py
TEST_OBJECTS:=eax-aes-test.o eax-serpent-test.o eax-serpentbe-test.o \
- eax-test.o aes.o
+ eax-test.o aes.o x25519-test.o x448-test.o
+
+TEST_OBJECTS += crypto-test.o
+TEST_OBJECTS += keccak1600-test.o sha3-test.o
+TEST_OBJECTS += ed25519-test.o ed448-test.o
ifeq (version.o,$(MAKECMDGOALS))
OBJECTS:=
%.tab.c %.tab.h: %.y
bison -d -o $@ $<
-%.o: %.c
+%.o: %.c $(cat_CATS)
$(CC) $(CPPFLAGS) $(ALL_CFLAGS) $(CDEPS_CFLAGS) -c $< -o $@
$(OBJECTS): conffile.yy.h pubkeys.yy.h base91s/base91.h
TESTDIRS=stest mtest
+CRYPTO_TESTS = keccak1600 sha3 f25519 x25519 ed25519 fgoldi x448 ed448
+
&TARGETS_check = eax-aes.tconfirm eax-serpent.tconfirm \
- eax-serpentbe.tconfirm ipaddrset.tconfirm
+ eax-serpentbe.tconfirm ipaddrset.tconfirm \
+ x25519.tconfirm x448.tconfirm \
+ $(foreach c,$(CRYPTO_TESTS),$c.tconfirm)
&TARGETS_fullcheck += $(&TARGETS_check)
&TARGETS_fullcheck += msgcode.tconfirm
diff -u $(srcdir)/ipaddrset-test.expected ipaddrset-test.new
touch $@
+$(foreach c,$(CRYPTO_TESTS),$c.trun): %.trun: %-test.o crypto-test.o
+ $(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $^
+
+$(foreach c,$(CRYPTO_TESTS),$c.tconfirm): \
+ %.tconfirm: %.trun cat/%-tests.in
+ ./$*.trun <cat/$*-tests.in
+ touch $@
+
&CLEAN += & pubkeys.fl
pubkeys.fl: ${srcdir}/pubkeys.fl.pl
$(RM) -f *.pyc *~ eax-*.tconfirm eax-*.trun
$(RM) -rf __pycache__
$(RM) -f msgcode.tconfirm msgcode.trun
+ $(RM) -f $(addsuffix .trun, $(CRYPTO_TESTS))
+ $(RM) -f $(addsuffix .tconfirm, $(CRYPTO_TESTS))
realclean:: clean
$(RM) -f *~ Makefile config.h \
&cat-converted: $(addprefix &~catacomb-import/, $(CATACOMB_IMPORT_DONORS))
-&CLEAN += & secnet-import.auto.mk.compare
+keccak1600.trun: & keccak1600.o
+sha3.trun: & sha3.o keccak1600.o
+f25519.trun: & f25519.o
+x25519.trun: & x25519.o f25519.o
+ed25519.trun: sha512.o & f25519.o scaf.o ed25519.o
+fgoldi.trun: & fgoldi.o
+x448.trun: & x448.o fgoldi.o
+ed448.trun: & keccak1600.o sha3.o fgoldi.o scaf.o ed448.o
+
+f25519-test.o: ec-field-test.c &$CATS
+ $(CC) $(CPPFLAGS) $(ALL_CFLAGS) -c -DFIELD=f25519 $< -o $@
+fgoldi-test.o: ec-field-test.c &$CATS
+ $(CC) $(CPPFLAGS) $(ALL_CFLAGS) -c -DFIELD=fgoldi $< -o $@
+x25519-test.o: xdh-test.c &$CATS
+ $(CC) $(CPPFLAGS) $(ALL_CFLAGS) -c -DXDH=x25519 -DFIELD=f25519 $< -o $@
+x448-test.o: xdh-test.c &$CATS
+ $(CC) $(CPPFLAGS) $(ALL_CFLAGS) -c -DXDH=x448 -DFIELD=fgoldi $< -o $@
+
+&CLEAN += & secnet-import.auto.mk.compare *.o .*.d