mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-08 00:33:06 +00:00
12604 gates, 318637 bytes
This commit is contained in:
parent
ec1147848a
commit
ad8428f38f
@ -177,6 +177,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
|||||||
x_index_bits: &[Target],
|
x_index_bits: &[Target],
|
||||||
proof: &FriInitialTreeProofTarget,
|
proof: &FriInitialTreeProofTarget,
|
||||||
initial_merkle_roots: &[MerkleCapTarget],
|
initial_merkle_roots: &[MerkleCapTarget],
|
||||||
|
cap_index: Target,
|
||||||
) {
|
) {
|
||||||
for (i, ((evals, merkle_proof), root)) in proof
|
for (i, ((evals, merkle_proof), root)) in proof
|
||||||
.evals_proofs
|
.evals_proofs
|
||||||
@ -187,7 +188,13 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
|||||||
with_context!(
|
with_context!(
|
||||||
self,
|
self,
|
||||||
&format!("verify {}'th initial Merkle proof", i),
|
&format!("verify {}'th initial Merkle proof", i),
|
||||||
self.verify_merkle_proof(evals.clone(), x_index_bits, root, merkle_proof)
|
self.verify_merkle_proof_with_cap_index(
|
||||||
|
evals.clone(),
|
||||||
|
x_index_bits,
|
||||||
|
cap_index,
|
||||||
|
root,
|
||||||
|
merkle_proof
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -297,6 +304,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
|||||||
&x_index_bits,
|
&x_index_bits,
|
||||||
&round_proof.initial_trees_proof,
|
&round_proof.initial_trees_proof,
|
||||||
initial_merkle_roots,
|
initial_merkle_roots,
|
||||||
|
cap_index
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
let mut old_x_index_bits = Vec::new();
|
let mut old_x_index_bits = Vec::new();
|
||||||
|
|||||||
@ -132,6 +132,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
use log::info;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::field::crandall_field::CrandallField;
|
use crate::field::crandall_field::CrandallField;
|
||||||
@ -425,17 +426,17 @@ mod tests {
|
|||||||
const D: usize = 4;
|
const D: usize = 4;
|
||||||
let config = CircuitConfig {
|
let config = CircuitConfig {
|
||||||
num_wires: 126,
|
num_wires: 126,
|
||||||
num_routed_wires: 33,
|
num_routed_wires: 37,
|
||||||
security_bits: 128,
|
security_bits: 128,
|
||||||
rate_bits: 3,
|
rate_bits: 3,
|
||||||
num_challenges: 3,
|
num_challenges: 3,
|
||||||
zero_knowledge: false,
|
zero_knowledge: false,
|
||||||
cap_height: 2,
|
cap_height: 3,
|
||||||
fri_config: FriConfig {
|
fri_config: FriConfig {
|
||||||
proof_of_work_bits: 1,
|
proof_of_work_bits: 1,
|
||||||
reduction_arity_bits: vec![2, 2, 2, 2, 2, 2],
|
reduction_arity_bits: vec![2, 2, 2, 2, 2, 2],
|
||||||
num_query_rounds: 40,
|
num_query_rounds: 40,
|
||||||
cap_height: 2,
|
cap_height: 3,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let (proof_with_pis, vd, cd) = {
|
let (proof_with_pis, vd, cd) = {
|
||||||
@ -488,6 +489,8 @@ mod tests {
|
|||||||
builder.print_gate_counts(0);
|
builder.print_gate_counts(0);
|
||||||
let data = builder.build();
|
let data = builder.build();
|
||||||
let recursive_proof = data.prove(pw)?;
|
let recursive_proof = data.prove(pw)?;
|
||||||
|
let proof_bytes = serde_cbor::to_vec(&recursive_proof).unwrap();
|
||||||
|
info!("Proof length: {} bytes", proof_bytes.len());
|
||||||
verify(recursive_proof, &data.verifier_only, &data.common)
|
verify(recursive_proof, &data.verifier_only, &data.common)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user