Raven Core
3.0.0
P2P Digital Currency
|
Go to the source code of this file.
Macros | |
#define | SPH_KECCAK_INTERLEAVE 1 |
#define | SPH_KECCAK_UNROLL 8 |
#define | SPH_KECCAK_NOCOPY 0 |
#define | INTERLEAVE(xl, xh) |
#define | UNINTERLEAVE(xl, xh) |
#define | DECL_STATE |
#define | READ_STATE(state) |
#define | WRITE_STATE(state) |
#define | READ64(d, off) |
#define | INPUT_BUF144 |
#define | INPUT_BUF136 |
#define | INPUT_BUF104 |
#define | INPUT_BUF72 |
#define | INPUT_BUF(lim) |
#define | DECL64(x) sph_u64 x ## l, x ## h |
#define | MOV64(d, s) (d ## l = s ## l, d ## h = s ## h) |
#define | XOR64(d, a, b) (d ## l = a ## l ^ b ## l, d ## h = a ## h ^ b ## h) |
#define | AND64(d, a, b) (d ## l = a ## l & b ## l, d ## h = a ## h & b ## h) |
#define | OR64(d, a, b) (d ## l = a ## l | b ## l, d ## h = a ## h | b ## h) |
#define | NOT64(d, s) (d ## l = SPH_T32(~s ## l), d ## h = SPH_T32(~s ## h)) |
#define | ROL64(d, v, n) ROL64_ ## n(d, v) |
#define | ROL64_odd1(d, v) |
#define | ROL64_odd63(d, v) |
#define | ROL64_odd(d, v, n) |
#define | ROL64_even(d, v, n) |
#define | ROL64_0(d, v) |
#define | ROL64_1(d, v) ROL64_odd1(d, v) |
#define | ROL64_2(d, v) ROL64_even(d, v, 1) |
#define | ROL64_3(d, v) ROL64_odd( d, v, 2) |
#define | ROL64_4(d, v) ROL64_even(d, v, 2) |
#define | ROL64_5(d, v) ROL64_odd( d, v, 3) |
#define | ROL64_6(d, v) ROL64_even(d, v, 3) |
#define | ROL64_7(d, v) ROL64_odd( d, v, 4) |
#define | ROL64_8(d, v) ROL64_even(d, v, 4) |
#define | ROL64_9(d, v) ROL64_odd( d, v, 5) |
#define | ROL64_10(d, v) ROL64_even(d, v, 5) |
#define | ROL64_11(d, v) ROL64_odd( d, v, 6) |
#define | ROL64_12(d, v) ROL64_even(d, v, 6) |
#define | ROL64_13(d, v) ROL64_odd( d, v, 7) |
#define | ROL64_14(d, v) ROL64_even(d, v, 7) |
#define | ROL64_15(d, v) ROL64_odd( d, v, 8) |
#define | ROL64_16(d, v) ROL64_even(d, v, 8) |
#define | ROL64_17(d, v) ROL64_odd( d, v, 9) |
#define | ROL64_18(d, v) ROL64_even(d, v, 9) |
#define | ROL64_19(d, v) ROL64_odd( d, v, 10) |
#define | ROL64_20(d, v) ROL64_even(d, v, 10) |
#define | ROL64_21(d, v) ROL64_odd( d, v, 11) |
#define | ROL64_22(d, v) ROL64_even(d, v, 11) |
#define | ROL64_23(d, v) ROL64_odd( d, v, 12) |
#define | ROL64_24(d, v) ROL64_even(d, v, 12) |
#define | ROL64_25(d, v) ROL64_odd( d, v, 13) |
#define | ROL64_26(d, v) ROL64_even(d, v, 13) |
#define | ROL64_27(d, v) ROL64_odd( d, v, 14) |
#define | ROL64_28(d, v) ROL64_even(d, v, 14) |
#define | ROL64_29(d, v) ROL64_odd( d, v, 15) |
#define | ROL64_30(d, v) ROL64_even(d, v, 15) |
#define | ROL64_31(d, v) ROL64_odd( d, v, 16) |
#define | ROL64_32(d, v) ROL64_even(d, v, 16) |
#define | ROL64_33(d, v) ROL64_odd( d, v, 17) |
#define | ROL64_34(d, v) ROL64_even(d, v, 17) |
#define | ROL64_35(d, v) ROL64_odd( d, v, 18) |
#define | ROL64_36(d, v) ROL64_even(d, v, 18) |
#define | ROL64_37(d, v) ROL64_odd( d, v, 19) |
#define | ROL64_38(d, v) ROL64_even(d, v, 19) |
#define | ROL64_39(d, v) ROL64_odd( d, v, 20) |
#define | ROL64_40(d, v) ROL64_even(d, v, 20) |
#define | ROL64_41(d, v) ROL64_odd( d, v, 21) |
#define | ROL64_42(d, v) ROL64_even(d, v, 21) |
#define | ROL64_43(d, v) ROL64_odd( d, v, 22) |
#define | ROL64_44(d, v) ROL64_even(d, v, 22) |
#define | ROL64_45(d, v) ROL64_odd( d, v, 23) |
#define | ROL64_46(d, v) ROL64_even(d, v, 23) |
#define | ROL64_47(d, v) ROL64_odd( d, v, 24) |
#define | ROL64_48(d, v) ROL64_even(d, v, 24) |
#define | ROL64_49(d, v) ROL64_odd( d, v, 25) |
#define | ROL64_50(d, v) ROL64_even(d, v, 25) |
#define | ROL64_51(d, v) ROL64_odd( d, v, 26) |
#define | ROL64_52(d, v) ROL64_even(d, v, 26) |
#define | ROL64_53(d, v) ROL64_odd( d, v, 27) |
#define | ROL64_54(d, v) ROL64_even(d, v, 27) |
#define | ROL64_55(d, v) ROL64_odd( d, v, 28) |
#define | ROL64_56(d, v) ROL64_even(d, v, 28) |
#define | ROL64_57(d, v) ROL64_odd( d, v, 29) |
#define | ROL64_58(d, v) ROL64_even(d, v, 29) |
#define | ROL64_59(d, v) ROL64_odd( d, v, 30) |
#define | ROL64_60(d, v) ROL64_even(d, v, 30) |
#define | ROL64_61(d, v) ROL64_odd( d, v, 31) |
#define | ROL64_62(d, v) ROL64_even(d, v, 31) |
#define | ROL64_63(d, v) ROL64_odd63(d, v) |
#define | XOR64_IOTA(d, s, k) (d ## l = s ## l ^ k.low, d ## h = s ## h ^ k.high) |
#define | TH_ELT(t, c0, c1, c2, c3, c4, d0, d1, d2, d3, d4) |
#define | THETA(b00, b01, b02, b03, b04, b10, b11, b12, b13, b14, b20, b21, b22, b23, b24, b30, b31, b32, b33, b34, b40, b41, b42, b43, b44) |
#define | RHO(b00, b01, b02, b03, b04, b10, b11, b12, b13, b14, b20, b21, b22, b23, b24, b30, b31, b32, b33, b34, b40, b41, b42, b43, b44) |
#define | KHI_XO(d, a, b, c) |
#define | KHI_XA(d, a, b, c) |
#define | KHI(b00, b01, b02, b03, b04, b10, b11, b12, b13, b14, b20, b21, b22, b23, b24, b30, b31, b32, b33, b34, b40, b41, b42, b43, b44) |
#define | IOTA(r) XOR64_IOTA(a00, a00, r) |
#define | P0 |
#define | P1 |
#define | P2 |
#define | P3 |
#define | P4 |
#define | P5 |
#define | P6 |
#define | P7 |
#define | P8 |
#define | P9 |
#define | P10 |
#define | P11 |
#define | P12 |
#define | P13 |
#define | P14 |
#define | P15 |
#define | P16 |
#define | P17 |
#define | P18 |
#define | P19 |
#define | P20 |
#define | P21 |
#define | P22 |
#define | P23 |
#define | P1_TO_P0 |
#define | P2_TO_P0 |
#define | P4_TO_P0 |
#define | P6_TO_P0 |
#define | P8_TO_P0 |
#define | P12_TO_P0 |
#define | LPAR ( |
#define | RPAR ) |
#define | KF_ELT(r, s, k) |
#define | DO(x) x |
#define | KECCAK_F_1600 DO(KECCAK_F_1600_) |
#define | KECCAK_F_1600_ |
#define | DEFCLOSE(d, lim) |
Functions | |
void | sph_keccak224_init (void *cc) |
Initialize a Keccak-224 context. More... | |
void | sph_keccak224 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_keccak224_close (void *cc, void *dst) |
Terminate the current Keccak-224 computation and output the result into the provided buffer. More... | |
void | sph_keccak224_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst) |
Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (28 bytes). More... | |
void | sph_keccak256_init (void *cc) |
Initialize a Keccak-256 context. More... | |
void | sph_keccak256 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_keccak256_close (void *cc, void *dst) |
Terminate the current Keccak-256 computation and output the result into the provided buffer. More... | |
void | sph_keccak256_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst) |
Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (32 bytes). More... | |
void | sph_keccak384_init (void *cc) |
Initialize a Keccak-384 context. More... | |
void | sph_keccak384 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_keccak384_close (void *cc, void *dst) |
Terminate the current Keccak-384 computation and output the result into the provided buffer. More... | |
void | sph_keccak384_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst) |
Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (48 bytes). More... | |
void | sph_keccak512_init (void *cc) |
Initialize a Keccak-512 context. More... | |
void | sph_keccak512 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_keccak512_close (void *cc, void *dst) |
Terminate the current Keccak-512 computation and output the result into the provided buffer. More... | |
void | sph_keccak512_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst) |
Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (64 bytes). More... | |
#define AND64 | ( | d, | |
a, | |||
b | |||
) | (d ## l = a ## l & b ## l, d ## h = a ## h & b ## h) |
#define DECL_STATE |
#define INPUT_BUF | ( | lim | ) |
#define INPUT_BUF104 |
#define INPUT_BUF136 |
#define INPUT_BUF144 |
#define INPUT_BUF72 |
#define INTERLEAVE | ( | xl, | |
xh | |||
) |
#define IOTA | ( | r | ) | XOR64_IOTA(a00, a00, r) |
#define KECCAK_F_1600 DO(KECCAK_F_1600_) |
#define KECCAK_F_1600_ |
#define KF_ELT | ( | r, | |
s, | |||
k | |||
) |
#define KHI | ( | b00, | |
b01, | |||
b02, | |||
b03, | |||
b04, | |||
b10, | |||
b11, | |||
b12, | |||
b13, | |||
b14, | |||
b20, | |||
b21, | |||
b22, | |||
b23, | |||
b24, | |||
b30, | |||
b31, | |||
b32, | |||
b33, | |||
b34, | |||
b40, | |||
b41, | |||
b42, | |||
b43, | |||
b44 | |||
) |
#define KHI_XA | ( | d, | |
a, | |||
b, | |||
c | |||
) |
#define KHI_XO | ( | d, | |
a, | |||
b, | |||
c | |||
) |
#define OR64 | ( | d, | |
a, | |||
b | |||
) | (d ## l = a ## l | b ## l, d ## h = a ## h | b ## h) |
#define P0 |
#define P1 |
#define P10 |
#define P11 |
#define P12 |
#define P13 |
#define P14 |
#define P15 |
#define P16 |
#define P17 |
#define P18 |
#define P19 |
#define P1_TO_P0 |
#define P2 |
#define P20 |
#define P21 |
#define P22 |
#define P23 |
#define P2_TO_P0 |
#define P3 |
#define P4 |
#define P5 |
#define P6 |
#define P7 |
#define P8 |
#define P9 |
#define READ64 | ( | d, | |
off | |||
) |
#define RHO | ( | b00, | |
b01, | |||
b02, | |||
b03, | |||
b04, | |||
b10, | |||
b11, | |||
b12, | |||
b13, | |||
b14, | |||
b20, | |||
b21, | |||
b22, | |||
b23, | |||
b24, | |||
b30, | |||
b31, | |||
b32, | |||
b33, | |||
b34, | |||
b40, | |||
b41, | |||
b42, | |||
b43, | |||
b44 | |||
) |
#define ROL64_1 | ( | d, | |
v | |||
) | ROL64_odd1(d, v) |
#define ROL64_10 | ( | d, | |
v | |||
) | ROL64_even(d, v, 5) |
#define ROL64_12 | ( | d, | |
v | |||
) | ROL64_even(d, v, 6) |
#define ROL64_14 | ( | d, | |
v | |||
) | ROL64_even(d, v, 7) |
#define ROL64_16 | ( | d, | |
v | |||
) | ROL64_even(d, v, 8) |
#define ROL64_18 | ( | d, | |
v | |||
) | ROL64_even(d, v, 9) |
#define ROL64_2 | ( | d, | |
v | |||
) | ROL64_even(d, v, 1) |
#define ROL64_20 | ( | d, | |
v | |||
) | ROL64_even(d, v, 10) |
#define ROL64_22 | ( | d, | |
v | |||
) | ROL64_even(d, v, 11) |
#define ROL64_24 | ( | d, | |
v | |||
) | ROL64_even(d, v, 12) |
#define ROL64_26 | ( | d, | |
v | |||
) | ROL64_even(d, v, 13) |
#define ROL64_28 | ( | d, | |
v | |||
) | ROL64_even(d, v, 14) |
#define ROL64_30 | ( | d, | |
v | |||
) | ROL64_even(d, v, 15) |
#define ROL64_32 | ( | d, | |
v | |||
) | ROL64_even(d, v, 16) |
#define ROL64_34 | ( | d, | |
v | |||
) | ROL64_even(d, v, 17) |
#define ROL64_36 | ( | d, | |
v | |||
) | ROL64_even(d, v, 18) |
#define ROL64_38 | ( | d, | |
v | |||
) | ROL64_even(d, v, 19) |
#define ROL64_4 | ( | d, | |
v | |||
) | ROL64_even(d, v, 2) |
#define ROL64_40 | ( | d, | |
v | |||
) | ROL64_even(d, v, 20) |
#define ROL64_42 | ( | d, | |
v | |||
) | ROL64_even(d, v, 21) |
#define ROL64_44 | ( | d, | |
v | |||
) | ROL64_even(d, v, 22) |
#define ROL64_46 | ( | d, | |
v | |||
) | ROL64_even(d, v, 23) |
#define ROL64_48 | ( | d, | |
v | |||
) | ROL64_even(d, v, 24) |
#define ROL64_50 | ( | d, | |
v | |||
) | ROL64_even(d, v, 25) |
#define ROL64_52 | ( | d, | |
v | |||
) | ROL64_even(d, v, 26) |
#define ROL64_54 | ( | d, | |
v | |||
) | ROL64_even(d, v, 27) |
#define ROL64_56 | ( | d, | |
v | |||
) | ROL64_even(d, v, 28) |
#define ROL64_58 | ( | d, | |
v | |||
) | ROL64_even(d, v, 29) |
#define ROL64_6 | ( | d, | |
v | |||
) | ROL64_even(d, v, 3) |
#define ROL64_60 | ( | d, | |
v | |||
) | ROL64_even(d, v, 30) |
#define ROL64_62 | ( | d, | |
v | |||
) | ROL64_even(d, v, 31) |
#define ROL64_63 | ( | d, | |
v | |||
) | ROL64_odd63(d, v) |
#define ROL64_8 | ( | d, | |
v | |||
) | ROL64_even(d, v, 4) |
#define ROL64_even | ( | d, | |
v, | |||
n | |||
) |
#define ROL64_odd | ( | d, | |
v, | |||
n | |||
) |
#define ROL64_odd1 | ( | d, | |
v | |||
) |
#define ROL64_odd63 | ( | d, | |
v | |||
) |
#define TH_ELT | ( | t, | |
c0, | |||
c1, | |||
c2, | |||
c3, | |||
c4, | |||
d0, | |||
d1, | |||
d2, | |||
d3, | |||
d4 | |||
) |
#define THETA | ( | b00, | |
b01, | |||
b02, | |||
b03, | |||
b04, | |||
b10, | |||
b11, | |||
b12, | |||
b13, | |||
b14, | |||
b20, | |||
b21, | |||
b22, | |||
b23, | |||
b24, | |||
b30, | |||
b31, | |||
b32, | |||
b33, | |||
b34, | |||
b40, | |||
b41, | |||
b42, | |||
b43, | |||
b44 | |||
) |
#define UNINTERLEAVE | ( | xl, | |
xh | |||
) |
#define XOR64 | ( | d, | |
a, | |||
b | |||
) | (d ## l = a ## l ^ b ## l, d ## h = a ## h ^ b ## h) |
void sph_keccak224 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
void sph_keccak224_addbits_and_close | ( | void * | cc, |
unsigned | ub, | ||
unsigned | n, | ||
void * | dst | ||
) |
Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (28 bytes).
If bit number i in ub
has value 2^i, then the extra bits are those numbered 7 downto 8-n (this is the big-endian convention at the byte level). The context is automatically reinitialized.
cc | the Keccak-224 context |
ub | the extra bits |
n | the number of extra bits (0 to 7) |
dst | the destination buffer |
Definition at line 1732 of file keccak.c.
void sph_keccak224_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current Keccak-224 computation and output the result into the provided buffer.
The destination buffer must be wide enough to accomodate the result (28 bytes). The context is automatically reinitialized.
cc | the Keccak-224 context |
dst | the destination buffer |
Definition at line 1725 of file keccak.c.
void sph_keccak224_init | ( | void * | cc | ) |
void sph_keccak256 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
void sph_keccak256_addbits_and_close | ( | void * | cc, |
unsigned | ub, | ||
unsigned | n, | ||
void * | dst | ||
) |
Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (32 bytes).
If bit number i in ub
has value 2^i, then the extra bits are those numbered 7 downto 8-n (this is the big-endian convention at the byte level). The context is automatically reinitialized.
cc | the Keccak-256 context |
ub | the extra bits |
n | the number of extra bits (0 to 7) |
dst | the destination buffer |
Definition at line 1760 of file keccak.c.
void sph_keccak256_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current Keccak-256 computation and output the result into the provided buffer.
The destination buffer must be wide enough to accomodate the result (32 bytes). The context is automatically reinitialized.
cc | the Keccak-256 context |
dst | the destination buffer |
Definition at line 1753 of file keccak.c.
void sph_keccak256_init | ( | void * | cc | ) |
void sph_keccak384 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
void sph_keccak384_addbits_and_close | ( | void * | cc, |
unsigned | ub, | ||
unsigned | n, | ||
void * | dst | ||
) |
Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (48 bytes).
If bit number i in ub
has value 2^i, then the extra bits are those numbered 7 downto 8-n (this is the big-endian convention at the byte level). The context is automatically reinitialized.
cc | the Keccak-384 context |
ub | the extra bits |
n | the number of extra bits (0 to 7) |
dst | the destination buffer |
Definition at line 1788 of file keccak.c.
void sph_keccak384_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current Keccak-384 computation and output the result into the provided buffer.
The destination buffer must be wide enough to accomodate the result (48 bytes). The context is automatically reinitialized.
cc | the Keccak-384 context |
dst | the destination buffer |
Definition at line 1781 of file keccak.c.
void sph_keccak384_init | ( | void * | cc | ) |
void sph_keccak512 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
void sph_keccak512_addbits_and_close | ( | void * | cc, |
unsigned | ub, | ||
unsigned | n, | ||
void * | dst | ||
) |
Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (64 bytes).
If bit number i in ub
has value 2^i, then the extra bits are those numbered 7 downto 8-n (this is the big-endian convention at the byte level). The context is automatically reinitialized.
cc | the Keccak-512 context |
ub | the extra bits |
n | the number of extra bits (0 to 7) |
dst | the destination buffer |
Definition at line 1816 of file keccak.c.
void sph_keccak512_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current Keccak-512 computation and output the result into the provided buffer.
The destination buffer must be wide enough to accomodate the result (64 bytes). The context is automatically reinitialized.
cc | the Keccak-512 context |
dst | the destination buffer |
Definition at line 1809 of file keccak.c.
void sph_keccak512_init | ( | void * | cc | ) |