mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-05 23:33:07 +00:00
All recursive proofs
This commit is contained in:
parent
c4fc9b0ae4
commit
2fa347128f
@ -76,7 +76,7 @@ pub enum Table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Table {
|
impl Table {
|
||||||
pub(crate) fn num_tables() -> usize {
|
pub(crate) const fn num_tables() -> usize {
|
||||||
Table::Memory as usize + 1
|
Table::Memory as usize + 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,14 +57,14 @@ pub(crate) fn recursively_prove_stark_proof<
|
|||||||
all_proof: &AllProof<F, C, D>,
|
all_proof: &AllProof<F, C, D>,
|
||||||
cross_table_lookups: &[CrossTableLookup<F>],
|
cross_table_lookups: &[CrossTableLookup<F>],
|
||||||
inner_config: &StarkConfig,
|
inner_config: &StarkConfig,
|
||||||
circuit_config: CircuitConfig,
|
circuit_config: &CircuitConfig,
|
||||||
) -> Result<ProofWithPublicInputs<F, C, D>>
|
) -> Result<ProofWithPublicInputs<F, C, D>>
|
||||||
where
|
where
|
||||||
[(); S::COLUMNS]:,
|
[(); S::COLUMNS]:,
|
||||||
[(); C::Hasher::HASH_SIZE]:,
|
[(); C::Hasher::HASH_SIZE]:,
|
||||||
C::Hasher: AlgebraicHasher<F>,
|
C::Hasher: AlgebraicHasher<F>,
|
||||||
{
|
{
|
||||||
let mut builder = CircuitBuilder::<F, D>::new(circuit_config);
|
let mut builder = CircuitBuilder::<F, D>::new(circuit_config.clone());
|
||||||
let mut pw = PartialWitness::new();
|
let mut pw = PartialWitness::new();
|
||||||
|
|
||||||
let nums_ctl_zs = all_proof.nums_ctl_zs();
|
let nums_ctl_zs = all_proof.nums_ctl_zs();
|
||||||
@ -105,6 +105,75 @@ where
|
|||||||
data.prove(pw)
|
data.prove(pw)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn recursively_prove_all_proofs<
|
||||||
|
F: RichField + Extendable<D>,
|
||||||
|
C: GenericConfig<D, F = F>,
|
||||||
|
const D: usize,
|
||||||
|
>(
|
||||||
|
all_stark: &AllStark<F, D>,
|
||||||
|
all_proof: &AllProof<F, C, D>,
|
||||||
|
cross_table_lookups: &[CrossTableLookup<F>],
|
||||||
|
inner_config: &StarkConfig,
|
||||||
|
circuit_config: CircuitConfig,
|
||||||
|
) -> Result<[ProofWithPublicInputs<F, C, D>; Table::num_tables()]>
|
||||||
|
where
|
||||||
|
[(); CpuStark::<F, D>::COLUMNS]:,
|
||||||
|
[(); KeccakStark::<F, D>::COLUMNS]:,
|
||||||
|
[(); KeccakMemoryStark::<F, D>::COLUMNS]:,
|
||||||
|
[(); LogicStark::<F, D>::COLUMNS]:,
|
||||||
|
[(); MemoryStark::<F, D>::COLUMNS]:,
|
||||||
|
[(); C::Hasher::HASH_SIZE]:,
|
||||||
|
C::Hasher: AlgebraicHasher<F>,
|
||||||
|
{
|
||||||
|
Ok([
|
||||||
|
recursively_prove_stark_proof(
|
||||||
|
Table::Cpu,
|
||||||
|
all_stark.cpu_stark,
|
||||||
|
all_stark,
|
||||||
|
all_proof,
|
||||||
|
cross_table_lookups,
|
||||||
|
inner_config,
|
||||||
|
&circuit_config,
|
||||||
|
)?,
|
||||||
|
recursively_prove_stark_proof(
|
||||||
|
Table::Cpu,
|
||||||
|
all_stark.cpu_stark,
|
||||||
|
all_stark,
|
||||||
|
all_proof,
|
||||||
|
cross_table_lookups,
|
||||||
|
inner_config,
|
||||||
|
&circuit_config,
|
||||||
|
)?,
|
||||||
|
recursively_prove_stark_proof(
|
||||||
|
Table::Cpu,
|
||||||
|
all_stark.cpu_stark,
|
||||||
|
all_stark,
|
||||||
|
all_proof,
|
||||||
|
cross_table_lookups,
|
||||||
|
inner_config,
|
||||||
|
&circuit_config,
|
||||||
|
)?,
|
||||||
|
recursively_prove_stark_proof(
|
||||||
|
Table::Cpu,
|
||||||
|
all_stark.cpu_stark,
|
||||||
|
all_stark,
|
||||||
|
all_proof,
|
||||||
|
cross_table_lookups,
|
||||||
|
inner_config,
|
||||||
|
&circuit_config,
|
||||||
|
)?,
|
||||||
|
recursively_prove_stark_proof(
|
||||||
|
Table::Cpu,
|
||||||
|
all_stark.cpu_stark,
|
||||||
|
all_stark,
|
||||||
|
all_proof,
|
||||||
|
cross_table_lookups,
|
||||||
|
inner_config,
|
||||||
|
&circuit_config,
|
||||||
|
)?,
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
pub fn verify_proof_circuit<
|
pub fn verify_proof_circuit<
|
||||||
F: RichField + Extendable<D>,
|
F: RichField + Extendable<D>,
|
||||||
C: GenericConfig<D, F = F>,
|
C: GenericConfig<D, F = F>,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user