getUpdateOutputSize method

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

Implementation

@override
int getUpdateOutputSize(int len) {
  var total = max(0, len) + _bufPos;

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

  return total - (total % BUF_SIZE);
}