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: add EcdsaCurve marker trait #787

Merged
merged 1 commit into from
Jan 17, 2024
Merged

Conversation

tarcieri
Copy link
Member

This trait is the intended successor to the SignPrimitive and VerifyPrimitive traits.

Currently the only reason for a non-default impl of those traits is to handle low-S normalization. The EcdsaCurve trait now not only marks the curve as being safe for use with ECDSA, but also captures this decision regarding low-S normalization so it doesn't have to be expressed in code.

This trait is the intended successor to the `SignPrimitive` and
`VerifyPrimitive` traits.

Currently the only reason for a non-default impl of those traits is to
handle low-S normalization. The `EcdsaCurve` trait now not only marks
the curve as being safe for use with ECDSA, but also captures this
decision regarding low-S normalization so it doesn't have to be
expressed in code.
@tarcieri tarcieri merged commit 9eda95a into master Jan 17, 2024
8 checks passed
@tarcieri tarcieri deleted the ecdsa/ecdsa-curve-trait branch January 17, 2024 19:16
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request Jan 17, 2024
This is a marker trait added in RustCrypto/signatures#787 which marks an
elliptic curve as being intended for use with ECDSA.

It's the intended successor of the `SignPrimitive` and `VerifyPrimitive`
traits, carrying with it the one bit of information needed to eliminate
the need for custom impls: a flag for low-S normalization.

`bp256`, `bp384`, `k256`, `p192`, `p224`, `p256`, `p384`, and `p521`
have all received trait impls.

Of those, only `k256` has the `NORMALIZE_S` flag set to `true`.
tarcieri added a commit that referenced this pull request Jan 17, 2024
Moves the trait added in #787 out of the `hazmat` module and into the
toplevel, so it's available regardless of whether or not the `hazmat`
feature has been enabled.
tarcieri added a commit that referenced this pull request Jan 17, 2024
Moves the trait added in #787 out of the `hazmat` module and into the
toplevel, so it's available regardless of whether or not the `hazmat`
feature has been enabled.
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request Jan 17, 2024
This is a marker trait added in RustCrypto/signatures#787 which marks an
elliptic curve as being intended for use with ECDSA.

It's the intended successor of the `SignPrimitive` and `VerifyPrimitive`
traits, carrying with it the one bit of information needed to eliminate
the need for custom impls: a flag for low-S normalization.

`bp256`, `bp384`, `k256`, `p192`, `p224`, `p256`, `p384`, and `p521`
have all received trait impls.

Of those, only `k256` has the `NORMALIZE_S` flag set to `true`.
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request Jan 17, 2024
This is a marker trait added in RustCrypto/signatures#787 which marks an
elliptic curve as being intended for use with ECDSA.

It's the intended successor of the `SignPrimitive` and `VerifyPrimitive`
traits, carrying with it the one bit of information needed to eliminate
the need for custom impls: a flag for low-S normalization.

`bp256`, `bp384`, `k256`, `p192`, `p224`, `p256`, `p384`, and `p521`
have all received trait impls.

Of those, only `k256` has the `NORMALIZE_S` flag set to `true`.
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