by woodruffw · 3y ago · 0 comments
My impression was that H(s||m) was reasonable with e.g. SHA-3, assuming you have a fixed key size. The only downside I can think of is that you have to remember not to do it with variable length keys or with SHA-2. Am I missing something?
https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.S...
HopMAC(K,M)=H(K || H(M))
HMAC(K,M)=H(K || H(K || M))
[0]: https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwe...
[1]: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.S...The big reason I can think of not to use H(k, m) (or hand-rolled SHA3 KMAC) is that it will quietly fail open if you switch to a normal SHA2 hash.