Skip to content

Commit

Permalink
transcript should not depend on the proving order of circuits
Browse files Browse the repository at this point in the history
  • Loading branch information
kunxian-xia committed Sep 14, 2024
1 parent 71b1aa2 commit 84731eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions ceno_zkvm/src/scheme/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ impl<E: ExtensionField> ZKVMProver<E> {
) -> Result<ZKVMProof<E>, ZKVMError> {
let mut vm_proof = ZKVMProof::default();
for (circuit_name, pk) in self.pk.circuit_pks.iter() {
// each circuit should be proved independently
let mut transcript = transcript.clone();
let witness = witnesses
.witnesses
.remove(circuit_name)
Expand Down Expand Up @@ -84,7 +86,7 @@ impl<E: ExtensionField> ZKVMProver<E> {
.collect_vec(),
num_instances,
max_threads,
transcript,
&mut transcript,
challenges,
)?;
tracing::info!(
Expand All @@ -106,7 +108,7 @@ impl<E: ExtensionField> ZKVMProver<E> {
.collect_vec(),
num_instances,
max_threads,
transcript,
&mut transcript,
challenges,
)?;
tracing::info!(
Expand Down
6 changes: 4 additions & 2 deletions ceno_zkvm/src/scheme/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ impl<E: ExtensionField> ZKVMVerifier<E> {
let point_eval = PointAndEval::default();
let mut dummy_table_item_multiplicity = 0;
for (name, opcode_proof) in vm_proof.opcode_proofs {
let mut transcript = transcript.clone();
let circuit_vk = self
.vk
.circuit_vks
Expand All @@ -57,7 +58,7 @@ impl<E: ExtensionField> ZKVMVerifier<E> {
let _rand_point = self.verify_opcode_proof(
circuit_vk,
&opcode_proof,
transcript,
&mut transcript,
NUM_FANIN,
&point_eval,
challenges,
Expand All @@ -83,6 +84,7 @@ impl<E: ExtensionField> ZKVMVerifier<E> {
}

for (name, table_proof) in vm_proof.table_proofs {
let mut transcript = transcript.clone();
let circuit_vk = self
.vk
.circuit_vks
Expand All @@ -91,7 +93,7 @@ impl<E: ExtensionField> ZKVMVerifier<E> {
let _rand_point = self.verify_table_proof(
circuit_vk,
&table_proof,
transcript,
&mut transcript,
NUM_FANIN_LOGUP,
&point_eval,
challenges,
Expand Down

0 comments on commit 84731eb

Please sign in to comment.