Test whether x is a valid X coordinate on the curve.
(self, x)
| 96 | 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 |
| 97 | |
| 98 | def is_x_coord(self, x): |
| 99 | """Test whether x is a valid X coordinate on the curve.""" |
| 100 | x_3 = pow(x, 3, self.p) |
| 101 | return jacobi_symbol(x_3 + self.a * x + self.b, self.p) != -1 |
| 102 | |
| 103 | def lift_x(self, x): |
| 104 | """Given an X coordinate on the curve, return a corresponding affine point for which the Y coordinate is even.""" |