From b8768fa4372eaeb0b816db7bc55813261bc35c2a Mon Sep 17 00:00:00 2001 From: lloyd Date: Sat, 24 May 2008 17:05:16 +0000 Subject: Remove both default arguments to the constructor of ANSI_X931_RNG. If the second argument was NULL, it would default to a new Randpool. But this introduces an annoying dependency: really it is the caller who is relying on Randpool. Make this explicit by passing a new Randpool pointer to the constructor in Library_State. This will break all callers using ANSI_X931_RNG's constructors with default arguments. To regain the previous behavior, change: ANSI_X931_RNG rng; ANSI_X931_RNG rng("/*cipher name*/"); to ANSI_X931_RNG rng(/*cipher name, default was AES-256 */, new Randpool); You are free to pass another PRNG object if you like. This make require inclusion of --- src/libstate.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libstate.cpp') diff --git a/src/libstate.cpp b/src/libstate.cpp index db2d124a8..b988625ce 100644 --- a/src/libstate.cpp +++ b/src/libstate.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -272,7 +273,7 @@ void Library_State::initialize(const InitializerOptions& args, for(u32bit j = 0; j != sources.size(); ++j) add_entropy_source(sources[j]); - set_prng(new ANSI_X931_RNG); + set_prng(new ANSI_X931_RNG("AES-256", new Randpool)); if(args.seed_rng()) { -- cgit v1.2.3