22 static const
word64 KeccakF_RoundConstants[24] =
34 static void KeccakF1600(
word64 *state)
37 word64 Aba, Abe, Abi, Abo, Abu;
38 word64 Aga, Age, Agi, Ago, Agu;
39 word64 Aka, Ake, Aki, Ako, Aku;
40 word64 Ama, Ame, Ami, Amo, Amu;
41 word64 Asa, Ase, Asi, Aso, Asu;
42 word64 BCa, BCe, BCi, BCo, BCu;
44 word64 Eba, Ebe, Ebi, Ebo, Ebu;
45 word64 Ega, Ege, Egi, Ego, Egu;
46 word64 Eka, Eke, Eki, Eko, Eku;
47 word64 Ema, Eme, Emi, Emo, Emu;
48 word64 Esa, Ese, Esi, Eso, Esu;
52 Block::Get(state)(Aba)(Abe)(Abi)(Abo)(Abu)(Aga)(Age)(Agi)(Ago)(Agu)(Aka)(Ake)(Aki)(Ako)(Aku)(Ama)(Ame)(Ami)(Amo)(Amu)(Asa)(Ase)(Asi)(Aso)(Asu);
57 BCa = Aba^Aga^Aka^Ama^Asa;
58 BCe = Abe^Age^Ake^Ame^Ase;
59 BCi = Abi^Agi^Aki^Ami^Asi;
60 BCo = Abo^Ago^Ako^Amo^Aso;
61 BCu = Abu^Agu^Aku^Amu^Asu;
80 Eba = BCa ^((~BCe)& BCi );
82 Ebe = BCe ^((~BCi)& BCo );
83 Ebi = BCi ^((~BCo)& BCu );
84 Ebo = BCo ^((~BCu)& BCa );
85 Ebu = BCu ^((~BCa)& BCe );
97 Ega = BCa ^((~BCe)& BCi );
98 Ege = BCe ^((~BCi)& BCo );
99 Egi = BCi ^((~BCo)& BCu );
100 Ego = BCo ^((~BCu)& BCa );
101 Egu = BCu ^((~BCa)& BCe );
113 Eka = BCa ^((~BCe)& BCi );
114 Eke = BCe ^((~BCi)& BCo );
115 Eki = BCi ^((~BCo)& BCu );
116 Eko = BCo ^((~BCu)& BCa );
117 Eku = BCu ^((~BCa)& BCe );
129 Ema = BCa ^((~BCe)& BCi );
130 Eme = BCe ^((~BCi)& BCo );
131 Emi = BCi ^((~BCo)& BCu );
132 Emo = BCo ^((~BCu)& BCa );
133 Emu = BCu ^((~BCa)& BCe );
145 Esa = BCa ^((~BCe)& BCi );
146 Ese = BCe ^((~BCi)& BCo );
147 Esi = BCi ^((~BCo)& BCu );
148 Eso = BCo ^((~BCu)& BCa );
149 Esu = BCu ^((~BCa)& BCe );
152 BCa = Eba^Ega^Eka^Ema^Esa;
153 BCe = Ebe^Ege^Eke^Eme^Ese;
154 BCi = Ebi^Egi^Eki^Emi^Esi;
155 BCo = Ebo^Ego^Eko^Emo^Eso;
156 BCu = Ebu^Egu^Eku^Emu^Esu;
175 Aba = BCa ^((~BCe)& BCi );
177 Abe = BCe ^((~BCi)& BCo );
178 Abi = BCi ^((~BCo)& BCu );
179 Abo = BCo ^((~BCu)& BCa );
180 Abu = BCu ^((~BCa)& BCe );
192 Aga = BCa ^((~BCe)& BCi );
193 Age = BCe ^((~BCi)& BCo );
194 Agi = BCi ^((~BCo)& BCu );
195 Ago = BCo ^((~BCu)& BCa );
196 Agu = BCu ^((~BCa)& BCe );
208 Aka = BCa ^((~BCe)& BCi );
209 Ake = BCe ^((~BCi)& BCo );
210 Aki = BCi ^((~BCo)& BCu );
211 Ako = BCo ^((~BCu)& BCa );
212 Aku = BCu ^((~BCa)& BCe );
224 Ama = BCa ^((~BCe)& BCi );
225 Ame = BCe ^((~BCi)& BCo );
226 Ami = BCi ^((~BCo)& BCu );
227 Amo = BCo ^((~BCu)& BCa );
228 Amu = BCu ^((~BCa)& BCe );
240 Asa = BCa ^((~BCe)& BCi );
241 Ase = BCe ^((~BCi)& BCo );
242 Asi = BCi ^((~BCo)& BCu );
243 Aso = BCo ^((~BCu)& BCa );
244 Asu = BCu ^((~BCa)& BCe );
248 Block::Put(NULL, state)(Aba)(Abe)(Abi)(Abo)(Abu)(Aga)(Age)(Agi)(Ago)(Agu)(Aka)(Ake)(Aki)(Ako)(Aku)(Ama)(Ame)(Ami)(Amo)(Amu)(Asa)(Ase)(Asi)(Aso)(Asu);
255 if (!length) {
return; }
258 while (length >= (spaceLeft =
r() -
m_counter))
T rotlFixed(T x, unsigned int y)
Performs a left rotate.
#define NAMESPACE_BEGIN(x)
void TruncatedFinal(byte *hash, size_t size)
Computes the hash of the current message.
Classes for Keccak message digests.
static GetBlock< T, B, GA > Get(const void *block)
Access a block of memory.
void Update(const byte *input, size_t length)
Updates a hash with additional input.
BlockGetAndPut< word32, BigEndian > Block
unsigned long long word64
void Restart()
Restart the hash.
FixedSizeSecBlock< word64, 25 > m_state
#define CRYPTOPP_ASSERT(exp)
void xorbuf(byte *buf, const byte *mask, size_t count)
Performs an XOR of a buffer with a mask.
uint8_t const size_t const size
void * memcpy(void *a, const void *b, size_t c)
#define round(a, b, c, x, mul)
size_type SizeInBytes() const
Provides the number of bytes in the SecBlock.
byte * BytePtr()
Provides a byte pointer to the first element in the memory block.