Merge pull request #3256 from ethereum/fix-compute_quotient_eval_within_domain

Fix `compute_quotient_eval_within_domain` overflow
This commit is contained in:
Hsiao-Wei Wang 2023-02-17 16:46:33 +08:00 committed by GitHub
commit 270a66e36c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -459,7 +459,7 @@ def compute_quotient_eval_within_domain(z: BLSFieldElement,
f_i = int(BLS_MODULUS) + int(polynomial[i]) - int(y) % BLS_MODULUS
numerator = f_i * int(omega_i) % BLS_MODULUS
denominator = int(z) * (int(BLS_MODULUS) + int(z) - int(omega_i)) % BLS_MODULUS
result += div(BLSFieldElement(numerator), BLSFieldElement(denominator))
result += int(div(BLSFieldElement(numerator), BLSFieldElement(denominator)))
return BLSFieldElement(result % BLS_MODULUS)
```