Math::Prime::Util::ECProjectivePoint(3pm)

Math::Prime::Util::ECProjectivePoint3pm

Elliptic curve operations for projective points

Usage

  # Create a point on a curve (a,b,n) with coordinates 0,1
  my $ECP = Math::Prime::Util::ECProjectivePoint->new($c, $n, 0, 1);
  # scalar multiplication by $k.
  $ECP->mul($k);
  # add two points on the same curve
  $ECP->add($ECP2);
  say "P = O" if $ECP->is_infinity();

Version

Version 0.73

Overview

This really should just be in Math::EllipticCurve.

To write.

Functions

new

  $point = Math::Prime::Util::ECProjectivePoint->new(c, n, x, z);

Returns a new point on the curve defined by the Montgomery parameter c.

c

n

Returns the "c", "d", or "n" values that describe the curve.

d

Returns the precalculated value of "int( (c + 2) / 4 )".

x

z

Returns the "x" or "z" values that define the point on the curve.

f

Returns a possible factor found after "normalize".

add

Takes another point on the same curve as an argument and adds it this point.

double

Double the current point on the curve.

mul

Takes an integer and performs scalar multiplication of the point.

is_infinity

Returns true if the point is (0,1), which is the point at infinity for the affine coordinates.

copy

Returns a copy of the point.

normalize

Performs an extended GCD operation to make "z=1". If a factor of "n" is found it is put in "f".

Releases

6 releases since Debian 8 (Jessie); the text changed 5 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12
  6. 13

Authors

Dana Jacobsen <[email protected]>

From libmath-prime-util-perl 0.73-2+b5 in Debian 13 (Trixie). Parsed by carta from the page's man source.