![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#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) |
void | sph_echo224 (void *cc, const void *data, size_t len) |
void | sph_echo224_close (void *cc, void *dst) |
void | sph_echo224_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst) |
void | sph_echo256_init (void *cc) |
void | sph_echo256 (void *cc, const void *data, size_t len) |
void | sph_echo256_close (void *cc, void *dst) |
void | sph_echo256_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst) |
void | sph_echo384_init (void *cc) |
void | sph_echo384 (void *cc, const void *data, size_t len) |
void | sph_echo384_close (void *cc, void *dst) |
void | sph_echo384_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst) |
void | sph_echo512_init (void *cc) |
void | sph_echo512 (void *cc, const void *data, size_t len) |
void | sph_echo512_close (void *cc, void *dst) |
void | sph_echo512_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst) |
#define AES_2ROUNDS | ( | X | ) |
#define BIG_MIX_COLUMNS |
#define BIG_ROUND |
#define BIG_SHIFT_ROWS |
#define BIG_SUB_WORDS |
#define COMPRESS_BIG | ( | sc | ) |
Definition at line 622 of file echo.c.
Referenced by echo_big_compress().
#define COMPRESS_SMALL | ( | sc | ) |
Definition at line 609 of file echo.c.
Referenced by echo_small_compress().
#define DECL_STATE_BIG sph_u32 W[16][4]; |
Definition at line 350 of file echo.c.
Referenced by echo_big_compress().
#define DECL_STATE_SMALL sph_u32 W[16][4]; |
Definition at line 347 of file echo.c.
Referenced by echo_small_compress().
#define FINAL_BIG |
#define FINAL_SMALL |
#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().
#define INPUT_BLOCK_BIG | ( | sc | ) |
#define INPUT_BLOCK_SMALL | ( | sc | ) |
#define MIX_COLUMN | ( | a, | |
b, | |||
c, | |||
d | |||
) |
#define MIX_COLUMN1 | ( | ia, | |
ib, | |||
ic, | |||
id, | |||
n | |||
) |
#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) |
|
static |
Definition at line 860 of file echo.c.
Referenced by sph_echo384_addbits_and_close(), sph_echo384_close(), sph_echo512_addbits_and_close(), and sph_echo512_close().
|
static |
Definition at line 723 of file echo.c.
Referenced by echo_big_close(), and echo_big_core().
|
static |
Definition at line 766 of file echo.c.
Referenced by sph_echo384(), and sph_echo512().
|
static |
Definition at line 673 of file echo.c.
Referenced by echo_big_close(), sph_echo384_init(), and sph_echo512_init().
|
static |
Definition at line 801 of file echo.c.
Referenced by sph_echo224_addbits_and_close(), sph_echo224_close(), sph_echo256_addbits_and_close(), and sph_echo256_close().
|
static |
Definition at line 715 of file echo.c.
Referenced by echo_small_close(), and echo_small_core().
|
static |
Definition at line 731 of file echo.c.
Referenced by sph_echo224(), and sph_echo256().
|
static |
Definition at line 647 of file echo.c.
Referenced by echo_small_close(), sph_echo224_init(), and sph_echo256_init().
void sph_echo224 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
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.
cc | the ECHO-224 context |
ub | the extra bits |
n | the number of extra bits (0 to 7) |
dst | the destination buffer |
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.
cc | the ECHO-224 context |
dst | the destination buffer |
void sph_echo224_init | ( | void * | cc | ) |
void sph_echo256 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
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.
cc | the ECHO-256 context |
ub | the extra bits |
n | the number of extra bits (0 to 7) |
dst | the destination buffer |
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.
cc | the ECHO-256 context |
dst | the destination buffer |
void sph_echo256_init | ( | void * | cc | ) |
void sph_echo384 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
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.
cc | the ECHO-384 context |
ub | the extra bits |
n | the number of extra bits (0 to 7) |
dst | the destination buffer |
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.
cc | the ECHO-384 context |
dst | the destination buffer |
void sph_echo384_init | ( | void * | cc | ) |
void sph_echo512 | ( | void * | cc, |
const void * | data, | ||
size_t | len | ||
) |
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.
cc | the ECHO-512 context |
ub | the extra bits |
n | the number of extra bits (0 to 7) |
dst | the destination buffer |
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.
cc | the ECHO-512 context |
dst | the destination buffer |
Definition at line 1018 of file echo.c.
Referenced by HashX11().