encrypt method
inp: the total bytes in plain textinpOff: the byte offset to start encryption atinpLength: the number of bytes (length) to encryptout: the buffer to write the encrypted output inoutOff: the byte offset to write the encrypted output to
returns the length of the new encrypted output
Implementation
@override
FutureOr<int> encrypt(
Uint8List inp, int inpOff, int inpLength, Uint8List out, int outOff) {
var iv = generateIv();
out.setAll(outOff, iv);
var len = _cipher.encrypt(iv, inp, 0, inpLength, out, outOff + 16);
return len + 16;
}