pyecsca.ec.divpoly module

Provides functions for computing division polynomials and the multiplication-by-n map on an elliptic curve.

pyecsca.ec.divpoly.a_invariants(curve)[source]

Compute the a-invariants of the curve.

Parameters:

curve (EllipticCurve) – The elliptic curve (only ShortWeierstrass model).

Return type:

Tuple[Mod, ...]

Returns:

A tuple of 5 a-invariants (a1, a2, a3, a4, a6).

pyecsca.ec.divpoly.b_invariants(curve)[source]

Compute the b-invariants of the curve.

Parameters:

curve (EllipticCurve) – The elliptic curve (only ShortWeierstrass model).

Return type:

Tuple[Mod, ...]

Returns:

A tuple of 4 b-invariants (b2, b4, b6, b8).

pyecsca.ec.divpoly.divpoly(curve, n, two_torsion_multiplicity=2)[source]

Compute the n-th division polynomial.

Parameters:
  • curve (EllipticCurve) – Curve to compute on.

  • n (int) – Scalar.

  • two_torsion_multiplicity (int) – Same as sagemath.

Return type:

Poly

Returns:

The division polynomial.

pyecsca.ec.divpoly.mult_by_n(curve, n, x_only=False, use_pari=True)[source]

Compute the multiplication-by-n map on an elliptic curve.

Parameters:
  • curve (EllipticCurve) – Curve to compute on.

  • n (int) – Scalar.

  • x_only (bool) – Whether to skip the my computation.

  • use_pari (bool) – Whether to use the Pari version.

Return type:

Tuple[Tuple[Poly, Poly], Optional[Tuple[Poly, Poly]]]

Returns:

A tuple (mx, my) where each is a tuple (numerator, denominator).