From 2b32d88fabd0cf45cb42981dd03258b39d1828c4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Thu, 14 Dec 2006 11:12:32 +0000 Subject: Move the UI pulse functions into the global library state. That is (as best as I can tell) the last of the global data, with the exception of the single global_lib_state pointer in libstate.cpp --- src/make_prm.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/make_prm.cpp') diff --git a/src/make_prm.cpp b/src/make_prm.cpp index c7461c411..7642ab435 100644 --- a/src/make_prm.cpp +++ b/src/make_prm.cpp @@ -4,11 +4,11 @@ *************************************************/ #include +#include #include #include #include #include -#include #include #include @@ -55,7 +55,7 @@ bool generate_dsa_primes(BigInt& p, BigInt& q, const byte const_seed[], q.binary_decode(qhash, qhash.size()); if(!is_prime(q)) return false; - UI::pulse(UI::PRIME_FOUND); + global_state().pulse(PRIME_FOUND); u32bit n = (pbits-1) / 160, b = (pbits-1) % 160; SecureVector W(20 * (n+1)); @@ -67,7 +67,7 @@ bool generate_dsa_primes(BigInt& p, BigInt& q, const byte const_seed[], for(u32bit j = 0; j != 4096 - counter_start; ++j) { - UI::pulse(UI::PRIME_SEARCHING); + global_state().pulse(PRIME_SEARCHING); for(u32bit k = 0; k != n + 1; ++k) { @@ -82,7 +82,7 @@ bool generate_dsa_primes(BigInt& p, BigInt& q, const byte const_seed[], if(p.bits() == pbits && is_prime(p)) { - UI::pulse(UI::PRIME_FOUND); + global_state().pulse(PRIME_FOUND); return true; } } @@ -99,7 +99,7 @@ SecureVector generate_dsa_primes(BigInt& p, BigInt& q, u32bit pbits) while(true) { Global_RNG::randomize(seed, seed.size()); - UI::pulse(UI::PRIME_SEARCHING); + global_state().pulse(PRIME_SEARCHING); if(generate_dsa_primes(p, q, seed, seed.size(), pbits)) return seed; } @@ -124,7 +124,7 @@ BigInt random_prime(u32bit bits, const BigInt& coprime, while(true) { - UI::pulse(UI::PRIME_SEARCHING); + global_state().pulse(PRIME_SEARCHING); BigInt p = random_integer(bits); p.set_bit(bits - 2); @@ -139,7 +139,7 @@ BigInt random_prime(u32bit bits, const BigInt& coprime, for(u32bit j = 0; j != sieve.size(); ++j) { sieve[j] = p % PRIMES[j]; - UI::pulse(UI::PRIME_SIEVING); + global_state().pulse(PRIME_SIEVING); } u32bit counter = 0; @@ -148,7 +148,7 @@ BigInt random_prime(u32bit bits, const BigInt& coprime, if(counter == 4096 || p.bits() > bits) break; - UI::pulse(UI::PRIME_SEARCHING); + global_state().pulse(PRIME_SEARCHING); bool passes_sieve = true; ++counter; @@ -157,17 +157,17 @@ BigInt random_prime(u32bit bits, const BigInt& coprime, for(u32bit j = 0; j != sieve.size(); ++j) { sieve[j] = (sieve[j] + modulo) % PRIMES[j]; - UI::pulse(UI::PRIME_SIEVING); + global_state().pulse(PRIME_SIEVING); if(sieve[j] == 0) passes_sieve = false; } if(!passes_sieve || gcd(p - 1, coprime) != 1) continue; - UI::pulse(UI::PRIME_PASSED_SIEVE); + global_state().pulse(PRIME_PASSED_SIEVE); if(passes_mr_tests(p)) { - UI::pulse(UI::PRIME_FOUND); + global_state().pulse(PRIME_FOUND); return p; } } -- cgit v1.2.3