aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-19 16:22:20 +0000
committerlloyd <[email protected]>2010-03-19 16:22:20 +0000
commitd22fc649eba193c10765d21d9028fa05bda7cd31 (patch)
tree7aea67a076ba9cd31878b791aa900449a8151bd4 /src/pubkey
parent1418ba24b73b8d9e4af67950fee38a02e7f1ac75 (diff)
A number of changes to primality tests:
Use 64 bit nonces in the Miller-Rabin test, instead of 40 bits. Rename check_prime to quick_check_prime and is_prime to check_prime Remove some internal functions which weren't used outside the primality test code, along with the prime products table. For quick checking, instead of doing Miller-Rabin with fixed base 2, do a small number of randomized tests. Always use random bases instead of the first n primes.
Diffstat (limited to 'src/pubkey')
-rw-r--r--src/pubkey/dl_group/dl_group.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pubkey/dl_group/dl_group.cpp b/src/pubkey/dl_group/dl_group.cpp
index 7940e69b2..cbbea5a60 100644
--- a/src/pubkey/dl_group/dl_group.cpp
+++ b/src/pubkey/dl_group/dl_group.cpp
@@ -64,7 +64,7 @@ DL_Group::DL_Group(RandomNumberGenerator& rng,
q = random_prime(rng, qbits);
BigInt X;
- while(p.bits() != pbits || !is_prime(p, rng))
+ while(p.bits() != pbits || !check_prime(p, rng))
{
X.randomize(rng, pbits);
p = X - (X % (2*q) - 1);