Skip to content

Commit

Permalink
Add arithmetic traits
Browse files Browse the repository at this point in the history
  • Loading branch information
darth-cy committed Dec 4, 2024
1 parent e46e854 commit 5f86ada
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion spartan_parallel/src/scalar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::{
cmp::Eq,
hash::Hash,
iter::{Product, Sum},
ops::{Add, Mul, MulAssign, Neg, Sub},
ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign},
};
use subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption};
use zeroize::Zeroize;
Expand All @@ -35,6 +35,9 @@ pub trait SpartanExtensionField:
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ AddAssign<Self>
+ SubAssign<Self>
+ MulAssign<Self>
+ Sum
+ Product
+ Clone
Expand Down
2 changes: 1 addition & 1 deletion spartan_parallel/src/sumcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl<S: SpartanExtensionField> SumcheckInstanceProof<S> {
let len = poly_A.len() / 2;
for i in 0..len {
// eval 0: bound_func is A(low)
eval_point_0 = eval_point_0 + comb_func(&poly_A[i], &poly_B[i], &poly_C[i]);
eval_point_0 += comb_func(&poly_A[i], &poly_B[i], &poly_C[i]);

// eval 2: bound_func is -A(low) + 2*A(high)
let poly_A_bound_point = poly_A[len + i] + poly_A[len + i] - poly_A[i];
Expand Down

0 comments on commit 5f86ada

Please sign in to comment.