returnByte method

  1. @override
int returnByte(
  1. int inp
)
override

Process one byte of data given by inp and return its encrypted value.

Implementation

@override
int returnByte(int inp) {
  if (_keyStreamOffset == 0) {
    generateKeyStream(_keyStream);

    if (++_state[12] == 0) {
      ++_state[13];
    }
  }

  var out = clip8(_keyStream[_keyStreamOffset] ^ inp);
  _keyStreamOffset = (_keyStreamOffset + 1) & 63;

  return out;
}