|
iPXE
|
Merkle-Damgård hash algorithms. More...
Go to the source code of this file.
Data Structures | |
| union | mdhash_len |
| Merkle-Damgård trailing bit-length count. More... | |
| struct | mdhash_algorithm |
| Merkle-Damgård hash algorithm. More... | |
Macros | |
| #define | mdhash_dd_t(digestsize, blocksize) |
| Merkle-Damgård hash algorithm digest and data block. | |
| #define | mdhash_context_t(digestsize, blocksize) |
| Merkle-Damgård hash algorithm context. | |
| #define | MDHASH_DD_PTR(_dd) |
| Merkle-Damgård hash algorithm digest and data block sample pointer. | |
| #define | MDHASH_COMPRESS_PTR(_dd) |
| Merkle-Damgård hash algorithm compression function sample pointer. | |
| #define | MDHASH_DIGEST_SIZE(_dd) |
| Merkle-Damgård hash algorithm digest size. | |
| #define | MDHASH_TOGGLE(_dd, _byteorder) |
| Merkle-Damgård hash algorithm data toggle. | |
| #define | MDHASH_LEN_LEN(_dd) |
| Merkle-Damgård hash algorithm length field length. | |
| #define | MDHASH_LEN_TOGGLE(_dd, _byteorder) |
| Merkle-Damgård hash algorithm length field toggle. | |
| #define | MDHASH_BLOCK_SIZE(_dd) |
| Merkle-Damgård hash algorithm block size. | |
| #define | MDHASH_CTX_SIZE(_dd) |
| Merkle-Damgård hash algorithm context size. | |
| #define | MDHASH_ALGORITHM(_name, _digest, _compress, _byteorder, _dd, _init, _digestsize) |
| Define a Merkle-Damgård hash algorithm. | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| FILE_SECBOOT (PERMITTED) | |
| void | mdhash_init (struct digest_algorithm *digest, void *ctx) |
| Initialise algorithm. | |
| void | mdhash_update (struct digest_algorithm *digest, void *ctx, const void *src, size_t len) |
| Accumulate data. | |
| void | mdhash_final (struct digest_algorithm *digest, void *ctx, void *out) |
| Generate digest. | |
Merkle-Damgård hash algorithms.
Definition in file mdhash.h.
| #define mdhash_dd_t | ( | digestsize, | |
| blocksize ) |
Merkle-Damgård hash algorithm digest and data block.
Definition at line 19 of file mdhash.h.
| #define mdhash_context_t | ( | digestsize, | |
| blocksize ) |
Merkle-Damgård hash algorithm context.
Definition at line 28 of file mdhash.h.
Referenced by mdhash_final(), mdhash_init(), and mdhash_update().
| #define MDHASH_DD_PTR | ( | _dd | ) |
| #define MDHASH_COMPRESS_PTR | ( | _dd | ) |
Merkle-Damgård hash algorithm compression function sample pointer.
Definition at line 96 of file mdhash.h.
| #define MDHASH_DIGEST_SIZE | ( | _dd | ) |
Merkle-Damgård hash algorithm digest size.
Definition at line 102 of file mdhash.h.
| #define MDHASH_TOGGLE | ( | _dd, | |
| _byteorder ) |
Merkle-Damgård hash algorithm data toggle.
Definition at line 106 of file mdhash.h.
| #define MDHASH_LEN_LEN | ( | _dd | ) |
Merkle-Damgård hash algorithm length field length.
Definition at line 111 of file mdhash.h.
| #define MDHASH_LEN_TOGGLE | ( | _dd, | |
| _byteorder ) |
Merkle-Damgård hash algorithm length field toggle.
Definition at line 115 of file mdhash.h.
| #define MDHASH_BLOCK_SIZE | ( | _dd | ) |
Merkle-Damgård hash algorithm block size.
Definition at line 122 of file mdhash.h.
| #define MDHASH_CTX_SIZE | ( | _dd | ) |
Merkle-Damgård hash algorithm context size.
Definition at line 126 of file mdhash.h.
| #define MDHASH_ALGORITHM | ( | _name, | |
| _digest, | |||
| _compress, | |||
| _byteorder, | |||
| _dd, | |||
| _init, | |||
| _digestsize ) |
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
|
extern |
Initialise algorithm.
| digest | Digest algorithm |
| ctx | MD hash context |
Definition at line 45 of file mdhash.c.
References digest_algorithm::blocksize, ctx, digestsize, mdhash_algorithm::digestsize, mdhash_algorithm::init, mdhash_context_t, memcpy(), and digest_algorithm::priv.
|
extern |
Accumulate data.
Definition at line 66 of file mdhash.c.
References digest_algorithm::blocksize, mdhash_algorithm::compress, ctx, data, DBGC2, DBGC2_HDA, digestsize, mdhash_algorithm::digestsize, len, mdhash_context_t, memcpy(), digest_algorithm::name, offset, digest_algorithm::priv, and mdhash_algorithm::toggle.
Referenced by mdhash_final().
|
extern |
Generate digest.
Definition at line 111 of file mdhash.c.
References assert, digest_algorithm::blocksize, ctx, DBGC, DBGC_HDA, digest_algorithm::digestsize, digestsize, mdhash_algorithm::digestsize, len, mdhash_algorithm::len_len, mdhash_algorithm::len_toggle, mdhash_context_t, mdhash_update(), digest_algorithm::name, out, pad, digest_algorithm::priv, and mdhash_algorithm::toggle.