aboutsummaryrefslogtreecommitdiffstats
path: root/checks/bigint.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-06-27 17:00:56 +0000
committerlloyd <[email protected]>2008-06-27 17:00:56 +0000
commit89382c8d6e8861e702def6a6e695fc2b783e7f09 (patch)
treee479233393d84ee88c5ae2f08889f7117e8da911 /checks/bigint.cpp
parent09d2b6df9a2a680476160a6a0a56c4b4f2fb91aa (diff)
Remove uses of global PRNG from self-test and benchmark code. Assumes
access to /dev/random (will be cleaned up shortly)
Diffstat (limited to 'checks/bigint.cpp')
-rw-r--r--checks/bigint.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/checks/bigint.cpp b/checks/bigint.cpp
index 84bee4eaa..518261580 100644
--- a/checks/bigint.cpp
+++ b/checks/bigint.cpp
@@ -7,7 +7,6 @@
#include <botan/bigint.h>
#include <botan/exceptn.h>
#include <botan/numthry.h>
-#include <botan/libstate.h>
using namespace Botan;
#include "common.h"
@@ -269,7 +268,7 @@ u32bit check_mod(const std::vector<std::string>& args)
/* Won't work for us, just pick one at random */
while(b_word == 0)
for(u32bit j = 0; j != 2*sizeof(word); j++)
- b_word = (b_word << 4) ^ global_state().random();
+ b_word = (b_word << 4) ^ global_rng().next_byte();
b = b_word;
@@ -338,7 +337,7 @@ u32bit check_primetest(const std::vector<std::string>& args)
bool should_be_prime = (args[1] == "1");
bool is_prime = Botan::verify_prime(n,
- global_state().prng_reference());
+ global_rng());
if(is_prime != should_be_prime)
{