aboutsummaryrefslogtreecommitdiffstats
path: root/checks/bigint.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-05-24 18:25:00 +0000
committerlloyd <[email protected]>2008-05-24 18:25:00 +0000
commitb7563677f13adb8dfa5813ef91ed79364b2d984d (patch)
treecf7fabb3eb43bc49333be726c15ecac1a7f9a1a7 /checks/bigint.cpp
parenta6a9110d02925e111cff2dc1143a09a3b7680f0b (diff)
Previously random_integer and friends used the global PRNG object to get
random bits. Now they take a reference to a RandomNumberGenerator object. This was applied several times out, so now the constructors to private key objects also take a RandomNumberGenerator& argument. This is also true for a number of randomized algorithms (Miller-Rabin, for instance). You can get a reference to the global PRNG with global_state().prng_reference() This is a provisional thing: and warning: it is not thread safe! If this is a problem instead keep per-thread PRNGs and pass them were needed.
Diffstat (limited to 'checks/bigint.cpp')
-rw-r--r--checks/bigint.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/checks/bigint.cpp b/checks/bigint.cpp
index 6a4d5ac94..5853e8a73 100644
--- a/checks/bigint.cpp
+++ b/checks/bigint.cpp
@@ -332,7 +332,8 @@ u32bit check_primetest(const std::vector<std::string>& args)
BigInt n(args[0]);
bool should_be_prime = (args[1] == "1");
- bool is_prime = Botan::verify_prime(n);
+ bool is_prime = Botan::verify_prime(n,
+ global_state().prng_reference());
if(is_prime != should_be_prime)
{