20040521, 05:30  #1 
Feb 2004
23 Posts 
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 ndigit 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 
20040521, 05:41  #2 
Dec 2003
Hopefully Near M48
2×3×293 Posts 

20040521, 12:55  #3 
Aug 2002
Buenos Aires, Argentina
10101000100_{2} Posts 
The previous link is useful only when you need primes of up to 14 digits, so it does not work for 5001000 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 512bit pseudoprime, and then it will apply the APRCLE algorithm that shows that the 155digit number in screen is prime. The entire process needs 34 seconds in my Pentium 4. Last fiddled with by alpertron on 20040521 at 12:59 Reason: Changed 2^512 by 2^511 
20040521, 13:55  #4  
"Nancy"
Aug 2002
Alexandria
2,467 Posts 
You could use the mpz_nextprime() function found in GMP. From the info page:
Quote:
Alex 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
prime generators for quadric irreducible polynomials  bhelmes  Computer Science & Computational Number Theory  122  20170825 21:09 
Error Codes?  Antonio  Information & Answers  6  20110927 13:20 
Alt codes : should shift = +32 in them ?  science_man_88  Programming  13  20110624 06:52 
Data On Error Codes  dave_0273  Data  1  20040502 15:08 
Most popular error codes  GP2  Data  14  20031228 22:02 