Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: the transcript should not depend on the proving order #223

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading