Library hkdf

To use this library in your code:

import crypto.hkdf
HMAC-based Extract-and-Expand Key Derivation Function (HKDF).
See RFC 5869.

Functions

hkdf --ikm/ByteArray --salt/ByteArray --info/ByteArray --size/int [hasher-creator] -> ByteArray
Generic HKDF implementation.
The hasher-creator is a block that creates an HMAC object for a given key.
The size is the desired size of the output key in bytes.

hkdf-expand --prk/ByteArray --info/ByteArray --size/int [hasher-creator] -> ByteArray
HKDF-Expand step.
The size is the desired size of the output key in bytes.

hkdf-extract --ikm/ByteArray --salt/ByteArray [hasher-creator] -> ByteArray
HKDF-Extract step.

hkdf-sha256 --ikm/ByteArray --salt/ByteArray=null --info/ByteArray=null --size/int -> ByteArray
Derives a key using HKDF-SHA256.
The ikm is the input keying material.
The salt is optional.
The info is optional context information.
The size is the desired size of the output key in bytes.