3#ifndef CRYPTOPP_SERPENTP_H
4#define CRYPTOPP_SERPENTP_H
9#define LT(i,a,b,c,d,e) {\
10 a = rotlConstant<13>(a); \
11 c = rotlConstant<3>(c); \
12 d = rotlConstant<7>(d ^ c ^ (a << 3)); \
13 b = rotlConstant<1>(b ^ a ^ c); \
14 a = rotlConstant<5>(a ^ b ^ d); \
15 c = rotlConstant<22>(c ^ d ^ (b << 7));}
18#define ILT(i,a,b,c,d,e) {\
19 c = rotrConstant<22>(c); \
20 a = rotrConstant<5>(a); \
23 b = rotrConstant<1>(b); \
24 d = rotrConstant<7>(d) ^ c ^ (a << 3); \
26 c = rotrConstant<3>(c); \
27 a = rotrConstant<13>(a);}
30#define beforeS0(f) f(0,a,b,c,d,e)
31#define afterS0(f) f(1,b,e,c,a,d)
32#define afterS1(f) f(2,c,b,a,e,d)
33#define afterS2(f) f(3,a,e,b,d,c)
34#define afterS3(f) f(4,e,b,d,c,a)
35#define afterS4(f) f(5,b,a,e,c,d)
36#define afterS5(f) f(6,a,c,b,e,d)
37#define afterS6(f) f(7,a,c,d,b,e)
38#define afterS7(f) f(8,d,e,b,a,c)
41#define beforeI7(f) f(8,a,b,c,d,e)
42#define afterI7(f) f(7,d,a,b,e,c)
43#define afterI6(f) f(6,a,b,c,e,d)
44#define afterI5(f) f(5,b,d,e,c,a)
45#define afterI4(f) f(4,b,c,e,a,d)
46#define afterI3(f) f(3,a,b,e,c,d)
47#define afterI2(f) f(2,b,d,e,c,a)
48#define afterI1(f) f(1,a,b,c,e,d)
49#define afterI0(f) f(0,a,d,b,e,c)
54#define S0(i, r0, r1, r2, r3, r4) \
76#define I0(i, r0, r1, r2, r3, r4) \
99#define S1(i, r0, r1, r2, r3, r4) \
121#define I1(i, r0, r1, r2, r3, r4) \
144#define S2(i, r0, r1, r2, r3, r4) \
164#define I2(i, r0, r1, r2, r3, r4) \
187#define S3(i, r0, r1, r2, r3, r4) \
210#define I3(i, r0, r1, r2, r3, r4) \
232#define S4(i, r0, r1, r2, r3, r4) \
256#define I4(i, r0, r1, r2, r3, r4) \
280#define S5(i, r0, r1, r2, r3, r4) \
303#define I5(i, r0, r1, r2, r3, r4) \
326#define S6(i, r0, r1, r2, r3, r4) \
348#define I6(i, r0, r1, r2, r3, r4) \
369#define S7(i, r0, r1, r2, r3, r4) \
393#define I7(i, r0, r1, r2, r3, r4) \
417#define KX(r, a, b, c, d, e) {\
423#define LK(r, a, b, c, d, e) {\
424 a = k[(8-r)*4 + 0]; \
425 b = k[(8-r)*4 + 1]; \
426 c = k[(8-r)*4 + 2]; \
429#define SK(r, a, b, c, d, e) {\
430 k[(8-r)*4 + 4] = a; \
431 k[(8-r)*4 + 5] = b; \
432 k[(8-r)*4 + 6] = c; \
435void Serpent_KeySchedule(
word32 *k,
unsigned int rounds,
const byte *userKey,
size_t keylen);
unsigned int word32
32-bit unsigned datatype
Crypto++ library namespace.