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 8a8950699eb8bb9cd29311d32d003431a4472ae4
parent 156b597dbe5900635fd629fd95783917b7c964d8
Author: Kévin Le Gouguec <kevin.legouguec@airbus.com>
Date:   Mon,  3 Dec 2018 10:28:12 +0100

Nettoyage du code du key schedule

Diffstat:
Msrc/tweakey.c | 12++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/tweakey.c b/src/tweakey.c @@ -47,8 +47,6 @@ static void _permute_state(tweakey_state *TK) uint8_t TK_old[TWEAKEY_BYTES]; memcpy(TK_old, TK->TK, sizeof(TK_old)); - /* TODO: homogenize indices; here j=lane; k=byte */ - for (size_t j=0; j<TWEAKEY_BYTES; j+=LANE_BYTES) { for (size_t k=0; k<LANE_BYTES; k++) @@ -62,15 +60,13 @@ static void _multiply_state(tweakey_state *TK) { /* Lane 0 is multiplied by Id; lane 1 by P_0, lane 2 by P_1... */ - for (size_t lane=1; lane<LANES_NB; lane++) + for (size_t j=1; j<LANES_NB; j++) { - const uint8_t* P_lane = P[lane-1]; - - /* TODO: homogenize indices; here b=byte */ + const uint8_t *P_lane = P[j-1]; - for (size_t b=0; b<LANE_BYTES; b++) + for (size_t k=0; k<LANE_BYTES; k++) { - size_t offset = lane*LANE_BYTES + b; + size_t offset = j*LANE_BYTES + k; TK->TK[offset] = P_lane[TK->TK[offset]]; } }