File tree Expand file tree Collapse file tree 4 files changed +6
-3
lines changed
Expand file tree Collapse file tree 4 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ and this library adheres to Rust's notion of
1010### Changed
1111- MSRV is now 1.63.0.
1212- Migrated to ` rand_core 0.9 ` .
13+ - ` ff::Field::random(rng: impl RngCore) -> Self ` has been changed back to
14+ ` Field::random<R: RngCore + ?Sized>(rng: &mut R) -> Self ` , to enable passing a
15+ trait object as the RNG.
1316
1417### Removed
1518- ` derive_bits ` feature flag (use ` bits ` instead).
Original file line number Diff line number Diff line change @@ -1267,7 +1267,7 @@ fn prime_field_impl(
12671267 const ONE : Self = R ;
12681268
12691269 /// Computes a uniformly random element using rejection sampling.
1270- fn random( mut rng : impl :: ff:: derive:: rand_core:: RngCore ) -> Self {
1270+ fn random< R : :: ff:: derive:: rand_core:: RngCore + ? Sized > ( rng : & mut R ) -> Self {
12711271 loop {
12721272 let mut tmp = {
12731273 let mut repr = [ 0u64 ; #limbs] ;
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ pub trait Field:
7575 const ONE : Self ;
7676
7777 /// Returns an element chosen uniformly at random using a user-provided RNG.
78- fn random ( rng : impl RngCore ) -> Self ;
78+ fn random < R : RngCore + ? Sized > ( rng : & mut R ) -> Self ;
7979
8080 /// Returns true iff this element is zero.
8181 fn is_zero ( & self ) -> Choice {
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ mod full_limbs {
3232 fn random_masking_does_not_overflow ( ) {
3333 use ff:: Field ;
3434
35- let _ = F384p :: random ( rand:: rng ( ) ) ;
35+ let _ = F384p :: random ( & mut rand:: rng ( ) ) ;
3636 }
3737}
3838
You can’t perform that action at this time.
0 commit comments