CBC constructor

CBC(
  1. BlockCipher cipher,
  2. List<int> iv
)

Implementation

CBC(BlockCipher cipher, List<int> iv) {
  if (iv.length != cipher.blockSize) {
    throw ArgumentException.invalidOperationArguments(
      "CBC",
      name: "iv",
      reason: "Invalid IV bytes length.",
    );
  }

  _cipher = cipher;
  _prevBlock = iv.clone();
  _tmpBlock = List<int>.filled(cipher.blockSize, 0);
}