openvm_stark_sdk::engine

Trait StarkEngine

Source
pub trait StarkEngine<SC>{
    // Required methods
    fn config(&self) -> &SC;
    fn new_challenger(&self) -> <SC as StarkGenericConfig>::Challenger;

    // Provided methods
    fn keygen_builder(&self) -> MultiStarkKeygenBuilder<'_, SC> { ... }
    fn prover(&self) -> MultiTraceStarkProver<'_, SC> { ... }
    fn verifier(&self) -> MultiTraceStarkVerifier<'_, SC> { ... }
    fn run_simple_test_impl(
        &self,
        chips: Vec<Arc<dyn AnyRap<SC>>>,
        traces: Vec<DenseMatrix<<<<SC as StarkGenericConfig>::Pcs as Pcs<<SC as StarkGenericConfig>::Challenge, <SC as StarkGenericConfig>::Challenger>>::Domain as PolynomialSpace>::Val>>,
        public_values: Vec<Vec<<<<SC as StarkGenericConfig>::Pcs as Pcs<<SC as StarkGenericConfig>::Challenge, <SC as StarkGenericConfig>::Challenger>>::Domain as PolynomialSpace>::Val>>,
    ) -> Result<VerificationData<SC>, VerificationError> { ... }
    fn run_test_impl(
        &self,
        air_proof_inputs: Vec<AirProofInput<SC>>,
    ) -> Result<VerificationData<SC>, VerificationError> { ... }
    fn set_up_keygen_builder(
        &self,
        keygen_builder: &mut MultiStarkKeygenBuilder<'_, SC>,
        air_proof_inputs: &[AirProofInput<SC>],
    ) -> Vec<usize> { ... }
    fn prove_then_verify(
        &self,
        pk: &MultiStarkProvingKey<SC>,
        proof_input: ProofInput<SC>,
    ) -> Result<(), VerificationError> { ... }
    fn prove(
        &self,
        pk: &MultiStarkProvingKey<SC>,
        proof_input: ProofInput<SC>,
    ) -> Proof<SC> { ... }
    fn verify(
        &self,
        vk: &MultiStarkVerifyingKey<SC>,
        proof: &Proof<SC>,
    ) -> Result<(), VerificationError> { ... }
}
Expand description

Testing engine

Required Methods§

Source

fn config(&self) -> &SC

Stark config

Source

fn new_challenger(&self) -> <SC as StarkGenericConfig>::Challenger

Creates a new challenger with a deterministic state. Creating new challenger for prover and verifier separately will result in them having the same starting state.

Provided Methods§

Source

fn keygen_builder(&self) -> MultiStarkKeygenBuilder<'_, SC>

Source

fn prover(&self) -> MultiTraceStarkProver<'_, SC>

Source

fn verifier(&self) -> MultiTraceStarkVerifier<'_, SC>

Source

fn run_simple_test_impl( &self, chips: Vec<Arc<dyn AnyRap<SC>>>, traces: Vec<DenseMatrix<<<<SC as StarkGenericConfig>::Pcs as Pcs<<SC as StarkGenericConfig>::Challenge, <SC as StarkGenericConfig>::Challenger>>::Domain as PolynomialSpace>::Val>>, public_values: Vec<Vec<<<<SC as StarkGenericConfig>::Pcs as Pcs<<SC as StarkGenericConfig>::Challenge, <SC as StarkGenericConfig>::Challenger>>::Domain as PolynomialSpace>::Val>>, ) -> Result<VerificationData<SC>, VerificationError>

Runs a single end-to-end test for a given set of AIRs and traces. This includes proving/verifying key generation, creating a proof, and verifying the proof. This function should only be used on AIRs where the main trace is not partitioned.

Source

fn run_test_impl( &self, air_proof_inputs: Vec<AirProofInput<SC>>, ) -> Result<VerificationData<SC>, VerificationError>

Runs a single end-to-end test for a given set of chips and traces partitions. This includes proving/verifying key generation, creating a proof, and verifying the proof.

Source

