diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common.mk | 10 | ||||
| -rw-r--r-- | src/parameters.h | 20 |
2 files changed, 26 insertions, 4 deletions
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/src/parameters.h b/src/parameters.h new file mode 100644 index 0000000..681a152 --- /dev/null +++ b/src/parameters.h @@ -0,0 +1,20 @@ +#ifndef PARAMETERS_H +#define PARAMETERS_H + +#include "_parameters.h" + +#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) + +#endif /* PARAMETERS_H */ |
