/* * Random Number Generator * (C) 1999-2008 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) */ #include #include namespace Botan { RandomNumberGenerator* RandomNumberGenerator::make_rng() { std::unique_ptr h1(MessageAuthenticationCode::create("HMAC(SHA-512)")); std::unique_ptr h2(MessageAuthenticationCode::create("HMAC(SHA-512)")); if(!h1 || !h2) throw Algorithm_Not_Found("HMAC_RNG HMACs"); std::unique_ptr rng(new HMAC_RNG(h1.release(), h2.release())); rng->reseed(256); return rng.release(); } }