ScramKeyDerivationRequest constructor

ScramKeyDerivationRequest({
  1. required Uint8List password,
  2. required Uint8List salt,
  3. required String kdf,
  4. required int iterations,
  5. required int memory,
  6. required int keyLength,
})

Implementation

ScramKeyDerivationRequest({
  required Uint8List password,
  required Uint8List salt,
  required this.kdf,
  required this.iterations,
  required this.memory,
  required this.keyLength,
}) : password = Uint8List.fromList(password),
     salt = Uint8List.fromList(salt) {
  if (iterations <= 0) {
    throw ArgumentError.value(iterations, 'iterations', 'must be positive');
  }
  if (memory <= 0) {
    throw ArgumentError.value(memory, 'memory', 'must be positive');
  }
  if (keyLength <= 0) {
    throw ArgumentError.value(keyLength, 'keyLength', 'must be positive');
  }
}