CanSampleBits

Trait CanSampleBits 

Source
pub trait CanSampleBits<T> {
    // Required method
    fn sample_bits(&mut self, bits: usize) -> T;
}
Expand description

A trait for sampling random bitstrings from the Fiat-Shamir transcript.

Required Methods§

Source

fn sample_bits(&mut self, bits: usize) -> T

Sample a random bits-bit integer from the transcript.

The distribution should be reasonably close to uniform. (In practice, a small bias may arise when bit-decomposing a uniformly sampled field element)

Guarantees that the returned value fits within the requested bit width.

Implementations on Foreign Types§

Source§

impl<C, T> CanSampleBits<T> for &mut C
where C: CanSampleBits<T>,

Source§

fn sample_bits(&mut self, bits: usize) -> T

Implementors§

Source§

impl<F, Inner> CanSampleBits<usize> for SerializingChallenger32<F, Inner>
where F: PrimeField32, Inner: CanSample<u8>,

Source§

impl<F, Inner> CanSampleBits<usize> for SerializingChallenger64<F, Inner>
where F: PrimeField64, Inner: CanSample<u8>,

Source§

impl<F, P, const WIDTH: usize, const RATE: usize> CanSampleBits<usize> for DuplexChallenger<F, P, WIDTH, RATE>

Source§

impl<F, PF, P, const WIDTH: usize, const RATE: usize> CanSampleBits<usize> for MultiField32Challenger<F, PF, P, WIDTH, RATE>