deriveKeyBytes method

Future<List<int>> deriveKeyBytes({
  1. required List<int> password,
  2. List<int> nonce = const [],
  3. List<int> optionalSecret = const [],
  4. List<int> associatedData = const [],
})

Computes result of the given parameters.

Implementation

Future<List<int>> deriveKeyBytes({
  required List<int> password,
  List<int> nonce = const [],
  List<int> optionalSecret = const [],
  List<int> associatedData = const [],
}) async {
  // Compute hash of the parameters.
  final h0 = preHashingDigest(
    password: password,
    nonce: nonce,
    optionalSecret: optionalSecret,
    associatedData: associatedData,
  );

  final result = await deriveKeyBytesFromPrehashingDigest(h0);
  h0.fillRange(0, h0.length, 0);
  return result;
}