From 52abee4e2d33c1bd7805e8c917e0def94045ebd1 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Wed, 21 Nov 2018 17:43:50 +0100 Subject: Implémentation de la couche linéaire MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Toujours conforme au vecteur de test. --- crypto_aead/lilliputaei128v1/ref/cipher.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crypto_aead/lilliputaei128v1/ref/cipher.c b/crypto_aead/lilliputaei128v1/ref/cipher.c index 44d22cb..7510a00 100644 --- a/crypto_aead/lilliputaei128v1/ref/cipher.c +++ b/crypto_aead/lilliputaei128v1/ref/cipher.c @@ -105,6 +105,22 @@ static void _nonlinear_layer(cipher_state *X, const uint8_t RTK[ROUND_TWEAKEY_BY static void _linear_layer(cipher_state *X) { debug_dump_buffer(X->debug, " Linear Layer :", sizeof(X->X), X->X, 10); + + X->X[15] ^= X->X[1]; + X->X[15] ^= X->X[2]; + X->X[15] ^= X->X[3]; + X->X[15] ^= X->X[4]; + X->X[15] ^= X->X[5]; + X->X[15] ^= X->X[6]; + X->X[15] ^= X->X[7]; + + X->X[14] ^= X->X[7]; + X->X[13] ^= X->X[7]; + X->X[12] ^= X->X[7]; + X->X[11] ^= X->X[7]; + X->X[10] ^= X->X[7]; + X->X[9] ^= X->X[7]; + debug_dump_buffer(X->debug, " State linearized :", sizeof(X->X), X->X, 10); } -- cgit v1.2.3