process method

  1. @override
Uint8List process(
  1. bool pad,
  2. Uint8List data
)
inherited

Process a whole block of data at once, returning the result in a byte array. If pad is true adds padding to the given block, otherwise, padding is removed.

Note: this assumes that the last block of plain text is always passed to it inside data. The reason for this is that some modes such as 'trailing bit compliment' base the padding on the last byte of plain text.

Implementation

@override
Uint8List process(bool pad, Uint8List data) {
  if (pad) {
    throw StateError(
        'cannot add padding, use PaddedBlockCipher to add padding');
  } else {
    var len = padCount(data);
    return data.sublist(0, data.length - len);
  }
}