Raven Core
3.0.0
P2P Digital Currency
|
Go to the source code of this file.
Macros | |
#define | sM 16 |
#define | C32 SPH_C32 |
#define | T32 SPH_T32 |
#define | O1 13 |
#define | O2 9 |
#define | O3 6 |
#define | DECL_STATE |
#define | READ_STATE(state) |
#define | WRITE_STATE(state) |
#define | DECODE_BLOCK |
#define | INPUT_BLOCK_ADD |
#define | INPUT_BLOCK_SUB |
#define | XOR_W |
#define | SWAP(v1, v2) |
#define | SWAP_BC |
#define | PERM_ELT(xa0, xa1, xb0, xb1, xb2, xb3, xc, xm) |
#define | PERM_STEP_0 |
#define | PERM_STEP_1 |
#define | PERM_STEP_2 |
#define | APPLY_P |
#define | INCR_W |
Functions | |
void | sph_shabal256_init (void *cc) |
Initialize a Shabal-256 context. More... | |
void | sph_shabal256 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_shabal256_close (void *cc, void *dst) |
Terminate the current Shabal-256 computation and output the result into the provided buffer. More... | |
void | sph_shabal256_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_shabal512_init (void *cc) |
Initialize a Shabal-512 context. More... | |
void | sph_shabal512 (void *cc, const void *data, size_t len) |
Process some data bytes. More... | |
void | sph_shabal512_close (void *cc, void *dst) |
Terminate the current Shabal-512 computation and output the result into the provided buffer. More... | |
void | sph_shabal512_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 APPLY_P |
Definition at line 327 of file sph_shabal.c.
#define C32 SPH_C32 |
Definition at line 52 of file sph_shabal.c.
#define DECL_STATE |
Definition at line 66 of file sph_shabal.c.
#define DECODE_BLOCK |
Definition at line 175 of file sph_shabal.c.
#define INCR_W |
Definition at line 385 of file sph_shabal.c.
#define INPUT_BLOCK_ADD |
Definition at line 194 of file sph_shabal.c.
#define INPUT_BLOCK_SUB |
Definition at line 213 of file sph_shabal.c.
#define O1 13 |
Definition at line 55 of file sph_shabal.c.
#define O2 9 |
Definition at line 56 of file sph_shabal.c.
#define O3 6 |
Definition at line 57 of file sph_shabal.c.
#define PERM_ELT | ( | xa0, | |
xa1, | |||
xb0, | |||
xb1, | |||
xb2, | |||
xb3, | |||
xc, | |||
xm | |||
) |
Definition at line 262 of file sph_shabal.c.
#define PERM_STEP_0 |
Definition at line 270 of file sph_shabal.c.
#define PERM_STEP_1 |
Definition at line 289 of file sph_shabal.c.
#define PERM_STEP_2 |
Definition at line 308 of file sph_shabal.c.
#define READ_STATE | ( | state | ) |
Definition at line 77 of file sph_shabal.c.
#define sM 16 |
Definition at line 50 of file sph_shabal.c.
#define SWAP | ( | v1, | |
v2 | |||
) |
Definition at line 237 of file sph_shabal.c.
#define SWAP_BC |
Definition at line 243 of file sph_shabal.c.
#define T32 SPH_T32 |
Definition at line 53 of file sph_shabal.c.
#define WRITE_STATE | ( | state | ) |
Definition at line 126 of file sph_shabal.c.
#define XOR_W |
Definition at line 232 of file sph_shabal.c.
void sph_shabal256 | ( | 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).
cc | the Shabal-256 context |
data | the input data |
len | the input data length (in bytes) |
Definition at line 730 of file sph_shabal.c.
void sph_shabal256_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 Shabal-256 context |
ub | the extra bits |
n | the number of extra bits (0 to 7) |
dst | the destination buffer |
Definition at line 744 of file sph_shabal.c.
void sph_shabal256_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current Shabal-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 Shabal-256 context |
dst | the destination buffer |
Definition at line 737 of file sph_shabal.c.
void sph_shabal256_init | ( | void * | cc | ) |
Initialize a Shabal-256 context.
This process performs no memory allocation.
cc | the Shabal-256 context (pointer to a sph_shabal256_context ) |
Definition at line 723 of file sph_shabal.c.
void sph_shabal512 | ( | 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).
cc | the Shabal-512 context |
data | the input data |
len | the input data length (in bytes) |
Definition at line 788 of file sph_shabal.c.
void sph_shabal512_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 Shabal-512 context |
ub | the extra bits |
n | the number of extra bits (0 to 7) |
dst | the destination buffer |
Definition at line 802 of file sph_shabal.c.
void sph_shabal512_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current Shabal-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 Shabal-512 context |
dst | the destination buffer |
Definition at line 795 of file sph_shabal.c.
void sph_shabal512_init | ( | void * | cc | ) |
Initialize a Shabal-512 context.
This process performs no memory allocation.
cc | the Shabal-512 context (pointer to a sph_shabal512_context ) |
Definition at line 781 of file sph_shabal.c.