Raven Core
3.0.0
P2P Digital Currency
|
Go to the source code of this file.
Macros | |
#define | XCAT(x, y) XCAT_(x, y) |
#define | XCAT_(x, y) x ## y |
#define | LPAR ( |
#define | I16_16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 |
#define | I16_17 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
#define | I16_18 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 |
#define | I16_19 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 |
#define | I16_20 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 |
#define | I16_21 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 |
#define | I16_22 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 |
#define | I16_23 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 |
#define | I16_24 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 |
#define | I16_25 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 |
#define | I16_26 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 |
#define | I16_27 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 |
#define | I16_28 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 |
#define | I16_29 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 |
#define | I16_30 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 |
#define | I16_31 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 |
#define | M16_16 0, 1, 3, 4, 7, 10, 11 |
#define | M16_17 1, 2, 4, 5, 8, 11, 12 |
#define | M16_18 2, 3, 5, 6, 9, 12, 13 |
#define | M16_19 3, 4, 6, 7, 10, 13, 14 |
#define | M16_20 4, 5, 7, 8, 11, 14, 15 |
#define | M16_21 5, 6, 8, 9, 12, 15, 16 |
#define | M16_22 6, 7, 9, 10, 13, 0, 1 |
#define | M16_23 7, 8, 10, 11, 14, 1, 2 |
#define | M16_24 8, 9, 11, 12, 15, 2, 3 |
#define | M16_25 9, 10, 12, 13, 0, 3, 4 |
#define | M16_26 10, 11, 13, 14, 1, 4, 5 |
#define | M16_27 11, 12, 14, 15, 2, 5, 6 |
#define | M16_28 12, 13, 15, 16, 3, 6, 7 |
#define | M16_29 13, 14, 0, 1, 4, 7, 8 |
#define | M16_30 14, 15, 1, 2, 5, 8, 9 |
#define | M16_31 15, 16, 2, 3, 6, 9, 10 |
#define | ss0(x) |
#define | ss1(x) |
#define | ss2(x) |
#define | ss3(x) |
#define | ss4(x) (((x) >> 1) ^ (x)) |
#define | ss5(x) (((x) >> 2) ^ (x)) |
#define | rs1(x) SPH_ROTL32(x, 3) |
#define | rs2(x) SPH_ROTL32(x, 7) |
#define | rs3(x) SPH_ROTL32(x, 13) |
#define | rs4(x) SPH_ROTL32(x, 16) |
#define | rs5(x) SPH_ROTL32(x, 19) |
#define | rs6(x) SPH_ROTL32(x, 23) |
#define | rs7(x) SPH_ROTL32(x, 27) |
#define | Ks(j) SPH_T32((sph_u32)(j) * SPH_C32(0x05555555)) |
#define | add_elt_s(mf, hf, j0m, j1m, j3m, j4m, j7m, j10m, j11m, j16) |
#define | expand1s_inner(qf, mf, hf, i16, i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i0m, i1m, i3m, i4m, i7m, i10m, i11m) |
#define | expand1s(qf, mf, hf, i16) expand1s_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16) |
#define | expand1s_(qf, mf, hf, i16, ix, iy) expand1s_inner LPAR qf, mf, hf, i16, ix, iy) |
#define | expand2s_inner(qf, mf, hf, i16, i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i0m, i1m, i3m, i4m, i7m, i10m, i11m) |
#define | expand2s(qf, mf, hf, i16) expand2s_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16) |
#define | expand2s_(qf, mf, hf, i16, ix, iy) expand2s_inner LPAR qf, mf, hf, i16, ix, iy) |
#define | MAKE_W(tt, i0, op01, i1, op12, i2, op23, i3, op34, i4) |
#define | Ws0 MAKE_W(SPH_T32, 5, -, 7, +, 10, +, 13, +, 14) |
#define | Ws1 MAKE_W(SPH_T32, 6, -, 8, +, 11, +, 14, -, 15) |
#define | Ws2 MAKE_W(SPH_T32, 0, +, 7, +, 9, -, 12, +, 15) |
#define | Ws3 MAKE_W(SPH_T32, 0, -, 1, +, 8, -, 10, +, 13) |
#define | Ws4 MAKE_W(SPH_T32, 1, +, 2, +, 9, -, 11, -, 14) |
#define | Ws5 MAKE_W(SPH_T32, 3, -, 2, +, 10, -, 12, +, 15) |
#define | Ws6 MAKE_W(SPH_T32, 4, -, 0, -, 3, -, 11, +, 13) |
#define | Ws7 MAKE_W(SPH_T32, 1, -, 4, -, 5, -, 12, -, 14) |
#define | Ws8 MAKE_W(SPH_T32, 2, -, 5, -, 6, +, 13, -, 15) |
#define | Ws9 MAKE_W(SPH_T32, 0, -, 3, +, 6, -, 7, +, 14) |
#define | Ws10 MAKE_W(SPH_T32, 8, -, 1, -, 4, -, 7, +, 15) |
#define | Ws11 MAKE_W(SPH_T32, 8, -, 0, -, 2, -, 5, +, 9) |
#define | Ws12 MAKE_W(SPH_T32, 1, +, 3, -, 6, -, 9, +, 10) |
#define | Ws13 MAKE_W(SPH_T32, 2, +, 4, +, 7, +, 10, +, 11) |
#define | Ws14 MAKE_W(SPH_T32, 3, -, 5, +, 8, -, 11, -, 12) |
#define | Ws15 MAKE_W(SPH_T32, 12, -, 4, -, 6, -, 9, +, 13) |
#define | MAKE_Qas |
#define | MAKE_Qbs |
#define | MAKE_Qs |
#define | Qs(j) (qt[j]) |
#define | FOLD(type, mkQ, tt, rol, mf, qf, dhf) |
#define | FOLDs FOLD(sph_u32, MAKE_Qs, SPH_T32, SPH_ROTL32, M, Qs, dH) |
#define | M(x) (mv[x]) |
#define | H(x) (h[x]) |
#define | dH(x) (dh[x]) |
Functions | |
void | sph_bmw224_init (void *cc) |
Initialize a BMW-224 context. More... | |
void | sph_bmw224 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_bmw224_close (void *cc, void *dst) |
Terminate the current BMW-224 computation and output the result into the provided buffer. More... | |
void | sph_bmw224_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_bmw256_init (void *cc) |
Initialize a BMW-256 context. More... | |
void | sph_bmw256 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_bmw256_close (void *cc, void *dst) |
Terminate the current BMW-256 computation and output the result into the provided buffer. More... | |
void | sph_bmw256_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... | |
#define add_elt_s | ( | mf, | |
hf, | |||
j0m, | |||
j1m, | |||
j3m, | |||
j4m, | |||
j7m, | |||
j10m, | |||
j11m, | |||
j16 | |||
) |
#define dH | ( | x | ) | (dh[x]) |
#define expand1s | ( | qf, | |
mf, | |||
hf, | |||
i16 | |||
) | expand1s_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16) |
#define expand1s_ | ( | qf, | |
mf, | |||
hf, | |||
i16, | |||
ix, | |||
iy | |||
) | expand1s_inner LPAR qf, mf, hf, i16, ix, iy) |
#define expand1s_inner | ( | qf, | |
mf, | |||
hf, | |||
i16, | |||
i0, | |||
i1, | |||
i2, | |||
i3, | |||
i4, | |||
i5, | |||
i6, | |||
i7, | |||
i8, | |||
i9, | |||
i10, | |||
i11, | |||
i12, | |||
i13, | |||
i14, | |||
i15, | |||
i0m, | |||
i1m, | |||
i3m, | |||
i4m, | |||
i7m, | |||
i10m, | |||
i11m | |||
) |
#define expand2s | ( | qf, | |
mf, | |||
hf, | |||
i16 | |||
) | expand2s_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16) |
#define expand2s_ | ( | qf, | |
mf, | |||
hf, | |||
i16, | |||
ix, | |||
iy | |||
) | expand2s_inner LPAR qf, mf, hf, i16, ix, iy) |
#define expand2s_inner | ( | qf, | |
mf, | |||
hf, | |||
i16, | |||
i0, | |||
i1, | |||
i2, | |||
i3, | |||
i4, | |||
i5, | |||
i6, | |||
i7, | |||
i8, | |||
i9, | |||
i10, | |||
i11, | |||
i12, | |||
i13, | |||
i14, | |||
i15, | |||
i0m, | |||
i1m, | |||
i3m, | |||
i4m, | |||
i7m, | |||
i10m, | |||
i11m | |||
) |
#define H | ( | x | ) | (h[x]) |
#define I16_16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 |
#define I16_17 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
#define I16_18 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 |
#define I16_19 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 |
#define I16_20 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 |
#define I16_21 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 |
#define I16_22 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 |
#define I16_23 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 |
#define I16_24 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 |
#define I16_25 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 |
#define I16_26 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 |
#define I16_27 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 |
#define I16_28 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 |
#define I16_29 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 |
#define I16_30 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 |
#define I16_31 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 |
#define M | ( | x | ) | (mv[x]) |
#define MAKE_Qas |
#define MAKE_Qbs |
#define MAKE_Qs |
#define MAKE_W | ( | tt, | |
i0, | |||
op01, | |||
i1, | |||
op12, | |||
i2, | |||
op23, | |||
i3, | |||
op34, | |||
i4 | |||
) |
#define rs1 | ( | x | ) | SPH_ROTL32(x, 3) |
#define rs2 | ( | x | ) | SPH_ROTL32(x, 7) |
#define rs3 | ( | x | ) | SPH_ROTL32(x, 13) |
#define rs4 | ( | x | ) | SPH_ROTL32(x, 16) |
#define rs5 | ( | x | ) | SPH_ROTL32(x, 19) |
#define rs6 | ( | x | ) | SPH_ROTL32(x, 23) |
#define rs7 | ( | x | ) | SPH_ROTL32(x, 27) |
#define ss0 | ( | x | ) |
#define ss1 | ( | x | ) |
#define ss2 | ( | x | ) |
#define ss3 | ( | x | ) |
void sph_bmw224 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
void sph_bmw224_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 BMW-224 context |
ub | the extra bits |
n | the number of extra bits (0 to 7) |
dst | the destination buffer |
Definition at line 866 of file bmw.c.
void sph_bmw224_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current BMW-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 BMW-224 context |
dst | the destination buffer |
Definition at line 859 of file bmw.c.
void sph_bmw224_init | ( | void * | cc | ) |
void sph_bmw256 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
void sph_bmw256_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 BMW-256 context |
ub | the extra bits |
n | the number of extra bits (0 to 7) |
dst | the destination buffer |
Definition at line 895 of file bmw.c.
void sph_bmw256_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current BMW-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 BMW-256 context |
dst | the destination buffer |
Definition at line 888 of file bmw.c.