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 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