mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-07 00:03:10 +00:00
cleaner rand
This commit is contained in:
parent
8ace54dcec
commit
95e5fb5910
@ -27,9 +27,9 @@ impl Fp {
|
|||||||
|
|
||||||
impl Distribution<Fp> for Standard {
|
impl Distribution<Fp> for Standard {
|
||||||
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Fp {
|
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Fp {
|
||||||
let (x0, x1, x2, x3) = rng.gen::<(u64, u64, u64, u64)>();
|
let xs = rng.gen::<[u64; 4]>();
|
||||||
Fp {
|
Fp {
|
||||||
val: U256([x0, x1, x2, x3]) % BN_BASE,
|
val: U256(xs) % BN_BASE,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user