[noise] HKDF input sizes

Trevor Perrin trevp at trevp.net
Mon Nov 9 17:51:38 PST 2015


On Mon, Nov 9, 2015 at 5:44 PM, Stephen Touset <stephen at squareup.com> wrote:
> The current documentation is unclear about the size of the inputs to HKDF. It’s clear that the outputs are either 32 or 64 bytes, but are the inputs always expected to be 32 bytes? I would argue that since all uses of HKDF use only the first 32 bytes of each output, the whole thing should simply be specified to take 32 byte inputs and always return 32 byte outputs.

Tried to clarify:
"""
Takes a `chaining_key` which is `HASHLEN` bytes in length, and an
`input_key_material` byte sequence which is either `DHLEN` bytes in
length or zero bytes in length.
"""

Note that HASHLEN isn't always 32, it could be 64 with SHA512 or
BLAKE2b.  input_key_material is zero-length in Split().

Trevor


More information about the Noise mailing list