code: public final byte[] doFinal(byte[] input) throws IllegalStateException
      {
          chooseFirstProvider();
          if (initialized == false) {
              throw new IllegalStateException("MAC not initialized");
          }
          update(input);
          return doFinal();
      }
docs: Processes the given array of bytes and finishes the MAC operation.
  
  <p>A call to this method resets this <code>Mac</code> object to the
  state it was in when previously initialized via a call to
  <code>init(Key)</code> or
  <code>init(Key, AlgorithmParameterSpec)</code>.
  That is, the object is reset and available to generate another MAC from
  the same key, if desired, via new calls to <code>update</code> and
  <code>doFinal</code>.
  (In order to reuse this <code>Mac</code> object with a different key,
  it must be reinitialized via a call to <code>init(Key)</code> or
  <code>init(Key, AlgorithmParameterSpec)</code>.
  
  @param input data in bytes
  @return the MAC result.
  
  @exception IllegalStateException if this <code>Mac</code> has not been
  initialized.