18 k0[keylen/4] |=
word32(1) << ((keylen%4)*8);
22 for (i = 0; i < 8; ++i)
23 k[i] = k0[i] = t =
rotlFixed(k0[i] ^ k0[(i+3)%8] ^ k0[(i+5)%8] ^ t ^ 0x9e3779b9 ^ i, 11);
24 for (i = 8; i < 4*(rounds+1); ++i)
25 k[i] = t =
rotlFixed(k[i-8] ^ k[i-5] ^ k[i-3] ^ t ^ 0x9e3779b9 ^ i, 11);
29 for (i=0; i<rounds/8; i++)
void GetUserKey(ByteOrder order, T *out, size_t outlen, const byte *in, size_t inlen)
#define I4(i, r0, r1, r2, r3, r4)
Utility functions for the Crypto++ library.
T rotlFixed(T x, unsigned int y)
Performs a left rotate.
#define NAMESPACE_BEGIN(x)
static GetBlock< T, B, GA > Get(const void *block)
void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms)
Sets the key for this object without performing parameter validation.
#define SK(r, a, b, c, d, e)
Access a block of memory.
#define S4(i, r0, r1, r2, r3, r4)
#define I3(i, r0, r1, r2, r3, r4)
byte order is little-endian
#define LT(i, a, b, c, d, e)
Classes and functions for secure memory allocations.
#define S3(i, r0, r1, r2, r3, r4)
#define S6(i, r0, r1, r2, r3, r4)
#define KX(r, a, b, c, d, e)
void AssertValidKeyLength(size_t length) const
Validates the key length.
BlockGetAndPut< word32, LittleEndian > Block
#define ILT(i, a, b, c, d, e)
iterator begin()
Provides an iterator pointing to the first element in the memory block.
#define I2(i, r0, r1, r2, r3, r4)
void Serpent_KeySchedule(word32 *k, unsigned int rounds, const byte *userKey, size_t keylen)
#define LK(r, a, b, c, d, e)
#define I7(i, r0, r1, r2, r3, r4)
#define I1(i, r0, r1, r2, r3, r4)
#define I0(i, r0, r1, r2, r3, r4)
Classes for the Serpent block cipher.
#define I6(i, r0, r1, r2, r3, r4)
#define S5(i, r0, r1, r2, r3, r4)
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
Encrypt or decrypt a block.
#define I5(i, r0, r1, r2, r3, r4)
#define S7(i, r0, r1, r2, r3, r4)
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
Encrypt or decrypt a block.
#define S2(i, r0, r1, r2, r3, r4)
Interface for retrieving values given their names.
FixedSizeSecBlock< word32, 33 *4 > m_key