chris maclellan, and daniel w. peterson. statistical primality testing miller-rabin and pseudoprimes...

Post on 01-Apr-2015

218 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Chris MacLellan, and Daniel W. Peterson

Statistical Primality TestingMiller-Rabin and pseudoprimesFrobenius test and pseudoprimesComposites which fool both tests

Strong Candidatesp-1|n-1 and p+1|n+1 for all p|nMust have at least 5 prime factorsPrefer composites with odd numbers of

factors.

Construction by PrimesImplications of q|p-1q^2|p-1 is harder to “regulate”Attempt to enforce restrictions on p

Regulating 22|p-1 and 2|p+1Either 4|n-1 or 4|n+1Restrict to 3 mod 8 or 5 mod 8Check that congruences work

3*3 ≡ 5*5 ≡ 1 mod 83*3*3 = 27 ≡ 3 mod 8

Regulating 3Either 3|p-1 or 3|p+1We don’t want both

Sieve ConditionsSieve through primesInclude only primes p≡3 mod 8Include only primes p≡2 mod 3Include only primes where p-1 and p+1 are

square-free (excepting 2)

Sieving MethodsSieve of EratosthenesJumping Sieve

Sieve of EratosthenesThe way that we sieved numbers was

originally like the sieve of Eratosthenes. We would fill an array full of numbers and start moving through and crossing numbers off.

When you use this method you run into memory problems, and it's slow.

Jumping SieveThis method is significantly more effective for

this application. We use the probabilistic nextprime() function

to give us the next prime number.We analyze that number and check it against

the sieve conditions. If it passes we write it to file, if it doesn't we

use the nextprime() function to get the next prime (and repeat test, etc...).

Psuedo-coden = 2;loop infinitely{if testconditions(n) = true

write n to filen = nextprime(n);}

Test the resultsOnce we let the test run for an adequate

amount of time we'd stop it and load the numbers into a hill climbing program.

This program then takes random subsets of these numbers, multiplies them together, and test how likely they are to fool the Miller-Rabin and Frobenius primality tests.

FutureKeep finding ways to tweak the test

conditionsFind ways to make the sieve run fasterRun the sieve for extended periods of timeContinue testing the sieved numbers

top related