From 4e5d619a69aa79c61986ce3b4ee86486e583eab3 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Mon, 3 Dec 2018 13:57:07 +0100 Subject: Mise à jour du code selon les modifs de !2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tweakey.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/tweakey.c b/src/tweakey.c index 761ec53..d1893e0 100644 --- 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