cleaner rand

This commit is contained in:
Dmitry Vagner 2023-02-27 22:40:39 -08:00
parent 8ace54dcec
commit 95e5fb5910

View File

@ -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,
} }
} }
} }