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 09602fcb6e50fda8245213ac66a340510f21a12f
parent 1b4b310cde60372107376c130de1d1950adc8809
Author: Kévin Le Gouguec <kevin.legouguec@airbus.com>
Date:   Fri,  5 Jul 2019 15:23:04 +0200

Suppression d'une variable intermédiaire dans add_felicsref

Pas sûr que la variable soit utile dans les autres… 🤷

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

diff --git a/CHANGELOG.txt b/CHANGELOG.txt @@ -68,6 +68,9 @@ See reference implementation. Further changes: - Compute round-tweakeys on the fly to save on RAM, instead of storing all pre-computed round-tweakeys. (cipher.c) +- Remove intermediate buffer X in lilliput_tbc_decrypt(), to resemble lilliput_tbc_encrypt(). + (cipher.c) + add_threshold ------------- diff --git a/src/add_felicsref/cipher.c b/src/add_felicsref/cipher.c @@ -168,18 +168,15 @@ void lilliput_tbc_decrypt( uint8_t message[BLOCK_BYTES] ) { - uint8_t X[BLOCK_BYTES]; - _state_init(X, ciphertext); + _state_init(message, ciphertext); uint8_t RTK[ROUNDS][ROUND_TWEAKEY_BYTES]; _compute_round_tweakeys(key, tweak, RTK); for (size_t i=0; i<ROUNDS-1; i++) { - _one_round_egfn(X, RTK[ROUNDS-1-i], PERMUTATION_DECRYPTION); + _one_round_egfn(message, RTK[ROUNDS-1-i], PERMUTATION_DECRYPTION); } - _one_round_egfn(X, RTK[0], PERMUTATION_NONE); - - memcpy(message, X, BLOCK_BYTES); + _one_round_egfn(message, RTK[0], PERMUTATION_NONE); }