Girocco/HashUtil.pm: take advantage of Digest::SHA::hmac_sha1
commite1dd24d58f8e12e272f8025d2b62460c0ceb3157
authorKyle J. McKay <mackyle@gmail.com>
Tue, 2 Mar 2021 01:16:40 +0000 (1 18:16 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Tue, 2 Mar 2021 01:16:40 +0000 (1 18:16 -0700)
treebb10db5546ca10ed689fc95a8da28a3e70e742d9
parentc1d00721bf99bab155dca7cc587723662b0d530b
Girocco/HashUtil.pm: take advantage of Digest::SHA::hmac_sha1

If Digest::SHA::hmac_sha1 can be imported, then use that as the
hmac_sha1 implementation.

It's approximately twice as fast (almost) as the included
hmac_sha1 implementation.

When using the Digest::SHA::hmac_sha1 implementation, double the
maximum key rounds since that's approximately the same CPU cost.

Clients of the HashUtil module automatically get whatever is
implementing hmac_sha1 imported as hmac_sha1 and do not need to
make any changes whatsoever.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Girocco/HashUtil.pm