Raven Core
3.0.0
P2P Digital Currency
|
Go to the source code of this file.
Macros | |
#define | CH(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z)) |
#define | MAJ(X, Y, Z) (((Y) & (Z)) | (((Y) | (Z)) & (X))) |
#define | ROTR SPH_ROTR32 |
#define | BSG2_0(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) |
#define | BSG2_1(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) |
#define | SSG2_0(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SPH_T32((x) >> 3)) |
#define | SSG2_1(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SPH_T32((x) >> 10)) |
#define | SHA2_ROUND_BODY(in, r) |
#define | SHA2_IN(x) sph_dec32be_aligned(data + (4 * (x))) |
#define | RFUN sha2_round |
#define | HASH sha224 |
#define | BE32 1 |
#define | SHA2_IN(x) msg[x] |
Functions | |
void | sph_sha224_init (void *cc) |
Initialize a SHA-224 context. More... | |
void | sph_sha256_init (void *cc) |
Initialize a SHA-256 context. More... | |
void | sph_sha224_close (void *cc, void *dst) |
Terminate the current SHA-224 computation and output the result into the provided buffer. More... | |
void | sph_sha224_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_sha256_close (void *cc, void *dst) |
Terminate the current SHA-256 computation and output the result into the provided buffer. More... | |
void | sph_sha256_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_sha224_comp (const sph_u32 msg[16], sph_u32 val[8]) |
Apply the SHA-224 compression function on the provided data. More... | |
#define BE32 1 |
Definition at line 655 of file sph_sha2.c.
Definition at line 51 of file sph_sha2.c.
Definition at line 52 of file sph_sha2.c.
Definition at line 46 of file sph_sha2.c.
#define HASH sha224 |
Definition at line 654 of file sph_sha2.c.
Definition at line 47 of file sph_sha2.c.
#define RFUN sha2_round |
Definition at line 653 of file sph_sha2.c.
#define ROTR SPH_ROTR32 |
Definition at line 49 of file sph_sha2.c.
#define SHA2_IN | ( | x | ) | sph_dec32be_aligned(data + (4 * (x))) |
#define SHA2_IN | ( | x | ) | msg[x] |
#define SHA2_ROUND_BODY | ( | in, | |
r | |||
) |
Definition at line 200 of file sph_sha2.c.
Definition at line 53 of file sph_sha2.c.
Definition at line 54 of file sph_sha2.c.
void sph_sha224_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 SHA-224 context |
ub | the extra bits |
n | the number of extra bits (0 to 7) |
dst | the destination buffer |
Definition at line 668 of file sph_sha2.c.
void sph_sha224_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current SHA-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 SHA-224 context |
dst | the destination buffer |
Definition at line 660 of file sph_sha2.c.
Apply the SHA-224 compression function on the provided data.
The msg
parameter contains the 16 32-bit input blocks, as numerical values (hence after the big-endian decoding). The val
parameter contains the 8 32-bit input blocks for the compression function; the output is written in place in this array.
msg | the message block (16 values) |
val | the function 256-bit input and output |
Definition at line 692 of file sph_sha2.c.
void sph_sha224_init | ( | void * | cc | ) |
Initialize a SHA-224 context.
This process performs no memory allocation.
cc | the SHA-224 context (pointer to a sph_sha224_context ) |
Definition at line 625 of file sph_sha2.c.
void sph_sha256_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 SHA-256 context |
ub | the extra bits |
n | the number of extra bits (0 to 7) |
dst | the destination buffer |
Definition at line 684 of file sph_sha2.c.
void sph_sha256_close | ( | void * | cc, |
void * | dst | ||
) |
Terminate the current SHA-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 SHA-256 context |
dst | the destination buffer |
Definition at line 676 of file sph_sha2.c.
void sph_sha256_init | ( | void * | cc | ) |
Initialize a SHA-256 context.
This process performs no memory allocation.
cc | the SHA-256 context (pointer to a sph_sha256_context ) |
Definition at line 640 of file sph_sha2.c.