Example of the project fnx.Demo.BigInts for Lazarus
Elliptic curve point halving over a GF(P) field with the TGFPEllipticCurve.GetHalves
method of the fnx.BigInts.GFPECurves unit.
////////////////////////////////////////////////////////////////////////////////
Random BPSW-prime
-----------------
M = 13719165191747829003318256337325870227252942667993160467594045021403
Curve coefficients
------------------
A4 = 10535623683466291052686038561413726083980811147439265038592122765898
A6 = 6846200065576149012739105555501568550650873998075401483137881065570
Curve type = Ordinary
Halving a point different from IDENTITY
ooooooooooooooooooooooooooooooooooooooo
Random point P
--------------
X = 6406120790314488090611436867631858524392945283590718644309815814808
Y = 4790835978927033499476552802962358539063617294824179600986751292995
Z = 1
P has 4 halves
H0
--
X = 13169915851708673006259180740632455088775109065020165943757290586694
Y = 13056579049696031230029257346249124414115590083319025331175090771997
Z = 1
H1
--
X = 8654096893533257500063979329435419880763896206004103139673045872742
Y = 13686758148979832806264548476381018707337820643889372710361109247841
Z = 1
H2
--
X = 5456829463747570641123164733478985157100826502997608188837802132810
Y = 6239954445882698125080044672357588637301944965045057976868051301964
Z = 1
H3
--
X = 12062806144016280218317679004306444198184892028334157772565169688389
Y = 5343396186857705834438571928711136553753582666339980789489759022158
Z = 1
Check (H0*2 = P) : OK
Check (H1*2 = P) : OK
Check (H2*2 = P) : OK
Check (H3*2 = P) : OK
Halving the IDENTITY point
oooooooooooooooooooooooooo
IDENTITY has 4 halves
H0
--
IDENTITY
H1
--
X = 6427056110265475635683083200561586867492436999219026428046347572394
Y = 0
Z = 1
H2
--
X = 11474799717698203526248939220924525779665061245331656284373212119256
Y = 0
Z = 1
H3
--
X = 9536474555531978844704490253165627807348387091435638222768530351156
Y = 0
Z = 1
Check (H1*2 = IDENTITY) ......... : OK
Check (H2*2 = IDENTITY) ......... : OK
Check (H3*2 = IDENTITY) ......... : OK
Check ((H1 + H2) = H3) .......... : OK
Check ((H1 + H3) = H2) .......... : OK
Check ((H2 + H3) = H1) .......... : OK
Check ((H1 + H2 + H3) = IDENTITY) : OK
Running times (milliseconds)
----------------------------
Creating prime ........ : 1.780
Finding random curve .. : 0.151
Computing curve type .. : 9.558
Finding random point .. : 0.256
Halving ............... : 21.065
Halving IDENTITY ...... : 8.433
////////////////////////////////////////////////////////////////////////////////
|
|
|
|