找回密码
 欢迎注册
查看: 19621|回复: 17

[分享] Windows7上使用GMP-ECM体验

[复制链接]
发表于 2020-8-29 09:28:12 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?欢迎注册

×
下载地址:

https://mersenneforum.org/showpost.php?p=480484&postcount=455


常用命令:

  1. ::打开cmd窗口,输入下面的命令
  2. ::必须切换到这个目录下,不然调用不了命令
  3. ::目录下必须含有下面两个exe文件 ecm.exe ecmfactor.exe README
  4. cd C:\Users\Administrator\Desktop\_123\gmpecm-svn3027-sandybridge
  5. ::全部帮助文件命令ecm --help
  6. ::1000条曲线,B1=1e6,B2=1e9,分解的整数在composites文件里
  7. ecm -c 1000 1e6 1e9 < composites
  8. ::找到一个因子就停止运行
  9. ecm -one -c 1000 1e6 1e9 < composites
复制代码


全部帮助文件:
  1. Usage: ecm [options] B1 [[B2min-]B2] < file

  2. Parameters:
  3.   B1           stage 1 bound
  4.   B2           stage 2 bound (or interval B2min-B2max)

  5. Options:
  6.   -x0 x        use x as initial point
  7.   -y0 y        use y as initial point (Weierstrass form)
  8.   -param i     which parametrization should be used [ecm]
  9.   -sigma s     use s as parameter to compute curve's coefficients
  10.                can use -sigma i:s to specify -param i at the same time [ecm]
  11.   -A A         use A as a curve coefficient [ecm, see README]
  12.   -torsion T   to generate a curve with torsion group T [ecm, see README]
  13.   -k n         perform >= n steps in stage 2
  14.   -power n     use x^n for Brent-Suyama's extension
  15.   -dickson n   use n-th Dickson's polynomial for Brent-Suyama's extension
  16.   -c n         perform n runs for each input
  17.   -pm1         perform P-1 instead of ECM
  18.   -pp1         perform P+1 instead of ECM
  19.   -q           quiet mode
  20.   -v           verbose mode
  21.   -timestamp   print a time stamp with each number
  22.   -mpzmod      use GMP's mpz_mod for modular reduction
  23.   -modmuln     use Montgomery's MODMULN for modular reduction
  24.   -redc        use Montgomery's REDC for modular reduction
  25.   -nobase2     disable special base-2 code
  26.   -nobase2s2   disable special base-2 code in ecm stage 2 only
  27.   -base2 n     force base 2 mode with 2^n+1 (n>0) or 2^|n|-1 (n<0)
  28.   -ntt         enable NTT convolution routines in stage 2
  29.   -no-ntt      disable NTT convolution routines in stage 2
  30.   -save file   save residues at end of stage 1 to file
  31.   -savea file  like -save, appends to existing files
  32.   -resume file resume residues from file, reads from stdin if file is "-"
  33.   -chkpnt file save periodic checkpoints during stage 1 to file (for -param 0)
  34.   -primetest   perform a primality test on input
  35.   -treefile f  [ECM only] store stage 2 data in files f.0, ...
  36.   -maxmem n    use at most n MB of memory in stage 2
  37.   -stage1time n add n seconds to ECM stage 1 time (for expected time est.)
  38.   -I f         increment B1 by f*sqrt(B1) on each run
  39.   -inp file    Use file as input (instead of redirecting stdin)
  40.   -one         Stop processing a candidate if a factor is found (looping mode)
  41.   -go val      Preload with group order val, which can be a simple expression,
  42.                or can use N as a placeholder for the number being factored.
  43.   -printconfig Print compile-time configuration and exit.
  44.   -bsaves file With -param 1-3, save stage 1 exponent in file.
  45.   -bloads file With -param 1-3, load stage 1 exponent from file.
  46.   -h, --help   Prints this help and exit.
复制代码


唯一的恼人的问题就是,一旦出现一个因子,但是不能够输出因子到文本文件里面(也许是我不会)

分享一下截屏


QQ截图20200829092722.png
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2020-8-29 09:41:17 | 显示全部楼层
椭圆曲线分解整数,感觉还是命令行的方式可以操控的办法多,gui的方式,操控的太有限了,
命令行的复制粘贴真是简单!可以重复利用
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2020-8-29 13:25:09 | 显示全部楼层
mathematica 发表于 2020-8-29 09:41
椭圆曲线分解整数,感觉还是命令行的方式可以操控的办法多,gui的方式,操控的太有限了,
命令行的复制粘 ...

我知道linux里面可以管道送到grep里面然后输出
windows里面应该可以有类似的操作
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2020-8-29 13:35:33 | 显示全部楼层
.·.·. 发表于 2020-8-29 13:25
我知道linux里面可以管道送到grep里面然后输出
windows里面应该可以有类似的操作

那你怎么弄的?怎么不写出来?
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2020-8-29 13:41:46 | 显示全部楼层
mathematica 发表于 2020-8-29 13:35
那你怎么弄的?怎么不写出来?

ecm ... | grep Found > output.txt(不会打印输出到标准输出)
我不写的原因是我没有ECM
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2020-8-29 14:17:37 | 显示全部楼层
.·.·. 发表于 2020-8-29 13:41
ecm ... | grep Found > output.txt(不会打印输出到标准输出)
我不写的原因是我没有ECM

受你的启发,我学会了下面的方式!
  1. ecm -one -c 1000 1e6 1e9 < composites | findstr "." >>output
复制代码
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2020-8-29 14:19:25 | 显示全部楼层
.·.·. 发表于 2020-8-29 13:41
ecm ... | grep Found > output.txt(不会打印输出到标准输出)
我不写的原因是我没有ECM

你真聪明,居然会用管道!

点评

这是linux标准操作……  发表于 2020-8-29 14:26
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2020-8-29 16:00:02 来自手机 | 显示全部楼层
.·.·. 发表于 2020-8-29 13:41
ecm ... | grep Found > output.txt(不会打印输出到标准输出)
我不写的原因是我没有ECM

难道你到现在都没有玩gmp ecm?

点评

没有,我现在在玩深度学习,连prime95都停了  发表于 2020-8-29 18:53
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2020-8-30 12:15:39 | 显示全部楼层
.·.·. 发表于 2020-8-29 13:41
ecm ... | grep Found > output.txt(不会打印输出到标准输出)
我不写的原因是我没有ECM
  1. cd C:\Users\Administrator\Desktop\_123\gmpecm-svn3027-sandybridge
  2. echo "(2^599-1)" | ecm -sigma 1604840403 3e6
复制代码

求这个因子,算简单的,得到因子
148296291984475077955727317447564721950969097

点评

然而factordb上面早就写好了答案  发表于 2020-8-30 15:30
算不动。我这里没有gmp-ecm,这个大小我应该是算不动的,我只能在求出一个因子之后分解剩下的部分  发表于 2020-8-30 15:29
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2020-8-30 20:39:25 | 显示全部楼层
.·.·. 发表于 2020-8-29 13:41
ecm ... | grep Found > output.txt(不会打印输出到标准输出)
我不写的原因是我没有ECM

你对椭圆曲线不了解,知道了sigma之后,运算会减少很多,时间主要都浪费在找sigma上!

点评

我的意思是,多线程找sigma啊  发表于 2020-9-6 17:00
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2024-4-24 02:47 , Processed in 0.068119 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表