I'm looking into refactoring hmac, mainly to trim context size
https://git.lysator.liu.se/nettle/nettle/-/issues/2.

Two questions somewhat related to this:

1. The hmac spec allows arbitrarily large keys; if key size exceeds
   underlying block size, the key is hashed and the digest is used as
   the hmac key. Effectively the same as if caller would hash the key,
   and pass in the digest. Is this a feature that anyone is using, or in
   other words, what would break if nettle's hmac implementation were
   restricted to key size <= block size, and leave the obscure(?)
   prehashing needed for support of arbitrary large keys to the
   application?

2. That kind of prehashing is also a usecase for all-in-one hashing.
   Would it be useful to add convenience functions for
   all-in-one-hashing, e.g.,

     void sha256_sum (uint8_t *digest, size_t length, const uint8_t *data);

   to hash a contiguous string without having to bother with
   init/update/digest? Implementation would typically need to allocate a
   context struct on the stack.

Regards,
/Niels

-- 
Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677.
Internet email is subject to wholesale government surveillance.
_______________________________________________
nettle-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to