processInPlace method
XORs the keystream over data[start..end) in place.
Implementation
void processInPlace(Uint8List data, [int start = 0, int? end]) {
final stop = RangeError.checkValidRange(start, end, data.length);
for (var i = start; i < stop; i++) {
if (_used == 16) {
_cipher.encryptBlock(_counter, 0, _keystream, 0);
_used = 0;
// Little-endian increment for the *next* block.
for (var j = 0; j < 16; j++) {
_counter[j] = (_counter[j] + 1) & 0xFF;
if (_counter[j] != 0) break;
}
}
data[i] ^= _keystream[_used++];
}
}