hmac_sha1

Share your advanced PureBasic knowledge/code with the community.
infratec
Always Here
Always Here
Posts: 7577
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: hmac_sha1

Post 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
infratec
Always Here
Always Here
Posts: 7577
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: hmac_sha1

Post by infratec »

This subject was already handled by me in 2015 :mrgreen:

viewtopic.php?p=464116
infratec
Always Here
Always Here
Posts: 7577
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: hmac_sha1

Post 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.
Post Reply