summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@airbus.com>2019-02-05 08:44:52 +0100
committerKévin Le Gouguec <kevin.legouguec@airbus.com>2019-02-05 08:44:52 +0100
commitff54e8b4a758d35f4a1d4e0b0303092e7d96da0e (patch)
tree689ac21607d8760fb53f6a97903c1c5976c52896
parent833b24eb5dffcfb675aabbefd2435ed6f6b72bfe (diff)
downloadlilliput-ae-implem-ff54e8b4a758d35f4a1d4e0b0303092e7d96da0e.tar.xz
Renommage des entêtes de constantes
Aucune idée de pourquoi j'avais insisté pour nommer les deux "parameters" plutôt que de distinguer les constantes des paramètres. Peut-être par souci de compatibilité avec FELICS, qui utilise constants.h. 🤷
-rw-r--r--README.md4
-rw-r--r--nist/api.h2
-rwxr-xr-xnist/make-package.sh4
l---------src/add_tweakeyloop/constants.h1
l---------src/add_tweakeyloop/parameters.h1
-rw-r--r--src/add_tweakeyloop/tweakey.c2
l---------src/add_tweakeysequences/constants.h1
l---------src/add_tweakeysequences/parameters.h1
-rw-r--r--src/add_tweakeysequences/tweakey.c2
-rw-r--r--src/i-128/parameters.h (renamed from src/i-128/_parameters.h)6
-rw-r--r--src/i-192/parameters.h (renamed from src/i-192/_parameters.h)6
-rw-r--r--src/i-256/parameters.h (renamed from src/i-256/_parameters.h)6
-rw-r--r--src/ii-128/parameters.h (renamed from src/ii-128/_parameters.h)6
-rw-r--r--src/ii-192/parameters.h (renamed from src/ii-192/_parameters.h)6
-rw-r--r--src/ii-256/parameters.h (renamed from src/ii-256/_parameters.h)6
-rw-r--r--src/ref/ae-common.h2
-rw-r--r--src/ref/cipher.c2
-rw-r--r--src/ref/cipher.h2
-rw-r--r--src/ref/constants.h (renamed from src/ref/parameters.h)8
-rw-r--r--src/ref/lilliput-ae.h2
-rw-r--r--src/ref/tweakey.c2
-rw-r--r--src/ref/tweakey.h2
-rwxr-xr-xtest/check-implementation.sh4
-rw-r--r--test/common.mk10
-rw-r--r--test/test-helpers.h2
25 files changed, 45 insertions, 45 deletions
diff --git a/README.md b/README.md
index 8dba12b..4504b1c 100644
--- a/README.md
+++ b/README.md
@@ -28,8 +28,8 @@ Each implementation folder contains:
- `tweakey.*`: implementation of Lilliput-TBC's tweakey schedule
- `cipher.*`: implementation of the tweakable block-cipher
Lilliput-TBC
-- `parameters.h`: byte sizes for inputs and outputs (depends on
- parameter-dependent `_parameters.h` files)
+- `constants.h`: byte sizes for inputs and outputs (depends on
+ parameter-dependent `parameters.h` files)
`test`
------
diff --git a/nist/api.h b/nist/api.h
index c952db3..497f5fb 100644
--- a/nist/api.h
+++ b/nist/api.h
@@ -1,7 +1,7 @@
#ifndef API_H
#define API_H
-#include "parameters.h"
+#include "constants.h"
#define CRYPTO_KEYBYTES KEY_BYTES
#define CRYPTO_NSECBYTES 0
diff --git a/nist/make-package.sh b/nist/make-package.sh
index 6fa7e7c..33abeac 100755
--- a/nist/make-package.sh
+++ b/nist/make-package.sh
@@ -46,8 +46,8 @@ add-variant ()
source_files=(
ae-common.h
cipher.{c,h}
+ constants.h
lilliput-ae{.h,-${mode}.c}
- parameters.h
tweakey.{c,h}
)
@@ -60,7 +60,7 @@ add-variant ()
for implem in ${implementations[@]}
do
mkdir ${dest}/${implem}
- cp ${ROOT}/src/${mode}-${key_length}/_parameters.h ${dest}/${implem}
+ cp ${ROOT}/src/${mode}-${key_length}/parameters.h ${dest}/${implem}
cp ${NIST_DIR}/{api.h,encrypt.c} ${dest}/${implem}
for f in ${source_files[@]}
diff --git a/src/add_tweakeyloop/constants.h b/src/add_tweakeyloop/constants.h
new file mode 120000
index 0000000..67df0f3
--- /dev/null
+++ b/src/add_tweakeyloop/constants.h
@@ -0,0 +1 @@
+../ref/constants.h \ No newline at end of file
diff --git a/src/add_tweakeyloop/parameters.h b/src/add_tweakeyloop/parameters.h
deleted file mode 120000
index 8eff42f..0000000
--- a/src/add_tweakeyloop/parameters.h
+++ /dev/null
@@ -1 +0,0 @@
-../ref/parameters.h \ No newline at end of file
diff --git a/src/add_tweakeyloop/tweakey.c b/src/add_tweakeyloop/tweakey.c
index 54b3036..6b1232e 100644
--- a/src/add_tweakeyloop/tweakey.c
+++ b/src/add_tweakeyloop/tweakey.c
@@ -1,7 +1,7 @@
#include <stdint.h>
#include <string.h>
-#include "parameters.h"
+#include "constants.h"
#include "tweakey.h"
diff --git a/src/add_tweakeysequences/constants.h b/src/add_tweakeysequences/constants.h
new file mode 120000
index 0000000..67df0f3
--- /dev/null
+++ b/src/add_tweakeysequences/constants.h
@@ -0,0 +1 @@
+../ref/constants.h \ No newline at end of file
diff --git a/src/add_tweakeysequences/parameters.h b/src/add_tweakeysequences/parameters.h
deleted file mode 120000
index 8eff42f..0000000
--- a/src/add_tweakeysequences/parameters.h
+++ /dev/null
@@ -1 +0,0 @@
-../ref/parameters.h \ No newline at end of file
diff --git a/src/add_tweakeysequences/tweakey.c b/src/add_tweakeysequences/tweakey.c
index 776352f..9f71622 100644
--- a/src/add_tweakeysequences/tweakey.c
+++ b/src/add_tweakeysequences/tweakey.c
@@ -1,7 +1,7 @@
#include <stdint.h>
#include <string.h>
-#include "parameters.h"
+#include "constants.h"
#include "tweakey.h"
diff --git a/src/i-128/_parameters.h b/src/i-128/parameters.h
index 08ce8c1..c1165b1 100644
--- a/src/i-128/_parameters.h
+++ b/src/i-128/parameters.h
@@ -1,9 +1,9 @@
-#ifndef _PARAMETERS_H
-#define _PARAMETERS_H
+#ifndef PARAMETERS_H
+#define PARAMETERS_H
#define KEY_LENGTH_BITS 128
#define ROUNDS 32
#define TWEAK_LENGTH_BITS 192
-#endif /* _PARAMETERS_H */
+#endif /* PARAMETERS_H */
diff --git a/src/i-192/_parameters.h b/src/i-192/parameters.h
index d1dc476..295c8b0 100644
--- a/src/i-192/_parameters.h
+++ b/src/i-192/parameters.h
@@ -1,9 +1,9 @@
-#ifndef _PARAMETERS_H
-#define _PARAMETERS_H
+#ifndef PARAMETERS_H
+#define PARAMETERS_H
#define KEY_LENGTH_BITS 192
#define ROUNDS 36
#define TWEAK_LENGTH_BITS 192
-#endif /* _PARAMETERS_H */
+#endif /* PARAMETERS_H */
diff --git a/src/i-256/_parameters.h b/src/i-256/parameters.h
index d948ac5..782611b 100644
--- a/src/i-256/_parameters.h
+++ b/src/i-256/parameters.h
@@ -1,9 +1,9 @@
-#ifndef _PARAMETERS_H
-#define _PARAMETERS_H
+#ifndef PARAMETERS_H
+#define PARAMETERS_H
#define KEY_LENGTH_BITS 256
#define ROUNDS 42
#define TWEAK_LENGTH_BITS 192
-#endif /* _PARAMETERS_H */
+#endif /* PARAMETERS_H */
diff --git a/src/ii-128/_parameters.h b/src/ii-128/parameters.h
index 147730d..bf3936d 100644
--- a/src/ii-128/_parameters.h
+++ b/src/ii-128/parameters.h
@@ -1,9 +1,9 @@
-#ifndef _PARAMETERS_H
-#define _PARAMETERS_H
+#ifndef PARAMETERS_H
+#define PARAMETERS_H
#define KEY_LENGTH_BITS 128
#define ROUNDS 32
#define TWEAK_LENGTH_BITS 128
-#endif /* _PARAMETERS_H */
+#endif /* PARAMETERS_H */
diff --git a/src/ii-192/_parameters.h b/src/ii-192/parameters.h
index 8b76285..bfb541e 100644
--- a/src/ii-192/_parameters.h
+++ b/src/ii-192/parameters.h
@@ -1,9 +1,9 @@
-#ifndef _PARAMETERS_H
-#define _PARAMETERS_H
+#ifndef PARAMETERS_H
+#define PARAMETERS_H
#define KEY_LENGTH_BITS 192
#define ROUNDS 36
#define TWEAK_LENGTH_BITS 128
-#endif /* _PARAMETERS_H */
+#endif /* PARAMETERS_H */
diff --git a/src/ii-256/_parameters.h b/src/ii-256/parameters.h
index 8bd0430..1255859 100644
--- a/src/ii-256/_parameters.h
+++ b/src/ii-256/parameters.h
@@ -1,9 +1,9 @@
-#ifndef _PARAMETERS_H
-#define _PARAMETERS_H
+#ifndef PARAMETERS_H
+#define PARAMETERS_H
#define KEY_LENGTH_BITS 256
#define ROUNDS 42
#define TWEAK_LENGTH_BITS 128
-#endif /* _PARAMETERS_H */
+#endif /* PARAMETERS_H */
diff --git a/src/ref/ae-common.h b/src/ref/ae-common.h
index 561854e..6648280 100644
--- a/src/ref/ae-common.h
+++ b/src/ref/ae-common.h
@@ -6,7 +6,7 @@
#include <string.h>
#include "cipher.h"
-#include "parameters.h"
+#include "constants.h"
static inline uint8_t upper_nibble(uint8_t i)
diff --git a/src/ref/cipher.c b/src/ref/cipher.c
index e5ccd15..48fc35c 100644
--- a/src/ref/cipher.c
+++ b/src/ref/cipher.c
@@ -2,7 +2,7 @@
#include <string.h>
#include "cipher.h"
-#include "parameters.h"
+#include "constants.h"
#include "tweakey.h"
diff --git a/src/ref/cipher.h b/src/ref/cipher.h
index 06dfde5..30cb9c5 100644
--- a/src/ref/cipher.h
+++ b/src/ref/cipher.h
@@ -3,7 +3,7 @@
#include <stdint.h>
-#include "parameters.h"
+#include "constants.h"
void lilliput_tbc_encrypt(
diff --git a/src/ref/parameters.h b/src/ref/constants.h
index 681a152..063c8af 100644
--- a/src/ref/parameters.h
+++ b/src/ref/constants.h
@@ -1,7 +1,7 @@
-#ifndef PARAMETERS_H
-#define PARAMETERS_H
+#ifndef CONSTANTS_H
+#define CONSTANTS_H
-#include "_parameters.h"
+#include "parameters.h"
#define TWEAKEY_LENGTH_BITS (TWEAK_LENGTH_BITS+KEY_LENGTH_BITS)
#define ROUND_TWEAKEY_LENGTH_BITS 64
@@ -17,4 +17,4 @@
#define NONCE_BYTES (NONCE_LENGTH_BITS/8)
#define TAG_BYTES (TAG_LENGTH_BITS/8)
-#endif /* PARAMETERS_H */
+#endif /* CONSTANTS_H */
diff --git a/src/ref/lilliput-ae.h b/src/ref/lilliput-ae.h
index e2d5051..24bd7de 100644
--- a/src/ref/lilliput-ae.h
+++ b/src/ref/lilliput-ae.h
@@ -5,7 +5,7 @@
#include <stdbool.h>
#include <stdint.h>
-#include "parameters.h"
+#include "constants.h"
void lilliput_ae_encrypt(
diff --git a/src/ref/tweakey.c b/src/ref/tweakey.c
index 0588c1b..e5faf2a 100644
--- a/src/ref/tweakey.c
+++ b/src/ref/tweakey.c
@@ -1,7 +1,7 @@
#include <stdint.h>
#include <string.h>
-#include "parameters.h"
+#include "constants.h"
#include "tweakey.h"
diff --git a/src/ref/tweakey.h b/src/ref/tweakey.h
index 5470bc8..f4c1f0a 100644
--- a/src/ref/tweakey.h
+++ b/src/ref/tweakey.h
@@ -3,7 +3,7 @@
#include <stdint.h>
-#include "parameters.h"
+#include "constants.h"
void tweakey_state_init(
diff --git a/test/check-implementation.sh b/test/check-implementation.sh
index 0ce739d..951c6af 100755
--- a/test/check-implementation.sh
+++ b/test/check-implementation.sh
@@ -27,8 +27,8 @@ run-genkat ()
local source_files=(
ae-common.h
cipher.{c,h}
+ constants.h
lilliput-ae{.h,-${mode}.c}
- parameters.h
tweakey.{c,h}
)
@@ -40,7 +40,7 @@ run-genkat ()
cp ${src_dir}/${implem}/${f} ${genkat_dir}
done
- cp ${src_dir}/${mode}-${keylen}/_parameters.h ${genkat_dir}
+ cp ${src_dir}/${mode}-${keylen}/parameters.h ${genkat_dir}
cp ${ROOT_DIR}/nist/{api.h,encrypt.c} ${genkat_dir}
cp ${ROOT_DIR}/nist/TestVectorGen/* ${genkat_dir}
diff --git a/test/common.mk b/test/common.mk
index e018a9d..c3182cb 100644
--- a/test/common.mk
+++ b/test/common.mk
@@ -78,14 +78,14 @@ $(results_dir)/test-tweakey: $(results_dir)/src/tweakey.o
# Object => headers dependencies
$(results_dir)/$(src_dir)/cipher.o: $(src_dir)/cipher.h \
-$(src_dir)/tweakey.h $(variant_dir)/_parameters.h
+$(src_dir)/tweakey.h $(variant_dir)/parameters.h
$(results_dir)/$(src_dir)/lilliput-ae-i.o $(results_dir)/$(src_dir)/lilliput-ae-ii.o: \
-$(src_dir)/lilliput-ae.h $(src_dir)/cipher.h $(src_dir)/parameters.h \
-$(variant_dir)/_parameters.h
+$(src_dir)/lilliput-ae.h $(src_dir)/cipher.h $(src_dir)/constants.h \
+$(variant_dir)/parameters.h
$(results_dir)/$(src_dir)/tweakey.o: $(src_dir)/tweakey.h \
-$(src_dir)/parameters.h $(variant_dir)/_parameters.h
+$(src_dir)/constants.h $(variant_dir)/parameters.h
$(results_dir)/test/test-tbc-encrypt.o $(results_dir)/test/test-tbc-decrypt.o $(results_dir)/test/traces-tbc.o: \
$(src_dir)/cipher.h
@@ -95,4 +95,4 @@ $(src_dir)/lilliput-ae.h
# TODO: add valgrind, although it does not seem to play well with ASAN
-# TODO: should use gcc -M... to generate .o -> .h dependencies
+# TODO: use gcc -M... to generate .o -> .h dependencies
diff --git a/test/test-helpers.h b/test/test-helpers.h
index 67b15a1..067b1fe 100644
--- a/test/test-helpers.h
+++ b/test/test-helpers.h
@@ -4,7 +4,7 @@
#include <inttypes.h>
#include <stdio.h>
-#include "parameters.h"
+#include "constants.h"
#define ARRAY_NB(A) (sizeof(A)/sizeof(A[0]))