aboutsummaryrefslogtreecommitdiffstats
path: root/src/dsa_gen.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-04-21 18:53:06 +0000
committerlloyd <[email protected]>2008-04-21 18:53:06 +0000
commit143cee28231dc11c77c6cf577b04088976d95c3a (patch)
tree15e7c78add9bdd4046f051eae4d3e46c5c83e691 /src/dsa_gen.cpp
parent90224856d6cc454eba6d5eacf4439b2d732acd65 (diff)
parenta2941106b36829e0b7187ca7d2a825175ced7fa4 (diff)
propagate from branch 'net.randombit.botan' (head 51f9ee5180a5cacdfff31504266e883b7bb0eb00)
to branch 'net.randombit.botan.remove-libstate' (head 636b767b9686261418b1cb45a6271edeef87501b)
Diffstat (limited to 'src/dsa_gen.cpp')
-rw-r--r--src/dsa_gen.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/dsa_gen.cpp b/src/dsa_gen.cpp
index 576c9a938..002af7d96 100644
--- a/src/dsa_gen.cpp
+++ b/src/dsa_gen.cpp
@@ -5,10 +5,9 @@
#include <botan/dl_group.h>
#include <botan/numthry.h>
-#include <botan/libstate.h>
#include <botan/lookup.h>
#include <botan/parsing.h>
-#include <botan/rng.h>
+#include <botan/libstate.h>
#include <algorithm>
#include <memory>
@@ -84,8 +83,6 @@ bool DL_Group::generate_dsa_primes(BigInt& p, BigInt& q,
if(!is_prime(q))
return false;
- global_state().pulse(PRIME_FOUND);
-
const u32bit n = (pbits-1) / (HASH_SIZE * 8),
b = (pbits-1) % (HASH_SIZE * 8);
@@ -94,8 +91,6 @@ bool DL_Group::generate_dsa_primes(BigInt& p, BigInt& q,
for(u32bit j = 0; j != 4096; ++j)
{
- global_state().pulse(PRIME_SEARCHING);
-
for(u32bit k = 0; k <= n; ++k)
{
++seed;
@@ -110,10 +105,7 @@ bool DL_Group::generate_dsa_primes(BigInt& p, BigInt& q,
p = X - (X % (2*q) - 1);
if(p.bits() == pbits && is_prime(p))
- {
- global_state().pulse(PRIME_FOUND);
return true;
- }
}
return false;
}
@@ -128,8 +120,7 @@ SecureVector<byte> DL_Group::generate_dsa_primes(BigInt& p, BigInt& q,
while(true)
{
- Global_RNG::randomize(seed, seed.size());
- global_state().pulse(PRIME_SEARCHING);
+ global_state().randomize(seed, seed.size());
if(generate_dsa_primes(p, q, pbits, qbits, seed))
return seed;