Package com.yahoo.security.hpke
Interface Kdf
public interface Kdf
Key derivation function (KDF)
- Author:
- vekterli
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]expand(byte[] prk, byte[] info, int nBytesToExpand) Expand a pseudorandom keyprkusing optional stringinfointonBytesToExpandbytes of output keying material.byte[]extract(byte[] salt, byte[] labeledIkm) Extract a pseudorandom key of fixed lengthnH()bytes from input keying materialikmand an optional byte stringsalt.static KdfshortkdfId()Predefined KDF ID, as given in RFC 9180 section 7.2shortnH()Output size of the extract() function in bytes
-
Method Details
-
extract
byte[] extract(byte[] salt, byte[] labeledIkm) Extract a pseudorandom key of fixed lengthnH()bytes from input keying materialikmand an optional byte stringsalt.- Parameters:
salt- non-secret salt used as input to KDFlabeledIkm- secret input keying material- Returns:
- nH bytes of PRK data
-
expand
byte[] expand(byte[] prk, byte[] info, int nBytesToExpand) Expand a pseudorandom keyprkusing optional stringinfointonBytesToExpandbytes of output keying material.- Parameters:
prk- pseudo random key previously gotten from a call to extract.info- contextual info for expansion; useful for key domain separationnBytesToExpand- number of bytes to return- Returns:
nBytesToExpandbytes of output keying material.
-
nH
short nH()Output size of the extract() function in bytes -
kdfId
short kdfId()Predefined KDF ID, as given in RFC 9180 section 7.2 -
hkdfSha256
-