Skip to content

Conversation

daxpedda
Copy link
Contributor

This PR replaces the Digest requirements of rfc6979 items with EagerHash. In the process I merged the ecdsa signing and verifying crate features into signature.

As discussed in RustCrypto/elliptic-curves#1423 (comment).

@daxpedda daxpedda force-pushed the signature-digest-remove-digest branch 2 times, most recently from 9765151 to f0ccd6c Compare September 15, 2025 20:53
@daxpedda daxpedda force-pushed the signature-digest-remove-digest branch 3 times, most recently from 50564db to 40b250b Compare September 15, 2025 21:25
@daxpedda daxpedda force-pushed the signature-digest-remove-digest branch from 40b250b to 4f9a6fe Compare September 15, 2025 21:27
@daxpedda daxpedda requested a review from tarcieri September 15, 2025 21:31
Comment on lines +43 to +44
arithmetic = ["dep:hmac", "dep:rfc6979", "elliptic-curve/arithmetic"]
algorithm = ["dep:rfc6979", "arithmetic", "digest", "hazmat"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe these could be consolidated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to do this here or in a follow-up?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Followup is fine

Copy link
Member

@tarcieri tarcieri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with this as is, curious about also consolidating arithmetic and algorithm though

@tarcieri tarcieri merged commit 580758e into RustCrypto:master Sep 15, 2025
76 checks passed
tarcieri added a commit to RustCrypto/traits that referenced this pull request Sep 15, 2025
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.
newpavlov pushed a commit to RustCrypto/traits that referenced this pull request Sep 16, 2025
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.
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.

2 participants