From 98d53334c29ff65e0e000bb4e9f4e16e51bc1071 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Tue, 2 Jul 2019 10:10:59 +0200 Subject: Mise à jour des patchs de génération de traces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- traces/traces-tbc.patch | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'traces') diff --git a/traces/traces-tbc.patch b/traces/traces-tbc.patch index 2b81a6b..f03cdfc 100644 --- a/traces/traces-tbc.patch +++ b/traces/traces-tbc.patch @@ -1,5 +1,5 @@ diff --git a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c -index 6f1b4b5..7a2ae05 100644 +index 8ebbbc3..c622374 100644 --- a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c +++ b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c @@ -17,6 +17,8 @@ http://creativecommons.org/publicdomain/zero/1.0/ @@ -109,11 +109,11 @@ index 6f1b4b5..7a2ae05 100644 memcpy(ciphertext, X, BLOCK_BYTES); diff --git a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/tweakey.c b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/tweakey.c -index 78c6060..75e9290 100644 +index 510f35a..4bf027c 100644 --- a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/tweakey.c +++ b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/tweakey.c -@@ -19,6 +19,8 @@ where multiplications by matrices M and M_R to the power n are performed - by functions expressing the exponentiated matrices with shifts and XORs. +@@ -17,6 +17,8 @@ http://creativecommons.org/publicdomain/zero/1.0/ + This file provides the implementation of Lilliput-TBC's tweakey schedule. */ +#include "debug.h" @@ -121,7 +121,7 @@ index 78c6060..75e9290 100644 #include #include -@@ -54,10 +56,16 @@ void tweakey_state_extract( +@@ -51,10 +53,16 @@ void tweakey_state_extract( { const uint8_t *TKj = TK + j*LANE_BYTES; @@ -138,23 +138,23 @@ index 78c6060..75e9290 100644 } round_tweakey[0] ^= round_constant; -@@ -160,6 +168,10 @@ static const matrix_multiplication ALPHAS[6] = { +@@ -73,6 +81,10 @@ static const matrix_multiplication ALPHAS[7] = { _multiply_MR3 }; -+static char const * const ALPHAS_STR[6] = { -+ "M", "M²", "M³", "MR", "MR²", "MR³" ++static char const * const ALPHAS_STR[7] = { ++ "M", "M²", "M³", "M⁴", "MR", "MR²", "MR³" +}; + void tweakey_state_update(uint8_t TK[TWEAKEY_BYTES]) { -@@ -173,5 +185,9 @@ void tweakey_state_update(uint8_t TK[TWEAKEY_BYTES]) +@@ -84,5 +96,9 @@ void tweakey_state_update(uint8_t TK[TWEAKEY_BYTES]) memcpy(TKj_old, TKj, LANE_BYTES); - ALPHAS[j-1](TKj_old, TKj); + ALPHAS[j](TKj_old, TKj); + -+ fprintf(DUMP, " multiplying lane %zu/%zu by %s\n", 1+j, (size_t)LANES_NB, ALPHAS_STR[j-1]); ++ fprintf(DUMP, " multiplying lane %zu/%zu by %s\n", 1+j, (size_t)LANES_NB, ALPHAS_STR[j]); + debug_dump_buffer("TK_j^i-1", LANE_BYTES, TKj_old, 12); + debug_dump_buffer("TK_j^i", LANE_BYTES, TKj, 12); } -- cgit v1.2.3 From 905416c5b9834d776683bb56ab305baa652028d4 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Fri, 5 Jul 2019 10:24:12 +0200 Subject: Correction du patch de traces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cassé par b29cc9d. Léger ajustement du Makefile pour que les plantages soient plus simples à comprendre. --- Makefile | 2 +- traces/traces-tbc.patch | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'traces') diff --git a/Makefile b/Makefile index 2b9e4e0..00d6f66 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ test: $(test_variants) traces: traces-ae traces-tbc traces-%: | results - @ echo "Collecting traces" + @ echo "Collecting $@" @ ./traces/collect-traces.sh $@ nist: diff --git a/traces/traces-tbc.patch b/traces/traces-tbc.patch index f03cdfc..ff36123 100644 --- a/traces/traces-tbc.patch +++ b/traces/traces-tbc.patch @@ -1,5 +1,5 @@ diff --git a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c -index 8ebbbc3..c622374 100644 +index 07405e1..0997cac 100644 --- a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c +++ b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c @@ -17,6 +17,8 @@ http://creativecommons.org/publicdomain/zero/1.0/ @@ -98,9 +98,9 @@ index 8ebbbc3..c622374 100644 + fprintf(DUMP, "running EGFN %zu times\n", (size_t)ROUNDS); + - for (uint8_t i=0; i Date: Fri, 5 Jul 2019 10:32:33 +0200 Subject: Correction du patch de traces *pour l'implémentation threshold* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤦 --- traces/add_threshold/traces-tbc.patch | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'traces') diff --git a/traces/add_threshold/traces-tbc.patch b/traces/add_threshold/traces-tbc.patch index f1d897d..ac239fa 100644 --- a/traces/add_threshold/traces-tbc.patch +++ b/traces/add_threshold/traces-tbc.patch @@ -240,7 +240,7 @@ index a966a8e..8d5f2cc 100644 + out[i] = i; } diff --git a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/add_threshold/tweakey.c b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/add_threshold/tweakey.c -index e228a69..b1aadc6 100644 +index 7822564..e1abbb6 100644 --- a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/add_threshold/tweakey.c +++ b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/add_threshold/tweakey.c @@ -20,6 +20,8 @@ This file provides a first-order threshold implementation of Lilliput-TBC's @@ -252,7 +252,7 @@ index e228a69..b1aadc6 100644 #include #include -@@ -42,6 +44,7 @@ void tweakey_state_init( +@@ -43,6 +45,7 @@ void tweakey_state_init( { uint8_t SHARES_0[KEY_BYTES]; randombytes(sizeof(SHARES_0), SHARES_0); @@ -260,7 +260,7 @@ index e228a69..b1aadc6 100644 memcpy(TK_Y, SHARES_0, KEY_BYTES); memcpy(TK_X, tweak, TWEAK_BYTES); -@@ -67,10 +70,16 @@ void tweakey_state_extract( +@@ -68,20 +71,32 @@ void tweakey_state_extract( { const uint8_t *TKj_X = TK_X + j*LANE_BYTES; @@ -276,8 +276,7 @@ index e228a69..b1aadc6 100644 + debug_dump_buffer("=> RTK_X", ROUND_TWEAKEY_BYTES, round_tweakey_X, 12); } - -@@ -78,10 +87,16 @@ void tweakey_state_extract( + for (size_t j=0; j