From ff54e8b4a758d35f4a1d4e0b0303092e7d96da0e Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Tue, 5 Feb 2019 08:44:52 +0100 Subject: Renommage des entêtes de constantes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. 🤷 --- src/add_tweakeyloop/constants.h | 1 + src/add_tweakeyloop/parameters.h | 1 - src/add_tweakeyloop/tweakey.c | 2 +- src/add_tweakeysequences/constants.h | 1 + src/add_tweakeysequences/parameters.h | 1 - src/add_tweakeysequences/tweakey.c | 2 +- src/i-128/_parameters.h | 9 --------- src/i-128/parameters.h | 9 +++++++++ src/i-192/_parameters.h | 9 --------- src/i-192/parameters.h | 9 +++++++++ src/i-256/_parameters.h | 9 --------- src/i-256/parameters.h | 9 +++++++++ src/ii-128/_parameters.h | 9 --------- src/ii-128/parameters.h | 9 +++++++++ src/ii-192/_parameters.h | 9 --------- src/ii-192/parameters.h | 9 +++++++++ src/ii-256/_parameters.h | 9 --------- src/ii-256/parameters.h | 9 +++++++++ src/ref/ae-common.h | 2 +- src/ref/cipher.c | 2 +- src/ref/cipher.h | 2 +- src/ref/constants.h | 20 ++++++++++++++++++++ src/ref/lilliput-ae.h | 2 +- src/ref/parameters.h | 20 -------------------- src/ref/tweakey.c | 2 +- src/ref/tweakey.h | 2 +- 26 files changed, 84 insertions(+), 84 deletions(-) create mode 120000 src/add_tweakeyloop/constants.h delete mode 120000 src/add_tweakeyloop/parameters.h create mode 120000 src/add_tweakeysequences/constants.h delete mode 120000 src/add_tweakeysequences/parameters.h delete mode 100644 src/i-128/_parameters.h create mode 100644 src/i-128/parameters.h delete mode 100644 src/i-192/_parameters.h create mode 100644 src/i-192/parameters.h delete mode 100644 src/i-256/_parameters.h create mode 100644 src/i-256/parameters.h delete mode 100644 src/ii-128/_parameters.h create mode 100644 src/ii-128/parameters.h delete mode 100644 src/ii-192/_parameters.h create mode 100644 src/ii-192/parameters.h delete mode 100644 src/ii-256/_parameters.h create mode 100644 src/ii-256/parameters.h create mode 100644 src/ref/constants.h delete mode 100644 src/ref/parameters.h (limited to 'src') 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 #include -#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 #include -#include "parameters.h" +#include "constants.h" #include "tweakey.h" diff --git a/src/i-128/_parameters.h b/src/i-128/_parameters.h deleted file mode 100644 index 08ce8c1..0000000 --- a/src/i-128/_parameters.h +++ /dev/null @@ -1,9 +0,0 @@ -#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/src/i-128/parameters.h b/src/i-128/parameters.h new file mode 100644 index 0000000..c1165b1 --- /dev/null +++ b/src/i-128/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/src/i-192/_parameters.h b/src/i-192/_parameters.h deleted file mode 100644 index d1dc476..0000000 --- a/src/i-192/_parameters.h +++ /dev/null @@ -1,9 +0,0 @@ -#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/src/i-192/parameters.h b/src/i-192/parameters.h new file mode 100644 index 0000000..295c8b0 --- /dev/null +++ b/src/i-192/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/src/i-256/_parameters.h b/src/i-256/_parameters.h deleted file mode 100644 index d948ac5..0000000 --- a/src/i-256/_parameters.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _PARAMETERS_H -#define _PARAMETERS_H - -#define KEY_LENGTH_BITS 256 -#define ROUNDS 42 - -#define TWEAK_LENGTH_BITS 192 - -#endif /* _PARAMETERS_H */ diff --git a/src/i-256/parameters.h b/src/i-256/parameters.h new file mode 100644 index 0000000..782611b --- /dev/null +++ b/src/i-256/parameters.h @@ -0,0 +1,9 @@ +#ifndef PARAMETERS_H +#define PARAMETERS_H + +#define KEY_LENGTH_BITS 256 +#define ROUNDS 42 + +#define TWEAK_LENGTH_BITS 192 + +#endif /* PARAMETERS_H */ diff --git a/src/ii-128/_parameters.h b/src/ii-128/_parameters.h deleted file mode 100644 index 147730d..0000000 --- a/src/ii-128/_parameters.h +++ /dev/null @@ -1,9 +0,0 @@ -#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/src/ii-128/parameters.h b/src/ii-128/parameters.h new file mode 100644 index 0000000..bf3936d --- /dev/null +++ b/src/ii-128/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/src/ii-192/_parameters.h b/src/ii-192/_parameters.h deleted file mode 100644 index 8b76285..0000000 --- a/src/ii-192/_parameters.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _PARAMETERS_H -#define _PARAMETERS_H - -#define KEY_LENGTH_BITS 192 -#define ROUNDS 36 - -#define TWEAK_LENGTH_BITS 128 - -#endif /* _PARAMETERS_H */ diff --git a/src/ii-192/parameters.h b/src/ii-192/parameters.h new file mode 100644 index 0000000..bfb541e --- /dev/null +++ b/src/ii-192/parameters.h @@ -0,0 +1,9 @@ +#ifndef PARAMETERS_H +#define PARAMETERS_H + +#define KEY_LENGTH_BITS 192 +#define ROUNDS 36 + +#define TWEAK_LENGTH_BITS 128 + +#endif /* PARAMETERS_H */ diff --git a/src/ii-256/_parameters.h b/src/ii-256/_parameters.h deleted file mode 100644 index 8bd0430..0000000 --- a/src/ii-256/_parameters.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _PARAMETERS_H -#define _PARAMETERS_H - -#define KEY_LENGTH_BITS 256 -#define ROUNDS 42 - -#define TWEAK_LENGTH_BITS 128 - -#endif /* _PARAMETERS_H */ diff --git a/src/ii-256/parameters.h b/src/ii-256/parameters.h new file mode 100644 index 0000000..1255859 --- /dev/null +++ b/src/ii-256/parameters.h @@ -0,0 +1,9 @@ +#ifndef PARAMETERS_H +#define PARAMETERS_H + +#define KEY_LENGTH_BITS 256 +#define ROUNDS 42 + +#define TWEAK_LENGTH_BITS 128 + +#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 #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 #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 -#include "parameters.h" +#include "constants.h" void lilliput_tbc_encrypt( diff --git a/src/ref/constants.h b/src/ref/constants.h new file mode 100644 index 0000000..063c8af --- /dev/null +++ b/src/ref/constants.h @@ -0,0 +1,20 @@ +#ifndef CONSTANTS_H +#define CONSTANTS_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 /* 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 #include -#include "parameters.h" +#include "constants.h" void lilliput_ae_encrypt( diff --git a/src/ref/parameters.h b/src/ref/parameters.h deleted file mode 100644 index 681a152..0000000 --- a/src/ref/parameters.h +++ /dev/null @@ -1,20 +0,0 @@ -#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 */ 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 #include -#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 -#include "parameters.h" +#include "constants.h" void tweakey_state_init( -- cgit v1.2.3