Math::...ePoint(3pm)
π NAME π
Math::Prime::Util::ECProjectivePoint β elliptic curve operations for projective points π¦
Ok so bestie, quick vibe check: this is one of those pages from the User Contributed Perl Documentation collection, section 3pm. That's the whole title situation. The rest of this page is math that will absolutely eat π
β¨ VERSION β¨
Version 0.74 β yes she's been at this a minute, she's iconic π
πΈ SYNOPSIS πΈ
# 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();
basically: make a point, times it by a number, add it to another point, and check if it accidentally became the point at infinity π«Ά That's the whole plot.
π DESCRIPTION π
The author's own words: this really should just be in Math::EllipticCurve.
And then, and I quote, "To write."
That's it. That's the description. Not me being dramatic, the entire DESCRIPTION section is two sentences and one of them is a promise π The lore is still loading, fr fr. What we do have is the FUNCTIONS list below, and she is thorough π
π₯ FUNCTIONS π₯
π new
$point = Math::Prime::Util::ECProjectivePoint->new(c, n, x, z);
Hands you back a brand new point on the curve that's defined by the Montgomery parameter c. Fresh point, zero notes, main character energy β¨
π c
π n
These give you the "c", "d", or "n" values that describe the curve. The curve's whole personality, basically π«
π d
Returns the precalculated value of int( (c + 2) / 4 ). She's already done the math so you don't have to β obsessed π
π x
π z
Returns the "x" or "z" values that define the point on the curve. Those are her coordinates, her whole address π‘
π f
Returns a possible factor found after normalize. Lowkey a little treasure that might be sitting there when you're done π
π add
Takes another point on the same curve as an argument and adds it to this point. Note: same curve, so don't be introducing points from other curves, that's not the vibe π«
π double
Doubles the current point on the curve. Not a drill. She's doubling herself π
π mul
Takes an integer and performs scalar multiplication of the point. That's the $k from the synopsis β she multiplies, no cap π₯
π is_infinity
Returns true if the point is (0,1), which is the point at infinity for the affine coordinates. So if you're getting (0,1) back, congrats, you've hit infinity π
π copy
Returns a copy of the point. A whole clone, same fit, different outfit π
π normalize
Performs an extended GCD operation to make z=1. And heads up bestie β if a factor of n gets found along the way, it gets put in f. So peep f after you normalize, that's where the tea is π
π¦ SEE ALSO π¦
Math::EllipticCurve::Prime
And once again, the author's take: this really should just be in a Math::EllipticCurve module. They said it twice. They meant it π
π AUTHORS π
Dana Jacobsen <dana@acm.org> β thank you for your service π«Ά
β COPYRIGHT β
Copyright 2012-2013 by Dana Jacobsen <dana@acm.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π
and that's the whole page, bestie π it came from perl v5.42.3, dated 2026-08-20, filed under Math::...ePoint(3pm) (yes the title line really does abbreviate itself like that, she's mysterious, she's giving cryptic). slay, go multiply some points β¨π
π¦ where this page comes from
- ubuntu stonking: libmath-prime-util-perl 0.74-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms