Skip to content

Conversation

tarcieri
Copy link
Member

Originally added in RustCrypto/MACs#151

The situation is ecdsa has a trait for the "default" hash function to use for a particular curve, which we want to work with RFC6979 and ergo HMAC, so we would like to use an EagerHash bound.

But rfc6979 is an optional dependency, so we can't depend on its transitive accessibility to rfc6979::hmac. This PR added hmac as a dependency gated on the digest feature of ecdsa:

RustCrypto/signatures#1076

But as I was looking at EagerHash I noticed there's nothing HMAC-specific about it at all and it can easily be moved to digest, so we're able to use it in bounds without any other dependencies besides digest, which would be nice.

cc @daxpedda

Originally added in RustCrypto/MACs#151

The situation is `ecdsa` has a trait for the "default" hash function to
use for a particular curve, which we want to work with RFC6979 and ergo
HMAC, so we would like to use an `EagerHash` bound.

But `rfc6979` is an optional dependency, so we can't depend on its
transitive accessibility to `rfc6979::hmac`. This PR added `hmac` as a
dependency gated on the `digest` feature of `ecdsa`:

RustCrypto/signatures#1076

But as I was looking at `EagerHash` I noticed there's nothing
HMAC-specific about it at all and it can easily be moved to `digest`, so
we're able to use it in bounds without any other dependencies besides
`digest`, which would be nice.
@tarcieri tarcieri requested a review from newpavlov September 15, 2025 22:45
@daxpedda
Copy link
Contributor

LGTM!

Can do follow-ups tomorrow if they aren't already done by then.

@newpavlov newpavlov merged commit a638f1f into master Sep 16, 2025
10 checks passed
@newpavlov newpavlov deleted the digest/move-eager-hash-from-hmac branch September 16, 2025 07:51
@daxpedda
Copy link
Contributor

Let me know if you want me to update any other repo.

tarcieri pushed a commit to RustCrypto/MACs that referenced this pull request Sep 16, 2025
@tarcieri
Copy link
Member Author

@daxpedda let me know if there are any remaining PRs I haven't reviewed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants