process method

Future<Iterable<int>> process(
  1. int pw,
  2. Iterable<int> pin
)

Implementation

Future<Iterable<int>> process(int pw, Iterable<int> pin) async {
  if (algorithm == KdfAlgorithm.none) {
    return pin;
  } else if (algorithm == KdfAlgorithm.kdfItersaltedS2k) {
    late Iterable<int> salt;
    if (pw == YubikitOpenPGPCommands.pw1_81) {
      salt = pw1SaltBytes!;
    } else if (pw == YubikitOpenPGPCommands.pw3_83) {
      salt = pw1SaltBytes ?? pw3SaltBytes;
    }
    return kdfItersaltedS2k(pin, salt);
  }
  throw Exception('Algorithm not supported!');
}