diff --git a/spartan/src/dense_mlpoly.rs b/spartan/src/dense_mlpoly.rs index d775aff1..94e8bc8e 100644 --- a/spartan/src/dense_mlpoly.rs +++ b/spartan/src/dense_mlpoly.rs @@ -221,6 +221,7 @@ impl DensePolynomial { for i in 0..n { self.Z[i] = self.Z[i] + *r * (self.Z[i + n] - self.Z[i]); } + self.Z.truncate(n); // Resize the vector Z to the new length self.num_vars -= 1; self.len = n; } @@ -230,6 +231,7 @@ impl DensePolynomial { for i in 0..n { self.Z[i] = self.Z[2 * i] + *r * (self.Z[2 * i + 1] - self.Z[2 * i]); } + self.Z.truncate(n); // Resize the vector Z to the new length self.num_vars -= 1; self.len = n; }