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/rsa_kgen.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'doc/examples/rsa_kgen.cpp') diff --git a/doc/examples/rsa_kgen.cpp b/doc/examples/rsa_kgen.cpp index c3942971b..ed8e786fe 100644 --- a/doc/examples/rsa_kgen.cpp +++ b/doc/examples/rsa_kgen.cpp @@ -45,16 +45,15 @@ int main(int argc, char* argv[]) try { - std::auto_ptr rng( - RandomNumberGenerator::make_rng()); + AutoSeeded_RNG rng; - RSA_PrivateKey key(*rng, bits); + RSA_PrivateKey key(rng, bits); pub << X509::PEM_encode(key); if(argc == 2) priv << PKCS8::PEM_encode(key); else - priv << PKCS8::PEM_encode(key, *rng, argv[2]); + priv << PKCS8::PEM_encode(key, rng, argv[2]); } catch(std::exception& e) { -- cgit v1.2.3