pyrxd.curve — secp256k1

class pyrxd.curve.Point

Bases: tuple

Point(x, y)

static __new__(_cls, x, y)

Create new instance of Point(x, y)

x

Alias for field number 0

y

Alias for field number 1

class pyrxd.curve.EllipticCurve

Bases: tuple

EllipticCurve(name, p, a, b, g, n, h)

static __new__(_cls, name, p, a, b, g, n, h)

Create new instance of EllipticCurve(name, p, a, b, g, n, h)

a

Alias for field number 2

b

Alias for field number 3

g

Alias for field number 4

h

Alias for field number 6

n

Alias for field number 5

name

Alias for field number 0

p

Alias for field number 1

pyrxd.curve.on_curve(point)[source]
Returns:

True if the given point lies on the elliptic curve

Parameters:

point (Point | None)

Return type:

bool

pyrxd.curve.curve_negative(point)[source]
Returns:

-point

Parameters:

point (Point | None)

Return type:

Point | None

pyrxd.curve.curve_add(p, q)[source]
Returns:

the result of p + q according to the group law

Parameters:
Return type:

Point | None

pyrxd.curve.curve_multiply(scalar, point)[source]

multiply the given point by a scalar

Parameters:
Return type:

Point | None

pyrxd.curve.curve_get_y(x, even)[source]

point (x, y) lies on the curve, calculate y from the given x and the parity of y

Parameters:
Return type:

int