@Override
  public byte[] computeMac() throws GeneralSecurityException {
    if (finalized) {
      throw new IllegalStateException(
          "Cannot compute after already computing the MAC tag. Please create a new object.");
    }
    if (key.getParameters().getVariant() == Variant.LEGACY) {
      update(ByteBuffer.wrap(FORMAT_VERSION));
    }
    finalized = true;
    return Bytes.concat(
        key.getOutputPrefix().toByteArray(),
        Arrays.copyOf(mac.doFinal(), key.getParameters().getCryptographicTagSizeBytes()));
  }
An implementation of streaming HMAC computation. Not thread-safe, thread safety must be ensured
by the caller if objects of this class are accessed concurrently.
java_src/src/main/java/com/google/crypto/tink/mac/internal/ChunkedHmacComputation.java