elliptic-curve: use crypto_common::Generate#2173
Merged
Conversation
78d7a51 to
6ec1d7a
Compare
Adds a dependency on `crypto-common` (all curve implementations pretty much have a transitive one already) and replaces all of the RNG functionality with the new `Generate` trait (#2096), for the following types: - `NonZeroScalar` - `ScalarValue` - `SecretKey` - `ecdh::EphemeralSecret` Additionally `Generate` trait bounds have been added to the associated types for `CurveArithmetic`: `AffinePoint`, `ProjectivePoint`, `Scalar`
6ec1d7a to
d2d3441
Compare
tarcieri
added a commit
to RustCrypto/signatures
that referenced
this pull request
Jan 6, 2026
Updates that go along with RustCrypto/traits#2173, which switched the `elliptic-curve` to use the `Generate` trait introduced in RustCrypto/traits#2096
tarcieri
added a commit
to RustCrypto/signatures
that referenced
this pull request
Jan 6, 2026
Updates that go along with RustCrypto/traits#2173, which switched the `elliptic-curve` to use the `Generate` trait introduced in RustCrypto/traits#2096
tarcieri
added a commit
to RustCrypto/elliptic-curves
that referenced
this pull request
Jan 6, 2026
Replaces various bespoke RNG APIs with the new `Generate` trait from `crypto_common`, which was added to `elliptic-curve` in RustCrypto/traits#2173. It's now a required bound for all affine/projective points and scalars, as well as the RNG API used by all generic types defined in the `elliptic-curve` crate itself. This API avoids having to directly import `getrandom::SysRng`, making it possible to call `T::generate()` instead so long as the `getrandom` feature of `elliptic-curve` is enabled.
tarcieri
added a commit
to RustCrypto/elliptic-curves
that referenced
this pull request
Jan 6, 2026
Replaces various bespoke RNG APIs with the new `Generate` trait from `crypto_common`, which was added to `elliptic-curve` in RustCrypto/traits#2173. It's now a required bound for all affine/projective points and scalars, as well as the RNG API used by all generic types defined in the `elliptic-curve` crate itself. This API avoids having to directly import `getrandom::SysRng`, making it possible to call `T::generate()` instead so long as the `getrandom` feature of `elliptic-curve` is enabled.
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.
Adds a dependency on
crypto-common(all curve implementations pretty much have a transitive one already) and replaces all of the RNG functionality with the newGeneratetrait (#2096), for the following types:NonZeroScalarScalarValueSecretKeyecdh::EphemeralSecretAdditionally
Generatetrait bounds have been added to the associated types forCurveArithmetic:AffinePoint,ProjectivePoint,Scalar