blob: 76e868b937b59917d28674d2952c69f06d8f6463 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
/*
* Random Number Generator
* (C) 1999-2008 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
#include <botan/rng.h>
#include <botan/hmac_rng.h>
#include <botan/lookup.h>
namespace Botan {
RandomNumberGenerator* RandomNumberGenerator::make_rng()
{
std::unique_ptr<MessageAuthenticationCode> h1(make_message_auth("HMAC(SHA-512)"));
std::unique_ptr<MessageAuthenticationCode> h2(h1->clone());
std::unique_ptr<RandomNumberGenerator> rng(new HMAC_RNG(h1.release(), h2.release()));
rng->reseed(256);
return rng.release();
}
}
|