diff options
author | tomsmeding <tom.smeding@gmail.com> | 2016-10-04 11:07:14 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2016-10-04 11:07:14 +0200 |
commit | 550ff72727a1829bb72f5c40cffb96f2225fae84 (patch) | |
tree | 6fd6a2a2f15ad5ff15a12340205ceab2c3ad6414 /primes.h | |
parent | d24ab714b958b9fece4631076e240739ad0dd23f (diff) |
More primes and primality testing
Diffstat (limited to 'primes.h')
-rw-r--r-- | primes.h | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -11,9 +11,15 @@ void fillsmallprimes(); //for use in RSA (pass target number of bits of N) std::pair<Bigint,Bigint> genprimepair(int nbits); -//finds random in range [low,high]; throws domain_error if no prime found +//finds random in range [low,high]; throws range_error("No primes") if no prime found //Will call fillsmallprimes() if not yet done Bigint randprime(const Bigint &low,const Bigint &high); +//checks Fermat [pseudo- or actual] primality +bool strongPseudoPrime2(const Bigint &n); + +//checks Lucas [pseudo- or actual] primality +bool strongLucasPrime(const Bigint &n,int D,int P,int Q); + //checks primality -bool bailliePSW(const Bigint&); +bool bailliePSW(const Bigint &n); |