Constraint degree should be at least 3

This commit is contained in:
wborgeaud 2021-07-06 11:10:08 +02:00
parent 85d162cdbc
commit 4a27a67bab
2 changed files with 2 additions and 0 deletions

View File

@ -403,6 +403,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
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);

View File

@ -25,6 +25,7 @@ pub fn partial_products<T: Product + Copy>(v: &[T], max_degree: usize) -> Vec<T>
/// 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 {