From fa8bfd4386a86834bf527988c2a05fbf0336f8cb Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Wed, 21 Nov 2018 17:39:25 +0100 Subject: Implémentation de la couche non-linéaire MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So far so good. --- crypto_aead/lilliputaei128v1/ref/cipher.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'crypto_aead/lilliputaei128v1/ref/cipher.c') diff --git a/crypto_aead/lilliputaei128v1/ref/cipher.c b/crypto_aead/lilliputaei128v1/ref/cipher.c index aa51bf8..44d22cb 100644 --- a/crypto_aead/lilliputaei128v1/ref/cipher.c +++ b/crypto_aead/lilliputaei128v1/ref/cipher.c @@ -4,6 +4,7 @@ #include #include "cipher.h" +#include "constants.h" #include "parameters.h" #include "tweakey.h" @@ -78,8 +79,26 @@ static void _nonlinear_layer(cipher_state *X, const uint8_t RTK[ROUND_TWEAKEY_BY { debug_dump_buffer(X->debug, " Non Linear Layer :", sizeof(X->X), X->X, 10); debug_dump_buffer(X->debug, " Subtweakey :", ROUND_TWEAKEY_BYTES, RTK, 66); - debug_dump_buffer(X->debug, " Variables xored :", ROUND_TWEAKEY_BYTES, RTK, 66); - debug_dump_buffer(X->debug, " Variables sboxed :", ROUND_TWEAKEY_BYTES, RTK, 66); + + uint8_t F[ROUND_TWEAKEY_BYTES]; + for (size_t j=0; jX[j] ^ RTK[j]; + } + debug_dump_buffer(X->debug, " Variables xored :", sizeof(F), F, 66); + + for (size_t j=0; jdebug, " Variables sboxed :", sizeof(F), F, 66); + + for (size_t j=0; j<8; j++) + { + size_t dest_j = 15-j; + X->X[dest_j] ^= F[j]; + } + debug_dump_buffer(X->debug, " State non linearized :", sizeof(X->X), X->X, 10); } -- cgit v1.2.3