|
iPXE
|
SHA-256 algorithm. More...
#include <stdint.h>#include <string.h>#include <byteswap.h>#include <assert.h>#include <ipxe/rotate.h>#include <ipxe/crypto.h>#include <ipxe/sha256.h>Go to the source code of this file.
Data Structures | |
| struct | sha256_variables |
| SHA-256 variables. 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... | |
| static void | sha256_init (void *ctx) |
| Initialise SHA-256 algorithm. More... | |
| static void | sha256_digest (struct sha256_context *context) |
| Calculate SHA-256 digest of accumulated data. 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 | |
| static const uint32_t | k [SHA256_ROUNDS] |
| SHA-256 constants. More... | |
| static const struct sha256_digest | sha256_init_digest |
| SHA-256 initial digest values. More... | |
| struct digest_algorithm | sha256_algorithm |
| SHA-256 algorithm. More... | |
SHA-256 algorithm.
Definition in file sha256.c.
| 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().
|
static |
Initialise SHA-256 algorithm.
| ctx | SHA-256 context |
Definition at line 107 of file sha256.c.
References ctx, sha256_family_init(), and sha256_init_digest.
|
static |
Calculate SHA-256 digest of accumulated data.
| context | SHA-256 context |
Definition at line 119 of file sha256.c.
References sha256_variables::a, assert(), sha256_variables::b, be32_to_cpus, build_assert, sha256_variables::c, ch, cpu_to_be32, sha256_variables::d, sha256_digest_data::data, DBGC, DBGC2, DBGC_HDA, sha256_digest_data_dwords::dd, sha256_context::ddd, sha256_digest_data::digest, sha256_digest_data_dwords::dword, sha256_variables::e, sha256_variables::f, sha256_variables::g, h, sha256_digest::h, k, sha256_context::len, ror32(), SHA256_ROUNDS, u, and sha256_variables::w.
Referenced by sha256_update().
| 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, sha256_context::len, 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().
|
static |
SHA-256 constants.
Definition at line 57 of file sha256.c.
Referenced by sha256_digest().
|
static |
SHA-256 initial digest values.
Definition at line 72 of file sha256.c.
Referenced by sha256_init().
| struct digest_algorithm sha256_algorithm |
SHA-256 algorithm.
Definition at line 264 of file sha256.c.
Referenced by icert_cert(), peerdist_info_v1(), sha256_test_exec(), and sha256sum_exec().
1.8.15