Page 2 of 2

Re: hmac_sha1

Posted: Sun Apr 09, 2023 7:47 pm
by infratec
:oops: :oops: :oops:

Found a big bug in my code:
If the XOR key generated a 00 byte in the middle, the later used StringFingerprint() used a to short string.
Happend when digit 6 or \ was in the key, because same values XORed results in 0.

So I have to use Fingerprint() instead of StringFingerprint()

During implementation I found that I can reduce the memory allocations.

The readability was lower than before, but I added now comments about the steps which are done.

Updated and now hopefully bugfree version is above:
viewtopic.php?p=599038#p599038

Re: hmac_sha1

Posted: Sun Apr 09, 2023 8:08 pm
by infratec
This subject was already handled by me in 2015 :mrgreen:

viewtopic.php?p=464116

Re: hmac_sha1

Posted: Sun Apr 09, 2023 8:38 pm
by infratec
Holy moly :!:

After searching deeper, I found online calculators for SHA3 HMAC and ... my results were wrong!
But I also found an online calculator which returns wrong results :cry:
2 others generates the same values as my code.
(see listing)

I had to adjust the blocksizes (bitrates in SHA3).
Please copy it again.