permutations.h 771 Bytes
Newer Older
lwc-tester committed
1 2 3
#ifndef PERMUTATIONS_H_
#define PERMUTATIONS_H_

Martin Schläffer committed
4
#include <stdint.h>
lwc-tester committed
5

Martin Schläffer committed
6
#include "ascon.h"
Martin Schläffer committed
7
#include "constants.h"
Martin Schläffer committed
8 9
#include "printstate.h"
#include "round.h"
lwc-tester committed
10

Martin Schläffer committed
11 12 13 14 15 16 17 18 19 20 21 22 23
static inline void P12(state_t* s) {
  ROUND(s, 0xf0);
  ROUND(s, 0xe1);
  ROUND(s, 0xd2);
  ROUND(s, 0xc3);
  ROUND(s, 0xb4);
  ROUND(s, 0xa5);
  ROUND(s, 0x96);
  ROUND(s, 0x87);
  ROUND(s, 0x78);
  ROUND(s, 0x69);
  ROUND(s, 0x5a);
  ROUND(s, 0x4b);
lwc-tester committed
24 25
}

Martin Schläffer committed
26 27 28 29 30 31 32 33 34
static inline void P8(state_t* s) {
  ROUND(s, 0xb4);
  ROUND(s, 0xa5);
  ROUND(s, 0x96);
  ROUND(s, 0x87);
  ROUND(s, 0x78);
  ROUND(s, 0x69);
  ROUND(s, 0x5a);
  ROUND(s, 0x4b);
lwc-tester committed
35 36
}

Martin Schläffer committed
37 38 39 40 41 42 43 44
static inline void P6(state_t* s) {
  ROUND(s, 0x96);
  ROUND(s, 0x87);
  ROUND(s, 0x78);
  ROUND(s, 0x69);
  ROUND(s, 0x5a);
  ROUND(s, 0x4b);
}
lwc-tester committed
45

Martin Schläffer committed
46
#endif /* PERMUTATIONS_H_ */