pbkdf2Sha256DeriveKey method

  1. @override
BuBytes pbkdf2Sha256DeriveKey({
  1. required List<int> password,
  2. required List<int> salt,
  3. required int iterations,
  4. required int length,
})
override

Derives length bytes with PBKDF2-HMAC-SHA256 from arbitrary password/salt. iterations and length must be non-negative. Throws on negative values or backend failure.

Implementation

@override
BuBytes pbkdf2Sha256DeriveKey({
  required List<int> password,
  required List<int> salt,
  required int iterations,
  required int length,
}) {
  final result = BuKdf.pbkdf2(
    _bindings,
    prf: BuKdfPrf.sha256,
    password: password,
    salt: salt,
    iterations: iterations,
    length: length,
  );
  return result.unwrapOrThrowCryptoError().asBytes;
}