fn set_up_keygen_builder( &self, keygen_builder: &mut MultiStarkKeygenBuilder<'_, SC>, air_proof_inputs: &[AirProofInput<SC>], ) -> Vec<usize>

Add AIRs and get AIR IDs

Source

fn prove_then_verify( &self, pk: &MultiStarkProvingKey<SC>, proof_input: ProofInput<SC>, ) -> Result<(), VerificationError>

Source

fn prove( &self, pk: &MultiStarkProvingKey<SC>, proof_input: ProofInput<SC>, ) -> Proof<SC>

Source

fn verify( &self, vk: &MultiStarkVerifyingKey<SC>, proof: &Proof<SC>, ) -> Result<(), VerificationError>

Implementors§

Source§

impl<H> StarkEngine<StarkConfig<TwoAdicFriPcs<MontyField31<BabyBearParameters>, Radix2DitParallel<MontyField31<BabyBearParameters>>, MerkleTreeMmcs<MontyField31<BabyBearParameters>, u8, SerializingHasher32<H>, CompressionFunctionFromHasher<H, 2, 32>, 32>, ExtensionMmcs<MontyField31<BabyBearParameters>, BinomialExtensionField<MontyField31<BabyBearParameters>, 4>, MerkleTreeMmcs<MontyField31<BabyBearParameters>, u8, SerializingHasher32<H>, CompressionFunctionFromHasher<H, 2, 32>, 32>>>, StarkLogUpPhase<MontyField31<BabyBearParameters>, BinomialExtensionField<MontyField31<BabyBearParameters>, 4>, SerializingChallenger32<MontyField31<BabyBearParameters>, HashChallenger<u8, H, 32>>>, BinomialExtensionField<MontyField31<BabyBearParameters>, 4>, SerializingChallenger32<MontyField31<BabyBearParameters>, HashChallenger<u8, H, 32>>>> for BabyBearByteHashEngine<H>
where H: CryptographicHasher<u8, [u8; 32]> + Clone + Send + Sync,

Source§

impl<P> StarkEngine<StarkConfig<TwoAdicFriPcs<Goldilocks, Radix2DitParallel<Goldilocks>, MerkleTreeMmcs<<Goldilocks as Field>::Packing, <Goldilocks as Field>::Packing, PaddingFreeSponge<P, WIDTH, RATE, DIGEST_WIDTH>, TruncatedPermutation<P, 2, DIGEST_WIDTH, WIDTH>, DIGEST_WIDTH>, ExtensionMmcs<Goldilocks, BinomialExtensionField<Goldilocks, 2>, MerkleTreeMmcs<<Goldilocks as Field>::Packing, <Goldilocks as Field>::Packing, PaddingFreeSponge<P, WIDTH, RATE, DIGEST_WIDTH>, TruncatedPermutation<P, 2, DIGEST_WIDTH, WIDTH>, DIGEST_WIDTH>>>, StarkLogUpPhase<Goldilocks, BinomialExtensionField<Goldilocks, 2>, DuplexChallenger<Goldilocks, P, WIDTH, RATE>>, BinomialExtensionField<Goldilocks, 2>, DuplexChallenger<Goldilocks, P, WIDTH, RATE>>> for GoldilocksPermutationEngine<P>
where P: CryptographicPermutation<[Goldilocks; 8]> + CryptographicPermutation<[<Goldilocks as Field>::Packing; 8]> + Clone,

Source§

impl<P> StarkEngine<StarkConfig<TwoAdicFriPcs<MontyField31<BabyBearParameters>, Radix2DitParallel<MontyField31<BabyBearParameters>>, MerkleTreeMmcs<<MontyField31<BabyBearParameters> as Field>::Packing, <MontyField31<BabyBearParameters> as Field>::Packing, PaddingFreeSponge<P, WIDTH, RATE, DIGEST_WIDTH>, TruncatedPermutation<P, 2, DIGEST_WIDTH, WIDTH>, DIGEST_WIDTH>, ExtensionMmcs<MontyField31<BabyBearParameters>, BinomialExtensionField<MontyField31<BabyBearParameters>, 4>, MerkleTreeMmcs<<MontyField31<BabyBearParameters> as Field>::Packing, <MontyField31<BabyBearParameters> as Field>::Packing, PaddingFreeSponge<P, WIDTH, RATE, DIGEST_WIDTH>, TruncatedPermutation<P, 2, DIGEST_WIDTH, WIDTH>, DIGEST_WIDTH>>>, StarkLogUpPhase<MontyField31<BabyBearParameters>, BinomialExtensionField<MontyField31<BabyBearParameters>, 4>, DuplexChallenger<MontyField31<BabyBearParameters>, P, WIDTH, RATE>>, BinomialExtensionField<MontyField31<BabyBearParameters>, 4>, DuplexChallenger<MontyField31<BabyBearParameters>, P, WIDTH, RATE>>> for BabyBearPermutationEngine<P>
where P: CryptographicPermutation<[BabyBear; 16]> + CryptographicPermutation<[<BabyBear as Field>::Packing; 16]> + Clone,

Source§

impl<P> StarkEngine<StarkConfig<TwoAdicFriPcs<MontyField31<BabyBearParameters>, Radix2DitParallel<MontyField31<BabyBearParameters>>, MerkleTreeMmcs<MontyField31<BabyBearParameters>, Bn254Fr, MultiField32PaddingFreeSponge<MontyField31<BabyBearParameters>, Bn254Fr, P, WIDTH, RATE, DIGEST_WIDTH>, TruncatedPermutation<P, 2, 1, WIDTH>, 1>, ExtensionMmcs<MontyField31<BabyBearParameters>, BinomialExtensionField<MontyField31<BabyBearParameters>, 4>, MerkleTreeMmcs<MontyField31<BabyBearParameters>, Bn254Fr, MultiField32PaddingFreeSponge<MontyField31<BabyBearParameters>, Bn254Fr, P, WIDTH, RATE, DIGEST_WIDTH>, TruncatedPermutation<P, 2, 1, WIDTH>, 1>>>, StarkLogUpPhase<MontyField31<BabyBearParameters>, BinomialExtensionField<MontyField31<BabyBearParameters>, 4>, MultiField32Challenger<MontyField31<BabyBearParameters>, Bn254Fr, P, WIDTH, 2>>, BinomialExtensionField<MontyField31<BabyBearParameters>, 4>, MultiField32Challenger<MontyField31<BabyBearParameters>, Bn254Fr, P, WIDTH, 2>>> for BabyBearPermutationRootEngine<P>
where P: CryptographicPermutation<[Bn254Fr; 3]> + Clone,