hkdfSha512DeriveKey method

  1. @override
BuBytes hkdfSha512DeriveKey({
  1. required List<int> ikm,
  2. int length = 32,
  3. List<int>? salt,
  4. List<int>? info,
})
override

Strict RFC 5869 HKDF-SHA-512 (always Extract-then-Expand). Omitted salt defaults to 64 zero bytes (ยง2.2) on every backend; info may be empty. length must be 1..255*64. Throws on invalid arguments or backend failure.

Implementation

@override
BuBytes hkdfSha512DeriveKey({
  required List<int> ikm,
  int length = 32,
  List<int>? salt,
  List<int>? info,
}) {
  final result = BuHkdf(
    bindings: _bindings,
    prf: BuKdfPrf.sha512,
    ikm: BuBytes(ikm),
    salt: salt == null ? null : BuBytes(salt),
    info: info == null ? null : BuBytes(info),
  ).expand(length: length);
  return result.unwrapOrThrowCryptoError().asBytes;
}