lilliput-ae-reference-implementation

Implementations of Lilliput-AE submitted to the NIST LWC standardization process
git clone https://git.kevinlegouguec.net/lilliput-ae-reference-implementation
Log | Files | Refs | README

commit 1b4b310cde60372107376c130de1d1950adc8809
parent 4f58d99e11e1c412a600f39f32a8d181765f0246
Author: Kévin Le Gouguec <kevin.legouguec@airbus.com>
Date:   Fri,  5 Jul 2019 15:00:59 +0200

Utilisation de "size_t" pour l'indexation d'un tableau

Cf. db83bae et 5fdd2fd, surtout par souci d'homogénéité.

Diffstat:
Msrc/add_felicsref/cipher.c | 2+-
Msrc/add_threshold/cipher.c | 4++--
Msrc/ref/cipher.c | 2+-
Mtraces/add_threshold/traces-tbc.patch | 4++--
Mtraces/traces-tbc.patch | 4++--
5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/add_felicsref/cipher.c b/src/add_felicsref/cipher.c @@ -77,7 +77,7 @@ static void _compute_round_tweakeys( tweakey_state_init(TK, key, tweak); tweakey_state_extract(TK, 0, RTK[0]); - for (uint8_t i=1; i<ROUNDS; i++) + for (size_t i=1; i<ROUNDS; i++) { tweakey_state_update(TK); tweakey_state_extract(TK, i, RTK[i]); diff --git a/src/add_threshold/cipher.c b/src/add_threshold/cipher.c @@ -103,7 +103,7 @@ static void _state_init( memcpy(X, SHARES_0, BLOCK_BYTES); memcpy(Y, SHARES_1, BLOCK_BYTES); - for (uint8_t i=0; i<BLOCK_BYTES; i++) + for (size_t i=0; i<BLOCK_BYTES; i++) { Z[i] = message[i] ^ SHARES_0[i] ^ SHARES_1[i]; } @@ -122,7 +122,7 @@ static void _compute_round_tweakeys( tweakey_state_init(TK_X, TK_Y, key, tweak); tweakey_state_extract(TK_X, TK_Y, 0, RTK_X[0], RTK_Y[0]); - for (uint8_t i=1; i<ROUNDS; i++) + for (size_t i=1; i<ROUNDS; i++) { tweakey_state_update(TK_X, TK_Y); tweakey_state_extract(TK_X, TK_Y, i, RTK_X[i], RTK_Y[i]); diff --git a/src/ref/cipher.c b/src/ref/cipher.c @@ -75,7 +75,7 @@ static void _compute_round_tweakeys( tweakey_state_init(TK, key, tweak); tweakey_state_extract(TK, 0, RTK[0]); - for (uint8_t i=1; i<ROUNDS; i++) + for (size_t i=1; i<ROUNDS; i++) { tweakey_state_update(TK); tweakey_state_extract(TK, i, RTK[i]); diff --git a/traces/add_threshold/traces-tbc.patch b/traces/add_threshold/traces-tbc.patch @@ -1,5 +1,5 @@ diff --git a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/add_threshold/cipher.c b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/add_threshold/cipher.c -index db1ec04..c92c756 100644 +index 778a100..3b49db5 100644 --- a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/add_threshold/cipher.c +++ b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/add_threshold/cipher.c @@ -25,6 +25,8 @@ throughout the entire round function in order to avoid extra randomness @@ -35,7 +35,7 @@ index db1ec04..c92c756 100644 + debug_dump_buffer("RTK_X", ROUND_TWEAKEY_BYTES, RTK_X[0], 8); + debug_dump_buffer("RTK_Y", ROUND_TWEAKEY_BYTES, RTK_Y[0], 8); + - for (uint8_t i=1; i<ROUNDS; i++) + for (size_t i=1; i<ROUNDS; i++) { tweakey_state_update(TK_X, TK_Y); + debug_dump_buffer("TK_X", TWEAKEY_BYTES, TK_X, 8); diff --git a/traces/traces-tbc.patch b/traces/traces-tbc.patch @@ -1,5 +1,5 @@ diff --git a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c -index 07405e1..0997cac 100644 +index b6b309e..011bc70 100644 --- a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c +++ b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c @@ -17,6 +17,8 @@ http://creativecommons.org/publicdomain/zero/1.0/ @@ -24,7 +24,7 @@ index 07405e1..0997cac 100644 + fprintf(DUMP, " 0\n"); + debug_dump_buffer("RTK", ROUND_TWEAKEY_BYTES, RTK[0], 8); + - for (uint8_t i=1; i<ROUNDS; i++) + for (size_t i=1; i<ROUNDS; i++) { + fprintf(DUMP, " %zu\n", (size_t)i); +