iPXE
mdhash_algorithm Struct Reference

Merkle-Damgård hash algorithm. More...

#include <mdhash.h>

Data Fields

void(* compress )(void *dd, const void *digest)
 Compression function.
const void * init
 Initial digest value (as host-endian words).
uint8_t digestsize
 Digest size (before any final truncation).
uint8_t toggle
 Data toggle (for endianness swapping).
uint8_t len_len
 Length field length.
uint8_t len_toggle
 Length field toggle (for endianness swapping).

Detailed Description

Merkle-Damgård hash algorithm.

Definition at line 50 of file mdhash.h.

Field Documentation

◆ compress

void(* mdhash_algorithm::compress) (void *dd, const void *digest)

Compression function.

Parameters
ddDigest and accumulated data
digestCopy of current digest value

We provide a read-only copy of the current digest value since most compression functions would otherwise have to make this copy themselves.

Definition at line 61 of file mdhash.h.

Referenced by mdhash_update().

◆ init

const void* mdhash_algorithm::init

Initial digest value (as host-endian words).

Definition at line 63 of file mdhash.h.

Referenced by mdhash_init().

◆ digestsize

uint8_t mdhash_algorithm::digestsize

Digest size (before any final truncation).

Definition at line 65 of file mdhash.h.

Referenced by mdhash_final(), mdhash_init(), and mdhash_update().

◆ toggle

uint8_t mdhash_algorithm::toggle

Data toggle (for endianness swapping).

This is the value to be XORed with a byte offset in the input data stream to obtain the byte offset within the internal word array.

This same value is also XORed with a byte offset in the internal word array to obtain the byte offset within the digest output.

Definition at line 76 of file mdhash.h.

Referenced by mdhash_final(), and mdhash_update().

◆ len_len

uint8_t mdhash_algorithm::len_len

Length field length.

This is the length (in bytes) of the trailing bit-length field (used for Merkle-Damgård strengthening).

Definition at line 82 of file mdhash.h.

Referenced by mdhash_final().

◆ len_toggle

uint8_t mdhash_algorithm::len_toggle

Length field toggle (for endianness swapping).

This is the value to be XORed with the byte offset within a host-endian 64-bit integer to obtain the byte offset within the trailing bit-length field.

Definition at line 89 of file mdhash.h.

Referenced by mdhash_final().


The documentation for this struct was generated from the following file: