summaryrefslogtreecommitdiff
path: root/crypto_aead/lilliputaeii128v1/ref/Makefile
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@airbus.com>2018-11-27 09:44:28 +0100
committerKévin Le Gouguec <kevin.legouguec@airbus.com>2018-11-27 09:44:28 +0100
commit0034747fd91b5d1b5d6375eb295a79f5221de84a (patch)
tree7f894d5932ec2283d0184fe8c5dc8f054d4ac54b /crypto_aead/lilliputaeii128v1/ref/Makefile
parentd14739644394986cb584acb45ed9b214dff1c501 (diff)
downloadlilliput-ae-implem-0034747fd91b5d1b5d6375eb295a79f5221de84a.tar.xz
Ajout de tests chiffrement/déchiffrement pour SCT-2
Diffstat (limited to 'crypto_aead/lilliputaeii128v1/ref/Makefile')
-rw-r--r--crypto_aead/lilliputaeii128v1/ref/Makefile43
1 files changed, 43 insertions, 0 deletions
diff --git a/crypto_aead/lilliputaeii128v1/ref/Makefile b/crypto_aead/lilliputaeii128v1/ref/Makefile
new file mode 100644
index 0000000..90f2a75
--- /dev/null
+++ b/crypto_aead/lilliputaeii128v1/ref/Makefile
@@ -0,0 +1,43 @@
+tests = test-ae-roundtrip
+
+nist_flags = -std=c99 -Wall -Wextra -Wshadow -fsanitize=address,undefined -O2
+CFLAGS += -I. -Isrc $(nist_flags) -Werror
+LDFLAGS += $(nist_flags)
+
+
+.PHONY: clean test $(tests)
+
+
+clean:
+ -rm -r results
+
+results:
+ mkdir -p $@
+
+results/%.o: %.c
+ @mkdir -p $(dir $@)
+ gcc -c $< $(CFLAGS) -o $@
+
+results/test-%: results/test/test-%.o
+ gcc $^ $(LDFLAGS) -o $@
+
+test: $(tests)
+
+$(tests): %: results/%
+ ./results/$@
+
+results/test-ae-roundtrip: results/src/lilliput-ae-ii.o results/src/cipher.o results/src/tweakey.o results/src/constants.o | results
+
+results/test-*.o: test/helpers.h parameters.h
+results/test-ae-roundtrip.o: src/lilliput-ae.h
+
+results/src/cipher.o: src/cipher.h src/tweakey.h src/constants.h parameters.h
+results/src/constants.o: src/constants.h
+results/src/lilliput-ae-ii.o: src/lilliput-ae.h src/cipher.h src/constants.h
+results/src/tweakey.o: src/tweakey.h src/constants.h parameters.h
+
+# TODO: should add order-only prerequisites to remove mkdirs inside recipes
+# TODO: add valgrind, although it does not seem to play well with ASAN
+# TODO: should use gcc -M... to generate .o -> .h dependencies
+
+results/src/lilliput-ae-ii.o: CFLAGS += -Wno-unused # FIXME: remove once implemented