Skip to content

Commit e77e18a

Browse files
committed
doc fix
1 parent 106ca9d commit e77e18a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/util.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@ pub fn scalar_exp_vartime(x: &Scalar, mut n: u64) -> Scalar {
146146
/// S(0) &= 0 & \\\\
147147
/// S(1) &= 1 & \\\\
148148
/// S(i) &= S(i-1) + x^{n_i} s_i b_i\\\\
149-
/// &= S(i) + x^{n_{i-1}} (x^{2^{i-1}})^{b_{i-1}} s_i b_i
149+
/// &= S(i-1) + x^{n_{i-1}} (x^{2^{i-1}})^{b_{i-1}} s_i b_i
150150
/// \end{aligned}
151151
/// \\]
152152
pub fn sum_of_powers(x: &Scalar, mut n: usize) -> Scalar {
153153
let mut result = Scalar::zero();
154-
let mut f = Scalar::one(); // power of x to offset interim polynomial
155-
let mut s = Scalar::one();
154+
let mut f = Scalar::one(); // power of x to offset subsequent polynomials based on lower bits of n.
155+
let mut s = Scalar::one(); // power-of-two polynomial: 1, 1+x, 1+x+x^2+x^3, ...
156156
let mut p = *x; // x, x^2, x^4, ..., x^{2^i}
157157
while n > 0 {
158158
// take a bit from n

0 commit comments

Comments
 (0)