crypto.hkdf
fn expand #
fn expand[H](h fn () H, pseudorandom_key []u8, info string, key_length int) ![]u8
expand derives a key from the given hash, key, and optional context info, returning a []u8 of length key_length that can be used as cryptographic key. The extraction step is skipped.
The key should have been generated by extract, or be a uniformly random or pseudorandom cryptographically strong key. See RFC 5869, Section 3.3. Most common scenarios will want to use key instead.
fn extract #
fn extract[H](h fn () H, secret []u8, salt []u8) ![]u8
extract generates a pseudorandom key for use with expand from an input secret and an optional independent salt.
Only use this function if you need to reuse the extracted key with multiple expand invocations and different context values. Most common scenarios, including the generation of multiple keys, should use key instead.
fn key #
fn key[H](h fn () H, secret []u8, salt []u8, info string, key_length int) ![]u8
key derives a key from the given hash, secret, salt and context info, returning a []u8 of length key_length that can be used as cryptographic key. Salt and info can be empty.