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 | DECL_TMP8(w) sph_u32 w ## 0, w ## 1, w ## 2, w ## 3, w ## 4, w ## 5, w ## 6, w ## 7; |
#define | M2(d, s) |
#define | XOR(d, s1, s2) |
#define | SUB_CRUMB(a0, a1, a2, a3) |
#define | MIX_WORD(u, v) |
#define | DECL_STATE3 |
#define | READ_STATE3(state) |
#define | WRITE_STATE3(state) |
#define | MI3 |
#define | TWEAK3 |
#define | P3 |
#define | DECL_STATE4 |
#define | READ_STATE4(state) |
#define | WRITE_STATE4(state) |
#define | MI4 |
#define | TWEAK4 |
#define | P4 |
#define | DECL_STATE5 |
#define | READ_STATE5(state) |
#define | WRITE_STATE5(state) |
#define | MI5 |
#define | TWEAK5 |
#define | P5 |
Functions | |
static void | luffa3 (sph_luffa224_context *sc, const void *data, size_t len) |
static void | luffa3_close (sph_luffa224_context *sc, unsigned ub, unsigned n, void *dst, unsigned out_size_w32) |
static void | luffa4 (sph_luffa384_context *sc, const void *data, size_t len) |
static void | luffa4_close (sph_luffa384_context *sc, unsigned ub, unsigned n, void *dst) |
static void | luffa5 (sph_luffa512_context *sc, const void *data, size_t len) |
static void | luffa5_close (sph_luffa512_context *sc, unsigned ub, unsigned n, void *dst) |
void | sph_luffa224_init (void *cc) |
Initialize a Luffa-224 context. More... | |
void | sph_luffa224 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_luffa224_close (void *cc, void *dst) |
Terminate the current Luffa-224 computation and output the result into the provided buffer. More... | |
void | sph_luffa224_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_luffa256_init (void *cc) |
Initialize a Luffa-256 context. More... | |
void | sph_luffa256 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_luffa256_close (void *cc, void *dst) |
Terminate the current Luffa-256 computation and output the result into the provided buffer. More... | |
void | sph_luffa256_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_luffa384_init (void *cc) |
Initialize a Luffa-384 context. More... | |
void | sph_luffa384 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_luffa384_close (void *cc, void *dst) |
Terminate the current Luffa-384 computation and output the result into the provided buffer. More... | |
void | sph_luffa384_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_luffa512_init (void *cc) |
Initialize a Luffa-512 context. More... | |
void | sph_luffa512 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_luffa512_close (void *cc, void *dst) |
Terminate the current Luffa-512 computation and output the result into the provided buffer. More... | |
void | sph_luffa512_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... | |
Variables | |
static const sph_u32 | V_INIT [5][8] |
static const sph_u32 | RC00 [8] |
static const sph_u32 | RC04 [8] |
static const sph_u32 | RC10 [8] |
static const sph_u32 | RC14 [8] |
static const sph_u32 | RC20 [8] |
static const sph_u32 | RC24 [8] |
static const sph_u32 | RC30 [8] |
static const sph_u32 | RC34 [8] |
static const sph_u32 | RC40 [8] |
static const sph_u32 | RC44 [8] |
Macro Definition Documentation
◆ DECL_STATE3
#define DECL_STATE3 |
Definition at line 310 of file luffa.c.
Referenced by luffa3(), and luffa3_close().
◆ DECL_STATE4
#define DECL_STATE4 |
Definition at line 495 of file luffa.c.
Referenced by luffa4(), and luffa4_close().
◆ DECL_STATE5
#define DECL_STATE5 |
Definition at line 748 of file luffa.c.
Referenced by luffa5(), and luffa5_close().
◆ DECL_TMP8
#define DECL_TMP8 | ( | w | ) | sph_u32 w ## 0, w ## 1, w ## 2, w ## 3, w ## 4, w ## 5, w ## 6, w ## 7; |
◆ M2
#define M2 | ( | d, | |
s | |||
) |
◆ MI3
#define MI3 |
Definition at line 369 of file luffa.c.
Referenced by luffa3(), and luffa3_close().
◆ MI4
#define MI4 |
Definition at line 571 of file luffa.c.
Referenced by luffa4(), and luffa4_close().
◆ MI5
#define MI5 |
Definition at line 841 of file luffa.c.
Referenced by luffa5(), and luffa5_close().
◆ MIX_WORD
#define MIX_WORD | ( | u, | |
v | |||
) |
◆ P3
#define P3 |
Definition at line 458 of file luffa.c.
Referenced by luffa3(), and luffa3_close().
◆ P4
#define P4 |
Definition at line 701 of file luffa.c.
Referenced by luffa4(), and luffa4_close().
◆ P5
#define P5 |
Definition at line 1001 of file luffa.c.
Referenced by luffa5(), and luffa5_close().
◆ READ_STATE3
#define READ_STATE3 | ( | state | ) |
Definition at line 315 of file luffa.c.
Referenced by luffa3(), and luffa3_close().
◆ READ_STATE4
#define READ_STATE4 | ( | state | ) |
Definition at line 501 of file luffa.c.
Referenced by luffa4(), and luffa4_close().
◆ READ_STATE5
#define READ_STATE5 | ( | state | ) |
Definition at line 755 of file luffa.c.
Referenced by luffa5(), and luffa5_close().
◆ SUB_CRUMB
#define SUB_CRUMB | ( | a0, | |
a1, | |||
a2, | |||
a3 | |||
) |
◆ TWEAK3
#define TWEAK3 |
◆ TWEAK4
#define TWEAK4 |
◆ TWEAK5
#define TWEAK5 |
◆ WRITE_STATE3
#define WRITE_STATE3 | ( | state | ) |
Definition at line 342 of file luffa.c.
Referenced by luffa3().
◆ WRITE_STATE4
◆ WRITE_STATE5
◆ XOR
#define XOR | ( | d, | |
s1, | |||
s2 | |||
) |
Function Documentation
◆ luffa3()
|
static |
Definition at line 1059 of file luffa.c.
References sph_luffa224_context::buf, DECL_STATE3, memcpy(), MI3, P3, sph_luffa224_context::ptr, READ_STATE3, and WRITE_STATE3.
Referenced by sph_luffa224(), and sph_luffa256().
◆ luffa3_close()
|
static |
Definition at line 1096 of file luffa.c.
References sph_luffa224_context::buf, DECL_STATE3, MI3, P3, sph_luffa224_context::ptr, READ_STATE3, and sph_enc32be().
Referenced by sph_luffa224_addbits_and_close(), and sph_luffa256_addbits_and_close().
◆ luffa4()
|
static |
Definition at line 1129 of file luffa.c.
References sph_luffa384_context::buf, DECL_STATE4, memcpy(), MI4, P4, sph_luffa384_context::ptr, READ_STATE4, and WRITE_STATE4.
Referenced by sph_luffa384().
◆ luffa4_close()
|
static |
Definition at line 1166 of file luffa.c.
References sph_luffa384_context::buf, DECL_STATE4, MI4, P4, sph_luffa384_context::ptr, READ_STATE4, and sph_enc32be().
Referenced by sph_luffa384_addbits_and_close().
◆ luffa5()
|
static |
Definition at line 1209 of file luffa.c.
References sph_luffa512_context::buf, DECL_STATE5, memcpy(), MI5, P5, sph_luffa512_context::ptr, READ_STATE5, and WRITE_STATE5.
Referenced by sph_luffa512().
◆ luffa5_close()
|
static |
Definition at line 1246 of file luffa.c.
References sph_luffa512_context::buf, DECL_STATE5, MI5, P5, sph_luffa512_context::ptr, READ_STATE5, and sph_enc32be().
Referenced by sph_luffa512_addbits_and_close().
◆ sph_luffa224()
void sph_luffa224 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
◆ sph_luffa224_addbits_and_close()
void sph_luffa224_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 Luffa-224 context ub the extra bits n the number of extra bits (0 to 7) dst the destination buffer
Definition at line 1319 of file luffa.c.
References luffa3_close(), and sph_luffa224_init().
Referenced by sph_luffa224_close().
◆ sph_luffa224_close()
void sph_luffa224_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current Luffa-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 Luffa-224 context dst the destination buffer
Definition at line 1312 of file luffa.c.
References sph_luffa224_addbits_and_close().
◆ sph_luffa224_init()
void sph_luffa224_init | ( | void * | cc | ) |
Initialize a Luffa-224 context.
This process performs no memory allocation.
- Parameters
-
cc the Luffa-224 context (pointer to a sph_luffa224_context
)
Definition at line 1294 of file luffa.c.
References memcpy(), sph_luffa224_context::ptr, sph_luffa224_context::V, and V_INIT.
Referenced by sph_luffa224_addbits_and_close().
◆ sph_luffa256()
void sph_luffa256 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
◆ sph_luffa256_addbits_and_close()
void sph_luffa256_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 Luffa-256 context ub the extra bits n the number of extra bits (0 to 7) dst the destination buffer
Definition at line 1352 of file luffa.c.
References luffa3_close(), and sph_luffa256_init().
Referenced by sph_luffa256_close().
◆ sph_luffa256_close()
void sph_luffa256_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current Luffa-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 Luffa-256 context dst the destination buffer
Definition at line 1345 of file luffa.c.
References sph_luffa256_addbits_and_close().
◆ sph_luffa256_init()
void sph_luffa256_init | ( | void * | cc | ) |
Initialize a Luffa-256 context.
This process performs no memory allocation.
- Parameters
-
cc the Luffa-256 context (pointer to a sph_luffa256_context
)
Definition at line 1327 of file luffa.c.
References memcpy(), sph_luffa224_context::ptr, sph_luffa224_context::V, and V_INIT.
Referenced by sph_luffa256_addbits_and_close().
◆ sph_luffa384()
void sph_luffa384 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
◆ sph_luffa384_addbits_and_close()
void sph_luffa384_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.
- Parameters
-
cc the Luffa-384 context ub the extra bits n the number of extra bits (0 to 7) dst the destination buffer
Definition at line 1385 of file luffa.c.
References luffa4_close(), and sph_luffa384_init().
Referenced by sph_luffa384_close().
◆ sph_luffa384_close()
void sph_luffa384_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current Luffa-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.
- Parameters
-
cc the Luffa-384 context dst the destination buffer
Definition at line 1378 of file luffa.c.
References sph_luffa384_addbits_and_close().
◆ sph_luffa384_init()
void sph_luffa384_init | ( | void * | cc | ) |
Initialize a Luffa-384 context.
This process performs no memory allocation.
- Parameters
-
cc the Luffa-384 context (pointer to a sph_luffa384_context
)
Definition at line 1360 of file luffa.c.
References memcpy(), sph_luffa384_context::ptr, sph_luffa384_context::V, and V_INIT.
Referenced by sph_luffa384_addbits_and_close().
◆ sph_luffa512()
void sph_luffa512 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
◆ sph_luffa512_addbits_and_close()
void sph_luffa512_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.
- Parameters
-
cc the Luffa-512 context ub the extra bits n the number of extra bits (0 to 7) dst the destination buffer
Definition at line 1418 of file luffa.c.
References luffa5_close(), and sph_luffa512_init().
Referenced by sph_luffa512_close().
◆ sph_luffa512_close()
void sph_luffa512_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current Luffa-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.
- Parameters
-
cc the Luffa-512 context dst the destination buffer
Definition at line 1411 of file luffa.c.
References sph_luffa512_addbits_and_close().
Referenced by HashX11().
◆ sph_luffa512_init()
void sph_luffa512_init | ( | void * | cc | ) |
Initialize a Luffa-512 context.
This process performs no memory allocation.
- Parameters
-
cc the Luffa-512 context (pointer to a sph_luffa512_context
)
Definition at line 1393 of file luffa.c.
References memcpy(), sph_luffa512_context::ptr, sph_luffa512_context::V, and V_INIT.
Referenced by HashX11(), and sph_luffa512_addbits_and_close().
Variable Documentation
◆ RC00
|
static |
◆ RC04
|
static |
◆ RC10
|
static |
◆ RC14
|
static |
◆ RC20
|
static |
◆ RC24
|
static |
◆ RC30
|
static |
◆ RC34
|
static |
◆ RC40
|
static |
◆ RC44
|
static |
◆ V_INIT
|
static |
Definition at line 51 of file luffa.c.
Referenced by sph_luffa224_init(), sph_luffa256_init(), sph_luffa384_init(), and sph_luffa512_init().