Botan 3.6.1
Crypto and TLS for C&
Botan::Threefish_F Namespace Reference

Functions

template<size_t R1, size_t R2>
BOTAN_FORCE_INLINE void d8_rounds (uint64_t &X0, uint64_t &X1, uint64_t &X2, uint64_t &X3, uint64_t &X4, uint64_t &X5, uint64_t &X6, uint64_t &X7, const Key_Inserter &key)
 
template<size_t R1, size_t R2, size_t R3, size_t R4>
BOTAN_FORCE_INLINE void d_round (uint64_t &X0, uint64_t &X1, uint64_t &X2, uint64_t &X3, uint64_t &X4, uint64_t &X5, uint64_t &X6, uint64_t &X7)
 
template<size_t R1, size_t R2>
BOTAN_FORCE_INLINE void e8_rounds (uint64_t &X0, uint64_t &X1, uint64_t &X2, uint64_t &X3, uint64_t &X4, uint64_t &X5, uint64_t &X6, uint64_t &X7, const Key_Inserter &key)
 
template<size_t R1, size_t R2, size_t R3, size_t R4>
BOTAN_FORCE_INLINE void e_round (uint64_t &X0, uint64_t &X1, uint64_t &X2, uint64_t &X3, uint64_t &X4, uint64_t &X5, uint64_t &X6, uint64_t &X7)
 

Function Documentation

◆ d8_rounds()

template<size_t R1, size_t R2>
BOTAN_FORCE_INLINE void Botan::Threefish_F::d8_rounds ( uint64_t & X0,
uint64_t & X1,
uint64_t & X2,
uint64_t & X3,
uint64_t & X4,
uint64_t & X5,
uint64_t & X6,
uint64_t & X7,
const Key_Inserter & key )

Definition at line 123 of file threefish_512.cpp.

131 {
132 d_round<8, 35, 56, 22>(X6, X0, X2, X4, X1, X7, X5, X3);
133 d_round<25, 29, 39, 43>(X4, X6, X0, X2, X1, X3, X5, X7);
134 d_round<13, 50, 10, 17>(X2, X4, X6, X0, X1, X7, X5, X3);
135 d_round<39, 30, 34, 24>(X0, X2, X4, X6, X1, X3, X5, X7);
136 key.d_add(R1, X0, X1, X2, X3, X4, X5, X6, X7);
137
138 d_round<44, 9, 54, 56>(X6, X0, X2, X4, X1, X7, X5, X3);
139 d_round<17, 49, 36, 39>(X4, X6, X0, X2, X1, X3, X5, X7);
140 d_round<33, 27, 14, 42>(X2, X4, X6, X0, X1, X7, X5, X3);
141 d_round<46, 36, 19, 37>(X0, X2, X4, X6, X1, X3, X5, X7);
142 key.d_add(R2, X0, X1, X2, X3, X4, X5, X6, X7);
143}

References d_round().

◆ d_round()

template<size_t R1, size_t R2, size_t R3, size_t R4>
BOTAN_FORCE_INLINE void Botan::Threefish_F::d_round ( uint64_t & X0,
uint64_t & X1,
uint64_t & X2,
uint64_t & X3,
uint64_t & X4,
uint64_t & X5,
uint64_t & X6,
uint64_t & X7 )

Definition at line 36 of file threefish_512.cpp.

37 {
38 X4 ^= X0;
39 X5 ^= X1;
40 X6 ^= X2;
41 X7 ^= X3;
42 X4 = rotr<R1>(X4);
43 X5 = rotr<R2>(X5);
44 X6 = rotr<R3>(X6);
45 X7 = rotr<R4>(X7);
46 X0 -= X4;
47 X1 -= X5;
48 X2 -= X6;
49 X3 -= X7;
50}

References Botan::rotr().

Referenced by d8_rounds().

◆ e8_rounds()

template<size_t R1, size_t R2>
BOTAN_FORCE_INLINE void Botan::Threefish_F::e8_rounds ( uint64_t & X0,
uint64_t & X1,
uint64_t & X2,
uint64_t & X3,
uint64_t & X4,
uint64_t & X5,
uint64_t & X6,
uint64_t & X7,
const Key_Inserter & key )

Definition at line 100 of file threefish_512.cpp.

108 {
109 e_round<46, 36, 19, 37>(X0, X2, X4, X6, X1, X3, X5, X7);
110 e_round<33, 27, 14, 42>(X2, X4, X6, X0, X1, X7, X5, X3);
111 e_round<17, 49, 36, 39>(X4, X6, X0, X2, X1, X3, X5, X7);
112 e_round<44, 9, 54, 56>(X6, X0, X2, X4, X1, X7, X5, X3);
113 key.e_add(R1, X0, X1, X2, X3, X4, X5, X6, X7);
114
115 e_round<39, 30, 34, 24>(X0, X2, X4, X6, X1, X3, X5, X7);
116 e_round<13, 50, 10, 17>(X2, X4, X6, X0, X1, X7, X5, X3);
117 e_round<25, 29, 39, 43>(X4, X6, X0, X2, X1, X3, X5, X7);
118 e_round<8, 35, 56, 22>(X6, X0, X2, X4, X1, X7, X5, X3);
119 key.e_add(R2, X0, X1, X2, X3, X4, X5, X6, X7);
120}

References e_round().

◆ e_round()

template<size_t R1, size_t R2, size_t R3, size_t R4>
BOTAN_FORCE_INLINE void Botan::Threefish_F::e_round ( uint64_t & X0,
uint64_t & X1,
uint64_t & X2,
uint64_t & X3,
uint64_t & X4,
uint64_t & X5,
uint64_t & X6,
uint64_t & X7 )

Definition at line 19 of file threefish_512.cpp.

20 {
21 X0 += X4;
22 X1 += X5;
23 X2 += X6;
24 X3 += X7;
25 X4 = rotl<R1>(X4);
26 X5 = rotl<R2>(X5);
27 X6 = rotl<R3>(X6);
28 X7 = rotl<R4>(X7);
29 X4 ^= X0;
30 X5 ^= X1;
31 X6 ^= X2;
32 X7 ^= X3;
33}

References Botan::rotl().

Referenced by e8_rounds().