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 4e5d619a69aa79c61986ce3b4ee86486e583eab3
parent 85a50344c964d0a57b09c7d03974c83b5d07932d
Author: Kévin Le Gouguec <kevin.legouguec@airbus.com>
Date:   Mon,  3 Dec 2018 13:57:07 +0100

Mise à jour du code selon les modifs de !2

Diffstat:
Msrc/tweakey.c | 14+++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/tweakey.c b/src/tweakey.c @@ -58,16 +58,24 @@ static void _permute_state(uint8_t TK[TWEAKEY_BYTES]) static void _multiply_state(uint8_t TK[TWEAKEY_BYTES]) { - /* Lane 0 is multiplied by Id; lane 1 by P_0, lane 2 by P_1... */ + /* Each byte in lane 0 is multiplied by alpha_0 = 1, i.e. it + * remains unchanged. + * + * Each byte b in lanes j = { 1, ..., p-1 } is multiplied by + * alpha_j; the result of b*alpha_j is stored in P_j[b]. + * + * In this implementation, P_j sequences are stored in array P; + * P_j = P[j-1]. + */ for (size_t j=1; j<LANES_NB; j++) { - const uint8_t *P_lane = P[j-1]; + const uint8_t *P_j = P[j-1]; for (size_t k=0; k<LANE_BYTES; k++) { size_t offset = j*LANE_BYTES + k; - TK[offset] = P_lane[TK[offset]]; + TK[offset] = P_j[TK[offset]]; } } }