iPXE
|
SHA-512 algorithm. More...
#include <stdint.h>
#include <string.h>
#include <byteswap.h>
#include <assert.h>
#include <ipxe/rotate.h>
#include <ipxe/crypto.h>
#include <ipxe/sha512.h>
Go to the source code of this file.
Data Structures | |
struct | sha512_variables |
SHA-512 variables. 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... | |
static void | sha512_init (void *ctx) |
Initialise SHA-512 algorithm. More... | |
static void | sha512_digest (struct sha512_context *context) |
Calculate SHA-512 digest of accumulated data. 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 | |
static const uint64_t | k [SHA512_ROUNDS] |
SHA-512 constants. More... | |
static const struct sha512_digest | sha512_init_digest |
SHA-512 initial digest values. More... | |
struct digest_algorithm | sha512_algorithm |
SHA-512 algorithm. More... | |
SHA-512 algorithm.
Definition in file sha512.c.
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().
|
static |
Initialise SHA-512 algorithm.
ctx | SHA-512 context |
Definition at line 123 of file sha512.c.
References ctx, sha512_family_init(), and sha512_init_digest.
|
static |
Calculate SHA-512 digest of accumulated data.
context | SHA-512 context |
Definition at line 135 of file sha512.c.
References sha512_variables::a, assert(), sha512_variables::b, be64_to_cpus, build_assert, c, ch, cpu_to_be64, sha512_variables::d, sha512_digest_data::data, DBGC, DBGC2, DBGC_HDA, sha512_digest_data_qwords::dd, sha512_context::ddq, sha512_digest_data::digest, sha512_variables::e, sha512_variables::f, sha512_variables::g, h, sha512_digest::h, k, sha512_context::len, sha512_digest_data_qwords::qword, SHA512_ROUNDS, u, and sha512_variables::w.
Referenced by sha512_update().
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().
|
static |
SHA-512 constants.
Definition at line 57 of file sha512.c.
Referenced by sha512_digest().
|
static |
SHA-512 initial digest values.
Definition at line 88 of file sha512.c.
Referenced by sha512_init().
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().