10 #if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) 11 void ThreeWay_TestInstantiations()
20 const word32 START_E = 0x0b0b;
21 const word32 START_D = 0xb1b1;
26 a = ((a & 0xAAAAAAAA) >> 1) | ((a & 0x55555555) << 1);
27 a = ((a & 0xCCCCCCCC) >> 2) | ((a & 0x33333333) << 2);
28 return ((a & 0xF0F0F0F0) >> 4) | ((a & 0x0F0F0F0F) << 4);
31 #define mu(a0, a1, a2) \ 33 a1 = reverseBits(a1); \ 34 word32 t = reverseBits(a0); \ 35 a0 = reverseBits(a2); \ 39 #define pi_gamma_pi(a0, a1, a2) \ 42 b2 = rotlFixed(a2, 1U); \ 43 b0 = rotlFixed(a0, 22U); \ 44 a0 = rotlFixed(b0 ^ (a1|(~b2)), 1U); \ 45 a2 = rotlFixed(b2 ^ (b0|(~a1)), 22U);\ 50 #define theta(a0, a1, a2) \ 54 c = rotlFixed(c, 16U) ^ rotlFixed(c, 8U); \ 55 b0 = (a0 << 24) ^ (a2 >> 8) ^ (a1 << 8) ^ (a0 >> 24); \ 56 b1 = (a1 << 24) ^ (a0 >> 8) ^ (a2 << 8) ^ (a1 >> 24); \ 59 a2 ^= c ^ (b0 >> 16) ^ (b1 << 16); \ 62 #define rho(a0, a1, a2) \ 65 pi_gamma_pi(a0, a1, a2); \ 74 for (
unsigned int i=0; i<3; i++)
98 a0 ^=
m_k[0] ^ (rc<<16);
104 if (rc&0x10000) rc ^= 0x11011;
106 a0 ^=
m_k[0] ^ (rc<<16);
126 a0 ^=
m_k[0] ^ (rc<<16);
132 if (rc&0x10000) rc ^= 0x11011;
134 a0 ^=
m_k[0] ^ (rc<<16);
Utility functions for the Crypto++ library.
#define NAMESPACE_BEGIN(x)
static GetBlock< T, B, GA > Get(const void *block)
#define theta(a0, a1, a2)
void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms)
Sets the key for this object without performing parameter validation.
unsigned int GetRoundsAndThrowIfInvalid(const NameValuePairs ¶m, const Algorithm *alg)
Validates the number of rounds for an algorithm.
BlockGetAndPut< word32, BigEndian > Block
void AssertValidKeyLength(size_t length) const
Validates the key length.
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
Encrypt or decrypt a block.
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
Encrypt or decrypt a block.
Classes for the 3-Way block cipher.
FixedSizeSecBlock< word32, 3 > m_k
byte ByteReverse(byte value)
Reverses bytes in a 8-bit value.
Interface for retrieving values given their names.