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