Skip to content

Commit 5f86ada

Browse files
committed
Add arithmetic traits
1 parent e46e854 commit 5f86ada

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

spartan_parallel/src/scalar/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::{
1313
cmp::Eq,
1414
hash::Hash,
1515
iter::{Product, Sum},
16-
ops::{Add, Mul, MulAssign, Neg, Sub},
16+
ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign},
1717
};
1818
use subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption};
1919
use zeroize::Zeroize;
@@ -35,6 +35,9 @@ pub trait SpartanExtensionField:
3535
+ Add<Output = Self>
3636
+ Sub<Output = Self>
3737
+ Mul<Output = Self>
38+
+ AddAssign<Self>
39+
+ SubAssign<Self>
40+
+ MulAssign<Self>
3841
+ Sum
3942
+ Product
4043
+ Clone

spartan_parallel/src/sumcheck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl<S: SpartanExtensionField> SumcheckInstanceProof<S> {
155155
let len = poly_A.len() / 2;
156156
for i in 0..len {
157157
// eval 0: bound_func is A(low)
158-
eval_point_0 = eval_point_0 + comb_func(&poly_A[i], &poly_B[i], &poly_C[i]);
158+
eval_point_0 += comb_func(&poly_A[i], &poly_B[i], &poly_C[i]);
159159

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

0 commit comments

Comments
 (0)