added defautl value to y_quadratic_residue
@@ -286,7 +286,7 @@ class Curve:
# switch low/high root as needed (XORing the conditions)
return root if (self._p//2 >= root) == low1high0 else self._p - root
- def y_quadratic_residue(self, x: int, quad_res: int) -> int:
+ def y_quadratic_residue(self, x: int, quad_res: int = 1) -> int:
"""return the quadratic residue y coordinate associated to x"""
if quad_res not in (0, 1):
raise ValueError("quad_res must be bool or 1/0")
@@ -314,7 +314,7 @@ def _mult_aff(ec: Curve, m: int, Q: Point) -> Point:
m %= ec.n
if m == 0 or Q[1] == 0: # Infinity point in affine coordinates
return 1, 0 # return Infinity point
- R = Point() # initialize as infinity point
+ R = 1, 0 # initialize as infinity point
while m > 0: # use binary representation of m
if m & 1: # if least significant bit is 1
R = ec._add_aff(R, Q) # then add current Q
