finish method

  1. @override
HMAC finish(
  1. List<int> out
)
override

Finalizes the hash computation and stores the hash state in the provided List<int> out.

This function completes the hash computation, finalizes the state, and stores the resulting hash in the provided out List<int>. If the hash has already been finished, this method will return the existing state without re-computing.

Parameters:

  • out: The List<int> in which the hash digest is stored.

Returns the current instance of the hash algorithm.

Implementation

@override
HMAC finish(List<int> out) {
  if (_finished) {
    _outer.finish(out);
    return this;
  }

  _inner.finish(out);

  _outer.update(out.sublist(0, getDigestLength)).finish(out);

  _finished = true;

  return this;
}