Category : BASIC Source Code
Archive   : UBAS830.ZIP
Filename : ECMJAC.UB

 
Output of file : ECMJAC.UB contained in archive : UBAS830.ZIP
&
˜»
Lenstra Elliptic Curve Method
Y˜î
programed by Hiromi Suyama, 21 Nov. 1988
טl written in UBASIC86 version 6.20 (produced by Y.Kida for Multiple- Precision Arithmetic & Number Theory)
à(˜u
ó2˜ˆ References
Æ<˜[ [1]D.V.Chudnovsky and G.V.Chudnovsky, Sequences of numbers generated by addition in formal groups and new primality and factorization tests, Advances in Applied Math. 7(1986),385-434.
7F˜Ì [2]H.W.Lenstra,Jr., Factoring integers with elliptic curves, Ann. of Math. 126(1987),649-673.
¼P˜Q
[3]P.L.Montgomery, Speeding the Pollard and Elliptic Curve Methods of factorization, Math. Comp. 48(1987),243-264.
:Z˜Ï
[4]T.Ono, On the relative Mordell-Weil rank of elliptic quartic curves, J. Math. Soc. Japan 32(1980),665-670.
Èd˜][5]Section 4.6.3(Evaluation of Powers) in D.E.Knuth, The Art of Computer Programming, Vol.2, second ed., Addison-Wesley, 1981.
Ñn˜f
9xŸñAÀBTÑñ ÀIÑñï(BTÞñ)ÞñÀ¤„SI)„TI)„CI)„DI)„STI)„CDI)
B‚˜×
…Œ§"ecmjac22 N="ÁƒNÀ€èƒNÔñ€ăNÂñ)Òñ}Ž¿
¥–§"ECM with limit Q1="ÁƒQ1
Å §" Q2="ÁƒQ2
ôª§"J.Curve No.(JC%)="ÁJCÀ¨€šÀƒJCÑðŽ¿
ý´˜’
A¾SZÑñåñåñåñåñ ÀƒQ1ÔñåSZŽSZÑñåñåñåñ
†ÈDSÑñåSZÀTSрЁSZ)ÞñÀ¤„XTS)ÀƒQ1р߃Q1ÂñåSZ)
áÒƒQ1рރQ1Þñ)ÀƒQрßñïñƒQ1)ÀƒPÑñÀMÑÞñÀ¤†MƒQèñp)„PƒQèñp)
êÜ’ÿÿ
øæ…MÑñ
ð’ÿÿ
VúƒPрރP)ÀƒW1уPÀ’ÿÿÀƒW2уW1ÀƒW1уW1åƒPÀ“°ƒW1҃QÀ…MхMåƒW2
Š“€èƒPуQ1€…M)ÒñŽ!}˜8590=540*16-50
Á MÀ†MM)хMÀ„PM)уPÀ™ƒPÁ€Â…M)
â“yƒPуQ1À™"Q1="ÁƒQ1Á€š
ë"˜‹
,õJ_CURVE¨€šÀ™"J.Curve"ÁJCÀƒNNуN
"6˜·

@˜¢ The parametrization of elliptic curves ' ' E(KK)={(S:T:C:D) : S^2+C^2=T^2 , KK*S^2+D^2=T^2}-{(0:0:0:0)}
¶J˜K 'lets first step of ECM compute [M]P from P in '
 T˜¤ {7+O(1/loglog M)}*(log M)/log 2 '
