mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Factoring

Reply
 
Thread Tools
Old 2004-05-21, 05:30   #1
Erasmus
 
Feb 2004

23 Posts
Default Prime Generators and/or Source Codes

Hi
Me and my colleague need a prime generator for our next text project. We'll be working on some of RSA's recent assignments and measure the performance of some methods. To do it, we must use a source code or executable to generate a prime list in a text file, or if possible in real time.

If the program can generate especially n-digit primes, it will be much better. Or it can at least be configured as "generate next n primes after the threshold"

Do you suggest any link for this purpose. I will be glad to hear from you.

Thanks for your help
Emrecan
Erasmus is offline   Reply With Quote
Old 2004-05-21, 05:41   #2
jinydu
 
jinydu's Avatar
 
Dec 2003
Hopefully Near M48

2×3×293 Posts
Default

http://primes.utm.edu/nthprime/
jinydu is offline   Reply With Quote
Old 2004-05-21, 12:55   #3
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

24·5·17 Posts
Default

The previous link is useful only when you need primes of up to 14 digits, so it does not work for 500-1000 bit primes, as needed in RSA.

You can use my factorization applet at: http://www.alpertron.com.ar/ECM.HTM . It allows formulas to be entered. The functions useful for you are b(x) (previous strong pseudoprime) and n(x) (next strong pseudoprime).

For instance, if you enter n(2^511), it will find the first 512-bit pseudoprime, and then it will apply the APR-CLE algorithm that shows that the 155-digit number in screen is prime. The entire process needs 34 seconds in my Pentium 4.

Last fiddled with by alpertron on 2004-05-21 at 12:59 Reason: Changed 2^512 by 2^511
alpertron is offline   Reply With Quote
Old 2004-05-21, 13:55   #4
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

2,467 Posts
Default

You could use the mpz_nextprime() function found in GMP. From the info page:

Quote:
- Function: void mpz_nextprime (mpz_t ROP, mpz_t OP)
Set ROP to the next prime greater than OP.

This function uses a probabilistic algorithm to identify primes.
For practical purposes it's adequate, the chance of a composite
passing will be extremely small.

Alex
akruppa is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
prime generators for quadric irreducible polynomials bhelmes Computer Science & Computational Number Theory 122 2017-08-25 21:09
Error Codes? Antonio Information & Answers 6 2011-09-27 13:20
Alt codes : should shift = +32 in them ? science_man_88 Programming 13 2011-06-24 06:52
Data On Error Codes dave_0273 Data 1 2004-05-02 15:08
Most popular error codes GP2 Data 14 2003-12-28 22:02

All times are UTC. The time now is 21:32.

Sun Jun 20 21:32:25 UTC 2021 up 23 days, 19:19, 1 user, load averages: 0.97, 1.10, 1.13

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.