MCPcopy Create free account
hub / github.com/ElementsProject/elements / is_x_coord

Method is_x_coord

test/functional/test_framework/key.py:98–101  ·  view source on GitHub ↗

Test whether x is a valid X coordinate on the curve.

(self, x)

Source from the content-addressed store, hash-verified

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."""

Callers 1

setMethod · 0.80

Calls 1

jacobi_symbolFunction · 0.85

Tested by

no test coverage detected