Import std.crypto.derive
Hkdf
struct
Public Struct Hkdf
HKDF (RFC 5869): length bytes of new key from material, a secret like a shared one from X25519, with salt, which can be empty, and info, which says what the key is for, so keys for different uses differ.
Examples
Local shared = SecureRandom.Bytes(32)
Local key = Hkdf.Sha256(shared, [], "session keys".Bytes, 32)
Expect(key.Count == 32)
Expect(key == Hkdf.Sha256(shared, [], "session keys".Bytes, 32))-
@PanicsAtCaller Public Static Method Sha256(material: UInt8[], salt: UInt8[], info: UInt8[], length: Int): UInt8[]static method #lengthbytes of key frommaterial,salt, andinfo, by HMAC-SHA256. Panics unlesslengthis from 0 to 8160, 255 hashes. -
@PanicsAtCaller Public Static Method Sha512(material: UInt8[], salt: UInt8[], info: UInt8[], length: Int): UInt8[]static method #lengthbytes of key frommaterial,salt, andinfo, by HMAC-SHA512. Panics unlesslengthis from 0 to 16320, 255 hashes.
Report an issue with this page or with FutureBlitz on GitHub.