diff options
author | lloyd <[email protected]> | 2008-09-15 16:42:25 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-15 16:42:25 +0000 |
commit | 78eb419a3190f139734140061179f7e23baef510 (patch) | |
tree | 6fd607bbed609eb11bce4a2ab87b7abf6dfc4ff9 /checks | |
parent | fdbbea2a13f45c6eb6e9ead20c6ac1a288bbf447 (diff) |
Clean up creation of RNG objects
Diffstat (limited to 'checks')
-rw-r--r-- | checks/dolook2.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/checks/dolook2.cpp b/checks/dolook2.cpp index a47efaff9..7493f4fe6 100644 --- a/checks/dolook2.cpp +++ b/checks/dolook2.cpp @@ -123,17 +123,16 @@ Filter* lookup_rng(const std::string& algname, // these are used for benchmarking: AES-256/SHA-256 matches library // defaults, so benchmark reflects real-world performance (maybe) - else if(algname == "Randpool") + else if(algname == "Randpool" || algname == "X9.31-RNG") { Randpool* randpool = new Randpool("AES-256", "HMAC(SHA-256)"); - randpool->add_entropy((const byte*)key.c_str(), key.length()); - prng = randpool; - } - else if(algname == "X9.31-RNG") - { - Randpool* randpool = new Randpool("AES-256", "HMAC(SHA-256)"); - randpool->add_entropy((const byte*)key.c_str(), key.length()); - prng = new ANSI_X931_RNG("AES-256", randpool); + randpool->add_entropy(reinterpret_cast<const byte*>(key.c_str()), + key.length()); + + if(algname == "Randpool") + prng = randpool; + else + prng = new ANSI_X931_RNG("AES-256", randpool); } if(prng) |