openvm_stark_backend::interaction

Trait RapPhaseSeq

Source
pub trait RapPhaseSeq<F, Challenge, Challenger> {
    type PartialProof: Clone + Serialize + DeserializeOwned;
    type ProvingKey: Clone + Serialize + DeserializeOwned + HasInteractionChunkSize;
    type Error: Debug;

    const ID: RapPhaseSeqKind;

    // Required methods
    fn generate_pk_per_air(
        &self,
        symbolic_constraints_per_air: Vec<SymbolicConstraints<F>>,
    ) -> Vec<Self::ProvingKey>;
    fn partially_prove(
        &self,
        challenger: &mut Challenger,
        params_per_air: &[Self::ProvingKey],
        constraints_per_air: &[&SymbolicConstraints<F>],
        trace_view_per_air: &[PairTraceView<'_, F>],
    ) -> Option<(Self::PartialProof, RapPhaseProverData<Challenge>)>;
    fn partially_verify<Commitment: Clone>(
        &self,
        challenger: &mut Challenger,
        partial_proof: Option<&Self::PartialProof>,
        exposed_values_per_air_per_phase: &[Vec<Vec<Challenge>>],
        commitments_per_phase: &[Commitment],
        after_challenge_opened_values: &[Vec<Vec<Vec<Challenge>>>],
    ) -> (RapPhaseVerifierData<Challenge>, Result<(), Self::Error>)
       where Challenger: CanObserve<Commitment>;
}
Expand description

Defines a particular protocol for the “after challenge” phase in a RAP.

A RapPhaseSeq is defined by the proving and verifying methods implemented in this trait, as well as via some “eval” method that is determined by RapPhaseId.

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn generate_pk_per_air( &self, symbolic_constraints_per_air: Vec<SymbolicConstraints<F>>, ) -> Vec<Self::ProvingKey>

The protocol parameters for the challenge phases may depend on the AIR constraints.

Source

fn partially_prove( &self, challenger: &mut Challenger, params_per_air: &[Self::ProvingKey], constraints_per_air: &[&SymbolicConstraints<F>], trace_view_per_air: &[PairTraceView<'_, F>], ) -> Option<(Self::PartialProof, RapPhaseProverData<Challenge>)>

Partially prove the challenge phases,

Samples challenges, generates after challenge traces and exposed values, and proves any extra-STARK part of the protocol.

“Partial” refers to the fact that some STARK parts of the protocol—namely, the constraints on the after challenge traces returned in RapPhaseProverData—are handled external to this function.

Source

fn partially_verify<Commitment: Clone>( &self, challenger: &mut Challenger, partial_proof: Option<&Self::PartialProof>, exposed_values_per_air_per_phase: &[Vec<Vec<Challenge>>], commitments_per_phase: &[Commitment], after_challenge_opened_values: &[Vec<Vec<Vec<Challenge>>>], ) -> (RapPhaseVerifierData<Challenge>, Result<(), Self::Error>)
where Challenger: CanObserve<Commitment>,

Partially verifies the challenge phases.

Assumes the shape of exposed_values_per_air_per_phase is verified externally.

An implementation of this function must sample challenges for the challenge phases and then observe the exposed values and commitment.

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§

Source§

impl<F, Challenge, Challenger> RapPhaseSeq<F, Challenge, Challenger> for StarkLogUpPhase<F, Challenge, Challenger>
where F: Field, Challenge: ExtensionField<F>, Challenger: FieldChallenger<F>,