squeeze method

void squeeze(
  1. Uint8List? output,
  2. int? offset,
  3. int outputLength
)
inherited

Implementation

void squeeze(Uint8List? output, int? offset, int outputLength) {
  if (!squeezing) {
    _padAndSwitchToSqueezingPhase();
  }

  if ((outputLength % 8) != 0) {
    throw StateError('outputLength not a multiple of 8');
  }

  var i = 0;
  while (i < outputLength) {
    if (_bitsInQueue == 0) {
      _keccakExtract();
    }

    var partialBlock = min(_bitsInQueue, outputLength - i);

    output!.setRange(
        offset! + (i ~/ 8),
        offset + (i ~/ 8) + (partialBlock ~/ 8),
        dataQueue.sublist((_rate - _bitsInQueue) ~/ 8));

    //System.arraycopy(dataQueue, (rate - bitsInQueue) / 8, output, offset + (int)(i / 8), partialBlock / 8);
    _bitsInQueue -= partialBlock;
    i += partialBlock;
  }
}