reset method

  1. @override
HMAC reset()
override

Resets the hash computation to its initial state.

This method initializes the hash computation to its initial state, clearing any previously processed data. After calling this method, you can start a new hash computation.

Returns the current instance of the hash algorithm with the initial stat

Implementation

@override
HMAC reset() {
  if (_inner is! SerializableHash || _outer is! SerializableHash) {
    throw MessageException(
        "hmac: can't reset() because hash doesn't implement restoreState()");
  }
  // Restore keyed states of inner and outer hashes.
  (_inner as SerializableHash).restoreState(_innerKeyedState);
  (_outer as SerializableHash).restoreState(_outerKeyedState);
  _finished = false;

  return this;
}