diff --git a/elgamal.py b/elgamal.py index 7d2aee4..690996a 100644 --- a/elgamal.py +++ b/elgamal.py @@ -194,7 +194,7 @@ def find_prime(iNumBits, iConfidence): p = random.randint(2**(iNumBits-2),2**(iNumBits-1)) #keep doing this if the solovay-strassen test fails - while( not SS(p, iConfidence) ): + while( not SS(p * 2 + 1, iConfidence) ): p = random.randint( 2**(iNumBits-2), 2**(iNumBits-1) ) while( p % 2 == 0 ): p = random.randint(2**(iNumBits-2), 2**(iNumBits-1))