diff --git a/src/circuit_builder.rs b/src/circuit_builder.rs index 93b440ab..f1db3ae3 100644 --- a/src/circuit_builder.rs +++ b/src/circuit_builder.rs @@ -403,6 +403,7 @@ impl, const D: usize> CircuitBuilder { let gates = self.gates.iter().cloned().collect(); let (gate_tree, max_filtered_constraint_degree, num_constants) = Tree::from_gates(gates); + let max_filtered_constraint_degree = max_filtered_constraint_degree.max(3); let prefixed_gates = PrefixedGate::from_tree(gate_tree); let degree_bits = log2_strict(degree); diff --git a/src/util/partial_products.rs b/src/util/partial_products.rs index e7c9069b..c3e5c2cd 100644 --- a/src/util/partial_products.rs +++ b/src/util/partial_products.rs @@ -25,6 +25,7 @@ pub fn partial_products(v: &[T], max_degree: usize) -> Vec /// Returns a tuple `(a,b)`, where `a` is the length of the output of `partial_products()` on a /// vector of length `n`, and `b` is the number of elements needed to compute the final product. pub fn num_partial_products(n: usize, max_degree: usize) -> (usize, usize) { + debug_assert!(max_degree > 1); let mut res = 0; let mut remainder = n; while remainder > max_degree {