![]() |
Raven Core
3.0.0
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 | |
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... | |
#define AES_2ROUNDS | ( | X | ) |
#define BIG_MIX_COLUMNS |
#define BIG_ROUND |
#define BIG_SHIFT_ROWS |
#define BIG_SUB_WORDS |
#define COMPRESS_BIG | ( | sc | ) |
#define COMPRESS_SMALL | ( | sc | ) |
#define FINAL_BIG |
#define FINAL_SMALL |
#define INCR_COUNTER | ( | sc, | |
val | |||
) |
#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) |
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.