summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@airbus.com>2018-11-27 08:58:46 +0100
committerKévin Le Gouguec <kevin.legouguec@airbus.com>2018-11-27 08:58:46 +0100
commitd14739644394986cb584acb45ed9b214dff1c501 (patch)
tree3bd49b3feeafcd3aeb23a779d161f67664a1eaec
parent89ff89643cf6682742730c3f65b572debe2c2ab1 (diff)
downloadlilliput-ae-implem-d14739644394986cb584acb45ed9b214dff1c501.tar.xz
Mise en commun du code TBC et ΘCB3
Il ne devrait pas varier selon les paramètres AFAICT.
-rw-r--r--crypto_aead/lilliputaei128v1/ref/Makefile36
-rw-r--r--crypto_aead/lilliputaei128v1/ref/api.h13
-rw-r--r--crypto_aead/lilliputaei128v1/ref/encrypt.c25
l---------crypto_aead/lilliputaei128v1/ref/src1
-rw-r--r--src/cipher.c (renamed from crypto_aead/lilliputaei128v1/ref/cipher.c)0
-rw-r--r--src/cipher.h (renamed from crypto_aead/lilliputaei128v1/ref/cipher.h)0
-rw-r--r--src/constants.c (renamed from crypto_aead/lilliputaei128v1/ref/constants.c)0
-rw-r--r--src/constants.h (renamed from crypto_aead/lilliputaei128v1/ref/constants.h)0
-rw-r--r--src/debug.h (renamed from crypto_aead/lilliputaei128v1/ref/debug.h)0
-rw-r--r--src/lilliput-ae-i.c (renamed from crypto_aead/lilliputaei128v1/ref/lilliput-ae-i.c)0
-rw-r--r--src/lilliput-ae.h (renamed from crypto_aead/lilliputaei128v1/ref/lilliput-ae.h)0
-rw-r--r--src/tweakey.c (renamed from crypto_aead/lilliputaei128v1/ref/tweakey.c)0
-rw-r--r--src/tweakey.h (renamed from crypto_aead/lilliputaei128v1/ref/tweakey.h)0
13 files changed, 19 insertions, 56 deletions
diff --git a/crypto_aead/lilliputaei128v1/ref/Makefile b/crypto_aead/lilliputaei128v1/ref/Makefile
index 31167b0..75754d4 100644
--- a/crypto_aead/lilliputaei128v1/ref/Makefile
+++ b/crypto_aead/lilliputaei128v1/ref/Makefile
@@ -3,7 +3,7 @@ test-tbc-encrypt test-tbc-decrypt \
test-ae-roundtrip test-ae-encrypt test-ae-decrypt
nist_flags = -std=c99 -Wall -Wextra -Wshadow -fsanitize=address,undefined -O2
-CFLAGS += -I. $(nist_flags) -Werror
+CFLAGS += -I. -Isrc $(nist_flags) -Werror
LDFLAGS += $(nist_flags)
@@ -28,25 +28,25 @@ test: $(tests)
$(tests): %: results/%
./results/$@
-results/test-ae-decrypt: results/lilliput-ae-i.o results/cipher.o results/tweakey.o results/constants.o | results
-results/test-ae-encrypt: results/lilliput-ae-i.o results/cipher.o results/tweakey.o results/constants.o | results
-results/test-ae-roundtrip: results/lilliput-ae-i.o results/cipher.o results/tweakey.o results/constants.o | results
-results/test-tbc-decrypt: results/cipher.o results/tweakey.o results/constants.o | results
-results/test-tbc-encrypt: results/cipher.o results/tweakey.o results/constants.o | results
-results/test-tweakey: results/tweakey.o results/constants.o | results
+results/test-ae-decrypt: results/src/lilliput-ae-i.o results/src/cipher.o results/src/tweakey.o results/src/constants.o | results
+results/test-ae-encrypt: results/src/lilliput-ae-i.o results/src/cipher.o results/src/tweakey.o results/src/constants.o | results
+results/test-ae-roundtrip: results/src/lilliput-ae-i.o results/src/cipher.o results/src/tweakey.o results/src/constants.o | results
+results/test-tbc-decrypt: results/src/cipher.o results/src/tweakey.o results/src/constants.o | results
+results/test-tbc-encrypt: results/src/cipher.o results/src/tweakey.o results/src/constants.o | results
+results/test-tweakey: results/src/tweakey.o results/src/constants.o | results
results/test-*.o: test/helpers.h parameters.h
-results/test-ae-decrypt.o: lilliput-ae.h
-results/test-ae-encrypt.o: lilliput-ae.h
-results/test-ae-roundtrip.o: lilliput-ae.h
-results/test-tbc-decrypt.o: cipher.h
-results/test-tbc-encrypt.o: cipher.h
-results/test-tweakey.o: tweakey.h
-
-results/cipher.o: cipher.h tweakey.h constants.h parameters.h
-results/constants.o: constants.h
-results/lilliput-ae-i.o: lilliput-ae.h cipher.h constants.h
-results/tweakey.o: tweakey.h constants.h parameters.h
+results/test-ae-decrypt.o: src/lilliput-ae.h
+results/test-ae-encrypt.o: src/lilliput-ae.h
+results/test-ae-roundtrip.o: src/lilliput-ae.h
+results/test-tbc-decrypt.o: src/cipher.h
+results/test-tbc-encrypt.o: src/cipher.h
+results/test-tweakey.o: src/tweakey.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-i.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
diff --git a/crypto_aead/lilliputaei128v1/ref/api.h b/crypto_aead/lilliputaei128v1/ref/api.h
deleted file mode 100644
index 80dc20c..0000000
--- a/crypto_aead/lilliputaei128v1/ref/api.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef API_H
-#define API_H
-
-#include "parameters.h"
-
-
-#define CRYPTO_KEYBYTES KEY_BYTES
-#define CRYPTO_NSECBYTES 0
-#define CRYPTO_NPUBBYTES NONCE_BYTES
-#define CRYPTO_ABYTES BLOCK_BYTES
-#define CRYPTO_NOOVERLAP 1
-
-#endif /* API_H */
diff --git a/crypto_aead/lilliputaei128v1/ref/encrypt.c b/crypto_aead/lilliputaei128v1/ref/encrypt.c
deleted file mode 100644
index 9f0f1cf..0000000
--- a/crypto_aead/lilliputaei128v1/ref/encrypt.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "api.h"
-#include "crypto_aead.h" /* TODO: provided by NIST's TestVectorGen.zip */
-
-
-int crypto_aead_encrypt(
- unsigned char *c, unsigned long long *clen,
- const unsigned char *m, unsigned long long mlen,
- const unsigned char *ad, unsigned long long adlen,
- const unsigned char *nsec,
- const unsigned char *npub,
- const unsigned char *k
-)
-{
-}
-
-int crypto_aead_decrypt(
- unsigned char *m, unsigned long long *mlen,
- unsigned char *nsec,
- const unsigned char *c, unsigned long long clen,
- const unsigned char *ad, unsigned long long adlen,
- const unsigned char *npub,
- const unsigned char *k
-)
-{
-}
diff --git a/crypto_aead/lilliputaei128v1/ref/src b/crypto_aead/lilliputaei128v1/ref/src
new file mode 120000
index 0000000..006f0fe
--- /dev/null
+++ b/crypto_aead/lilliputaei128v1/ref/src
@@ -0,0 +1 @@
+/home/klegouguec/projects/paclido/sp3/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src \ No newline at end of file
diff --git a/crypto_aead/lilliputaei128v1/ref/cipher.c b/src/cipher.c
index 7f1152a..7f1152a 100644
--- a/crypto_aead/lilliputaei128v1/ref/cipher.c
+++ b/src/cipher.c
diff --git a/crypto_aead/lilliputaei128v1/ref/cipher.h b/src/cipher.h
index 06dfde5..06dfde5 100644
--- a/crypto_aead/lilliputaei128v1/ref/cipher.h
+++ b/src/cipher.h
diff --git a/crypto_aead/lilliputaei128v1/ref/constants.c b/src/constants.c
index 29da1d8..29da1d8 100644
--- a/crypto_aead/lilliputaei128v1/ref/constants.c
+++ b/src/constants.c
diff --git a/crypto_aead/lilliputaei128v1/ref/constants.h b/src/constants.h
index a786023..a786023 100644
--- a/crypto_aead/lilliputaei128v1/ref/constants.h
+++ b/src/constants.h
diff --git a/crypto_aead/lilliputaei128v1/ref/debug.h b/src/debug.h
index 87140e5..87140e5 100644
--- a/crypto_aead/lilliputaei128v1/ref/debug.h
+++ b/src/debug.h
diff --git a/crypto_aead/lilliputaei128v1/ref/lilliput-ae-i.c b/src/lilliput-ae-i.c
index 60a916b..60a916b 100644
--- a/crypto_aead/lilliputaei128v1/ref/lilliput-ae-i.c
+++ b/src/lilliput-ae-i.c
diff --git a/crypto_aead/lilliputaei128v1/ref/lilliput-ae.h b/src/lilliput-ae.h
index 062c71c..062c71c 100644
--- a/crypto_aead/lilliputaei128v1/ref/lilliput-ae.h
+++ b/src/lilliput-ae.h
diff --git a/crypto_aead/lilliputaei128v1/ref/tweakey.c b/src/tweakey.c
index da97019..da97019 100644
--- a/crypto_aead/lilliputaei128v1/ref/tweakey.c
+++ b/src/tweakey.c
diff --git a/crypto_aead/lilliputaei128v1/ref/tweakey.h b/src/tweakey.h
index 0642724..0642724 100644
--- a/crypto_aead/lilliputaei128v1/ref/tweakey.h
+++ b/src/tweakey.h