pub struct SerializingChallenger32<F, Inner> { /* private fields */ }
Expand description
Given a challenger that can observe and sample bytes, produces a challenger that is able to
sample and observe field elements of a PrimeField32
.
Observing:
- Takes a field element will serialize it into a byte array and observe each byte.
Sampling:
- Samples a field element in a prime field of size
p
by sampling uniformly an element in the range (0..1 << log_2(p)). This avoids modulo bias.
Implementations§
Source§impl<F: PrimeField32, Inner: CanObserve<u8>> SerializingChallenger32<F, Inner>
impl<F: PrimeField32, Inner: CanObserve<u8>> SerializingChallenger32<F, Inner>
Source§impl<F, H> SerializingChallenger32<F, HashChallenger<u8, H, 32>>
impl<F, H> SerializingChallenger32<F, HashChallenger<u8, H, 32>>
pub fn from_hasher(initial_state: Vec<u8>, hasher: H) -> Self
Trait Implementations§
Source§impl<F: PrimeField32, Inner: CanObserve<u8>> CanObserve<F> for SerializingChallenger32<F, Inner>
impl<F: PrimeField32, Inner: CanObserve<u8>> CanObserve<F> for SerializingChallenger32<F, Inner>
Source§impl<F: PrimeField32, const N: usize, Inner: CanObserve<u8>> CanObserve<Hash<F, u64, N>> for SerializingChallenger32<F, Inner>
impl<F: PrimeField32, const N: usize, Inner: CanObserve<u8>> CanObserve<Hash<F, u64, N>> for SerializingChallenger32<F, Inner>
Source§impl<F: PrimeField32, const N: usize, Inner: CanObserve<u8>> CanObserve<Hash<F, u8, N>> for SerializingChallenger32<F, Inner>
impl<F: PrimeField32, const N: usize, Inner: CanObserve<u8>> CanObserve<Hash<F, u8, N>> for SerializingChallenger32<F, Inner>
Source§impl<F, EF, Inner> CanSample<EF> for SerializingChallenger32<F, Inner>
impl<F, EF, Inner> CanSample<EF> for SerializingChallenger32<F, Inner>
Source§impl<F, Inner> CanSampleBits<usize> for SerializingChallenger32<F, Inner>
impl<F, Inner> CanSampleBits<usize> for SerializingChallenger32<F, Inner>
fn sample_bits(&mut self, bits: usize) -> usize
Source§impl<F: Clone, Inner: Clone> Clone for SerializingChallenger32<F, Inner>
impl<F: Clone, Inner: Clone> Clone for SerializingChallenger32<F, Inner>
Source§fn clone(&self) -> SerializingChallenger32<F, Inner>
fn clone(&self) -> SerializingChallenger32<F, Inner>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<F, Inner> FieldChallenger<F> for SerializingChallenger32<F, Inner>
impl<F, Inner> FieldChallenger<F> for SerializingChallenger32<F, Inner>
fn observe_ext_element<EF: AbstractExtensionField<F>>(&mut self, ext: EF)
fn sample_ext_element<EF: AbstractExtensionField<F>>(&mut self) -> EF
Source§impl<F, Inner> GrindingChallenger for SerializingChallenger32<F, Inner>
impl<F, Inner> GrindingChallenger for SerializingChallenger32<F, Inner>
Auto Trait Implementations§
impl<F, Inner> Freeze for SerializingChallenger32<F, Inner>where
Inner: Freeze,
impl<F, Inner> RefUnwindSafe for SerializingChallenger32<F, Inner>where
Inner: RefUnwindSafe,
F: RefUnwindSafe,
impl<F, Inner> Send for SerializingChallenger32<F, Inner>
impl<F, Inner> Sync for SerializingChallenger32<F, Inner>
impl<F, Inner> Unpin for SerializingChallenger32<F, Inner>
impl<F, Inner> UnwindSafe for SerializingChallenger32<F, Inner>where
Inner: UnwindSafe,
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more