Skip to content

Commit

Permalink
dense_mlpoly.rs: Fix manipulation of evaluation vector Z by bound fun…
Browse files Browse the repository at this point in the history
…ctions (#283)

* dense_mlpoly.rs: Fix bound functions

They left the Z vector enlarged and that was not working well with evaluate()

* fixup! dense_mlpoly.rs: Fix bound functions
  • Loading branch information
asn-d6 authored Sep 30, 2024
1 parent 7162d8d commit 4657c63
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spartan/src/dense_mlpoly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ impl<F: PrimeField> DensePolynomial<F> {
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;
}
Expand All @@ -230,6 +231,7 @@ impl<F: PrimeField> DensePolynomial<F> {
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;
}
Expand Down

0 comments on commit 4657c63

Please sign in to comment.