¸ ^˜Mmultiplications(4 of the 7(multiplications) are squarings) for arbitrary 'point P on the curve E(KK). '
È hEJCÔðŽ
ö rÀTсJCÞñÀƒWрہTïñÞñƒN)
L
|ÀƒWÑðÀƒGDрāTïñÞñƒN)Àˆõ PRINT_GCDƒWрہTïñÞñƒN)À‘
·
†ÀƒBÑñå(TïñށTÝñ)åƒWçƒNÀƒW1уBïñçƒNÀƒAуW1ÞñÀƒWрۃAå(ƒW1Ýñ)ƒN)
 ÀƒWÑðÀƒGDрăAå(ƒW1Ýñ)ƒN)Àˆõ PRINT_GCDƒWрۃAå(ƒW1Ýñ)ƒN)À‘
 šÀƒSAÑñåƒAåƒBçƒNÀƒTAÑ(ƒAïñ݃W1)çƒNÀƒCAÑ(ƒTAÞñåƒW1)çƒNÀƒKуTAåƒWçƒNÀƒDAуKå(ƒW1Þñ)çƒNåƒAçƒN
¶ ¤ÀƒKKуKïñçƒN
¿ ®˜T
Ï ¸JCÒðŽ
ÂÀƒSAÑñåJCÀƒTAуSAåJCÝñÀƒCAуTAÞñÀƒDAуSAÀƒWрۃSAƒN)
f ÌÀõƒWÑðÀƒGDрăSAƒN)Àˆõ PRINT_GCDƒWрۃSAƒN)À‘·
“ ÖÀƒKуCAåƒWçƒNÀƒKKуKïñçƒN
œ à˜1
ö êƒGDрăKKå(ƒKKÞñ)ƒN)À…ƒGDÒñÀˆõREDUCEƒGDрăKKå(ƒKKÞñ)ƒN)À‘O
ÿ ô˜”
 
þ˜5 The above selection of curves and initial points implies that Np, the 'order of the group of the elliptic curve E(KK)(mod p), is divisible by 8
I˜Þ(and Np is divisible by 16 when JC%<0 and (-1/p)=1), where p is a prime 'factor of the current N. '
[‰IÑðŠM
›…MцMI)ÀƒPфPI)ÀˆõJACPW8CæƒGDрăSAƒN)
Ù&hƒGDÒñÀ™"Q1="ÁƒPÀˆõREDUCE«æƒGDрăSAƒN)À‘1
à0Œ
é:˜~
D™"Q1="ÁƒPÁ€šÀ¨€š
N˜Ÿ
?XƒXAÑ(ƒTAå€ÛƒSAƒN)çƒN)ïñçƒNÀƒZAÑñ
Hb˜Ý
tl…MсDSÀˆõJACPW3‘æƒWрۃSAƒN)
¶vEƒWÑðÀƒGDрăSAƒN)ÀˆõREDUCEƒWрۃSAƒN)À‘

1€ƒSAÑñÀƒTAуTAåƒWçƒNÀƒCAуCAåƒWçƒNÀƒDAуDAåƒWçƒNÀƒX1уTAïñçƒNÀƒY1уTAåƒCAçƒNåƒDAçƒN
:Š˜Ï
i”…MÑ(ƒQ1ށSZ)èDSÀƒQхMåDS݁SZ
‘ž …MÀˆõJACPW4wæƒWрۃSAƒN)
Ó¨bƒWÑðÀƒGDрăSAƒN)ÀˆõREDUCEƒWрۃSAƒN)À‘'
N²ƒSAÑñÀƒTAуTAåƒWçƒNÀƒCAуCAåƒWçƒNÀƒDAуDAåƒWçƒNÀƒX2уTAïñçƒNÀƒY2уTAåƒCAçƒNåƒDAçƒN
W¼˜ì
nƨJÀ„Xð)уXA
ÜЃWуXAïñçƒNÀƒXCÑ(ƒWރKK)ïñçƒNÀƒZCÑ(ƒXCÞ(ƒWÞñåƒXA݃KK)ïñ)çƒNÀƒWрۃXCƒN)
ڐ­ƒWÑðÀƒGDрăXCƒN)ÀˆõREDUCEƒWрۃXCƒN)À‘r
KäƒW1уZCåƒWçƒNÀƒW2уW1åƒKKçƒN
cîƒXBуXAÀƒZBÑñ
ø‰IÑñŠSZÞñ‹ñ
þƒW3Ñ(ƒZBåƒW2çƒNރXB)ïñçƒNåƒZAçƒNÀƒZAуZBÀƒZBÑ(ƒXBåƒW1çƒNރZB)ïñçƒNåƒXAçƒNÀƒXAуXBÀƒXBуW3
 -€ÄISZ)ÑñŽ
