permutations.c 645 Bytes
Newer Older
Martin Schläffer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include "permutations.h"

#include "round.h"

#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 > 0x4a; i -= 0x0f) ROUND(s, i);
}

#else /* !ASCON_INLINE_PERM && !ASCON_SINGLE_PERM */

Martin Schläffer committed
16 17 18 19
void P12(state_t* s) {
  printstate(" permutation input", s);
  P12ROUNDS(s);
}
Martin Schläffer committed
20 21

#if defined(CRYPTO_ABYTES) && ASCON_RATE == 16
Martin Schläffer committed
22 23 24 25
void P8(state_t* s) {
  printstate(" permutation input", s);
  P8ROUNDS(s);
}
Martin Schläffer committed
26 27 28
#endif

#if defined(CRYPTO_ABYTES) && ASCON_RATE == 8
Martin Schläffer committed
29 30 31 32
void P6(state_t* s) {
  printstate(" permutation input", s);
  P6ROUNDS(s);
}
Martin Schläffer committed
33 34 35
#endif

#endif