From c30548a179dcd0999bd342b10eeaad2a1a304e90 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Wed, 21 Nov 2018 18:00:22 +0100 Subject: Implémentation de la permutation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Toujours conforme au vecteur de test ! Le test passe, du coup. J'ai un doute sur la gestion des indices de π, ceci dit. --- crypto_aead/lilliputaei128v1/ref/cipher.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crypto_aead/lilliputaei128v1/ref/cipher.c b/crypto_aead/lilliputaei128v1/ref/cipher.c index 7510a00..c866e4c 100644 --- a/crypto_aead/lilliputaei128v1/ref/cipher.c +++ b/crypto_aead/lilliputaei128v1/ref/cipher.c @@ -130,7 +130,19 @@ static void _permutation_layer(cipher_state *X, permutation p) { return; } + debug_dump_buffer(X->debug, " Permutation Layer :", sizeof(X->X), X->X, 10); + + uint8_t X_old[BLOCK_BYTES]; + memcpy(X_old, X, sizeof(X_old)); + + const uint8_t *pi = PERMUTATIONS[p]; + + for (size_t j=0; jX[pi[j]] = X_old[j]; + } + debug_dump_buffer(X->debug, " State permuted :", sizeof(X->X), X->X, 10); } -- cgit v1.2.3