Skip to content

ecdsa: add EcdsaCurve marker trait#787

Merged
tarcieri merged 1 commit into
masterfrom
ecdsa/ecdsa-curve-trait
Jan 17, 2024
Merged

ecdsa: add EcdsaCurve marker trait#787
tarcieri merged 1 commit into
masterfrom
ecdsa/ecdsa-curve-trait

Conversation

@tarcieri

Copy link
Copy Markdown
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
@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`.
@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