9 static const
word32 DELTA = 0x9e3779b9;
14 AssertValidKeyLength(length);
17 m_limit = GetRoundsAndThrowIfInvalid(params,
this) * DELTA;
29 y += ((z << 4) + m_k[0]) ^ (z + sum) ^ ((z >> 5) +
m_k[1]);
30 z += ((y << 4) + m_k[2]) ^ (y + sum) ^ ((y >> 5) +
m_k[3]);
44 z -= ((y << 4) + m_k[2]) ^ (y + sum) ^ ((y >> 5) +
m_k[3]);
45 y -= ((z << 4) + m_k[0]) ^ (z + sum) ^ ((z >> 5) +
m_k[1]);
68 while ((sum&0xffffffff) !=
m_limit)
74 y += ((z<<4 ^ z>>5) + z) ^ (sum +
m_k[sum&3]);
76 z += ((y<<4 ^ y>>5) + y) ^ (sum +
m_k[sum>>11 & 3]);
90 while ((sum&0xffffffff) != 0)
96 z -= ((y<<4 ^ y>>5) + y) ^ (sum +
m_k[sum>>11 & 3]);
98 y -= ((z<<4 ^ z>>5) + z) ^ (sum +
m_k[sum&3]);
104 #define MX ((z>>5^y<<2)+(y>>3^z<<4))^((sum^y)+(m_k[(p&3)^e]^z)) 112 unsigned int n = m_blockSize / 4;
124 for (p = 0; p < n-1; p++)
142 unsigned int n = m_blockSize / 4;
153 for (p = n-1; p > 0; p--)
void GetUserKey(ByteOrder order, T *out, size_t outlen, const byte *in, size_t inlen)
Utility functions for the Crypto++ library.
#define NAMESPACE_BEGIN(x)
Converts an enumeration to a type suitable for use as a template parameter.
static GetBlock< T, B, GA > Get(const void *block)
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
Encrypt or decrypt a block.
Access a block of memory.
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
Encrypt or decrypt a block.
bool IsAlignedOn(const void *ptr, unsigned int alignment)
Determines whether ptr is aligned to a minimum value.
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.
unsigned int GetRoundsAndThrowIfInvalid(const NameValuePairs ¶m, const Algorithm *alg)
Validates the number of rounds for an algorithm.
T ConditionalByteReverse(ByteOrder order, T value)
Reverses bytes in a value depending upon endianness.
FixedSizeSecBlock< word32, 4 > m_k
TEA block cipher default operation.
Classes for the TEA, BTEA and XTEA block ciphers.
void AssertValidKeyLength(size_t length) const
Validates the key length.
void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms)
Sets the key for this object without performing parameter validation.
#define CRYPTOPP_ASSERT(exp)
iterator begin()
Provides an iterator pointing to the first element in the memory block.
#define CRYPTOPP_UNUSED(x)
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.
Interface for retrieving values given their names.