Given an X coordinate on the curve, return a corresponding affine point for which the Y coordinate is even.
(self, x)
| 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.""" |
| 105 | x_3 = pow(x, 3, self.p) |
| 106 | v = x_3 + self.a * x + self.b |
| 107 | y = modsqrt(v, self.p) |
| 108 | if y is None: |
| 109 | return None |
| 110 | return (x, self.p - y if y & 1 else y, 1) |
| 111 | |
| 112 | def double(self, p1): |
| 113 | """Double a Jacobian tuple p1 |
no test coverage detected