From 1b70dc0fdb7c445f526a51ced73e531ac31cf438 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Wed, 21 Nov 2018 10:29:44 +0100 Subject: Implémentation de la multiplication du tweakey MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crypto_aead/lilliputaei128v1/ref/tweakey.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'crypto_aead/lilliputaei128v1/ref/tweakey.c') diff --git a/crypto_aead/lilliputaei128v1/ref/tweakey.c b/crypto_aead/lilliputaei128v1/ref/tweakey.c index d7a5805..71bc030 100644 --- a/crypto_aead/lilliputaei128v1/ref/tweakey.c +++ b/crypto_aead/lilliputaei128v1/ref/tweakey.c @@ -8,6 +8,7 @@ #define LANE_BITS 64 #define LANE_BYTES (LANE_BITS/8) +#define LANES_NB (TWEAKEY_BYTES/LANE_BYTES) static void _dump_buffer(FILE *output, size_t len, const uint8_t buf[len], int indent) @@ -90,8 +91,22 @@ static void _permute_state(tweakey_state *TK) } } -static void _multiply_state(__attribute__((unused)) tweakey_state *TK) +static void _multiply_state(tweakey_state *TK) { + /* Lane 0 is multiplied by Id; lane 1 by P_0, lane 2 by P_1... */ + + for (size_t lane=1; laneTK[offset] = P_lane[TK->TK[offset]]; + } + } } void tweakey_state_update(tweakey_state *TK) -- cgit v1.2.3