From ac105f472a6383ff1cdb4eaa308c654606721094 Mon Sep 17 00:00:00 2001 From: b-wagn Date: Thu, 6 Jun 2024 16:36:03 +0200 Subject: [PATCH] update polynomial-commitments-sampling.md -- fix shift_polynomialcoeff --- specs/_features/eip7594/polynomial-commitments-sampling.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specs/_features/eip7594/polynomial-commitments-sampling.md b/specs/_features/eip7594/polynomial-commitments-sampling.md index 3a0bd8a77..b5f7995c5 100644 --- a/specs/_features/eip7594/polynomial-commitments-sampling.md +++ b/specs/_features/eip7594/polynomial-commitments-sampling.md @@ -263,14 +263,14 @@ def divide_polynomialcoeff(a: PolynomialCoeff, b: PolynomialCoeff) -> Polynomial def shift_polynomialcoeff(polynomial_coeff: PolynomialCoeff, factor: BLSFieldElement) -> PolynomialCoeff: """ Shift the evaluation of a polynomial in coefficient form by factor. - This results in a new polynomial g(x) = f(factor * x) + This returns a new polynomial g in coefficient form such that g(x) = f(factor * x). + In other words, each coefficient of f is scaled by a power of factor. """ factor_power = 1 - inv_factor = pow(int(factor), BLS_MODULUS - 2, BLS_MODULUS) o = [] for p in polynomial_coeff: o.append(int(p) * factor_power % BLS_MODULUS) - factor_power = factor_power * inv_factor % BLS_MODULUS + factor_power = factor_power * int(factor) % BLS_MODULUS return o ```