summaryrefslogtreecommitdiff
path: root/crypto_aead
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@airbus.com>2018-11-21 17:43:50 +0100
committerKévin Le Gouguec <kevin.legouguec@airbus.com>2018-11-21 17:44:23 +0100
commit52abee4e2d33c1bd7805e8c917e0def94045ebd1 (patch)
treee61bca27f858c55b5c59b4e3a18c9f69e36ddc70 /crypto_aead
parentfa8bfd4386a86834bf527988c2a05fbf0336f8cb (diff)
downloadlilliput-ae-implem-52abee4e2d33c1bd7805e8c917e0def94045ebd1.tar.xz
Implémentation de la couche linéaire
Toujours conforme au vecteur de test.
Diffstat (limited to 'crypto_aead')
-rw-r--r--crypto_aead/lilliputaei128v1/ref/cipher.c16
1 files changed, 16 insertions, 0 deletions
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);
}