getOutputSize method

  1. @override
int getOutputSize(
  1. int len
)
override

Implementation

@override
// ignore: missing_return
int getOutputSize(int len) {
  var total = max(0, len) + _bufPos;

  switch (_state) {
    case State.DEC_INIT:
    case State.DEC_AAD:
    case State.DEC_DATA:
      return max(0, total - MAC_SIZE);
    case State.ENC_INIT:
    case State.ENC_AAD:
    case State.ENC_DATA:
      return total + MAC_SIZE;
    default:
      throw StateError('state = $_state');
  }
}