#include <cstdint>
Go to the source code of this file.
◆ __KECCAK256_HPP_
◆ sha3_max_permutation_size
#define sha3_max_permutation_size 25 |
◆ sha3_max_rate_in_qwords
#define sha3_max_rate_in_qwords 24 |
◆ SHA3_CTX
typedef struct SHA3_CTX SHA3_CTX |
◆ keccak_final()
void keccak_final |
( |
SHA3_CTX * | ctx, |
|
|
unsigned char * | result ) |
Store calculated hash into the given array.
- Parameters
-
ctx | the algorithm context containing current hashing state |
result | calculated hash in binary form |
Definition at line 220 of file keccak256.cpp.
221{
223
224
225
229
230
232
233
234
235 if (result) {
237 }
238}
#define me64_to_le_str(to, from, length)
uint64_t message[sha3_max_rate_in_qwords]
uint64_t hash[sha3_max_permutation_size]
memset(pInfo->slotDescription, ' ', 64)
◆ keccak_init()
◆ keccak_update()
Calculate message hash. Can be called repeatedly with chunks of the message to be hashed.
- Parameters
-
ctx | the algorithm context containing current hashing state |
msg | message chunk |
size | length of the message chunk |
Definition at line 175 of file keccak256.cpp.
176{
178
179
181
182
183 if (idx) {
185 memcpy((
char*)ctx->
message + idx, msg, (size < left ? size : left));
186 if (size < left) return;
187
188
190 msg += left;
191 size -= left;
192 }
193
197
198 aligned_message_block = (
uint64_t*)(
void*)msg;
199 } else {
201 aligned_message_block = ctx->
message;
202 }
203
204 sha3_process_block(ctx->
hash, aligned_message_block);
207 }
208
209 if (size) {
211 }
212}
unsigned __int64 uint64_t
memcpy((char *) pInfo->slotDescription, s, l)