|
iPXE
|
HMAC-based Extract-and-Expand Key Derivation Function (HKDF). More...
#include <ipxe/crypto.h>Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| FILE_SECBOOT (PERMITTED) | |
| void | hkdf_extract (struct digest_algorithm *digest, const void *salt, size_t salt_len, const void *ikm, size_t ikm_len, void *prk) |
| Extract fixed-length pseudorandom key. | |
| void | hkdf_expand (struct digest_algorithm *digest, const void *prk, const void *info, size_t info_len, void *out, size_t len) |
| Expand pseudorandom key. | |
HMAC-based Extract-and-Expand Key Derivation Function (HKDF).
Definition in file hkdf.h.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
extern |
Extract fixed-length pseudorandom key.
| digest | Digest algorithm |
| salt | Salt value (or NULL) |
| salt_len | Length of salt value |
| ikm | Input keying material |
| ikm_len | Length of input keying material |
| prk | Pseudorandom key to fill in |
The salt and input keying material are allowed to overlap the buffer that will be filled in with the pseudorandom key.
Definition at line 56 of file hkdf.c.
References assert, ctx, digest_algorithm::digestsize, hmac_ctxsize(), hmac_final(), hmac_init(), hmac_update(), and memset().
Referenced by hkdf_okx(), and tls_generate_ephemeral_master().
|
extern |
Expand pseudorandom key.
| digest | Digest algorithm |
| prk | Pseudorandom key |
| info | Additional information (or NULL) |
| info_len | Length of additional information |
| out | Output keying material |
| len | Length of output keying material |
The pseudorandom key and additional information are allowed to overlap the buffer that will be filled in with the output keying material, provided that the length of the output keying material is less than or equal to the length of the pseudorandom key.
In particular, this allows hkdf_expand() to be used to create a new generation of pseudorandom key (i.e. to have the output keying material overwrite the existing pseudorandom key).
Definition at line 95 of file hkdf.c.
References ctx, digest_algorithm::digestsize, digestsize, hash, hmac_ctxsize(), hmac_final(), hmac_init(), hmac_update(), index, info, info_len, len, memcpy(), and out.
Referenced by hkdf_okx(), and tls_ephemeral().