ge25519 module

Pure-Python data structure for working with Ed25519 (and Ristretto) group elements and operations.

class ge25519.ge25519.ge25519[source]

Bases: object

Base class for group elements representing elliptic curve points.

The public interface of this class and those of derived classes are defined primarily to support the representation of elliptic curve points and the implementation of common operations over those points (e.g., as in the oblivious library).

static is_canonical(s: bytes) int[source]

Determine whether a binary representation of an element is in canonical form.

static has_small_order(s: bytes) int[source]
class ge25519.ge25519.ge25519_p2(X: fe25519.fe25519.fe25519, Y: fe25519.fe25519.fe25519, Z: fe25519.fe25519.fe25519)[source]

Bases: ge25519.ge25519.ge25519

Specialized class for group elements representing elliptic curve points.

static from_p3(p: ge25519.ge25519.ge25519_p3) ge25519.ge25519.ge25519_p2[source]
static from_p1p1(p: ge25519.ge25519.ge25519_p1p1) ge25519.ge25519.ge25519_p2[source]
dbl() ge25519.ge25519.ge25519_p1p1[source]
class ge25519.ge25519.ge25519_p3(X: fe25519.fe25519.fe25519 = None, Y: fe25519.fe25519.fe25519 = None, Z: fe25519.fe25519.fe25519 = None, T: fe25519.fe25519.fe25519 = None, root_check: bool = None)[source]

Bases: ge25519.ge25519.ge25519

Specialized class for group elements representing elliptic curve points.

static zero() ge25519.ge25519.ge25519_p3[source]

Constant corresponding to the zero element.

static from_bytes(bs: bytes) ge25519.ge25519.ge25519_p3[source]

Construct an element from its binary representation.

static from_bytes_ristretto255(bs: bytes) ge25519.ge25519.ge25519_p3[source]

Construct a Ristretto point from its binary representation.

static from_hash_ristretto255(h: bytes) bytes[source]

Construct a Ristretto point from a hash value.

static from_uniform(r: bytes) ge25519.ge25519.ge25519_p3[source]
static from_p1p1(p: ge25519.ge25519.ge25519_p1p1) ge25519.ge25519.ge25519_p3[source]
is_on_curve() int[source]
is_on_main_subgroup() int[source]
dbl() ge25519.ge25519.ge25519_p1p1[source]
mul_l() ge25519.ge25519.ge25519_p3[source]
static scalar_mult_base(a: bytes) ge25519.ge25519.ge25519_p3[source]
scalar_mult(a: bytes) ge25519.ge25519.ge25519_p3[source]

Method that supports the implementation of a scalar multiplication operation for elliptic curve points.

static elligator_ristretto255(t: fe25519.fe25519.fe25519) ge25519.ge25519.ge25519_p3[source]
static elligator2(r: fe25519.fe25519.fe25519, x_sign: int) ge25519.ge25519.ge25519_p3[source]
to_bytes() bytes[source]

Emit binary representation of this element.

to_bytes_ristretto255() bytes[source]

Emit binary representation of the Ristretto point that this element represents.

class ge25519.ge25519.ge25519_p1p1(X: fe25519.fe25519.fe25519 = None, Y: fe25519.fe25519.fe25519 = None, Z: fe25519.fe25519.fe25519 = None, T: fe25519.fe25519.fe25519 = None)[source]

Bases: ge25519.ge25519.ge25519

Specialized class for group elements representing elliptic curve points.

static dbl(p: ge25519.ge25519.ge25519_p3) ge25519.ge25519.ge25519_p1p1[source]
static madd(p: ge25519.ge25519.ge25519_p3, q: ge25519.ge25519.ge25519_precomp) ge25519.ge25519.ge25519_p1p1[source]

Method that supports scalar multiplication of a base element.

static add(p: ge25519.ge25519.ge25519_p3, q: ge25519.ge25519.ge25519_cached) ge25519.ge25519.ge25519_p1p1[source]

Method that supports the implementation of an addition operation for elliptic curve points.

static sub(p: ge25519.ge25519.ge25519_p3, q: ge25519.ge25519.ge25519_cached) ge25519.ge25519.ge25519_p1p1[source]

Method that supports the implementation of a subtraction operation for elliptic curve points.

class ge25519.ge25519.ge25519_precomp(yplusx: fe25519.fe25519.fe25519 = None, yminusx: fe25519.fe25519.fe25519 = None, xy2d: fe25519.fe25519.fe25519 = None)[source]

Bases: ge25519.ge25519.ge25519

Specialized class for group elements corresponding to entries found in the table of precomputed points.

static zero() ge25519.ge25519.ge25519_precomp[source]

Constant corresponding to the zero element.

class ge25519.ge25519.ge25519_cached(YplusX: fe25519.fe25519.fe25519 = None, YminusX: fe25519.fe25519.fe25519 = None, Z: fe25519.fe25519.fe25519 = None, T2d: fe25519.fe25519.fe25519 = None)[source]

Bases: ge25519.ge25519.ge25519

Specialized class for group elements representing elliptic curve points.

static zero() ge25519.ge25519.ge25519_cached[source]

Constant corresponding to the zero element.

static from_p3(p: ge25519.ge25519.ge25519_p3) ge25519.ge25519.ge25519_cached[source]