Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecdsa: remove SignPrimitive and VerifyPrimitive traits #793

Merged

Conversation

tarcieri
Copy link
Member

The backstory of these traits was once upon a time we didn't yet have the trait structure in place to express algorithms like ECDSA signing and verification generically, so each crate (at the time just k256 and p256) had a nearly duplicated implementation of ECDSA, with k256 including tweaks for low-S normalization.

Now the ecdsa crate contains fully generic implementations of both algorithms, and with the EcdsaCurve trait, carries a NORMALIZE_S preference, so these traits are just needless indirection at this point.

This removes the traits, converting non-trivial methods into static functions in the hazmat module, namely sign_prehashed_rfc6979.

@tarcieri tarcieri force-pushed the ecdsa/remove-signprimitive-and-verifyprimitive-traits branch 3 times, most recently from 76c58b4 to 4948b56 Compare January 18, 2024 01:14
The backstory of these traits was once upon a time we didn't yet have
the trait structure in place to express algorithms like ECDSA signing
and verification generically, so each crate (at the time just `k256` and
`p256`) had a nearly duplicated implementation of ECDSA, with `k256`
including tweaks for low-S normalization.

Now the `ecdsa` crate contains fully generic implementations of both
algorithms, and with the `EcdsaCurve` trait, carries a `NORMALIZE_S`
preference, so these traits are just needless indirection at this point.

This removes the traits, converting non-trivial methods into static
functions in the `hazmat` module, namely `sign_prehashed_rfc6979`.
@tarcieri tarcieri force-pushed the ecdsa/remove-signprimitive-and-verifyprimitive-traits branch from 4948b56 to 0ab00f1 Compare January 18, 2024 01:15
@tarcieri tarcieri merged commit 3ed9867 into master Jan 18, 2024
8 checks passed
@tarcieri tarcieri deleted the ecdsa/remove-signprimitive-and-verifyprimitive-traits branch January 18, 2024 01:19
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request Jan 18, 2024
These were removed upstream in RustCrypto/signatures#793.

The ECDSA implementation is fully generic now. These traits were
originally for per-curve implementations, but those are no-longer
needed.

The upstream implementation now has native support for low-S
normalization by way of `EcdsaCurve::NORMALIZE_S`.
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request Jan 18, 2024
These were removed upstream in RustCrypto/signatures#793.

The ECDSA implementation is fully generic now. These traits were
originally for per-curve implementations, but those are no-longer
needed.

The upstream implementation now has native support for low-S
normalization by way of `EcdsaCurve::NORMALIZE_S`.
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request Jan 18, 2024
These were removed upstream in RustCrypto/signatures#793.

The ECDSA implementation is fully generic now. These traits were
originally for per-curve implementations, but those are no-longer
needed.

The upstream implementation now has native support for low-S
normalization by way of `EcdsaCurve::NORMALIZE_S`.
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.

1 participant