|
#1 |
Sep 2002
Database er0rr
452410 Posts |
This is the first in a series of three GMP based PRP programs; It does A times Fermat PRP tests followed by B times Lucas PRP tests. The second program will do the same but with "Jacobi strength" ; The third will do strong tests.
Note parts of the codes can be replaced with mpz_powm(res, base, something, align); Last fiddled with by paulunderwood on 2022-03-18 at 16:05 |
|
|
|
#2 |
Sep 2002
Database er0rr
106548 Posts |
Here is a program that does Miller-Rabin (Fermat) and the same sort of thing in Lucas terms.
Last fiddled with by paulunderwood on 2022-04-29 at 14:52 Reason: fixed usage words |
|
|
|
#3 |
Sep 2002
Database er0rr
22·3·13·29 Posts |
Here attached is a GMP program that does a base 2 Fermat PRP test followed by a Lucas binary chain PRP test over x^2-2^r*x+1 where jacob(4^r-4,n) is -1. It has a section to deal with Fermat numbers, and products of these.
Both Fermat and Lucas parts can be made strong. It does no trial division. It is nearly as fast as GMP's mpz_probab_prime_p function. The speed comes form using 2^r in the chain and I believe a hand-crafted "mpn" program should be even quicker and as such would be quicker than mpz_probab_prime_p. (It is similar to Pari/GP's ispseudoprime function, but uses 2^r instead of minimal "a"; The latter has to propogate more than the former when subtraction is done in the chain.) Last fiddled with by paulunderwood on 2023-02-24 at 07:21 |
|
|
|
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to run these C++ programs? | sweety439 | sweety439 | 4 | 2020-06-08 16:16 |
tones from c programs | davar55 | Programming | 12 | 2015-12-13 03:41 |
they used to be called programs... | chappy | Lounge | 15 | 2012-08-11 21:02 |
GPU Testing programs | nucleon | GPU Computing | 5 | 2011-08-21 04:24 |
factoring programs | henryzz | Factoring | 6 | 2007-09-19 13:47 |