Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <stddef.h>
#include <string.h>
#include <limits.h>
#include "sph_echo.h"
#include "aes_helper.c"
Go to the source code of this file.
Macros | |
#define | T32 SPH_T32 |
#define | C32 SPH_C32 |
#define | AES_BIG_ENDIAN 0 |
#define | DECL_STATE_SMALL sph_u32 W[16][4]; |
#define | DECL_STATE_BIG sph_u32 W[16][4]; |
#define | INPUT_BLOCK_SMALL(sc) |
#define | INPUT_BLOCK_BIG(sc) |
#define | AES_2ROUNDS(X) |
#define | BIG_SUB_WORDS |
#define | SHIFT_ROW1(a, b, c, d) |
#define | SHIFT_ROW2(a, b, c, d) |
#define | SHIFT_ROW3(a, b, c, d) SHIFT_ROW1(d, c, b, a) |
#define | BIG_SHIFT_ROWS |
#define | MIX_COLUMN1(ia, ib, ic, id, n) |
#define | MIX_COLUMN(a, b, c, d) |
#define | BIG_MIX_COLUMNS |
#define | BIG_ROUND |
#define | FINAL_SMALL |
#define | FINAL_BIG |
#define | COMPRESS_SMALL(sc) |
#define | COMPRESS_BIG(sc) |
#define | INCR_COUNTER(sc, val) |
Functions | |
static void | echo_small_init (sph_echo_small_context *sc, unsigned out_len) |
static void | echo_big_init (sph_echo_big_context *sc, unsigned out_len) |
static void | echo_small_compress (sph_echo_small_context *sc) |
static void | echo_big_compress (sph_echo_big_context *sc) |
static void | echo_small_core (sph_echo_small_context *sc, const unsigned char *data, size_t len) |
static void | echo_big_core (sph_echo_big_context *sc, const unsigned char *data, size_t len) |
static void | echo_small_close (sph_echo_small_context *sc, unsigned ub, unsigned n, void *dst, unsigned out_size_w32) |
static void | echo_big_close (sph_echo_big_context *sc, unsigned ub, unsigned n, void *dst, unsigned out_size_w32) |
void | sph_echo224_init (void *cc) |
Initialize an ECHO-224 context. More... | |
void | sph_echo224 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_echo224_close (void *cc, void *dst) |
Terminate the current ECHO-224 computation and output the result into the provided buffer. More... | |
void | sph_echo224_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_echo256_init (void *cc) |
Initialize an ECHO-256 context. More... | |
void | sph_echo256 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_echo256_close (void *cc, void *dst) |
Terminate the current ECHO-256 computation and output the result into the provided buffer. More... | |
void | sph_echo256_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_echo384_init (void *cc) |
Initialize an ECHO-384 context. More... | |
void | sph_echo384 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_echo384_close (void *cc, void *dst) |
Terminate the current ECHO-384 computation and output the result into the provided buffer. More... | |
void | sph_echo384_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_echo512_init (void *cc) |
Initialize an ECHO-512 context. More... | |
void | sph_echo512 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_echo512_close (void *cc, void *dst) |
Terminate the current ECHO-512 computation and output the result into the provided buffer. More... | |
void | sph_echo512_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... | |
Macro Definition Documentation
◆ AES_2ROUNDS
#define AES_2ROUNDS | ( | X | ) |
◆ AES_BIG_ENDIAN
◆ BIG_MIX_COLUMNS
#define BIG_MIX_COLUMNS |
◆ BIG_ROUND
#define BIG_ROUND |
◆ BIG_SHIFT_ROWS
#define BIG_SHIFT_ROWS |
◆ BIG_SUB_WORDS
#define BIG_SUB_WORDS |
◆ C32
◆ COMPRESS_BIG
#define COMPRESS_BIG | ( | sc | ) |
Definition at line 622 of file echo.c.
Referenced by echo_big_compress().
◆ COMPRESS_SMALL
#define COMPRESS_SMALL | ( | sc | ) |
Definition at line 609 of file echo.c.
Referenced by echo_small_compress().
◆ DECL_STATE_BIG
#define DECL_STATE_BIG sph_u32 W[16][4]; |
Definition at line 350 of file echo.c.
Referenced by echo_big_compress().
◆ DECL_STATE_SMALL
#define DECL_STATE_SMALL sph_u32 W[16][4]; |
Definition at line 347 of file echo.c.
Referenced by echo_small_compress().
◆ FINAL_BIG
#define FINAL_BIG |
◆ FINAL_SMALL
#define FINAL_SMALL |
◆ INCR_COUNTER
#define INCR_COUNTER | ( | sc, | |
val | |||
) |
Definition at line 637 of file echo.c.
Referenced by echo_big_close(), echo_big_core(), echo_small_close(), and echo_small_core().
◆ INPUT_BLOCK_BIG
#define INPUT_BLOCK_BIG | ( | sc | ) |
◆ INPUT_BLOCK_SMALL
#define INPUT_BLOCK_SMALL | ( | sc | ) |
◆ MIX_COLUMN
#define MIX_COLUMN | ( | a, | |
b, | |||
c, | |||
d | |||
) |
◆ MIX_COLUMN1
#define MIX_COLUMN1 | ( | ia, | |
ib, | |||
ic, | |||
id, | |||
n | |||
) |
◆ SHIFT_ROW1
#define SHIFT_ROW1 | ( | a, | |
b, | |||
c, | |||
d | |||
) |
◆ SHIFT_ROW2
#define SHIFT_ROW2 | ( | a, | |
b, | |||
c, | |||
d | |||
) |
◆ SHIFT_ROW3
#define SHIFT_ROW3 | ( | a, | |
b, | |||
c, | |||
d | |||
) | SHIFT_ROW1(d, c, b, a) |
◆ T32
Function Documentation
◆ echo_big_close()
|
static |
Definition at line 860 of file echo.c.
References sph_echo_big_context::buf, sph_echo_big_context::C0, sph_echo_big_context::C1, sph_echo_big_context::C2, sph_echo_big_context::C3, echo_big_compress(), echo_big_init(), INCR_COUNTER, memcpy(), sph_echo_big_context::ptr, sph_enc16le(), sph_enc32le_aligned(), sph_echo_big_context::u, and sph_echo_big_context::Vs.
Referenced by sph_echo384_addbits_and_close(), sph_echo384_close(), sph_echo512_addbits_and_close(), and sph_echo512_close().
◆ echo_big_compress()
|
static |
Definition at line 723 of file echo.c.
References COMPRESS_BIG, and DECL_STATE_BIG.
Referenced by echo_big_close(), and echo_big_core().
◆ echo_big_core()
|
static |
Definition at line 766 of file echo.c.
References sph_echo_big_context::buf, echo_big_compress(), INCR_COUNTER, memcpy(), and sph_echo_big_context::ptr.
Referenced by sph_echo384(), and sph_echo512().
◆ echo_big_init()
|
static |
Definition at line 673 of file echo.c.
References sph_echo_big_context::C0, sph_echo_big_context::C1, sph_echo_big_context::C2, sph_echo_big_context::C3, sph_echo_big_context::ptr, sph_echo_big_context::u, and sph_echo_big_context::Vs.
Referenced by echo_big_close(), sph_echo384_init(), and sph_echo512_init().
◆ echo_small_close()
|
static |
Definition at line 801 of file echo.c.
References sph_echo_small_context::buf, sph_echo_small_context::C0, sph_echo_small_context::C1, sph_echo_small_context::C2, sph_echo_small_context::C3, echo_small_compress(), echo_small_init(), INCR_COUNTER, memcpy(), sph_echo_small_context::ptr, sph_enc16le(), sph_enc32le_aligned(), sph_echo_small_context::u, and sph_echo_small_context::Vs.
Referenced by sph_echo224_addbits_and_close(), sph_echo224_close(), sph_echo256_addbits_and_close(), and sph_echo256_close().
◆ echo_small_compress()
|
static |
Definition at line 715 of file echo.c.
References COMPRESS_SMALL, and DECL_STATE_SMALL.
Referenced by echo_small_close(), and echo_small_core().
◆ echo_small_core()
|
static |
Definition at line 731 of file echo.c.
References sph_echo_small_context::buf, echo_small_compress(), INCR_COUNTER, memcpy(), and sph_echo_small_context::ptr.
Referenced by sph_echo224(), and sph_echo256().
◆ echo_small_init()
|
static |
Definition at line 647 of file echo.c.
References sph_echo_small_context::C0, sph_echo_small_context::C1, sph_echo_small_context::C2, sph_echo_small_context::C3, sph_echo_small_context::ptr, sph_echo_small_context::u, and sph_echo_small_context::Vs.
Referenced by echo_small_close(), sph_echo224_init(), and sph_echo256_init().
◆ sph_echo224()
void sph_echo224 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
Process some data bytes.
It is acceptable that len
is zero (in which case this function does nothing).
- Parameters
-
cc the ECHO-224 context data the input data len the input data length (in bytes)
Definition at line 927 of file echo.c.
References echo_small_core().
◆ sph_echo224_addbits_and_close()
void sph_echo224_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 ECHO-224 context ub the extra bits n the number of extra bits (0 to 7) dst the destination buffer
Definition at line 941 of file echo.c.
References echo_small_close().
◆ sph_echo224_close()
void sph_echo224_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current ECHO-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 ECHO-224 context dst the destination buffer
Definition at line 934 of file echo.c.
References echo_small_close().
◆ sph_echo224_init()
void sph_echo224_init | ( | void * | cc | ) |
Initialize an ECHO-224 context.
This process performs no memory allocation.
- Parameters
-
cc the ECHO-224 context (pointer to a sph_echo224_context
)
Definition at line 920 of file echo.c.
References echo_small_init().
◆ sph_echo256()
void sph_echo256 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
Process some data bytes.
It is acceptable that len
is zero (in which case this function does nothing).
- Parameters
-
cc the ECHO-256 context data the input data len the input data length (in bytes)
Definition at line 955 of file echo.c.
References echo_small_core().
◆ sph_echo256_addbits_and_close()
void sph_echo256_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 ECHO-256 context ub the extra bits n the number of extra bits (0 to 7) dst the destination buffer
Definition at line 969 of file echo.c.
References echo_small_close().
◆ sph_echo256_close()
void sph_echo256_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current ECHO-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 ECHO-256 context dst the destination buffer
Definition at line 962 of file echo.c.
References echo_small_close().
◆ sph_echo256_init()
void sph_echo256_init | ( | void * | cc | ) |
Initialize an ECHO-256 context.
This process performs no memory allocation.
- Parameters
-
cc the ECHO-256 context (pointer to a sph_echo256_context
)
Definition at line 948 of file echo.c.
References echo_small_init().
◆ sph_echo384()
void sph_echo384 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
Process some data bytes.
It is acceptable that len
is zero (in which case this function does nothing).
- Parameters
-
cc the ECHO-384 context data the input data len the input data length (in bytes)
Definition at line 983 of file echo.c.
References echo_big_core().
◆ sph_echo384_addbits_and_close()
void sph_echo384_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 ECHO-384 context ub the extra bits n the number of extra bits (0 to 7) dst the destination buffer
Definition at line 997 of file echo.c.
References echo_big_close().
◆ sph_echo384_close()
void sph_echo384_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current ECHO-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 ECHO-384 context dst the destination buffer
Definition at line 990 of file echo.c.
References echo_big_close().
◆ sph_echo384_init()
void sph_echo384_init | ( | void * | cc | ) |
Initialize an ECHO-384 context.
This process performs no memory allocation.
- Parameters
-
cc the ECHO-384 context (pointer to a sph_echo384_context
)
Definition at line 976 of file echo.c.
References echo_big_init().
◆ sph_echo512()
void sph_echo512 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
Process some data bytes.
It is acceptable that len
is zero (in which case this function does nothing).
- Parameters
-
cc the ECHO-512 context data the input data len the input data length (in bytes)
Definition at line 1011 of file echo.c.
References echo_big_core().
Referenced by HashX11().
◆ sph_echo512_addbits_and_close()
void sph_echo512_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 ECHO-512 context ub the extra bits n the number of extra bits (0 to 7) dst the destination buffer
Definition at line 1025 of file echo.c.
References echo_big_close().
◆ sph_echo512_close()
void sph_echo512_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current ECHO-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 ECHO-512 context dst the destination buffer
Definition at line 1018 of file echo.c.
References echo_big_close().
Referenced by HashX11().
◆ sph_echo512_init()
void sph_echo512_init | ( | void * | cc | ) |
Initialize an ECHO-512 context.
This process performs no memory allocation.
- Parameters
-
cc the ECHO-512 context (pointer to a sph_echo512_context
)
Definition at line 1004 of file echo.c.
References echo_big_init().
Referenced by HashX11().