summaryrefslogtreecommitdiff
path: root/traces/traces-tbc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'traces/traces-tbc.patch')
-rw-r--r--traces/traces-tbc.patch26
1 files changed, 13 insertions, 13 deletions
diff --git a/traces/traces-tbc.patch b/traces/traces-tbc.patch
index 2b81a6b..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 6f1b4b5..7a2ae05 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 6f1b4b5..7a2ae05 100644
+ fprintf(DUMP, "running EGFN %zu times\n", (size_t)ROUNDS);
+
- for (uint8_t i=0; i<ROUNDS-1; i++)
+ for (size_t i=0; i<ROUNDS-1; i++)
{
-+ fprintf(DUMP, " round %zu\n", (size_t)i);
++ fprintf(DUMP, " round %zu\n", i);
_one_round_egfn(X, RTK[i], PERMUTATION_ENCRYPTION);
}
@@ -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);
}