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 inputOff, Uint8List out, int outOff) {
if (workingKey == null) {
throw ArgumentError('RC2 engine not initialised');
}
if ((inputOff + BLOCK_SIZE) > input.length) {
throw ArgumentError('input buffer too short');
}
if ((outOff + BLOCK_SIZE) > out.length) {
throw ArgumentError('output buffer too short');
}
if (forEncryption) {
encryptBlock(input, inputOff, out, outOff);
} else {
decryptBlock(input, inputOff, out, outOff);
}
return BLOCK_SIZE;
}