iPXE
|
SHA-256 algorithm. More...
Go to the source code of this file.
Data Structures | |
struct | sha256_digest |
An SHA-256 digest. More... | |
union | sha256_block |
An SHA-256 data block. More... | |
struct | sha256_digest_data |
SHA-256 digest and data block. More... | |
union | sha256_digest_data_dwords |
SHA-256 digest and data block. More... | |
struct | sha256_context |
An SHA-256 context. More... | |
Macros | |
#define | SHA256_ROUNDS 64 |
SHA-256 number of rounds. More... | |
#define | SHA256_CTX_SIZE sizeof ( struct sha256_context ) |
SHA-256 context size. More... | |
#define | SHA256_BLOCK_SIZE sizeof ( union sha256_block ) |
SHA-256 block size. More... | |
#define | SHA256_DIGEST_SIZE sizeof ( struct sha256_digest ) |
SHA-256 digest size. More... | |
#define | SHA224_DIGEST_SIZE ( SHA256_DIGEST_SIZE * 224 / 256 ) |
SHA-224 digest size. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
void | sha256_family_init (struct sha256_context *context, const struct sha256_digest *init, size_t digestsize) |
Initialise SHA-256 family algorithm. More... | |
void | sha256_update (void *ctx, const void *data, size_t len) |
Accumulate data with SHA-256 algorithm. More... | |
void | sha256_final (void *ctx, void *out) |
Generate SHA-256 digest. More... | |
Variables | |
struct digest_algorithm | sha256_algorithm |
SHA-256 algorithm. More... | |
struct digest_algorithm | sha224_algorithm |
SHA-224 algorithm. More... | |
SHA-256 algorithm.
Definition in file sha256.h.
#define SHA256_CTX_SIZE sizeof ( struct sha256_context ) |
#define SHA256_BLOCK_SIZE sizeof ( union sha256_block ) |
#define SHA256_DIGEST_SIZE sizeof ( struct sha256_digest ) |
#define SHA224_DIGEST_SIZE ( SHA256_DIGEST_SIZE * 224 / 256 ) |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
void sha256_family_init | ( | struct sha256_context * | context, |
const struct sha256_digest * | init, | ||
size_t | digestsize | ||
) |
Initialise SHA-256 family algorithm.
context | SHA-256 context |
init | Initial digest values |
digestsize | Digest size |
Definition at line 92 of file sha256.c.
References sha256_digest_data_dwords::dd, sha256_context::ddd, sha256_digest_data::digest, digestsize, sha256_context::digestsize, sha256_context::len, and memcpy().
Referenced by sha224_init(), and sha256_init().
void sha256_update | ( | void * | ctx, |
const void * | data, | ||
size_t | len | ||
) |
Accumulate data with SHA-256 algorithm.
ctx | SHA-256 context |
data | Data |
len | Length of data |
Definition at line 216 of file sha256.c.
References sha256_block::byte, ctx, data, sha256_digest_data::data, sha256_digest_data_dwords::dd, sha256_context::ddd, len, sha256_context::len, offset, and sha256_digest().
Referenced by sha256_final().
void sha256_final | ( | void * | ctx, |
void * | out | ||
) |
Generate SHA-256 digest.
ctx | SHA-256 context |
out | Output buffer |
Definition at line 239 of file sha256.c.
References assert(), cpu_to_be64, ctx, sha256_digest_data::data, sha256_digest_data_dwords::dd, sha256_context::ddd, sha256_digest_data::digest, sha256_context::digestsize, sha256_context::len, memcpy(), offsetof, out, pad, sha256_update(), and typeof().
struct digest_algorithm sha256_algorithm |
SHA-256 algorithm.
Definition at line 264 of file sha256.c.
Referenced by icert_cert(), peerdist_info_v1(), and sha256_test_exec().
struct digest_algorithm sha224_algorithm |