0

Reading through the wikipedia entry for HMAC I see that SHA-3 can be used with the HMAC algorithm to give HMAC-SHA3-512.

I also know that there is KMAC, which from my understanding is a MAC construction designed specifically for KECCAK, basically SHA-3 and it makes use of CSHAKE.

Question now is what would be the difference between HMAC-SHA3-512 and KMAC? And when should one be used over the other?

Maarten Bodewes
  • 92,551
  • 13
  • 161
  • 313
dade
  • 133
  • 5
  • 1
    HMAC uses double hashing and this is unnecessary for the SHA3 family. Maybe this is a dupe for you; Should I use HMAC or KMAC for SHA3? – kelalaka Oct 23 '21 at 13:46
  • 2
    in other words HMAC-SHA3-512 is unnecessary...or any other constructs that uses hmac construction with sha-3 – dade Oct 23 '21 at 13:56
  • 1
    Yes, indeed. HMAC works with any hash basically, even those that have length extension attacks. However, because of that, it performs unnecessary operations when it comes to SHA-3 (or, in this case SHAKE128 / SHAKE256). Note that you could use KMAC-SHAKE128 without too much concern even against quantum computers if you deem KMAC-SHAKE256 too slow. – Maarten Bodewes Oct 23 '21 at 14:35
  • PS First square brackets, then the parentheses for links. Or just hit the link button while editing, which puts the referenced link on the bottom of the page. – Maarten Bodewes Oct 23 '21 at 14:39

0 Answers0