iPXE
|
SHA-512 algorithm. More...
Go to the source code of this file.
Data Structures | |
struct | sha512_digest |
An SHA-512 digest. More... | |
union | sha512_block |
An SHA-512 data block. More... | |
struct | sha512_digest_data |
SHA-512 digest and data block. More... | |
union | sha512_digest_data_qwords |
SHA-512 digest and data block. More... | |
struct | sha512_context |
An SHA-512 context. More... | |
Macros | |
#define | SHA512_ROUNDS 80 |
SHA-512 number of rounds. More... | |
#define | SHA512_CTX_SIZE sizeof ( struct sha512_context ) |
SHA-512 context size. More... | |
#define | SHA512_BLOCK_SIZE sizeof ( union sha512_block ) |
SHA-512 block size. More... | |
#define | SHA512_DIGEST_SIZE sizeof ( struct sha512_digest ) |
SHA-512 digest size. More... | |
#define | SHA384_DIGEST_SIZE ( SHA512_DIGEST_SIZE * 384 / 512 ) |
SHA-384 digest size. More... | |
#define | SHA512_256_DIGEST_SIZE ( SHA512_DIGEST_SIZE * 256 / 512 ) |
SHA-512/256 digest size. More... | |
#define | SHA512_224_DIGEST_SIZE ( SHA512_DIGEST_SIZE * 224 / 512 ) |
SHA-512/224 digest size. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
void | sha512_family_init (struct sha512_context *context, const struct sha512_digest *init, size_t digestsize) |
Initialise SHA-512 family algorithm. More... | |
void | sha512_update (void *ctx, const void *data, size_t len) |
Accumulate data with SHA-512 algorithm. More... | |
void | sha512_final (void *ctx, void *out) |
Generate SHA-512 digest. More... | |
Variables | |
struct digest_algorithm | sha512_algorithm |
SHA-512 algorithm. More... | |
struct digest_algorithm | sha384_algorithm |
SHA-384 algorithm. More... | |
struct digest_algorithm | sha512_256_algorithm |
SHA-512/256 algorithm. More... | |
struct digest_algorithm | sha512_224_algorithm |
SHA-512/224 algorithm. More... | |
SHA-512 algorithm.
Definition in file sha512.h.
#define SHA512_CTX_SIZE sizeof ( struct sha512_context ) |
#define SHA512_BLOCK_SIZE sizeof ( union sha512_block ) |
#define SHA512_DIGEST_SIZE sizeof ( struct sha512_digest ) |
#define SHA384_DIGEST_SIZE ( SHA512_DIGEST_SIZE * 384 / 512 ) |
#define SHA512_256_DIGEST_SIZE ( SHA512_DIGEST_SIZE * 256 / 512 ) |
#define SHA512_224_DIGEST_SIZE ( SHA512_DIGEST_SIZE * 224 / 512 ) |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
void sha512_family_init | ( | struct sha512_context * | context, |
const struct sha512_digest * | init, | ||
size_t | digestsize | ||
) |
Initialise SHA-512 family algorithm.
context | SHA-512 context |
init | Initial digest values |
digestsize | Digest size |
Definition at line 108 of file sha512.c.
References sha512_digest_data_qwords::dd, sha512_context::ddq, sha512_digest_data::digest, digestsize, sha512_context::digestsize, sha512_context::len, and memcpy().
Referenced by sha384_init(), sha512_224_init(), sha512_256_init(), and sha512_init().
void sha512_update | ( | void * | ctx, |
const void * | data, | ||
size_t | len | ||
) |
Accumulate data with SHA-512 algorithm.
ctx | SHA-512 context |
data | Data |
len | Length of data |
Definition at line 233 of file sha512.c.
References sha512_block::byte, ctx, data, sha512_digest_data::data, sha512_digest_data_qwords::dd, sha512_context::ddq, len, sha512_context::len, offset, and sha512_digest().
Referenced by sha512_final().
void sha512_final | ( | void * | ctx, |
void * | out | ||
) |
Generate SHA-512 digest.
ctx | SHA-512 context |
out | Output buffer |
Definition at line 256 of file sha512.c.
References assert(), cpu_to_be64, ctx, sha512_digest_data::data, sha512_digest_data_qwords::dd, sha512_context::ddq, sha512_digest_data::digest, sha512_context::digestsize, sha512_context::len, memcpy(), offsetof, out, pad, sha512_update(), and typeof().
struct digest_algorithm sha512_algorithm |
SHA-512 algorithm.
Definition at line 284 of file sha512.c.
Referenced by peerdist_info_v1(), peerdist_info_v2(), and sha512_test_exec().
struct digest_algorithm sha384_algorithm |
SHA-384 algorithm.
Definition at line 63 of file sha384.c.
Referenced by peerdist_info_v1(), and sha512_test_exec().
struct digest_algorithm sha512_256_algorithm |
SHA-512/256 algorithm.
Definition at line 64 of file sha512_256.c.
Referenced by sha512_test_exec().
struct digest_algorithm sha512_224_algorithm |
SHA-512/224 algorithm.
Definition at line 64 of file sha512_224.c.
Referenced by sha512_test_exec().