0ÀƒWрۃZBƒN)
y ÀƒWÑðÀ™IÀƒGDрăZBƒN)ÀˆõREDUCEƒWрۃZBƒN)À‘Ç
ž*À JÀ„XJ)уXBåƒWçƒN
¥4Œ
»>‰IÑðŠTS‹ñ
ÿHƒW1фXI)݄XIÝñ)ÀƒW2фXI)å„XIÝñ)çƒN
KRƒW3фXIÝñ)݄XIÝñ)ÀƒW4фXIÝñ)å„XIÝñ)çƒN
‰\ƒB3Ñ(ƒW1݃W3Þñ)çƒNÀƒB3рáƒB3݀åƒB3)åƒNÂÞñ)
Êf„XI)рáƒB3݀åƒB3)åƒNÂÞñ)ÀƒB2фXI)ïñçƒN
ýpƒB1Ñ(ñåƒB2݃B3ރW1åƒW3ރW2ރW4)çƒN
Fz„XIÝñ)Ñ((ƒB2݃B2ރB1)åƒB3݃B2ރW2åƒW3ރW1åƒW4)çƒN
s„„XIÝñ)Ñ(ƒB1ބXIÝñ))çƒN
ÄŽ„XIÝñ)Ñ((ƒB2ރB1)åƒB2݄XIÝñ)å„XIÝñ)ރW2åƒW4)çƒN
˘Œ
Ô¢˜i
¬ƒX1уX1çƒNÀƒY1уY1çƒNÀƒX2уX2çƒNÀƒY2уY2çƒNÀ™€šÀ¨€š
&¶˜»
/À’ÿÿ
EʉJÑðŠTS‹ñ
¼ÔƒWÑ(ƒX2ބXJ))ïñçƒNÀƒGDÑ((ƒWބXJÝñ))å(ƒWރX2ބXJÝñ))ބXJÝñ))çƒNåƒGDçƒN
ÃÞŒ
õèƒWрÛ(ƒX2ރX1)åƒGDƒN)ÀƒQуQ݁DS
ò\"ƒWÑð
?üƒGDрÄ(ƒX2ރX1)åƒGDƒN)À™"Q2="ÁƒQÀˆõREDUCE«æ
¨ƒX1уX1çƒNÀƒY1уY1çƒNÀƒX2уX2çƒNÀƒY2уY2çƒNÀ‰JÑðŠTSÀ„XJ)фXJ)çƒNÀŒ
ăWрۃX2ރX1ƒN)
Í‘‹!
A$ƒWÑ(ƒY2ރY1)åƒGDçƒNåƒWçƒNÀƒX2Ñ(ƒWïñރX2ރX1݃KKÝñ)çƒNÀƒY2Ñ((ƒX1ރX2)åƒWރY1)çƒN
S.“¾ ƒQӃQ2
\8˜ñ"
 B™"Q2="ÁƒQÁ€šÀƒNԃNNŽ–À—ÀJCсJC݀ÁJC)À‡õJ_CURVE‹
