narodnik пре 5 година
родитељ
комит
250c67b168
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      scripts/zk/3-encrypted-polynomial.py

+ 3 - 0
scripts/zk/3-encrypted-polynomial.py

@@ -77,6 +77,9 @@ def evaluate(poly, encrypted_powers):
     for power, coeff in zip(encrypted_powers, coeffs):
         #print(coeff, power)
         coeff = int(coeff)
+        # I have to do this for some strange reason
+        # Because if coeff is negative and I do += power * coeff
+        # then it gives me a different result than what I expect
         if coeff < 0:
             result -= power * (-coeff)
         else: