Rng

Trait Rng 

Source
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§

Source

fn mix(&mut self, val: &Digest)

Mix in randomness from a Fiat-Shamir commitment.

Source

fn random_bits(&mut self, bits: usize) -> u32

Get a cryptographically uniform set of bits, as the low order bits of a u32

Source

fn random_elem(&mut self) -> F::Elem

Get a cryptographically uniform field element

Source

fn random_ext_elem(&mut self) -> F::ExtElem

Get a cryptographically uniform extension field element

Implementors§