pub trait CanSample<T> {
// Required method
fn sample(&mut self) -> T;
// Provided methods
fn sample_array<const N: usize>(&mut self) -> [T; N] { ... }
fn sample_vec(&mut self, n: usize) -> Vec<T> { ... }
}Expand description
A trait for sampling challenge elements from the Fiat-Shamir transcript.
Sampling produces pseudo-random elements deterministically derived from the absorbed inputs and the sponge state.
Required Methods§
Provided Methods§
Sourcefn sample_array<const N: usize>(&mut self) -> [T; N]
fn sample_array<const N: usize>(&mut self) -> [T; N]
Sample an array of N challenge values from the transcript.
Sourcefn sample_vec(&mut self, n: usize) -> Vec<T>
fn sample_vec(&mut self, n: usize) -> Vec<T>
Sample a Vec of n challenge values from the transcript.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.