mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-04 23:03:08 +00:00
Comments
This commit is contained in:
parent
a5f4730bd5
commit
e6708da36f
@ -194,7 +194,7 @@ mod tests {
|
||||
use crate::memory::NUM_CHANNELS;
|
||||
use crate::proof::{AllProof, PublicValues};
|
||||
use crate::prover::prove_with_traces;
|
||||
use crate::recursive_verifier::recursively_prove_all_proof;
|
||||
use crate::recursive_verifier::recursively_verify_all_proof;
|
||||
use crate::stark::Stark;
|
||||
use crate::util::{limb_from_bits_le, trace_rows_to_poly_values};
|
||||
use crate::verifier::verify_proof;
|
||||
@ -746,7 +746,7 @@ mod tests {
|
||||
inner_config: &StarkConfig,
|
||||
) -> Result<()> {
|
||||
let circuit_config = CircuitConfig::standard_recursion_config();
|
||||
let recursive_all_proof = recursively_prove_all_proof(
|
||||
let recursive_all_proof = recursively_verify_all_proof(
|
||||
&inner_all_stark,
|
||||
&inner_proof,
|
||||
inner_config,
|
||||
@ -756,7 +756,7 @@ mod tests {
|
||||
let circuit_config = CircuitConfig::standard_recursion_config();
|
||||
let mut builder = CircuitBuilder::<F, D>::new(circuit_config);
|
||||
let mut pw = PartialWitness::new();
|
||||
recursive_all_proof.recursively_verify(&mut builder, &mut pw);
|
||||
recursive_all_proof.verify_circuit(&mut builder, &mut pw);
|
||||
|
||||
let data = builder.build::<C>();
|
||||
let proof = data.prove(pw)?;
|
||||
|
||||
@ -35,7 +35,9 @@ use crate::util::{h160_limbs, u256_limbs};
|
||||
use crate::vanishing_poly::eval_vanishing_poly_circuit;
|
||||
use crate::vars::StarkEvaluationTargets;
|
||||
|
||||
pub struct AllRecursiveProofs<
|
||||
/// Table-wise recursive proofs of an `AllProof`.
|
||||
/// Also contains verifier data for each proof.
|
||||
pub struct RecursiveAllProof<
|
||||
F: RichField + Extendable<D>,
|
||||
C: GenericConfig<D, F = F>,
|
||||
const D: usize,
|
||||
@ -45,8 +47,9 @@ pub struct AllRecursiveProofs<
|
||||
}
|
||||
|
||||
impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>
|
||||
AllRecursiveProofs<F, C, D>
|
||||
RecursiveAllProof<F, C, D>
|
||||
{
|
||||
/// Verify every recursive proof.
|
||||
pub fn verify(self) -> Result<()>
|
||||
where
|
||||
[(); C::Hasher::HASH_SIZE]:,
|
||||
@ -57,7 +60,8 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn recursively_verify<W>(&self, builder: &mut CircuitBuilder<F, D>, pw: &mut W)
|
||||
/// Recursively verify every recursive proof.
|
||||
pub fn verify_circuit<W>(&self, builder: &mut CircuitBuilder<F, D>, pw: &mut W)
|
||||
where
|
||||
W: Witness<F>,
|
||||
[(); C::Hasher::HASH_SIZE]:,
|
||||
@ -79,7 +83,9 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>
|
||||
}
|
||||
}
|
||||
|
||||
fn recursively_prove_stark_proof<
|
||||
/// Recursively verify a Stark proof.
|
||||
/// Outputs the recursive proof and the associated verifier data.
|
||||
fn recursively_verify_stark_proof<
|
||||
F: RichField + Extendable<D>,
|
||||
C: GenericConfig<D, F = F>,
|
||||
S: Stark<F, D>,
|
||||
@ -138,7 +144,8 @@ where
|
||||
Ok((data.prove(pw)?, data.verifier_data()))
|
||||
}
|
||||
|
||||
pub fn recursively_prove_all_proof<
|
||||
/// Recursively verify every Stark proof in an `AllProof`.
|
||||
pub fn recursively_verify_all_proof<
|
||||
F: RichField + Extendable<D>,
|
||||
C: GenericConfig<D, F = F>,
|
||||
const D: usize,
|
||||
@ -147,7 +154,7 @@ pub fn recursively_prove_all_proof<
|
||||
all_proof: &AllProof<F, C, D>,
|
||||
inner_config: &StarkConfig,
|
||||
circuit_config: CircuitConfig,
|
||||
) -> Result<AllRecursiveProofs<F, C, D>>
|
||||
) -> Result<RecursiveAllProof<F, C, D>>
|
||||
where
|
||||
[(); CpuStark::<F, D>::COLUMNS]:,
|
||||
[(); KeccakStark::<F, D>::COLUMNS]:,
|
||||
@ -157,9 +164,9 @@ where
|
||||
[(); C::Hasher::HASH_SIZE]:,
|
||||
C::Hasher: AlgebraicHasher<F>,
|
||||
{
|
||||
Ok(AllRecursiveProofs {
|
||||
Ok(RecursiveAllProof {
|
||||
recursive_proofs: [
|
||||
recursively_prove_stark_proof(
|
||||
recursively_verify_stark_proof(
|
||||
Table::Cpu,
|
||||
all_stark.cpu_stark,
|
||||
all_stark,
|
||||
@ -167,7 +174,7 @@ where
|
||||
inner_config,
|
||||
&circuit_config,
|
||||
)?,
|
||||
recursively_prove_stark_proof(
|
||||
recursively_verify_stark_proof(
|
||||
Table::Keccak,
|
||||
all_stark.keccak_stark,
|
||||
all_stark,
|
||||
@ -175,7 +182,7 @@ where
|
||||
inner_config,
|
||||
&circuit_config,
|
||||
)?,
|
||||
recursively_prove_stark_proof(
|
||||
recursively_verify_stark_proof(
|
||||
Table::KeccakMemory,
|
||||
all_stark.keccak_memory_stark,
|
||||
all_stark,
|
||||
@ -183,7 +190,7 @@ where
|
||||
inner_config,
|
||||
&circuit_config,
|
||||
)?,
|
||||
recursively_prove_stark_proof(
|
||||
recursively_verify_stark_proof(
|
||||
Table::Logic,
|
||||
all_stark.logic_stark,
|
||||
all_stark,
|
||||
@ -191,7 +198,7 @@ where
|
||||
inner_config,
|
||||
&circuit_config,
|
||||
)?,
|
||||
recursively_prove_stark_proof(
|
||||
recursively_verify_stark_proof(
|
||||
Table::Memory,
|
||||
all_stark.memory_stark,
|
||||
all_stark,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user