From d24ab714b958b9fece4631076e240739ad0dd23f Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Mon, 3 Oct 2016 22:15:25 +0200 Subject: Progress --- primes.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 primes.h (limited to 'primes.h') diff --git a/primes.h b/primes.h new file mode 100644 index 0000000..61e5fc7 --- /dev/null +++ b/primes.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include +#include "bigint.h" + +extern std::vector smallprimes; + +void fillsmallprimes(); + +//for use in RSA (pass target number of bits of N) +std::pair genprimepair(int nbits); + +//finds random in range [low,high]; throws domain_error if no prime found +//Will call fillsmallprimes() if not yet done +Bigint randprime(const Bigint &low,const Bigint &high); + +//checks primality +bool bailliePSW(const Bigint&); -- cgit v1.2.3-70-g09d2