Skip to content

Commit ac105f4

Browse files
committed
update polynomial-commitments-sampling.md -- fix shift_polynomialcoeff
1 parent 3644f36 commit ac105f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

specs/_features/eip7594/polynomial-commitments-sampling.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,14 @@ def divide_polynomialcoeff(a: PolynomialCoeff, b: PolynomialCoeff) -> Polynomial
263263
def shift_polynomialcoeff(polynomial_coeff: PolynomialCoeff, factor: BLSFieldElement) -> PolynomialCoeff:
264264
"""
265265
Shift the evaluation of a polynomial in coefficient form by factor.
266-
This results in a new polynomial g(x) = f(factor * x)
266+
This returns a new polynomial g in coefficient form such that g(x) = f(factor * x).
267+
In other words, each coefficient of f is scaled by a power of factor.
267268
"""
268269
factor_power = 1
269-
inv_factor = pow(int(factor), BLS_MODULUS - 2, BLS_MODULUS)
270270
o = []
271271
for p in polynomial_coeff:
272272
o.append(int(p) * factor_power % BLS_MODULUS)
273-
factor_power = factor_power * inv_factor % BLS_MODULUS
273+
factor_power = factor_power * int(factor) % BLS_MODULUS
274274
return o
275275
```
276276

0 commit comments

Comments
 (0)