Daiki Ueno ueno@gnu.org writes:
+static void +hmac_md5_set_key_wrapper (void *ctx, const uint8_t *key) +{
- hmac_md5_set_key (ctx, MD5_BLOCK_SIZE, key);
+}
[...]
+extern const struct nettle_mac nettle_hmac_md5; +extern const struct nettle_mac nettle_hmac_ripemd160; +extern const struct nettle_mac nettle_hmac_sha1; +extern const struct nettle_mac nettle_hmac_sha224; +extern const struct nettle_mac nettle_hmac_sha256; +extern const struct nettle_mac nettle_hmac_sha384; +extern const struct nettle_mac nettle_hmac_sha512;
If we define a single nettle_mac for each supported (no-nonce) mac algorithm, what should the key size be for each algorithm? Using the underlying block size for the hmac algorithms seems to be a bit overkill. What key sizes are used in practice? Does it make sense to use key size equal to digest size (at least, that's what used for hmac in the ssh protocol)?
My current plan is to first add struct nettle_mac as an interface for no-nonce macs. And then add a different struct for macs requiring a per-message nonce. struct nettle_nmac was suggested, any better name for this?
Regards, /Niels