From 7f7e390737b9df12f5a87e93b1b138089847b4a3 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Fri, 27 Jul 2018 16:56:48 +0200 Subject: [PATCH] Removed not needed code --- safe_prime_generator.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/safe_prime_generator.go b/safe_prime_generator.go index 8fa65a2..ade754c 100644 --- a/safe_prime_generator.go +++ b/safe_prime_generator.go @@ -210,9 +210,6 @@ func runGenPrimeRoutine( q.SetBytes(bytes) - p.Mul(q, big.NewInt(2)) - p.Add(p, big.NewInt(1)) - // Calculate the value mod the product of smallPrimes. If it's // a multiple of any of these primes we add two until it isn't. // The probability of overflowing is minimal and can be ignored @@ -279,9 +276,7 @@ func isPocklingtonCriterionSatisfied(p *big.Int) bool { } func isPrimeCandidate(number *big.Int) bool { - bigMod := new(big.Int) - bigMod.Mod(number, smallPrimesProduct) - m := bigMod.Uint64() + m := new(big.Int).Mod(number, smallPrimesProduct).Uint64() for _, prime := range smallPrimes { if m%uint64(prime) == 0 && m != uint64(prime) {