Score:0

What is the difference between HMAC-SHA3-512 and KMAC?

bt flag

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?

kelalaka avatar
in flag
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?](https://crypto.stackexchange.com/a/68047/18298)
dade avatar
bt flag
in other words HMAC-SHA3-512 is unnecessary...or any other constructs that uses hmac construction with sha-3
Maarten Bodewes avatar
in flag
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 avatar
in flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.