Math::...ePoint(3pm)

πŸ’– Math::Prime::Util::ECAffinePoint β€” bestie's guide to affine elliptic curve points πŸ’–

okay so like, this page lives in the User Contributed Perl Documentation section of the manual (3pm, iykyk), and it's all about Math::Prime::Util::ECAffinePoint β€” elliptic curve operations for affine points. yes bestie, actual math, actual curves, we're doing this πŸ¦‹


✨ NAME ✨

Math::Prime::Util::ECAffinePoint β€” elliptic curve operations for affine points. that's the whole vibe. it's a point. it's affine. it does math. periodt πŸ’…


🌸 VERSION 🌸

Version 0.74 β€” that's the one we're working with, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

here's the little glow-up demo, copy it exactly or don't come crying to me:

# Create a point on a curve (a,b,n) with coordinates 0,1
my $ECP = Math::Prime::Util::ECAffinePoint->new($a, $b, $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();

like. look at her go. making points, multiplying them by scalars, adding points together, checking if she's the point at infinity. main character energy fr fr πŸ‘‘


🫢 DESCRIPTION 🫢

ngl, this module really should just be in Math::EllipticCurve. that's not me being shady, that's literally what the docs say, and honestly? valid.

and then… To write.

yeah. the description is a work in progress, bestie. she said "to write" and left. iconic, honestly. sometimes you just gotta note it down and move on πŸ’€


πŸ”₯ FUNCTIONS πŸ”₯

🧚 new

$point = Math::Prime::Util::ECAffinePoint->new(a, b, n, x, y);

gives you a shiny new point sitting at (x,y,1) on the curve (a,b,n). that's it. that's the constructor. cute, right? ✨

πŸ“ a

πŸ“ b

πŸ“ n

these hand you back the a, b, or n values that describe the curve. three little accessors, all living their best life, all telling you what curve you're standing on πŸ’œ

🌈 x

🌈 y

and these give you the x or y values that define the point on the curve. the coordinates. the location. the whole "where am I on this curve" situation.

πŸ’« f

returns a possible factor found during EC multiplication. it's a possible factor β€” that's the word the docs use, so that's the word I'm using, don't @ me.

πŸ’– add

takes another point on the same curve as an argument and adds it to this point. two points enter, one point leaves. math is wild fr.

πŸ¦‹ mul

takes an integer and performs scalar multiplication of the point. you give it a number, it does the thing, slay.

πŸ‘‘ is_infinity

returns true if the point is (0,1) β€” which is, quote unquote, the point at infinity for the affine coordinates. so if you're looking at (0,1)? bestie, you're at infinity. no cap. πŸ’€βœ¨


🌟 SEE ALSO 🌟

  • Math::EllipticCurve::Prime

and once again, for the people in the back: this really should just be in a Math::EllipticCurve module. πŸŽ€


πŸ’œ AUTHORS πŸ’œ

Dana Jacobsen <dana@acm.org> β€” thank you for your service, queen 🫢


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.


okay bestie, go forth and multiply some points πŸ’…

and that's a wrap, cuties β€” perl v5.42.3, generated 2026-08-20, courtesy of the User Contributed Perl Documentation, and honestly? she ate πŸŒΈπŸ’–βœ¨

πŸ“¦ where this page comes from