diff options
| author | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2018-11-21 17:43:50 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2018-11-21 17:44:23 +0100 |
| commit | 52abee4e2d33c1bd7805e8c917e0def94045ebd1 (patch) | |
| tree | e61bca27f858c55b5c59b4e3a18c9f69e36ddc70 /crypto_aead/lilliputaei128v1/ref/cipher.c | |
| parent | fa8bfd4386a86834bf527988c2a05fbf0336f8cb (diff) | |
| download | lilliput-ae-implem-52abee4e2d33c1bd7805e8c917e0def94045ebd1.tar.xz | |
Implémentation de la couche linéaire
Toujours conforme au vecteur de test.
Diffstat (limited to 'crypto_aead/lilliputaei128v1/ref/cipher.c')
| -rw-r--r-- | crypto_aead/lilliputaei128v1/ref/cipher.c | 16 |
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); } |
