LayerDescription

Trait LayerDescription 

Source
pub trait LayerDescription<F: Field> {
    type VerifierLayer: VerifierLayer<F> + Debug + Serialize + for<'a> Deserialize<'a>;

    // Required methods
    fn layer_id(&self) -> LayerId;
    fn verify_rounds(
        &self,
        claims: &[&RawClaim<F>],
        transcript: &mut impl VerifierTranscript<F>,
    ) -> Result<VerifierLayerEnum<F>>;
    fn sumcheck_round_indices(&self) -> Vec<usize>;
    fn convert_into_verifier_layer(
        &self,
        sumcheck_bindings: &[F],
        claim_points: &[&[F]],
        transcript: &mut impl VerifierTranscript<F>,
    ) -> Result<Self::VerifierLayer>;
    fn get_post_sumcheck_layer(
        &self,
        round_challenges: &[F],
        claim_challenges: &[&[F]],
        random_coefficients: &[F],
    ) -> PostSumcheckLayer<F, Option<F>>;
    fn max_degree(&self) -> usize;
    fn index_mle_indices(&mut self, start_index: usize);
    fn compute_data_outputs(
        &self,
        mle_outputs_necessary: &HashSet<&MleDescription<F>>,
        circuit_map: &mut CircuitEvalMap<F>,
    );
    fn get_circuit_mles(&self) -> Vec<&MleDescription<F>>;
    fn convert_into_prover_layer(
        &self,
        circuit_map: &CircuitEvalMap<F>,
    ) -> LayerEnum<F>;
}
Expand description

A circuit-description counterpart of the GKR Layer trait.

Required Associated Types§

Source

type VerifierLayer: VerifierLayer<F> + Debug + Serialize + for<'a> Deserialize<'a>

The associated type that the verifier uses to work with a layer of this kind.

Required Methods§

Source

fn layer_id(&self) -> LayerId

Returns this layer’s ID.

Source

fn verify_rounds( &self, claims: &[&RawClaim<F>], transcript: &mut impl VerifierTranscript<F>, ) -> Result<VerifierLayerEnum<F>>

Tries to verify claims for this layer and returns a VerifierLayer with a fully bound and evaluated expression.

There is only a single aggregated claim if our [shared_types::config::ClaimAggregationStrategy] is Interpolative, otherwise we have several claims we take the random linear combination over.

The proof is implicitly included in the transcript.

Source

fn sumcheck_round_indices(&self) -> Vec<usize>

The list of sumcheck rounds this layer will prove, by index.

Source

fn convert_into_verifier_layer( &self, sumcheck_bindings: &[F], claim_points: &[&[F]], transcript: &mut impl VerifierTranscript<F>, ) -> Result<Self::VerifierLayer>

Turns this LayerDescription into a VerifierLayer by taking the sumcheck_bindings and claim_points and inserting them into the expression to become a verifier expression.

Source

fn get_post_sumcheck_layer( &self, round_challenges: &[F], claim_challenges: &[&[F]], random_coefficients: &[F], ) -> PostSumcheckLayer<F, Option<F>>

Gets the PostSumcheckLayer for this layer. Relevant for the Hyrax IP, where we need commitments to fully bound MLEs as well as their intermediate products.

Source

fn max_degree(&self) -> usize

The maximum degree for any univariate in the sumcheck protocol.

Source

fn index_mle_indices(&mut self, start_index: usize)

Label the MLE indices, starting from the start_index by converting crate::mle::MleIndex::Free to crate::mle::MleIndex::Indexed.

Source

fn compute_data_outputs( &self, mle_outputs_necessary: &HashSet<&MleDescription<F>>, circuit_map: &mut CircuitEvalMap<F>, )

Given the MleDescriptions of which outputs are expected of this layer, compute the data that populates these bookkeeping tables and mutate the circuit map to reflect this.

Source

fn get_circuit_mles(&self) -> Vec<&MleDescription<F>>

The MleDescriptions that make up the leaves of the expression in this layer.

Source

fn convert_into_prover_layer( &self, circuit_map: &CircuitEvalMap<F>, ) -> LayerEnum<F>

Given a CircuitEvalMap, turn this LayerDescription into a ProverLayer.

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.

Implementors§