Skip to content

ecdsa: remove SignPrimitive and VerifyPrimitive traits#793

Merged
tarcieri merged 1 commit into
masterfrom
ecdsa/remove-signprimitive-and-verifyprimitive-traits
Jan 18, 2024
Merged

ecdsa: remove SignPrimitive and VerifyPrimitive traits#793
tarcieri merged 1 commit into
masterfrom
ecdsa/remove-signprimitive-and-verifyprimitive-traits

Conversation

@tarcieri

Copy link
Copy Markdown
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
@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`.
@tarcieri tarcieri mentioned this pull request Jul 2, 2026
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