Remove FieldExt::rand

This removes a dependency on the `getrandom` crate in no-std mode, which
doesn't work on some no-std targets that `getrandom` doesn't support.
This commit is contained in:
Jack Grigg 2021-12-22 05:15:06 +00:00
parent ab03c3d5e1
commit f874d29238
3 changed files with 2 additions and 6 deletions

View file

@ -21,6 +21,7 @@ and this project adheres to Rust's notion of
- `FieldExt::from_u64` (use `From<u64> for ff::PrimeField` instead).
- `FieldExt::{from_bytes, read, to_bytes, write}`
(use `ff::PrimeField::{from_repr, to_repr}` instead).
- `FieldExt::rand` (use `ff::Field::random` instead).
## [0.2.1] - 2021-09-17
### Changed

View file

@ -44,7 +44,7 @@ required-features = ["std"]
blake2b_simd = { version = "0.5", default-features = false }
ff = { version = "0.11", default-features = false }
group = { version = "0.11", default-features = false }
rand = { version = "0.8", default-features = false, features = ["getrandom"] }
rand = { version = "0.8", default-features = false }
static_assertions = "1.1.0"
subtle = { version = "2.3", default-features = false }

View file

@ -112,11 +112,6 @@ pub trait FieldExt: SqrtRatio + From<bool> + Ord + Group<Scalar = Self> {
/// Element of multiplicative order $3$.
const ZETA: Self;
/// This computes a random element of the field using system randomness.
fn rand() -> Self {
Self::random(rand::rngs::OsRng)
}
/// Obtains a field element congruent to the integer `v`.
fn from_u128(v: u128) -> Self;