From 9f8820ccd190648b6d254afc1f20b95fbcd50231 Mon Sep 17 00:00:00 2001 From: Martin Schläffer Date: Wed, 7 Oct 2020 07:52:32 +0000 Subject: [PATCH] ascon update --- ascon/Implementations/CMakeLists.txt | 3 +-- ascon/Implementations/crypto_aead/ascon128av12/bi32/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon128av12/bi32_arm/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon128av12/bi32_lowreg/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/ascon.c | 3 +++ ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/process.c | 2 -- ascon/Implementations/crypto_aead/ascon128av12/opt64/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/ascon.c | 3 +++ ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/process.c | 2 -- ascon/Implementations/crypto_aead/ascon128v12/bi32/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon128v12/bi32_arm/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon128v12/bi32_lowreg/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon128v12/bi32_lowsize/ascon.c | 3 +++ ascon/Implementations/crypto_aead/ascon128v12/bi32_lowsize/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon128v12/opt64/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon128v12/opt64_lowsize/ascon.c | 3 +++ ascon/Implementations/crypto_aead/ascon128v12/opt64_lowsize/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon80pqv12/bi32/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon80pqv12/bi32_lowsize/ascon.c | 3 +++ ascon/Implementations/crypto_aead/ascon80pqv12/bi32_lowsize/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon80pqv12/opt64/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_aead/ascon80pqv12/opt64_lowsize/ascon.c | 3 +++ ascon/Implementations/crypto_aead/ascon80pqv12/opt64_lowsize/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_hash/asconhashv12/bi32/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_hash/asconhashv12/bi32_arm/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_hash/asconhashv12/bi32_lowreg/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_hash/asconhashv12/bi32_lowsize/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_hash/asconhashv12/opt64/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_hash/asconhashv12/opt64_lowsize/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_hash/asconxofv12/bi32/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_hash/asconxofv12/opt64/permutations.c | 15 ++++++++++++--- ascon/Implementations/crypto_hash/asconxofv12/opt64_lowsize/permutations.c | 15 ++++++++++++--- 34 files changed, 319 insertions(+), 81 deletions(-) diff --git a/ascon/Implementations/CMakeLists.txt b/ascon/Implementations/CMakeLists.txt index 08bbf6b..99a1754 100644 --- a/ascon/Implementations/CMakeLists.txt +++ b/ascon/Implementations/CMakeLists.txt @@ -5,8 +5,7 @@ enable_testing() # set the default version, algorithms, implementations, tests, flags, defs set(DEFAULT_VERSIONS v12) set(DEFAULT_ALGS ascon128 ascon128a ascon80pq asconhash asconxof) -set(DEFAULT_IMPLS ref opt64 opt64_lowsize bi32 bi32_lowsize bi32_lowreg bi16 bi8 - opt64_2shares opt64_3shares bi32_2shares bi32_3shares) +set(DEFAULT_IMPLS ref opt64 opt64_lowsize bi32 bi32_lowsize bi32_lowreg bi16 bi8) set(DEFAULT_TESTS genkat getcycles) set(DEFAULT_REL_FLAGS -std=c99 -O2 -fomit-frame-pointer -march=native -mtune=native) set(DEFAULT_DBG_FLAGS -std=c99 -O2 -Wall -Wextra -Wshadow) diff --git a/ascon/Implementations/crypto_aead/ascon128av12/bi32/permutations.c b/ascon/Implementations/crypto_aead/ascon128av12/bi32/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_aead/ascon128av12/bi32/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon128av12/bi32/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon128av12/bi32_arm/permutations.c b/ascon/Implementations/crypto_aead/ascon128av12/bi32_arm/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_aead/ascon128av12/bi32_arm/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon128av12/bi32_arm/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowreg/permutations.c b/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowreg/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowreg/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowreg/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/ascon.c b/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/ascon.c index 5e60f1a..84b754b 100644 --- a/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/ascon.c +++ b/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/ascon.c @@ -40,8 +40,11 @@ void ascon_core(state_t* s, uint8_t* out, const uint8_t* in, uint64_t tlen, PB(s); } XOR(s->x4, WORD_T(1)); + printstate("process associated data", s); /* process plaintext/ciphertext */ process_data(s, out, in, tlen, mode); + if (mode == ASCON_ENC) printstate("process plaintext", s); + if (mode == ASCON_DEC) printstate("process ciphertext", s); /* finalization */ if (CRYPTO_KEYBYTES == 16 && ASCON_RATE == 8) { XOR(s->x1, K1); diff --git a/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/permutations.c b/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/process.c b/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/process.c index 2ec9d1f..7208ed7 100644 --- a/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/process.c +++ b/ascon/Implementations/crypto_aead/ascon128av12/bi32_lowsize/process.c @@ -7,8 +7,6 @@ void process_data(state_t* s, uint8_t* out, const uint8_t* in, uint64_t len, uint8_t mode) { word_t tmp0, tmp1; - uint64_t t0, t1; - uint64_t i; while (len >= ASCON_RATE) { tmp0 = LOAD64(in); diff --git a/ascon/Implementations/crypto_aead/ascon128av12/opt64/permutations.c b/ascon/Implementations/crypto_aead/ascon128av12/opt64/permutations.c index 3aecaa6..8d39320 100644 --- a/ascon/Implementations/crypto_aead/ascon128av12/opt64/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon128av12/opt64/permutations.c @@ -13,14 +13,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/ascon.c b/ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/ascon.c index 5e60f1a..84b754b 100644 --- a/ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/ascon.c +++ b/ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/ascon.c @@ -40,8 +40,11 @@ void ascon_core(state_t* s, uint8_t* out, const uint8_t* in, uint64_t tlen, PB(s); } XOR(s->x4, WORD_T(1)); + printstate("process associated data", s); /* process plaintext/ciphertext */ process_data(s, out, in, tlen, mode); + if (mode == ASCON_ENC) printstate("process plaintext", s); + if (mode == ASCON_DEC) printstate("process ciphertext", s); /* finalization */ if (CRYPTO_KEYBYTES == 16 && ASCON_RATE == 8) { XOR(s->x1, K1); diff --git a/ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/permutations.c b/ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/permutations.c index 3aecaa6..8d39320 100644 --- a/ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/permutations.c @@ -13,14 +13,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/process.c b/ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/process.c index 2ec9d1f..7208ed7 100644 --- a/ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/process.c +++ b/ascon/Implementations/crypto_aead/ascon128av12/opt64_lowsize/process.c @@ -7,8 +7,6 @@ void process_data(state_t* s, uint8_t* out, const uint8_t* in, uint64_t len, uint8_t mode) { word_t tmp0, tmp1; - uint64_t t0, t1; - uint64_t i; while (len >= ASCON_RATE) { tmp0 = LOAD64(in); diff --git a/ascon/Implementations/crypto_aead/ascon128v12/bi32/permutations.c b/ascon/Implementations/crypto_aead/ascon128v12/bi32/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_aead/ascon128v12/bi32/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon128v12/bi32/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon128v12/bi32_arm/permutations.c b/ascon/Implementations/crypto_aead/ascon128v12/bi32_arm/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_aead/ascon128v12/bi32_arm/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon128v12/bi32_arm/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon128v12/bi32_lowreg/permutations.c b/ascon/Implementations/crypto_aead/ascon128v12/bi32_lowreg/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_aead/ascon128v12/bi32_lowreg/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon128v12/bi32_lowreg/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon128v12/bi32_lowsize/ascon.c b/ascon/Implementations/crypto_aead/ascon128v12/bi32_lowsize/ascon.c index 5e60f1a..84b754b 100644 --- a/ascon/Implementations/crypto_aead/ascon128v12/bi32_lowsize/ascon.c +++ b/ascon/Implementations/crypto_aead/ascon128v12/bi32_lowsize/ascon.c @@ -40,8 +40,11 @@ void ascon_core(state_t* s, uint8_t* out, const uint8_t* in, uint64_t tlen, PB(s); } XOR(s->x4, WORD_T(1)); + printstate("process associated data", s); /* process plaintext/ciphertext */ process_data(s, out, in, tlen, mode); + if (mode == ASCON_ENC) printstate("process plaintext", s); + if (mode == ASCON_DEC) printstate("process ciphertext", s); /* finalization */ if (CRYPTO_KEYBYTES == 16 && ASCON_RATE == 8) { XOR(s->x1, K1); diff --git a/ascon/Implementations/crypto_aead/ascon128v12/bi32_lowsize/permutations.c b/ascon/Implementations/crypto_aead/ascon128v12/bi32_lowsize/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_aead/ascon128v12/bi32_lowsize/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon128v12/bi32_lowsize/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon128v12/opt64/permutations.c b/ascon/Implementations/crypto_aead/ascon128v12/opt64/permutations.c index 3aecaa6..8d39320 100644 --- a/ascon/Implementations/crypto_aead/ascon128v12/opt64/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon128v12/opt64/permutations.c @@ -13,14 +13,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon128v12/opt64_lowsize/ascon.c b/ascon/Implementations/crypto_aead/ascon128v12/opt64_lowsize/ascon.c index 5e60f1a..84b754b 100644 --- a/ascon/Implementations/crypto_aead/ascon128v12/opt64_lowsize/ascon.c +++ b/ascon/Implementations/crypto_aead/ascon128v12/opt64_lowsize/ascon.c @@ -40,8 +40,11 @@ void ascon_core(state_t* s, uint8_t* out, const uint8_t* in, uint64_t tlen, PB(s); } XOR(s->x4, WORD_T(1)); + printstate("process associated data", s); /* process plaintext/ciphertext */ process_data(s, out, in, tlen, mode); + if (mode == ASCON_ENC) printstate("process plaintext", s); + if (mode == ASCON_DEC) printstate("process ciphertext", s); /* finalization */ if (CRYPTO_KEYBYTES == 16 && ASCON_RATE == 8) { XOR(s->x1, K1); diff --git a/ascon/Implementations/crypto_aead/ascon128v12/opt64_lowsize/permutations.c b/ascon/Implementations/crypto_aead/ascon128v12/opt64_lowsize/permutations.c index 3aecaa6..8d39320 100644 --- a/ascon/Implementations/crypto_aead/ascon128v12/opt64_lowsize/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon128v12/opt64_lowsize/permutations.c @@ -13,14 +13,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon80pqv12/bi32/permutations.c b/ascon/Implementations/crypto_aead/ascon80pqv12/bi32/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_aead/ascon80pqv12/bi32/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon80pqv12/bi32/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon80pqv12/bi32_lowsize/ascon.c b/ascon/Implementations/crypto_aead/ascon80pqv12/bi32_lowsize/ascon.c index 5e60f1a..84b754b 100644 --- a/ascon/Implementations/crypto_aead/ascon80pqv12/bi32_lowsize/ascon.c +++ b/ascon/Implementations/crypto_aead/ascon80pqv12/bi32_lowsize/ascon.c @@ -40,8 +40,11 @@ void ascon_core(state_t* s, uint8_t* out, const uint8_t* in, uint64_t tlen, PB(s); } XOR(s->x4, WORD_T(1)); + printstate("process associated data", s); /* process plaintext/ciphertext */ process_data(s, out, in, tlen, mode); + if (mode == ASCON_ENC) printstate("process plaintext", s); + if (mode == ASCON_DEC) printstate("process ciphertext", s); /* finalization */ if (CRYPTO_KEYBYTES == 16 && ASCON_RATE == 8) { XOR(s->x1, K1); diff --git a/ascon/Implementations/crypto_aead/ascon80pqv12/bi32_lowsize/permutations.c b/ascon/Implementations/crypto_aead/ascon80pqv12/bi32_lowsize/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_aead/ascon80pqv12/bi32_lowsize/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon80pqv12/bi32_lowsize/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon80pqv12/opt64/permutations.c b/ascon/Implementations/crypto_aead/ascon80pqv12/opt64/permutations.c index 3aecaa6..8d39320 100644 --- a/ascon/Implementations/crypto_aead/ascon80pqv12/opt64/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon80pqv12/opt64/permutations.c @@ -13,14 +13,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_aead/ascon80pqv12/opt64_lowsize/ascon.c b/ascon/Implementations/crypto_aead/ascon80pqv12/opt64_lowsize/ascon.c index 5e60f1a..84b754b 100644 --- a/ascon/Implementations/crypto_aead/ascon80pqv12/opt64_lowsize/ascon.c +++ b/ascon/Implementations/crypto_aead/ascon80pqv12/opt64_lowsize/ascon.c @@ -40,8 +40,11 @@ void ascon_core(state_t* s, uint8_t* out, const uint8_t* in, uint64_t tlen, PB(s); } XOR(s->x4, WORD_T(1)); + printstate("process associated data", s); /* process plaintext/ciphertext */ process_data(s, out, in, tlen, mode); + if (mode == ASCON_ENC) printstate("process plaintext", s); + if (mode == ASCON_DEC) printstate("process ciphertext", s); /* finalization */ if (CRYPTO_KEYBYTES == 16 && ASCON_RATE == 8) { XOR(s->x1, K1); diff --git a/ascon/Implementations/crypto_aead/ascon80pqv12/opt64_lowsize/permutations.c b/ascon/Implementations/crypto_aead/ascon80pqv12/opt64_lowsize/permutations.c index 3aecaa6..8d39320 100644 --- a/ascon/Implementations/crypto_aead/ascon80pqv12/opt64_lowsize/permutations.c +++ b/ascon/Implementations/crypto_aead/ascon80pqv12/opt64_lowsize/permutations.c @@ -13,14 +13,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_hash/asconhashv12/bi32/permutations.c b/ascon/Implementations/crypto_hash/asconhashv12/bi32/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_hash/asconhashv12/bi32/permutations.c +++ b/ascon/Implementations/crypto_hash/asconhashv12/bi32/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_hash/asconhashv12/bi32_arm/permutations.c b/ascon/Implementations/crypto_hash/asconhashv12/bi32_arm/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_hash/asconhashv12/bi32_arm/permutations.c +++ b/ascon/Implementations/crypto_hash/asconhashv12/bi32_arm/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_hash/asconhashv12/bi32_lowreg/permutations.c b/ascon/Implementations/crypto_hash/asconhashv12/bi32_lowreg/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_hash/asconhashv12/bi32_lowreg/permutations.c +++ b/ascon/Implementations/crypto_hash/asconhashv12/bi32_lowreg/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_hash/asconhashv12/bi32_lowsize/permutations.c b/ascon/Implementations/crypto_hash/asconhashv12/bi32_lowsize/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_hash/asconhashv12/bi32_lowsize/permutations.c +++ b/ascon/Implementations/crypto_hash/asconhashv12/bi32_lowsize/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_hash/asconhashv12/opt64/permutations.c b/ascon/Implementations/crypto_hash/asconhashv12/opt64/permutations.c index 3aecaa6..8d39320 100644 --- a/ascon/Implementations/crypto_hash/asconhashv12/opt64/permutations.c +++ b/ascon/Implementations/crypto_hash/asconhashv12/opt64/permutations.c @@ -13,14 +13,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_hash/asconhashv12/opt64_lowsize/permutations.c b/ascon/Implementations/crypto_hash/asconhashv12/opt64_lowsize/permutations.c index 3aecaa6..8d39320 100644 --- a/ascon/Implementations/crypto_hash/asconhashv12/opt64_lowsize/permutations.c +++ b/ascon/Implementations/crypto_hash/asconhashv12/opt64_lowsize/permutations.c @@ -13,14 +13,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_hash/asconxofv12/bi32/permutations.c b/ascon/Implementations/crypto_hash/asconxofv12/bi32/permutations.c index 1bca2ef..56273c6 100644 --- a/ascon/Implementations/crypto_hash/asconxofv12/bi32/permutations.c +++ b/ascon/Implementations/crypto_hash/asconxofv12/bi32/permutations.c @@ -22,14 +22,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_hash/asconxofv12/opt64/permutations.c b/ascon/Implementations/crypto_hash/asconxofv12/opt64/permutations.c index 3aecaa6..8d39320 100644 --- a/ascon/Implementations/crypto_hash/asconxofv12/opt64/permutations.c +++ b/ascon/Implementations/crypto_hash/asconxofv12/opt64/permutations.c @@ -13,14 +13,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif diff --git a/ascon/Implementations/crypto_hash/asconxofv12/opt64_lowsize/permutations.c b/ascon/Implementations/crypto_hash/asconxofv12/opt64_lowsize/permutations.c index 3aecaa6..8d39320 100644 --- a/ascon/Implementations/crypto_hash/asconxofv12/opt64_lowsize/permutations.c +++ b/ascon/Implementations/crypto_hash/asconxofv12/opt64_lowsize/permutations.c @@ -13,14 +13,23 @@ void P(state_t* s, uint8_t rounds) { #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ -void P12(state_t* s) { P12ROUNDS(s); } +void P12(state_t* s) { + printstate(" permutation input", s); + P12ROUNDS(s); +} #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 -void P8(state_t* s) { P8ROUNDS(s); } +void P8(state_t* s) { + printstate(" permutation input", s); + P8ROUNDS(s); +} #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 -void P6(state_t* s) { P6ROUNDS(s); } +void P6(state_t* s) { + printstate(" permutation input", s); + P6ROUNDS(s); +} #endif #endif -- libgit2 0.26.0