processBlock method

  1. @override
int processBlock(
  1. Uint8List input,
  2. int inOff,
  3. Uint8List output,
  4. int outOff,
)
override

Process a whole block of data given by inp and starting at offset inpOff.

The resulting cipher text is put in out beginning at position outOff.

This method returns the total bytes processed (which is the same as the block size of the algorithm).

Implementation

@override
int processBlock(
  Uint8List input,
  int inOff,
  Uint8List output,
  int outOff,
) {
  if (!initialised) {
    throw Exception('$algorithmName engine not initialised');
  }

  if ((inOff + BLOCK_SIZE) > input.length) {
    throw Exception('Input buffer too short');
  }
  if ((outOff + BLOCK_SIZE) > output.length) {
    throw Exception('Output buffer too short');
  }
  if (_keyIs128) {
    return _processBlock128(input, inOff, output, outOff);
  } else {
    return _processBlock256(input, inOff, output, outOff);
  }
}