#include "permutations.h" #include "round.h" #if !ASCON_UNROLL_LOOPS || ASCON_SINGLE_PERM const uint64_t constants[12] = { 0x0101010100000000ull, 0x0101010000000001ull, 0x0101000100000100ull, 0x0101000000000101ull, 0x0100010100010000ull, 0x0100010000010001ull, 0x0100000100010100ull, 0x0100000000010101ull, 0x0001010101000000ull, 0x0001010001000001ull, 0x0001000101000100ull, 0x0001000001000101ull}; #endif #if ASCON_INLINE_PERM #elif ASCON_SINGLE_PERM void P(state_t* s, uint8_t rounds) { printstate(" permutation input", s); for (int i = START(rounds); i < 12; ++i) ROUND(s, constants[i]); } #else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */ void P12(state_t* s) { printstate(" permutation input", s); P12ROUNDS(s); } #if defined(CRYPTO_ABYTES) && ASCON_RATE == 16 void P8(state_t* s) { printstate(" permutation input", s); P8ROUNDS(s); } #endif #if defined(CRYPTO_ABYTES) && ASCON_RATE == 8 void P6(state_t* s) { printstate(" permutation input", s); P6ROUNDS(s); } #endif #endif