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) | |
struct sha512_variables | __attribute__ ((packed)) |
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 | |
uint64_t | a |
uint64_t | b |
uint64_t | c |
uint64_t | d |
uint64_t | e |
uint64_t | f |
uint64_t | g |
uint64_t | h |
uint64_t | w [SHA512_ROUNDS] |
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 | ) |
struct sha512_variables __attribute__ | ( | (packed) | ) |
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 a, assert(), b, be64_to_cpus, c, ch, cpu_to_be64, d, sha512_digest_data::data, DBGC, DBGC2, DBGC_HDA, sha512_digest_data_qwords::dd, sha512_context::ddq, sha512_digest_data::digest, e, f, g, sha512_digest::h, h, k, sha512_context::len, linker_assert, sha512_digest_data_qwords::qword, SHA512_ROUNDS, u, and 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().
uint64_t a |
Definition at line 28 of file sha512.c.
Referenced by sha512_digest().
uint64_t b |
Definition at line 29 of file sha512.c.
Referenced by sha512_digest().
uint64_t c |
Definition at line 30 of file sha512.c.
Referenced by sha512_digest().
uint64_t d |
Definition at line 31 of file sha512.c.
Referenced by sha512_digest().
uint64_t e |
Definition at line 32 of file sha512.c.
Referenced by sha512_digest().
uint64_t f |
Definition at line 33 of file sha512.c.
Referenced by sha512_digest().
uint64_t g |
Definition at line 34 of file sha512.c.
Referenced by sha512_digest().
uint64_t h |
Definition at line 35 of file sha512.c.
Referenced by sha512_digest().
Definition at line 36 of file sha512.c.
Referenced by sha512_digest().
|
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().