ecdsa: add EcdsaCurve marker trait#787
Merged
Merged
Conversation
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
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`.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This trait is the intended successor to the
SignPrimitiveandVerifyPrimitivetraits.Currently the only reason for a non-default impl of those traits is to handle low-S normalization. The
EcdsaCurvetrait 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.