Commit Graph

9 Commits

Author SHA1 Message Date
Lucas Gabriel Vuotto 666b833b98 auth/hmac: complete overhaul
Now that there are dedicated struct for initial parameters, make the
HMAC params provide a lc_hash_ctx to be used internally. This makes HMAC
less special and allows it to work with any hash, instead of needing
dedicated inits and ctx_news. As an upside, now it's possible to have a
one-pass HMAC.
2024-06-10 17:29:29 +00:00
Lucas Gabriel Vuotto 2b3e390bbf Make params struct non-const
Upcoming changes will push lc_*_ctx into the params struct for higher
order constructions like HMAC or HKDF.
2024-06-09 15:09:15 +00:00
Lucas Gabriel Vuotto 8f1b773e5f auth/hmac: rename BLOCKSZ to BLOCKLEN 2024-06-09 14:25:05 +00:00
Lucas Gabriel Vuotto f1c4ceea84 Make the block lengths part of the public interface 2024-06-09 14:16:18 +00:00
Lucas Gabriel Vuotto 06e9c5ec67 Rename *_CHUNK* to *_BLOCKLEN* 2024-06-09 14:05:52 +00:00
Lucas Gabriel Vuotto b26a9c7274 auth: replace init args with a implementation-specific params struct
This allows for more flexibility in the future.

This commit breaks ChaCha20-Poly1305. It'll be fixed in a subsequent
commit.
2024-06-07 18:40:14 +00:00
Lucas Gabriel Vuotto 1a8f813442 hash: implement SHA-{224,256}
Add the HMAC and Wycheproof bits for HMAC while at it.
2024-06-07 03:14:21 +00:00
Lucas Gabriel Vuotto 11b86db9db auth/hmac: 0-pad the hashed key in longer-than-blocksize case 2024-06-06 17:14:30 +00:00
Lucas Gabriel Vuotto ad42d99e0b auth: add HMAC implementation
This allows for checking the SHA-512 implementation against Wycheproof
via the HMAC tests.
2024-06-06 12:41:44 +00:00