#include "SHA3.h"
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "RLP.h"
#include "picosha2.h"
Go to the source code of this file.
|
| #define | decshake(bits) int shake##bits(uint8_t*, size_t, const uint8_t*, size_t); |
| | libkeccak-tiny More...
|
| |
| #define | decsha3(bits) int sha3_##bits(uint8_t*, size_t, const uint8_t*, size_t); |
| |
| #define | rol(x, s) (((x) << s) | ((x) >> (64 - s))) |
| |
| #define | REPEAT6(e) e e e e e e |
| |
| #define | REPEAT24(e) REPEAT6(e e e e) |
| |
| #define | REPEAT5(e) e e e e e |
| |
| #define | FOR5(v, s, e) |
| |
| #define | _(S) do { S } while (0) |
| |
| #define | FOR(i, ST, L, S) _(for (size_t i = 0; i < L; i += ST) { S; }) |
| |
| #define | mkapply_ds(NAME, S) |
| |
| #define | mkapply_sd(NAME, S) |
| |
| #define | P keccakf |
| |
| #define | Plen 200 |
| |
| #define | foldP(I, L, F) |
| |
| #define | defshake(bits) |
| |
| #define | defsha3(bits) |
| |
- Author
- Gav Wood i@gav.nosp@m.wood.nosp@m..com
- Date
- 2014
Definition in file SHA3.cpp.
| #define _ |
( |
|
S | ) |
do { S } while (0) |
| #define decsha3 |
( |
|
bits | ) |
int sha3_##bits(uint8_t*, size_t, const uint8_t*, size_t); |
| #define decshake |
( |
|
bits | ) |
int shake##bits(uint8_t*, size_t, const uint8_t*, size_t); |
libkeccak-tiny
A single-file implementation of SHA-3 and SHAKE.
Implementor: David Leon Gil License: CC0, attribution kindly requested. Blame taken too, but not liability.
Definition at line 50 of file SHA3.cpp.
Value:int sha3_##bits(uint8_t* out, size_t outlen, \
const uint8_t* in,
size_t inlen) {
\ if (outlen > (bits/8)) { \
return -1; \
} \
return hash(out, outlen, in, inlen, 200 - (bits / 4), 0x01); \
}
if(a.IndicesBefore(b, len, lenIndices))
Value:int shake##bits(uint8_t* out, size_t outlen, \
const uint8_t* in, size_t inlen) { \
return hash(out, outlen, in, inlen, 200 - (bits / 4), 0x1f); \
}
| #define foldP |
( |
|
I, |
|
|
|
L, |
|
|
|
F |
|
) |
| |
| #define FOR |
( |
|
i, |
|
|
|
ST, |
|
|
|
L, |
|
|
|
S |
|
) |
| _(for (size_t i = 0; i < L; i += ST) { S; }) |
| #define mkapply_ds |
( |
|
NAME, |
|
|
|
S |
|
) |
| |
Value:static inline void NAME(uint8_t* dst, \
const uint8_t* src, \
}
Definition at line 135 of file SHA3.cpp.
| #define mkapply_sd |
( |
|
NAME, |
|
|
|
S |
|
) |
| |
Value:static inline void NAME(const uint8_t* src, \
uint8_t* dst, \
}
Definition at line 141 of file SHA3.cpp.
| #define REPEAT5 |
( |
|
e | ) |
e e e e e |
| #define rol |
( |
|
x, |
|
|
|
s |
|
) |
| (((x) << s) | ((x) >> (64 - s))) |