processBlock method
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 (_workingKey.isEmpty) {
throw StateError('$algorithmName not initialised');
}
if ((inOff + BLOCK_SIZE) > input.lengthInBytes) {
throw ArgumentError('Input buffer too short for $algorithmName engine');
}
if ((outOff + BLOCK_SIZE) > output.lengthInBytes) {
throw ArgumentError('Output buffer too short for $algorithmName engine');
}
if (_forEncryption) {
_encryptBlock(input, inOff, output, outOff);
} else {
_decryptBlock(input, inOff, output, outOff);
}
return BLOCK_SIZE;
}