35 #include <Serialize.hpp> 36 #include <metaprogramming/LoopUnroll.hpp> 44 std::array<uint64_t,5>;
48 std::array<uint64_t,4>;
54 loopUnroll<0,5>([&x,&key](
const int j)
56 loopUnroll<0,2>([j,&x,&key](
const int i)
58 constexpr uint64_t mk[2][2]=
69 key[(2*i+1+j)%5]+((i==1)?j:0);
73 (x1<<rx)|(x1>>(64-rx));
77 loopUnroll<0,3>([j,&x](
const int l)
79 loopUnroll<0,2>([l,j,&x](
const int i)
81 constexpr uint64_t m[2][3][2]=
82 {{{52,57},{23,40},{5,37}},
83 {{46,12},{58,22},{32,32}}};
88 x[(2*i+((l%2==0)?3:1))%4];
95 (x1<<rx)|(x1>>(64-rx));
123 0x1BD11BDAA9FC1A22^key[0]^key[1]^key[2]^key[3];
Word encrypt(const Key &key, Word x)
Encrypts the input.
Key buildKey(const Word &word)
Build a key from a word.
decltype(auto) operator+(T1 &&smet1, T2 &&smet2)
Implement smet1+smet2.