From 38dd8896682365a01a6cbbec97631b9ed7573953 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Mon, 20 May 2019 14:06:58 +0200 Subject: Mise à jour du patch de traces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- traces/traces-tbc.patch | 64 ++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 36 deletions(-) diff --git a/traces/traces-tbc.patch b/traces/traces-tbc.patch index 5dc749e..2b81a6b 100644 --- a/traces/traces-tbc.patch +++ b/traces/traces-tbc.patch @@ -1,8 +1,8 @@ diff --git a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c -index 48144d4..3b5f36c 100644 +index 6f1b4b5..7a2ae05 100644 --- a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c +++ b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/cipher.c -@@ -15,6 +15,8 @@ http://creativecommons.org/publicdomain/zero/1.0/ +@@ -17,6 +17,8 @@ http://creativecommons.org/publicdomain/zero/1.0/ This file provides the implementation for Lilliput-TBC. */ @@ -11,7 +11,7 @@ index 48144d4..3b5f36c 100644 #include #include -@@ -69,40 +71,61 @@ static void _compute_round_tweakeys( +@@ -71,33 +73,53 @@ static void _compute_round_tweakeys( uint8_t RTK[ROUNDS][ROUND_TWEAKEY_BYTES] ) { @@ -36,53 +36,45 @@ index 48144d4..3b5f36c 100644 } + static uint8_t _Fj(uint8_t Xj, uint8_t RTKj) + { ++ fprintf(DUMP, " Xj: %02x; S[Xj]: %02x; RTKj: %02x; Fj: %02x\n", Xj, S[Xj], RTKj, S[Xj ^ RTKj]); + return S[Xj ^ RTKj]; + } + static void _nonlinear_layer(uint8_t X[BLOCK_BYTES], const uint8_t RTK[ROUND_TWEAKEY_BYTES]) { + fprintf(DUMP, " nonlinear layer\n"); + + debug_dump_buffer("X", BLOCK_BYTES, X, 12); -+ - uint8_t F[ROUND_TWEAKEY_BYTES]; - for (size_t j=0; j #include -@@ -52,10 +54,16 @@ void tweakey_state_extract( +@@ -54,10 +56,16 @@ void tweakey_state_extract( { const uint8_t *TKj = TK + j*LANE_BYTES; @@ -146,7 +138,7 @@ index 39e5980..4cdcf2a 100644 } round_tweakey[0] ^= round_constant; -@@ -165,6 +173,10 @@ static const matrix_multiplication ALPHAS[6] = { +@@ -160,6 +168,10 @@ static const matrix_multiplication ALPHAS[6] = { _multiply_MR3 }; @@ -157,7 +149,7 @@ index 39e5980..4cdcf2a 100644 void tweakey_state_update(uint8_t TK[TWEAKEY_BYTES]) { -@@ -178,5 +190,9 @@ void tweakey_state_update(uint8_t TK[TWEAKEY_BYTES]) +@@ -173,5 +185,9 @@ void tweakey_state_update(uint8_t TK[TWEAKEY_BYTES]) memcpy(TKj_old, TKj, LANE_BYTES); ALPHAS[j-1](TKj_old, TKj); -- cgit v1.2.3