From a8ee54d459a42d98fdfe1e9ff4f0c011c2f41e10 Mon Sep 17 00:00:00 2001 From: lloyd Date: Sun, 26 Oct 2008 03:07:18 +0000 Subject: Move rng.{cpp,h} from core to rng/ topdir Add a new class AutoSeeded_RNG that is a RandomNumberGenerator that wraps up the logic formerly in RandomNumberGenerator::make_rng. make_rng in fact now just returns a new AutoSeeded_RNG object. AutoSeeded_RNG is a bit more convenient because - No need to use auto_ptr - No need to dereference (same syntax everywhere - it's an underestimated advantage imo) Also move the code from timer/timer_base to timer/ --- doc/examples/ressol.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'doc/examples/ressol.cpp') diff --git a/doc/examples/ressol.cpp b/doc/examples/ressol.cpp index ff49ef19d..47a6550b6 100644 --- a/doc/examples/ressol.cpp +++ b/doc/examples/ressol.cpp @@ -1,4 +1,5 @@ #include +#include using namespace Botan; @@ -47,7 +48,7 @@ void test_ressol(const BigInt& p, RandomNumberGenerator& rng) int main() { - RandomNumberGenerator* rng = RandomNumberGenerator::make_rng(); + AutoSeeded_RNG rng; #if 0 std::cout << ressol(8, 17) << "\n"; @@ -58,8 +59,8 @@ int main() for(int j = 16; j != 1024; ++j) { std::cout << "Round " << j << "\n"; - BigInt p = random_prime(*rng, j); - test_ressol(p, *rng); + BigInt p = random_prime(rng, j); + test_ressol(p, rng); //printf("%d\n", j); @@ -70,7 +71,7 @@ int main() { std::cout << "PRIME[" << j << "] == " << PRIMES[j] << std::endl; //printf("%d - ", PRIMES[j]); - test_ressol(PRIMES[j], *rng); + test_ressol(PRIMES[j], rng); //printf("\n"); } */ -- cgit v1.2.3