update method

  1. @override
void update(
  1. Uint8List inp,
  2. int inOff,
  3. int len
)
override

Add len bytes of data contained in inp, starting at position inpOff to the MAC'ed input.

Implementation

@override
void update(final Uint8List inp, final int inOff, final int len) {
  var copied = 0;
  while (len > copied) {
    if (currentBlockOffset == BLOCK_SIZE) {
      processBlock();
      currentBlockOffset = 0;
    }

    var toCopy = (len - copied) > (BLOCK_SIZE - currentBlockOffset)
        ? (BLOCK_SIZE - currentBlockOffset)
        : (len - copied);
    arrayCopy(inp, copied + inOff, currentBlock, currentBlockOffset, toCopy);
    copied += toCopy;
    currentBlockOffset += toCopy;
  }
}