Fix `compute_quotient_eval_within_domain` overflow

This commit is contained in:
Hsiao-Wei Wang 2023-02-17 01:22:11 +08:00
parent 4fa396d2cf
commit c7ac9ccea3
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4
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)
```