Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
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 | |
static void | compress_small (const unsigned char *data, const sph_u32 h[16], sph_u32 dh[16]) |
static void | bmw32_init (sph_bmw_small_context *sc, const sph_u32 *iv) |
static void | bmw32 (sph_bmw_small_context *sc, const void *data, size_t len) |
static void | bmw32_close (sph_bmw_small_context *sc, unsigned ub, unsigned n, void *dst, size_t out_size_w32) |
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... | |
Variables | |
static const sph_u32 | IV224 [] |
static const sph_u32 | IV256 [] |
static const sph_u32 | final_s [16] |
Macro Definition Documentation
◆ add_elt_s
#define add_elt_s | ( | mf, | |
hf, | |||
j0m, | |||
j1m, | |||
j3m, | |||
j4m, | |||
j7m, | |||
j10m, | |||
j11m, | |||
j16 | |||
) |
◆ dH
#define dH | ( | x | ) | (dh[x]) |
◆ expand1s
#define expand1s | ( | qf, | |
mf, | |||
hf, | |||
i16 | |||
) | expand1s_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16) |
◆ expand1s_
#define expand1s_ | ( | qf, | |
mf, | |||
hf, | |||
i16, | |||
ix, | |||
iy | |||
) | expand1s_inner LPAR qf, mf, hf, i16, ix, iy) |
◆ expand1s_inner
#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 | |||
) |
◆ expand2s
#define expand2s | ( | qf, | |
mf, | |||
hf, | |||
i16 | |||
) | expand2s_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16) |
◆ expand2s_
#define expand2s_ | ( | qf, | |
mf, | |||
hf, | |||
i16, | |||
ix, | |||
iy | |||
) | expand2s_inner LPAR qf, mf, hf, i16, ix, iy) |
◆ expand2s_inner
#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 | |||
) |
◆ FOLD
◆ FOLDs
Definition at line 560 of file bmw.c.
Referenced by compress_small().
◆ H
#define H | ( | x | ) | (h[x]) |
Referenced by groestl_big_close(), and groestl_small_close().
◆ I16_16
#define I16_16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 |
◆ I16_17
#define I16_17 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
◆ I16_18
#define I16_18 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 |
◆ I16_19
#define I16_19 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 |
◆ I16_20
#define I16_20 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 |
◆ I16_21
#define I16_21 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 |
◆ I16_22
#define I16_22 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 |
◆ I16_23
#define I16_23 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 |
◆ I16_24
#define I16_24 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 |
◆ I16_25
#define I16_25 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 |
◆ I16_26
#define I16_26 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 |
◆ I16_27
#define I16_27 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 |
◆ I16_28
#define I16_28 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 |
◆ I16_29
#define I16_29 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 |
◆ I16_30
#define I16_30 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 |
◆ I16_31
#define I16_31 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 |
◆ Ks
◆ LPAR
◆ M
#define M | ( | x | ) | (mv[x]) |
Referenced by secp256k1_fe_mul_inner(), and secp256k1_fe_sqr_inner().
◆ M16_16
◆ M16_17
◆ M16_18
◆ M16_19
◆ M16_20
◆ M16_21
◆ M16_22
◆ M16_23
◆ M16_24
◆ M16_25
◆ M16_26
◆ M16_27
◆ M16_28
◆ M16_29
◆ M16_30
◆ M16_31
◆ MAKE_Qas
#define MAKE_Qas |
◆ MAKE_Qbs
#define MAKE_Qbs |
◆ MAKE_Qs
#define MAKE_Qs |
◆ MAKE_W
#define MAKE_W | ( | tt, | |
i0, | |||
op01, | |||
i1, | |||
op12, | |||
i2, | |||
op23, | |||
i3, | |||
op34, | |||
i4 | |||
) |
◆ Qs
◆ rs1
#define rs1 | ( | x | ) | SPH_ROTL32(x, 3) |
◆ rs2
#define rs2 | ( | x | ) | SPH_ROTL32(x, 7) |
◆ rs3
#define rs3 | ( | x | ) | SPH_ROTL32(x, 13) |
◆ rs4
#define rs4 | ( | x | ) | SPH_ROTL32(x, 16) |
◆ rs5
#define rs5 | ( | x | ) | SPH_ROTL32(x, 19) |
◆ rs6
#define rs6 | ( | x | ) | SPH_ROTL32(x, 23) |
◆ rs7
#define rs7 | ( | x | ) | SPH_ROTL32(x, 27) |
◆ ss0
#define ss0 | ( | x | ) |
◆ ss1
#define ss1 | ( | x | ) |
◆ ss2
#define ss2 | ( | x | ) |
◆ ss3
#define ss3 | ( | x | ) |
◆ ss4
◆ ss5
◆ Ws0
◆ Ws1
◆ Ws10
◆ Ws11
◆ Ws12
◆ Ws13
◆ Ws14
◆ Ws15
◆ Ws2
◆ Ws3
◆ Ws4
◆ Ws5
◆ Ws6
◆ Ws7
◆ Ws8
◆ Ws9
◆ XCAT
◆ XCAT_
Function Documentation
◆ bmw32()
|
static |
Definition at line 627 of file bmw.c.
References sph_bmw_small_context::bit_count_high, sph_bmw_small_context::bit_count_low, sph_bmw_small_context::buf, compress_small(), sph_bmw_small_context::H, memcpy(), sph_bmw_small_context::ptr, and SPH_T32.
Referenced by sph_bmw224(), and sph_bmw256().
◆ bmw32_close()
|
static |
Definition at line 676 of file bmw.c.
References sph_bmw_small_context::bit_count_high, sph_bmw_small_context::bit_count_low, sph_bmw_small_context::buf, compress_small(), final_s, sph_bmw_small_context::H, sph_bmw_small_context::ptr, sph_enc32le(), sph_enc32le_aligned(), and SPH_T32.
Referenced by sph_bmw224_addbits_and_close(), and sph_bmw256_addbits_and_close().
◆ bmw32_init()
|
static |
Definition at line 614 of file bmw.c.
References sph_bmw_small_context::bit_count_high, sph_bmw_small_context::bit_count_low, sph_bmw_small_context::H, memcpy(), and sph_bmw_small_context::ptr.
Referenced by sph_bmw224_init(), and sph_bmw256_init().
◆ compress_small()
|
static |
Definition at line 569 of file bmw.c.
References FOLDs, and sph_dec32le_aligned().
Referenced by bmw32(), and bmw32_close().
◆ sph_bmw224()
void sph_bmw224 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
◆ sph_bmw224_addbits_and_close()
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.
- Parameters
-
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.
References bmw32_close(), and sph_bmw224_init().
Referenced by sph_bmw224_close().
◆ sph_bmw224_close()
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.
- Parameters
-
cc the BMW-224 context dst the destination buffer
Definition at line 859 of file bmw.c.
References sph_bmw224_addbits_and_close().
◆ sph_bmw224_init()
void sph_bmw224_init | ( | void * | cc | ) |
Initialize a BMW-224 context.
This process performs no memory allocation.
- Parameters
-
cc the BMW-224 context (pointer to a sph_bmw224_context
)
Definition at line 845 of file bmw.c.
References bmw32_init(), and IV224.
Referenced by sph_bmw224_addbits_and_close().
◆ sph_bmw256()
void sph_bmw256 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
◆ sph_bmw256_addbits_and_close()
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.
- Parameters
-
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.
References bmw32_close(), and sph_bmw256_init().
Referenced by sph_bmw256_close().
◆ sph_bmw256_close()
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.
- Parameters
-
cc the BMW-256 context dst the destination buffer
Definition at line 888 of file bmw.c.
References sph_bmw256_addbits_and_close().
◆ sph_bmw256_init()
void sph_bmw256_init | ( | void * | cc | ) |
Initialize a BMW-256 context.
This process performs no memory allocation.
- Parameters
-
cc the BMW-256 context (pointer to a sph_bmw256_context
)
Definition at line 874 of file bmw.c.
References bmw32_init(), and IV256.
Referenced by sph_bmw256_addbits_and_close().
Variable Documentation
◆ final_s
|
static |
◆ IV224
|
static |
◆ IV256
|
static |