iPXE
|
MD5 algorithm. More...
#include <stdint.h>
#include <string.h>
#include <byteswap.h>
#include <assert.h>
#include <ipxe/rotate.h>
#include <ipxe/crypto.h>
#include <ipxe/md5.h>
Go to the source code of this file.
Data Structures | |
struct | md5_variables |
MD5 variables. More... | |
struct | md5_step |
An MD5 step function. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static uint32_t | md5_f_0_15 (struct md5_variables *v) |
f(b,c,d) for steps 0 to 15 More... | |
static uint32_t | md5_f_16_31 (struct md5_variables *v) |
f(b,c,d) for steps 16 to 31 More... | |
static uint32_t | md5_f_32_47 (struct md5_variables *v) |
f(b,c,d) for steps 32 to 47 More... | |
static uint32_t | md5_f_48_63 (struct md5_variables *v) |
f(b,c,d) for steps 48 to 63 More... | |
static void | md5_init (void *ctx) |
Initialise MD5 algorithm. More... | |
static void | md5_digest (struct md5_context *context) |
Calculate MD5 digest of accumulated data. More... | |
static void | md5_update (void *ctx, const void *data, size_t len) |
Accumulate data with MD5 algorithm. More... | |
static void | md5_final (void *ctx, void *out) |
Generate MD5 digest. More... | |
Variables | |
static const uint32_t | k [64] |
MD5 constants. More... | |
static const uint8_t | r [4][4] |
MD5 shift amounts. More... | |
static struct md5_step | md5_steps [4] |
MD5 steps. More... | |
struct digest_algorithm | md5_algorithm |
MD5 algorithm. More... | |
MD5 algorithm.
Definition in file md5.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
f(b,c,d) for steps 0 to 15
v | MD5 variables |
f | f(b,c,d) |
Definition at line 81 of file md5.c.
References md5_variables::b, md5_variables::c, and md5_variables::d.
|
static |
f(b,c,d) for steps 16 to 31
v | MD5 variables |
f | f(b,c,d) |
Definition at line 91 of file md5.c.
References md5_variables::b, md5_variables::c, and md5_variables::d.
|
static |
f(b,c,d) for steps 32 to 47
v | MD5 variables |
f | f(b,c,d) |
Definition at line 101 of file md5.c.
References md5_variables::b, md5_variables::c, and md5_variables::d.
|
static |
f(b,c,d) for steps 48 to 63
v | MD5 variables |
f | f(b,c,d) |
Definition at line 111 of file md5.c.
References md5_variables::b, md5_variables::c, and md5_variables::d.
|
static |
Initialise MD5 algorithm.
ctx | MD5 context |
Definition at line 147 of file md5.c.
References cpu_to_le32, ctx, md5_digest_data_dwords::dd, md5_context::ddd, md5_digest_data::digest, md5_digest::h, and md5_context::len.
|
static |
Calculate MD5 digest of accumulated data.
context | MD5 context |
Definition at line 162 of file md5.c.
References md5_variables::a, assert(), md5_variables::b, build_assert, c, cpu_to_le32, md5_variables::d, md5_digest_data::data, DBGC, DBGC2, DBGC_HDA, md5_digest_data_dwords::dd, md5_context::ddd, md5_digest_data::digest, md5_digest_data_dwords::dword, md5_step::f, md5_digest::h, k, le32_to_cpus, md5_context::len, md5_steps, r, rol32(), step(), u, and md5_variables::w.
Referenced by md5_update().
|
static |
Accumulate data with MD5 algorithm.
ctx | MD5 context |
data | Data |
len | Length of data |
Definition at line 237 of file md5.c.
References md5_block::byte, ctx, data, md5_digest_data::data, md5_digest_data_dwords::dd, md5_context::ddd, len, md5_context::len, md5_digest(), and offset.
Referenced by md5_final().
|
static |
Generate MD5 digest.
ctx | MD5 context |
out | Output buffer |
Definition at line 260 of file md5.c.
References assert(), cpu_to_le64, ctx, md5_digest_data::data, md5_digest_data_dwords::dd, md5_context::ddd, md5_digest_data::digest, md5_context::len, md5_update(), memcpy(), offsetof, out, pad, and typeof().
|
static |
MD5 constants.
Definition at line 53 of file md5.c.
Referenced by ath9k_adjust_pdadc_values(), ath9k_change_gain_boundary_setting(), ath9k_hw_fill_vpd_table(), ath9k_hw_get_gain_boundaries_pdadcs(), atl_hw_reset(), atl_hw_reset_flb_(), atl_hw_reset_rbl_(), md5_digest(), sha1_digest(), and vxgetlink().
|
static |
MD5 shift amounts.
Definition at line 68 of file md5.c.
Referenced by md5_digest().
|
static |
MD5 steps.
Definition at line 131 of file md5.c.
Referenced by md5_digest().
struct digest_algorithm md5_algorithm |
MD5 algorithm.
Definition at line 286 of file md5.c.
Referenced by dbg_md5_da(), eap_rx_md5(), http_digest_final(), http_digest_init(), http_digest_update(), iscsi_handle_chap_i_value(), iscsi_handle_chap_r_value(), md5_sha1_final(), md5_sha1_init(), md5_sha1_update(), md5_test_exec(), md5sum_exec(), ntlm_key(), ntlm_response(), tkip_kie_mic(), and tls_prf().