CTR constructor

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

Creates a CTR instance over cipher, starting the counter at iv (which must be cipher's block size).

Implementation

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

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