Added documentation to isPoclingtonCriterionSatisfied

This commit is contained in:
Piotr Dyraga committed 2018-07-30 16:34:59 +02:00
1 parent 1200243127
commit be670a086c
1 file changed
+4
+4
View File
@@ -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 { func isPocklingtonCriterionSatisfied(p *big.Int) bool {
return new(big.Int).Exp( return new(big.Int).Exp(
big.NewInt(2), big.NewInt(2),