Skip to content

elliptic-curve: use crypto_common::Generate#2173

Merged
tarcieri merged 1 commit intomasterfrom
elliptic-curve/use-the-generate-trait
Jan 6, 2026
Merged

elliptic-curve: use crypto_common::Generate#2173
tarcieri merged 1 commit intomasterfrom
elliptic-curve/use-the-generate-trait

Conversation

@tarcieri
Copy link
Member

@tarcieri tarcieri commented Jan 6, 2026

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

@tarcieri tarcieri force-pushed the elliptic-curve/use-the-generate-trait branch 2 times, most recently from 78d7a51 to 6ec1d7a Compare January 6, 2026 16:57
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`
@tarcieri tarcieri force-pushed the elliptic-curve/use-the-generate-trait branch from 6ec1d7a to d2d3441 Compare January 6, 2026 17:06
@tarcieri tarcieri merged commit ffb6cf7 into master Jan 6, 2026
73 checks passed
@tarcieri tarcieri deleted the elliptic-curve/use-the-generate-trait branch January 6, 2026 17:11
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.
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