expand function

Uint8List expand({
  1. required Uint8List prk,
  2. required Uint8List info,
  3. int length = 32,
})

Derives a key of length bytes, using the given pseudorandom key and optional context info, skipping the extraction step.

The 32-byte prk should have been generated by extract, or be a uniformly random or pseudorandom cryptographically strong key. See RFC 5869, Section 3.3. Most common scenarios will want to use key instead.

Throws if prk is not 32 bytes long, or if length is negative or exceeds the maximum output length for SHA-256 HKDF, 255 * 32 = 8160 bytes.

Implementation

Uint8List expand({
  required Uint8List prk,
  required Uint8List info,
  int length = 32,
}) {
  _checkLength(length);
  return ffi.hkdfExpand(prk: prk, info: info, length: BigInt.from(length));
}