©L˜
²V˜
Â`õJACPW8
ÍjºI
tBTр߀€…M))åñ èñ
ÞñÂñ)ÀLсBTÞñÀ§#LÑðŽõJACPW4
!~˜¶#
jˆƒS1уSAÀƒT1уTAÀƒC1уCAÀƒD1уDAÀˆõJACSQ(æƒWрۃS3ƒN)
›’*$ƒWÑðŽƒGDрăS3ƒN)ÀˆõREDUCE‡ñt
œƒS2ÑñÀƒT2уT3åƒWçƒNÀƒC2уC3åƒWçƒNÀƒD2уD3åƒWçƒNÀƒSTуT2ÀƒCDуC2åƒD2çƒN
¦˜¡$
u°„Sð)уSAÀ„Tð)уTAÀ„Cð)уCAÀ„Dð)уDAÀ„STð)уSAåƒTAåñçƒNÀ„CDð)уCAåƒDAåñçƒN
‘º‰IÑñŠñïLÞñ
íăW1фSIÞñ)åƒT2çƒNÀƒW3фCIÞñ)åƒD2çƒNÀƒW4уC2å„DIÞñ)çƒN
?΃W5уW1ބTIÞñ)ÀƒW6уW1݄TIÞñ)À„SI)уW5åƒW6åñçƒN
¦Ø…W7Ñ(ƒW3݃W4)åƒW5À…W8Ñ(ƒW3ރW4)åƒW6À„CI)Ñ(…W7݅W8)çƒNÀ„DI)Ñ(…W7ޅW8)çƒN
ââ„TI)Ñ(„STIÞñ)åƒCDރSTå„CDIÞñ))çƒN
5ì„STI)фSI)å„TI)åñçƒNÀ„CDI)фCI)å„DI)åñçƒN
<öŒ
E˜Ú&
[
Iр…M)Þñ
d¸ÿÿ
‡5'€ç'IÓð€ÁI…M)Ñð}
(ˆõJACSQA]桁I
¦2‘ú&
·<F'IÔðŽ•
ìFKрßðIށL)À{'€ÃK…M)ÑðÀ KÀ‘a'
÷P¨J
Z‰IсIŠK‹Þñ
=dJÑñåJ݀ÁI…M)ÀˆõJACSQA]æ
DnŒ
exIсKÞñÀJсJèñ
΂ƒW1уSAå„TJ)çƒNÀƒW2фSJ)åƒTAçƒNÀƒW3уCAå„DJ)çƒNÀƒW4фCJ)åƒDAçƒN
ŒƒTAÑ(ƒSAåƒTAçƒNå„CDJ)ބSTJ)åƒCAçƒNåƒDA)çƒN
L–ƒW5уW1ރW2ÀƒW6уW1݃W2ÀƒSAуW5åƒW6åñçƒN
© …W7Ñ(ƒW3݃W4)åƒW5À…W8Ñ(ƒW3ރW4)åƒW6ÀƒCAÑ(…W7݅W8)çƒNÀƒDAÑ(…W7ޅW8)çƒN
²ª¹ó&
»´˜
˾˜ *JACML
ÖȘ '
Ò˜ W1=S1*T2@N:W2=S2*T1@N:W3=C1*D2@N:W4=C2*D1@N
3ܘ W5=W1-W2:W6=W1+W2:S3=W5*W6*2@N
xæ˜ W7#=(W3+W4)*W5:W8#=(W3-W4)*W6:C3=(W7#+W8#)@N:D3=(W7#-W8#)@N
ªð˜ T3=(S1*T1@N*C2@N*D2-S2*T2@N*C1@N*D1)*2@N
ºú˜ return
Ř '
ÔõJACSQ
ݘr*
& "ƒW1уC1åƒT1çƒNÀ…W2уW1ïñÀƒW3уD1åƒS1çƒNÀ…W4уW3ïñ
W ,ƒC3Ñ(…W2ޅW4)çƒNÀƒT3Ñ(…W2݅W4)çƒN
§ 6ƒS3Ñ((ƒW1݃W3)ïñރT3)çƒNÀƒD3Ñ(ñå(ƒC1åƒD1çƒN)ïñރC3)çƒN
® @•
· J˜
Ç TõJACSQA
Ð ^˜e+
!hƒW1уTAåƒCAçƒNÀ…W2уW1ïñÀƒW3уSAåƒDAçƒNÀ…W4уW3ïñ
J!rƒW5Ñ(…W2ޅW4)çƒNÀƒTAÑ(…W2݅W4)çƒN
¤!|ƒSAÑ((ƒW1݃W3)ïñރTA)çƒNÀƒDAÑ(ñå(ƒCAåƒDAçƒN)ïñރW5)çƒNÀƒCAуW5
«!†•
´!˜
Õ!šõJACPW4d,…MÔñÀ–À‘T,
Þ!¤˜s,
ñ!®&-µƒSAÑñŽ
"¸ÀƒWрۃSAƒN)
L"ÂÀƒWÑðÀƒGDрăSAƒN)ÀˆõREDUCEƒWрۃSAƒN)À‘
—"ÌÀƒSAÑñÀƒTAуTAåƒWçƒNÀƒCAуCAåƒWçƒNÀƒDAуDAåƒWçƒN
å"ÖƒC2уCAÀƒD2уDAÀƒT2уTAÀƒSTуTAåñçƒNÀƒCDуCAåƒDAåñçƒN
#à‰Iр…M)ÞñŠð‹Þñ
(#êˆõJACSQA]æÇ.€ÃI…M)ÑñŽ
ˆ#ôÀƒW1уSAåƒT2çƒNÀƒW3уCAåƒD2çƒNÀƒW4уC2åƒDAçƒNÀƒW5уW1ރTAÀƒW6уW1݃TA
Ú#þÀƒTAÑ(ƒSAåƒTAçƒNåƒCDރSTåƒCAçƒNåƒDA)çƒNÀƒSAуW5åƒW6åñçƒN
8$À…W7Ñ(ƒW3݃W4)åƒW5À…W8Ñ(ƒW3ރW4)åƒW6ÀƒCAÑ(…W7݅W8)çƒNÀƒDAÑ(…W7ޅW8)çƒN
?$Œ
F$•
O$&˜
p$0õJACPW3ÿ.…MÔñÀ–À‘ï.
y$:˜/
Ö$DƒS2уSAÀƒC2уCAÀƒD2уDAÀƒT2уTAÀƒSTуSAåƒTAåñçƒNÀƒCDуCAåƒDAåñçƒN
ô$N‰Iр…M)ÞñŠð‹Þñ
%XˆõJACSQA]æÒ0€ÃI…M)ÑñŽ
o%bÀƒW1уSAåƒT2çƒNÀƒW2уS2åƒTAçƒNÀƒW3уCAåƒD2çƒNÀƒW4уC2åƒDAçƒN
©%lÀƒTAÑ(ƒSAåƒTAçƒNåƒCDރSTåƒCAçƒNåƒDA)çƒN
å%vÀƒW5уW1ރW2ÀƒW6уW1݃W2ÀƒSAуW5åƒW6åñçƒN
C&€À…W7Ñ(ƒW3݃W4)åƒW5À…W8Ñ(ƒW3ރW4)åƒW6ÀƒCAÑ(…W7݅W8)çƒNÀƒDAÑ(…W7ޅW8)çƒN
J&ŠŒ
Q&”•
Z&ž˜
j&¨õREDUCE
s&²˜1
Ó&¼ˆõ PRINT_GCDâæƒSAуSAçƒNÀƒTAуTAçƒNÀƒCAуCAçƒNÀƒDAуDAçƒNÀƒKKуKKçƒNÀ•
Ü&Ƙ
ï&Ðõ PRINT_GCD
ø&Ú˜1
"'ä™"GCD="ÁƒGDÁ€ÝƒGD)Á"digits"Á€šÀ¨€š
Z'îƒNуNèƒGDÀé1ƒNÑñÀ™"Cofactor is 1."À–À‘Ç1
'øƒGDрăGDƒN)ÀƒGDÑñŽ•õ PRINT_GCD
˜'˜


  3 Responses to “Category : BASIC Source Code
Archive   : UBAS830.ZIP
Filename : ECMJAC.UB

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/