Pseudo Random Key
Instances2Eq, ByteArrayAccess
Eq (PRK a)Defined in crypton-2.1.7 · Crypto.KDF.HKDFByteArrayAccess (PRK a)Defined in crypton-2.1.7 · Crypto.KDF.HKDF
:: a typeCtrl KGHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10
Modulecrypton-2.1.7Haskell2010
Key Derivation Function based on HMAC
See RFC5869
Pseudo Random Key
Eq (PRK a)Defined in crypton-2.1.7 · Crypto.KDF.HKDFByteArrayAccess (PRK a)Defined in crypton-2.1.7 · Crypto.KDF.HKDFextract :: (HashAlgorithm a, ByteArrayAccess salt, ByteArrayAccess ikm)=> saltSalt
-> ikmInput Keying Material
-> PRK aPseudo random key
Extract a Pseudo Random Key using the parameter and the underlaying hash mechanism
Create a PRK directly from the input key material.
Only use when guaranteed to have a good quality and random data to use directly as key. This effectively skip a HMAC with key=salt and data=key.
expand :: (HashAlgorithm a, ByteArrayAccess info, ByteArray out)=> PRK aPseudo Random Key
-> infoOptional context and application specific information
-> IntOutput length in bytes
-> outOutput data
Expand key material of specific length out of the parameters
Requests exceeding the RFC 5869 limit of 255 * HashLen raise
CryptoError_OutputLengthTooBig; tryExpand reports the same condition as
CryptoFailed.
tryExpand :: (HashAlgorithm a, ByteArrayAccess info, ByteArray out)=> PRK aPseudo Random Key
-> infoOptional context and application specific information
-> IntOutput length in bytes
-> CryptoFailable outOutput data
Expand key material of specific length out of the parameters, reporting a length the RFC refuses rather than raising.