Skip to content

Commit

Permalink
Update labrador/src/algebra.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Juno Chiu <48847495+Junochiu@users.noreply.github.com>
  • Loading branch information
luckyyang and Junochiu authored Dec 23, 2024
1 parent e9d1715 commit ecc081d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions labrador/src/algebra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ impl PolynomialRing {
// Initialize a vector to hold the intermediate multiplication result
let mut result_coefficients =
vec![Zq::new(0); self.coefficients.len() + other.coefficients.len() - 1];
for (i, coeff1) in self.coefficients.iter().enumerate() {
for (j, coeff2) in other.coefficients.iter().enumerate() {
result_coefficients[i + j] = result_coefficients[i + j] + (*coeff1 * *coeff2);
for (i, &coeff1) in self.coefficients.iter().enumerate() {
for (j, &coeff2) in other.coefficients.iter().enumerate() {
result_coefficients[i + j] += coeff1 * coeff2;
}
}

Expand Down

0 comments on commit ecc081d

Please sign in to comment.