CTR constructor

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

Creates a CTR instance with the given block cipher and initialization vector (IV).

Parameters:

  • cipher: The block cipher used for encryption.
  • iv: The initialization vector for the CTR mode.

Implementation

CTR(BlockCipher cipher, List<int> iv) {
  _counter = List<int>.filled(cipher.blockSize, 0);

  _buffer = List<int>.filled(cipher.blockSize, 0);
  setCipher(cipher, iv);
}