FieldChallenger

Trait FieldChallenger 

Source
pub trait FieldChallenger<F: Field>:
    CanObserve<F>
    + CanSample<F>
    + CanSampleBits<usize>
    + Sync {
    // Provided methods
    fn observe_algebra_element<A: BasedVectorSpace<F>>(&mut self, alg_elem: A) { ... }
    fn observe_algebra_slice<A: BasedVectorSpace<F> + Clone>(
        &mut self,
        alg_elems: &[A],
    ) { ... }
    fn sample_algebra_element<A: BasedVectorSpace<F>>(&mut self) -> A { ... }
    fn observe_base_as_algebra_element<EF>(&mut self, val: F)
       where EF: Algebra<F> + BasedVectorSpace<F> { ... }
}
Expand description

A high-level trait combining observation and sampling over a finite field.

Provided Methods§

Source

fn observe_algebra_element<A: BasedVectorSpace<F>>(&mut self, alg_elem: A)

Absorb an element from a vector space over the base field.

Decomposes the element into its basis coefficients and absorbs each.

Source

fn observe_algebra_slice<A: BasedVectorSpace<F> + Clone>( &mut self, alg_elems: &[A], )

Absorb a slice of elements from a vector space over the base field.

Decomposes each element into its basis coefficients and absorbs them.

Source

fn sample_algebra_element<A: BasedVectorSpace<F>>(&mut self) -> A

Sample an element of a vector space over the base field.

Constructs the element by sampling basis coefficients.

Source

fn observe_base_as_algebra_element<EF>(&mut self, val: F)
where EF: Algebra<F> + BasedVectorSpace<F>,

Observe base field elements as extension field elements for recursion-friendly transcripts.

This simplifies recursive verifier circuits by using a uniform extension field challenger. Instead of observing a mix of base and extension field elements, we convert all base field observations (metadata, public values) to extension field elements before passing to the challenger.

§Recursion Benefits

In recursive proof systems, the verifier circuit needs to verify the inner proof. Since STARK verification operates entirely in the extension field (challenges, opened values, constraint evaluation), having a challenger that only observes extension field elements significantly simplifies the recursive circuit implementation.

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.

Implementations on Foreign Types§

Source§

impl<C, F: Field> FieldChallenger<F> for &mut C
where C: FieldChallenger<F>,

Implementors§

Source§

impl<F, Inner> FieldChallenger<F> for SerializingChallenger32<F, Inner>
where F: PrimeField32, Inner: CanSample<u8> + CanObserve<u8> + Clone + Send + Sync,

Source§

impl<F, Inner> FieldChallenger<F> for SerializingChallenger64<F, Inner>
where F: PrimeField64, Inner: CanSample<u8> + CanObserve<u8> + Clone + Send + Sync,

Source§

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

Source§

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