diff --git a/test/functional/test_framework/key.py b/test/functional/test_framework/key.py index e5dea66963d9ce..e3e46c1d1708eb 100644 --- a/test/functional/test_framework/key.py +++ b/test/functional/test_framework/key.py @@ -95,6 +95,13 @@ def on_curve(self, p1): z4 = pow(z2, 2, self.p) return z1 != 0 and (pow(x1, 3, self.p) + self.a * x1 * z4 + self.b * z2 * z4 - pow(y1, 2, self.p)) % self.p == 0 + def is_infinity(self, p1): + """Return true if Jacobian tuple p is at infinity""" + _, _, z1 = p1 + if z1 == 0: + return True + return False + def is_x_coord(self, x): """Test whether x is a valid X coordinate on the curve.""" x_3 = pow(x, 3, self.p)