iPXE
|
SHA-1 algorithm. More...
#include <stdint.h>
#include <string.h>
#include <byteswap.h>
#include <assert.h>
#include <ipxe/rotate.h>
#include <ipxe/crypto.h>
#include <ipxe/sha1.h>
Go to the source code of this file.
Data Structures | |
struct | sha1_variables |
SHA-1 variables. More... | |
struct | sha1_step |
An SHA-1 step function. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static uint32_t | sha1_f_0_19 (struct sha1_variables *v) |
f(a,b,c,d) for steps 0 to 19 More... | |
static uint32_t | sha1_f_20_39_60_79 (struct sha1_variables *v) |
f(a,b,c,d) for steps 20 to 39 and 60 to 79 More... | |
static uint32_t | sha1_f_40_59 (struct sha1_variables *v) |
f(a,b,c,d) for steps 40 to 59 More... | |
static void | sha1_init (void *ctx) |
Initialise SHA-1 algorithm. More... | |
static void | sha1_digest (struct sha1_context *context) |
Calculate SHA-1 digest of accumulated data. More... | |
static void | sha1_update (void *ctx, const void *data, size_t len) |
Accumulate data with SHA-1 algorithm. More... | |
static void | sha1_final (void *ctx, void *out) |
Generate SHA-1 digest. More... | |
Variables | |
static struct sha1_step | sha1_steps [4] |
SHA-1 steps. More... | |
struct digest_algorithm | sha1_algorithm |
SHA-1 algorithm. More... | |
SHA-1 algorithm.
Definition in file sha1.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
f(a,b,c,d) for steps 0 to 19
v | SHA-1 variables |
f | f(a,b,c,d) |
Definition at line 59 of file sha1.c.
References sha1_variables::b, sha1_variables::c, and sha1_variables::d.
|
static |
f(a,b,c,d) for steps 20 to 39 and 60 to 79
v | SHA-1 variables |
f | f(a,b,c,d) |
Definition at line 69 of file sha1.c.
References sha1_variables::b, sha1_variables::c, and sha1_variables::d.
|
static |
f(a,b,c,d) for steps 40 to 59
v | SHA-1 variables |
f | f(a,b,c,d) |
Definition at line 79 of file sha1.c.
References sha1_variables::b, sha1_variables::c, and sha1_variables::d.
|
static |
Initialise SHA-1 algorithm.
ctx | SHA-1 context |
Definition at line 113 of file sha1.c.
References cpu_to_be32, ctx, sha1_digest_data_dwords::dd, sha1_context::ddd, sha1_digest_data::digest, sha1_digest::h, and sha1_context::len.
|
static |
Calculate SHA-1 digest of accumulated data.
context | SHA-1 context |
Definition at line 129 of file sha1.c.
References sha1_variables::a, assert(), sha1_variables::b, be32_to_cpus, build_assert, c, cpu_to_be32, sha1_variables::d, sha1_digest_data::data, DBGC, DBGC2, DBGC_HDA, sha1_digest_data_dwords::dd, sha1_context::ddd, sha1_digest_data::digest, sha1_digest_data_dwords::dword, sha1_variables::e, sha1_step::f, sha1_digest::h, k, sha1_context::len, rol32(), sha1_steps, step(), u, and sha1_variables::w.
Referenced by sha1_update().
|
static |
Accumulate data with SHA-1 algorithm.
ctx | SHA-1 context |
data | Data |
len | Length of data |
Definition at line 208 of file sha1.c.
References sha1_block::byte, ctx, data, sha1_digest_data::data, sha1_digest_data_dwords::dd, sha1_context::ddd, len, sha1_context::len, offset, and sha1_digest().
Referenced by sha1_final().
|
static |
Generate SHA-1 digest.
ctx | SHA-1 context |
out | Output buffer |
Definition at line 231 of file sha1.c.
References assert(), cpu_to_be64, ctx, sha1_digest_data::data, sha1_digest_data_dwords::dd, sha1_context::ddd, sha1_digest_data::digest, sha1_context::len, memcpy(), offsetof, out, pad, sha1_update(), and typeof().
|
static |
SHA-1 steps.
Definition at line 97 of file sha1.c.
Referenced by sha1_digest().
struct digest_algorithm sha1_algorithm |
SHA-1 algorithm.
Definition at line 257 of file sha1.c.
Referenced by ccmp_kie_mic(), certstat(), md5_sha1_final(), md5_sha1_init(), md5_sha1_update(), mschapv2_auth(), mschapv2_challenge_hash(), ocsp_compare_responder_key_hash(), pbkdf2_sha1_f(), prf_sha1(), sha1_test_exec(), sha1sum_exec(), tls_prf(), and x509_name().