1
/*************************************************
2
* File EntropySource Source File *
3
* (C) 1999-2007 The Botan Project *
4
*************************************************/
6
#include <botan/es_file.h>
7
#include <botan/config.h>
12
/*************************************************
13
* Gather Entropy from Randomness Source *
14
*************************************************/
15
u32bit File_EntropySource::slow_poll(byte output[], u32bit length)
17
std::vector<std::string> sources =
18
global_config().option_as_list("rng/es_files");
21
for(u32bit j = 0; j != sources.size(); ++j)
23
std::ifstream random_source(sources[j].c_str(), std::ios::binary);
24
if(!random_source) continue;
25
random_source.read((char*)output + read, length);
26
read += random_source.gcount();
27
length -= random_source.gcount();