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

13
Chris MacLellan, and Daniel W. Peterson

Upload: jacob-overbeck

Post on 01-Apr-2015

218 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which

Chris MacLellan, and Daniel W. Peterson

Page 2: Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which

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

Page 3: Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which

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.

Page 4: Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which

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

Page 5: Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which

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

Page 6: Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which

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

Page 7: Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which

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)

Page 8: Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which

Sieving MethodsSieve of EratosthenesJumping Sieve

Page 9: Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which

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.

Page 10: Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which

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...).

Page 11: Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which

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

write n to filen = nextprime(n);}

Page 12: Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which

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.

Page 13: Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which

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