createCipher method
Implementation
BlockCipher createCipher(
Uint8List key,
Uint8List iv, {
required bool forEncryption,
}) {
if (key.length != keySize) {
throw ArgumentError.value(key, 'key', 'Key must be $keySize bytes long');
}
if (iv.length != ivSize) {
throw ArgumentError.value(iv, 'iv', 'IV must be $ivSize bytes long');
}
final cipher = cipherFactory();
cipher.init(forEncryption, ParametersWithIV(KeyParameter(key), iv));
return cipher;
}