webcrypto-examples icon indicating copy to clipboard operation
webcrypto-examples copied to clipboard

Add doc for 'label' and 'context' params in HKDF

Open patrickfav opened this issue 7 years ago • 3 comments

These are according to the HKDF spec: https://tools.ietf.org/html/rfc5869

There is a extract and a expand phase. The salt (aka label) is used in the extract phase:

HKDF-Extract(salt, IKM) -> PRK
salt     optional salt value (a non-secret random value);
         if not provided, it is set to a string of HashLen zeros.

and the info (aka context) is used in the expand phase:

HKDF-Expand(PRK, info, L) -> OKM
info     optional context and application specific information
         (can be a zero-length string)

patrickfav avatar Jun 12 '18 15:06 patrickfav

Any chance this will be merged?

patrickfav avatar Nov 05 '18 13:11 patrickfav

Please note that salt and info are required as per webcrypto spec: https://www.w3.org/TR/WebCryptoAPI/#hkdf-params

In addition, HKDF-CRT was replaced with HKDF, and I already addressed it with https://github.com/diafygi/webcrypto-examples/pull/54

LiraNuna avatar Mar 07 '19 19:03 LiraNuna

Thanks for the heads up. Thats interesting as the the RFC defines it as optional. Your PR is probably better then. Unfortunately it seems the maintainer has no interest in merging these PRs anytime soon.

patrickfav avatar Mar 08 '19 08:03 patrickfav