8#include <botan/internal/serpent.h>
10#include <botan/internal/serpent_sbox.h>
11#include <botan/internal/simd_32.h>
18void Serpent::simd_encrypt_4(
const uint8_t in[64], uint8_t out[64])
const {
30 key_xor(0, B0, B1, B2, B3);
33 key_xor(1, B0, B1, B2, B3);
36 key_xor(2, B0, B1, B2, B3);
39 key_xor(3, B0, B1, B2, B3);
42 key_xor(4, B0, B1, B2, B3);
45 key_xor(5, B0, B1, B2, B3);
48 key_xor(6, B0, B1, B2, B3);
51 key_xor(7, B0, B1, B2, B3);
55 key_xor(8, B0, B1, B2, B3);
58 key_xor(9, B0, B1, B2, B3);
61 key_xor(10, B0, B1, B2, B3);
64 key_xor(11, B0, B1, B2, B3);
67 key_xor(12, B0, B1, B2, B3);
70 key_xor(13, B0, B1, B2, B3);
73 key_xor(14, B0, B1, B2, B3);
76 key_xor(15, B0, B1, B2, B3);
80 key_xor(16, B0, B1, B2, B3);
83 key_xor(17, B0, B1, B2, B3);
86 key_xor(18, B0, B1, B2, B3);
89 key_xor(19, B0, B1, B2, B3);
92 key_xor(20, B0, B1, B2, B3);
95 key_xor(21, B0, B1, B2, B3);
98 key_xor(22, B0, B1, B2, B3);
101 key_xor(23, B0, B1, B2, B3);
105 key_xor(24, B0, B1, B2, B3);
108 key_xor(25, B0, B1, B2, B3);
111 key_xor(26, B0, B1, B2, B3);
114 key_xor(27, B0, B1, B2, B3);
117 key_xor(28, B0, B1, B2, B3);
120 key_xor(29, B0, B1, B2, B3);
123 key_xor(30, B0, B1, B2, B3);
126 key_xor(31, B0, B1, B2, B3);
128 key_xor(32, B0, B1, B2, B3);
141void Serpent::simd_decrypt_4(
const uint8_t in[64], uint8_t out[64])
const {
153 key_xor(32, B0, B1, B2, B3);
155 key_xor(31, B0, B1, B2, B3);
158 key_xor(30, B0, B1, B2, B3);
161 key_xor(29, B0, B1, B2, B3);
164 key_xor(28, B0, B1, B2, B3);
167 key_xor(27, B0, B1, B2, B3);
170 key_xor(26, B0, B1, B2, B3);
173 key_xor(25, B0, B1, B2, B3);
176 key_xor(24, B0, B1, B2, B3);
180 key_xor(23, B0, B1, B2, B3);
183 key_xor(22, B0, B1, B2, B3);
186 key_xor(21, B0, B1, B2, B3);
189 key_xor(20, B0, B1, B2, B3);
192 key_xor(19, B0, B1, B2, B3);
195 key_xor(18, B0, B1, B2, B3);
198 key_xor(17, B0, B1, B2, B3);
201 key_xor(16, B0, B1, B2, B3);
205 key_xor(15, B0, B1, B2, B3);
208 key_xor(14, B0, B1, B2, B3);
211 key_xor(13, B0, B1, B2, B3);
214 key_xor(12, B0, B1, B2, B3);
217 key_xor(11, B0, B1, B2, B3);
220 key_xor(10, B0, B1, B2, B3);
223 key_xor(9, B0, B1, B2, B3);
226 key_xor(8, B0, B1, B2, B3);
230 key_xor(7, B0, B1, B2, B3);
233 key_xor(6, B0, B1, B2, B3);
236 key_xor(5, B0, B1, B2, B3);
239 key_xor(4, B0, B1, B2, B3);
242 key_xor(3, B0, B1, B2, B3);
245 key_xor(2, B0, B1, B2, B3);
248 key_xor(1, B0, B1, B2, B3);
251 key_xor(0, B0, B1, B2, B3);
static void transpose(SIMD_4x32 &B0, SIMD_4x32 &B1, SIMD_4x32 &B2, SIMD_4x32 &B3) noexcept
void store_le(uint32_t out[4]) const noexcept
static SIMD_4x32 load_le(const void *in) noexcept
BOTAN_FORCE_INLINE void transform(T &B0, T &B1, T &B2, T &B3)
BOTAN_FORCE_INLINE void i_transform(T &B0, T &B1, T &B2, T &B3)
BOTAN_FORCE_INLINE void SBoxE6(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxD4(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxE4(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxE7(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxE5(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxD5(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxE2(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxE3(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxE0(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxD0(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxD1(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxE1(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxD6(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxD2(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxD3(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)
BOTAN_FORCE_INLINE void SBoxD7(SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d)