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 5fdd2fd67a68d43830300c3ddf4440478ff73cfd
parent 5fc1268d9c866ac78d3360af51eb0c0201a31167
Author: Kévin Le Gouguec <kevin.legouguec@airbus.com>
Date:   Fri,  5 Jul 2019 09:48:32 +0200

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

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

Diffstat:
MCHANGELOG.txt | 6+++---
Msrc/add_felicsref/cipher.c | 4++--
Msrc/ref/cipher.c | 4++--
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/CHANGELOG.txt b/CHANGELOG.txt @@ -34,6 +34,9 @@ These modifications are structural and/or stylistic and do not change the algori - Extract tweakey multiplications into their own header file, so that other implementations can make more targeted changes. (constants.h, multiplications.h, tweakey.c) +- Use size_t to iterate on arrays in lilliput_tbc_encrypt() and lilliput_tbc_decrypt(). + (cipher.c) + add_threshold ------------- @@ -45,9 +48,6 @@ See reference implementation. See reference implementation. Further cleanups: -- Use size_t to iterate on arrays in lilliput_tbc_encrypt() and lilliput_tbc_decrypt(). - (cipher.c) - - Add constant macros KEY_LANES_NB and TWEAK_LANES_NB to make tweakey schedule code more legible. (tweakey.c) diff --git a/src/add_felicsref/cipher.c b/src/add_felicsref/cipher.c @@ -150,7 +150,7 @@ void lilliput_tbc_encrypt( uint8_t RTK[ROUND_TWEAKEY_BYTES]; tweakey_state_init(TK, key, tweak); - for (unsigned i=0; i<ROUNDS-1; i++) + for (size_t i=0; i<ROUNDS-1; i++) { tweakey_state_extract(TK, i, RTK); _one_round_egfn(ciphertext, RTK, PERMUTATION_ENCRYPTION); @@ -174,7 +174,7 @@ void lilliput_tbc_decrypt( uint8_t RTK[ROUNDS][ROUND_TWEAKEY_BYTES]; _compute_round_tweakeys(key, tweak, RTK); - for (uint8_t i=0; i<ROUNDS-1; i++) + for (size_t i=0; i<ROUNDS-1; i++) { _one_round_egfn(X, RTK[ROUNDS-1-i], PERMUTATION_DECRYPTION); } diff --git a/src/ref/cipher.c b/src/ref/cipher.c @@ -148,7 +148,7 @@ void lilliput_tbc_encrypt( uint8_t RTK[ROUNDS][ROUND_TWEAKEY_BYTES]; _compute_round_tweakeys(key, tweak, RTK); - for (uint8_t i=0; i<ROUNDS-1; i++) + for (size_t i=0; i<ROUNDS-1; i++) { _one_round_egfn(X, RTK[i], PERMUTATION_ENCRYPTION); } @@ -171,7 +171,7 @@ void lilliput_tbc_decrypt( uint8_t RTK[ROUNDS][ROUND_TWEAKEY_BYTES]; _compute_round_tweakeys(key, tweak, RTK); - for (uint8_t i=0; i<ROUNDS-1; i++) + for (size_t i=0; i<ROUNDS-1; i++) { _one_round_egfn(X, RTK[ROUNDS-1-i], PERMUTATION_DECRYPTION); }