9 #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 10 # pragma GCC diagnostic ignored "-Wmissing-braces" 17 static const byte iG[8][8] = {
18 0xe7, 0x30, 0x90, 0x85, 0xd0, 0x4b, 0x91, 0x41,
19 0x53, 0x95, 0x9b, 0xa5, 0x96, 0xbc, 0xa1, 0x68,
20 0x02, 0x45, 0xf7, 0x65, 0x5c, 0x1f, 0xb6, 0x52,
21 0xa2, 0xca, 0x22, 0x94, 0x44, 0x63, 0x2a, 0xa2,
22 0xfc, 0x67, 0x8e, 0x10, 0x29, 0x75, 0x85, 0x71,
23 0x24, 0x45, 0xa2, 0xcf, 0x2f, 0x22, 0xc1, 0x0e,
24 0xa1, 0xf1, 0x71, 0x40, 0x91, 0x27, 0x18, 0xa5,
25 0x56, 0xf4, 0xaf, 0x32, 0xd2, 0xa4, 0xdc, 0x71,
30 for (
unsigned int i=0; i<8; i++)
31 for(
unsigned int j=0; j<8; j++)
44 for (
unsigned int i=0; i<(
m_rounds+1)*8; i++)
49 byte IV[8] = {0,0,0,0,0,0,0,0};
63 for (i=0; i<m_rounds/2; i++)
70 #ifdef IS_LITTLE_ENDIAN 82 for (
unsigned int i=0; i<DEFAULT_ROUNDS; i++)
85 m_roundKeys[DEFAULT_ROUNDS] = SHARKTransform(cbox[0][DEFAULT_ROUNDS]);
87 #ifdef IS_LITTLE_ENDIAN 99 tmp = cbox[0][
GetByte(order, tmp, 0)] ^ cbox[1][
GetByte(order, tmp, 1)]
100 ^ cbox[2][
GetByte(order, tmp, 2)] ^ cbox[3][
GetByte(order, tmp, 3)]
101 ^ cbox[4][
GetByte(order, tmp, 4)] ^ cbox[5][
GetByte(order, tmp, 5)]
102 ^ cbox[6][
GetByte(order, tmp, 6)] ^ cbox[7][
GetByte(order, tmp, 7)]
105 for(
unsigned int i=2; i<
m_rounds; i++)
134 tmp = cbox[0][
GetByte(order, tmp, 0)] ^ cbox[1][
GetByte(order, tmp, 1)]
135 ^ cbox[2][
GetByte(order, tmp, 2)] ^ cbox[3][
GetByte(order, tmp, 3)]
136 ^ cbox[4][
GetByte(order, tmp, 4)] ^ cbox[5][
GetByte(order, tmp, 5)]
137 ^ cbox[6][
GetByte(order, tmp, 6)] ^ cbox[7][
GetByte(order, tmp, 7)]
140 for(
unsigned int i=2; i<
m_rounds; i++)
Utility functions for the Crypto++ library.
ByteOrder
Provides the byte ordering.
void swap(dev::eth::Watch &_a, dev::eth::Watch &_b)
Class file for modes of operation.
#define NAMESPACE_BEGIN(x)
void New(size_type newSize)
Change size without preserving contents.
GF(256) with polynomial basis.
SecBlock< word64 > m_roundKeys
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.
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.
unsigned long long word64
void AssertValidKeyLength(size_t length) const
Validates the key length.
Classes and functions for schemes over GF(256)
#define CRYPTOPP_ASSERT(exp)
iterator begin()
Provides an iterator pointing to the first element in the memory block.
ByteOrder GetNativeByteOrder()
Returns NativeByteOrder as an enumerated ByteOrder value.
Access a block of memory.
Classes for the SHARK block cipher.
unsigned int GetByte(ByteOrder order, T value, unsigned int index)
Gets a byte from a value.
byte ByteReverse(byte value)
Reverses bytes in a 8-bit value.
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
Encrypt or decrypt a block.
Interface for retrieving values given their names.
void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶m)
Sets the key for this object without performing parameter validation.