CTR constructor
CTR(
- BlockCipher cipher,
- 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);
}