From e17823e7770ed685a6d333cdb884fcadd44be490 Mon Sep 17 00:00:00 2001 From: wborgeaud Date: Tue, 11 Oct 2022 11:47:37 +0200 Subject: [PATCH] Disallow zk for dummy proof --- plonky2/src/plonk/conditional_recursive_verifier.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plonky2/src/plonk/conditional_recursive_verifier.rs b/plonky2/src/plonk/conditional_recursive_verifier.rs index 00b21fde..8ac0a4f2 100644 --- a/plonky2/src/plonk/conditional_recursive_verifier.rs +++ b/plonky2/src/plonk/conditional_recursive_verifier.rs @@ -1,4 +1,4 @@ -use anyhow::Result; +use anyhow::{ensure, Result}; use itertools::Itertools; use plonky2_field::extension::Extendable; use plonky2_util::ceil_div_usize; @@ -33,6 +33,10 @@ where let mut pw = PartialWitness::new(); let mut builder = CircuitBuilder::::new(config); + ensure!( + !common_data.config.zero_knowledge, + "Degree calculation can be off if zero-knowledge is on." + ); let degree = 1 << common_data.degree_bits; // Number of `NoopGate`s to add to get a circuit of size `degree` in the end. // Need to account for public input hashing, a `PublicInputGate` and a `ConstantGate`.