From be670a086c2d88a4d0b65a3b22808e9eda5780cc Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Mon, 30 Jul 2018 16:34:59 +0200 Subject: [PATCH] Added documentation to isPoclingtonCriterionSatisfied --- safe_prime_generator.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/safe_prime_generator.go b/safe_prime_generator.go index c905172..f0e70a6 100644 --- a/safe_prime_generator.go +++ b/safe_prime_generator.go @@ -265,6 +265,10 @@ func runGenPrimeRoutine( }() } +// Pocklington's criterion can be used to prove the primality of `p = 2q + 1` +// once one has proven the primality of `q`. +// With `q` prime, `p = 2q + 1`, and `p` passing Fermat's primality test to base +// `2` that `2^{p-1} = 1 (mod p)` then `p` is prime as well. func isPocklingtonCriterionSatisfied(p *big.Int) bool { return new(big.Int).Exp( big.NewInt(2),