pub trait Rng<F: Field> {
// Required methods
fn mix(&mut self, val: &Digest);
fn random_bits(&mut self, bits: usize) -> u32;
fn random_elem(&mut self) -> F::Elem;
fn random_ext_elem(&mut self) -> F::ExtElem;
}Expand description
A trait that sets the PRNG used by Fiat-Shamir. We allow specialization at this level rather than at RngCore because some hashes such as Poseidon have elements distributed uniformly over the field natively.
Required Methods§
Sourcefn random_bits(&mut self, bits: usize) -> u32
fn random_bits(&mut self, bits: usize) -> u32
Get a cryptographically uniform set of bits, as the low order bits of a u32
Sourcefn random_elem(&mut self) -> F::Elem
fn random_elem(&mut self) -> F::Elem
Get a cryptographically uniform field element
Sourcefn random_ext_elem(&mut self) -> F::ExtElem
fn random_ext_elem(&mut self) -> F::ExtElem
Get a cryptographically uniform extension field element