diff options
| author | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2018-11-28 13:42:48 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2018-11-28 13:44:54 +0100 |
| commit | 98a7cb6d80f4151aebf6c1c0e76a2e9a22ab6e57 (patch) | |
| tree | 6c38fe0873295a3186e9a0d82d798c0058b87c25 | |
| parent | 253ba2a44878542d50877fcc10461491ecd67085 (diff) | |
| download | lilliput-ae-implem-98a7cb6d80f4151aebf6c1c0e76a2e9a22ab6e57.tar.xz | |
Dégraissage de parameters.h
| -rw-r--r-- | crypto_aead/lilliputaei128v1/ref/Makefile | 4 | ||||
| -rw-r--r-- | crypto_aead/lilliputaei128v1/ref/_parameters.h | 9 | ||||
| -rw-r--r-- | crypto_aead/lilliputaei192v1/ref/Makefile | 1 | ||||
| -rw-r--r-- | crypto_aead/lilliputaei192v1/ref/_parameters.h | 9 | ||||
| -rw-r--r-- | crypto_aead/lilliputaei192v1/ref/parameters.h | 23 | ||||
| -rw-r--r-- | crypto_aead/lilliputaeii128v1/ref/Makefile | 1 | ||||
| -rw-r--r-- | crypto_aead/lilliputaeii128v1/ref/_parameters.h | 9 | ||||
| -rw-r--r-- | crypto_aead/lilliputaeii128v1/ref/parameters.h | 23 | ||||
| -rw-r--r-- | src/common.mk | 10 | ||||
| -rw-r--r-- | src/parameters.h (renamed from crypto_aead/lilliputaei128v1/ref/parameters.h) | 7 |
10 files changed, 36 insertions, 60 deletions
diff --git a/crypto_aead/lilliputaei128v1/ref/Makefile b/crypto_aead/lilliputaei128v1/ref/Makefile index 699a4be..ca9e1db 100644 --- a/crypto_aead/lilliputaei128v1/ref/Makefile +++ b/crypto_aead/lilliputaei128v1/ref/Makefile @@ -1,5 +1,4 @@ -tests = test-tweakey \ -test-tbc-encrypt test-tbc-decrypt \ +tests = test-tweakey test-tbc-encrypt test-tbc-decrypt \ test-ae-roundtrip test-ae-encrypt test-ae-decrypt include src/common.mk @@ -11,7 +10,6 @@ results/test-tbc-decrypt: results/src/cipher.o results/src/tweakey.o results/src 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: src/lilliput-ae.h results/test-ae-encrypt.o: src/lilliput-ae.h results/test-ae-roundtrip.o: src/lilliput-ae.h diff --git a/crypto_aead/lilliputaei128v1/ref/_parameters.h b/crypto_aead/lilliputaei128v1/ref/_parameters.h new file mode 100644 index 0000000..08ce8c1 --- /dev/null +++ b/crypto_aead/lilliputaei128v1/ref/_parameters.h @@ -0,0 +1,9 @@ +#ifndef _PARAMETERS_H +#define _PARAMETERS_H + +#define KEY_LENGTH_BITS 128 +#define ROUNDS 32 + +#define TWEAK_LENGTH_BITS 192 + +#endif /* _PARAMETERS_H */ diff --git a/crypto_aead/lilliputaei192v1/ref/Makefile b/crypto_aead/lilliputaei192v1/ref/Makefile index 5853669..3692548 100644 --- a/crypto_aead/lilliputaei192v1/ref/Makefile +++ b/crypto_aead/lilliputaei192v1/ref/Makefile @@ -4,7 +4,6 @@ include src/common.mk 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-*.o: test/helpers.h parameters.h results/test-ae-roundtrip.o: src/lilliput-ae.h # TODO: should add order-only prerequisites to remove mkdirs inside recipes diff --git a/crypto_aead/lilliputaei192v1/ref/_parameters.h b/crypto_aead/lilliputaei192v1/ref/_parameters.h new file mode 100644 index 0000000..d1dc476 --- /dev/null +++ b/crypto_aead/lilliputaei192v1/ref/_parameters.h @@ -0,0 +1,9 @@ +#ifndef _PARAMETERS_H +#define _PARAMETERS_H + +#define KEY_LENGTH_BITS 192 +#define ROUNDS 36 + +#define TWEAK_LENGTH_BITS 192 + +#endif /* _PARAMETERS_H */ diff --git a/crypto_aead/lilliputaei192v1/ref/parameters.h b/crypto_aead/lilliputaei192v1/ref/parameters.h deleted file mode 100644 index 061fb63..0000000 --- a/crypto_aead/lilliputaei192v1/ref/parameters.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef PARAMETERS_H -#define PARAMETERS_H - -#define TWEAK_LENGTH_BITS 192 -#define KEY_LENGTH_BITS 192 -#define TWEAKEY_LENGTH_BITS (TWEAK_LENGTH_BITS+KEY_LENGTH_BITS) -#define ROUND_TWEAKEY_LENGTH_BITS 64 -#define BLOCK_LENGTH_BITS 128 -#define NONCE_LENGTH_BITS 120 -#define TAG_LENGTH_BITS 128 - -#define TWEAK_BYTES (TWEAK_LENGTH_BITS/8) -#define KEY_BYTES (KEY_LENGTH_BITS/8) -#define TWEAKEY_BYTES (TWEAKEY_LENGTH_BITS/8) -#define ROUND_TWEAKEY_BYTES (ROUND_TWEAKEY_LENGTH_BITS/8) -#define BLOCK_BYTES (BLOCK_LENGTH_BITS/8) -#define NONCE_BYTES (NONCE_LENGTH_BITS/8) -#define TAG_BYTES (TAG_LENGTH_BITS/8) - - -#define ROUNDS 36 - -#endif /* PARAMETERS_H */ diff --git a/crypto_aead/lilliputaeii128v1/ref/Makefile b/crypto_aead/lilliputaeii128v1/ref/Makefile index 941a11a..0b15384 100644 --- a/crypto_aead/lilliputaeii128v1/ref/Makefile +++ b/crypto_aead/lilliputaeii128v1/ref/Makefile @@ -4,5 +4,4 @@ include src/common.mk 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 diff --git a/crypto_aead/lilliputaeii128v1/ref/_parameters.h b/crypto_aead/lilliputaeii128v1/ref/_parameters.h new file mode 100644 index 0000000..147730d --- /dev/null +++ b/crypto_aead/lilliputaeii128v1/ref/_parameters.h @@ -0,0 +1,9 @@ +#ifndef _PARAMETERS_H +#define _PARAMETERS_H + +#define KEY_LENGTH_BITS 128 +#define ROUNDS 32 + +#define TWEAK_LENGTH_BITS 128 + +#endif /* _PARAMETERS_H */ diff --git a/crypto_aead/lilliputaeii128v1/ref/parameters.h b/crypto_aead/lilliputaeii128v1/ref/parameters.h deleted file mode 100644 index f2ebe0a..0000000 --- a/crypto_aead/lilliputaeii128v1/ref/parameters.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef PARAMETERS_H -#define PARAMETERS_H - -#define TWEAK_LENGTH_BITS 128 -#define KEY_LENGTH_BITS 128 -#define TWEAKEY_LENGTH_BITS (TWEAK_LENGTH_BITS+KEY_LENGTH_BITS) -#define ROUND_TWEAKEY_LENGTH_BITS 64 -#define BLOCK_LENGTH_BITS 128 -#define NONCE_LENGTH_BITS 120 -#define TAG_LENGTH_BITS 128 - -#define TWEAK_BYTES (TWEAK_LENGTH_BITS/8) -#define KEY_BYTES (KEY_LENGTH_BITS/8) -#define TWEAKEY_BYTES (TWEAKEY_LENGTH_BITS/8) -#define ROUND_TWEAKEY_BYTES (ROUND_TWEAKEY_LENGTH_BITS/8) -#define BLOCK_BYTES (BLOCK_LENGTH_BITS/8) -#define NONCE_BYTES (NONCE_LENGTH_BITS/8) -#define TAG_BYTES (TAG_LENGTH_BITS/8) - - -#define ROUNDS 32 - -#endif /* PARAMETERS_H */ diff --git a/src/common.mk b/src/common.mk index ec56102..b854933 100644 --- a/src/common.mk +++ b/src/common.mk @@ -1,5 +1,5 @@ nist_flags = -std=c99 -Wall -Wextra -Wshadow -fsanitize=address,undefined -O2 -CFLAGS += -I. -Isrc $(nist_flags) -Werror +CFLAGS += -Isrc -I. $(nist_flags) -Werror LDFLAGS += $(nist_flags) # use "make VERBOSE=1" to have full commands printed out. @@ -36,11 +36,13 @@ $(tests): %: results/% $(Q) ./results/$@ -results/src/cipher.o: src/cipher.h src/tweakey.h src/constants.h parameters.h +results/src/cipher.o: src/cipher.h src/tweakey.h src/constants.h src/parameters.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 +results/src/lilliput-ae-i.o: src/lilliput-ae.h src/cipher.h src/constants.h src/parameters.h _parameters.h +results/src/tweakey.o: src/tweakey.h src/constants.h src/parameters.h _parameters.h +results/test-*.o: test/helpers.h src/parameters.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 +# TODO: auto-generate "tests" variable diff --git a/crypto_aead/lilliputaei128v1/ref/parameters.h b/src/parameters.h index d4d55c2..681a152 100644 --- a/crypto_aead/lilliputaei128v1/ref/parameters.h +++ b/src/parameters.h @@ -1,8 +1,8 @@ #ifndef PARAMETERS_H #define PARAMETERS_H -#define TWEAK_LENGTH_BITS 192 -#define KEY_LENGTH_BITS 128 +#include "_parameters.h" + #define TWEAKEY_LENGTH_BITS (TWEAK_LENGTH_BITS+KEY_LENGTH_BITS) #define ROUND_TWEAKEY_LENGTH_BITS 64 #define BLOCK_LENGTH_BITS 128 @@ -17,7 +17,4 @@ #define NONCE_BYTES (NONCE_LENGTH_BITS/8) #define TAG_BYTES (TAG_LENGTH_BITS/8) - -#define ROUNDS 32 - #endif /* PARAMETERS_H */ |
