# Module ring::hkdf [−] [src]

HMAC-based Extract-and-Expand Key Derivation Function.

HKDF is specified in RFC 5869.

In most situations, it is best to use `extract_and_expand` to do both the HKDF-Extract and HKDF-Expand as one atomic operation. It is only necessary to use the separate `expand` and `extract` functions if a single derived `PRK` (defined in RFC 5869) is used more than once.

Salts have type `hmac::SigningKey` instead of `&[u8]` because they are frequently used for multiple HKDF operations, and it is more efficient to construct the `SigningKey` once and reuse it. Given a digest algorithm `digest_alg` and a salt `salt: &[u8]`, the `SigningKey` should be constructed as `hmac::SigningKey::new(digest_alg, salt)`.

## Functions

expand | Fills `out` with the output of the HKDF-Expand operation for the given inputs.
extract | The HKDF-Extract operation.
extract_and_expand | Fills `out` with the output of the HKDF Extract-and-Expand operation for the given inputs.

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)