iPXE
|
Hash-based derivation function (Hash_df) More...
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
void | hash_df (struct digest_algorithm *hash, const void *input, size_t input_len, void *output, size_t output_len) |
Distribute entropy throughout a buffer. More... | |
Hash-based derivation function (Hash_df)
Definition in file hash_df.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
void hash_df | ( | struct digest_algorithm * | hash, |
const void * | input, | ||
size_t | input_len, | ||
void * | output, | ||
size_t | output_len | ||
) |
Distribute entropy throughout a buffer.
hash | Underlying hash algorithm |
input | Input data |
input_len | Length of input data, in bytes |
output | Output buffer |
output_len | Length of output buffer, in bytes |
This is the Hash_df function defined in ANS X9.82 Part 3-2007 Section 10.5.2 (NIST SP 800-90 Section 10.4.1).
The number of bits requested is implicit in the length of the output buffer. Requests must be for an integral number of bytes.
The output buffer is filled incrementally with each iteration of the central loop, rather than constructing an overall "temp" and then taking the leftmost(no_of_bits_to_return) bits.
There is no way for the Hash_df function to fail. The returned status SUCCESS is implicit.
Definition at line 84 of file hash_df.c.
References __attribute__, assert(), DBGC, DBGC_HDA, digest_final(), digest_init(), digest_update(), hash, hash_df(), htonl, memcpy(), NULL, offsetof, pad, prefix, and typeof().
Referenced by get_entropy_input(), get_entropy_input_tmp(), and hash_df().