diff options
| author | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-07-04 17:13:57 +0200 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-07-04 17:13:57 +0200 |
| commit | 5fc1268d9c866ac78d3360af51eb0c0201a31167 (patch) | |
| tree | ce7a28187e7c407f6fa56bf4ff4ed29245f8b484 /traces | |
| parent | 7e4b76b05d9a3945b916af09de0f9672abd2b22c (diff) | |
| parent | 649073fb97cb11e4c1057ad25d8b816575fb85c2 (diff) | |
| download | lilliput-ae-implem-5fc1268d9c866ac78d3360af51eb0c0201a31167.tar.xz | |
Merge branch 'fix-tweakey-m4'
Diffstat (limited to 'traces')
| -rw-r--r-- | traces/traces-tbc.patch | 22 |
1 files changed, 11 insertions, 11 deletions
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 <stdint.h> #include <string.h> -@@ -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); } |
