The unified diff between revisions [cc2a894e..] and [bd0f733f..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'src/rng.cpp'
#
#
# patch "src/rng.cpp"
# from [78a6700890ab4c89f13aeef7c67609a3b4944949]
# to [f00aa8f21353954852793fe3efa4a26be4d317a0]
#
============================================================
--- src/rng.cpp 78a6700890ab4c89f13aeef7c67609a3b4944949
+++ src/rng.cpp f00aa8f21353954852793fe3efa4a26be4d317a0
@@ -72,22 +72,24 @@ RandomNumberGenerator* RandomNumberGener
*************************************************/
RandomNumberGenerator* RandomNumberGenerator::make_rng()
{
- Randpool* randpool = new Randpool("AES-256", "HMAC(SHA-256)");
+ RandomNumberGenerator* rng =
+ new ANSI_X931_RNG("AES-256",
+ new Randpool("AES-256", "HMAC(SHA-256)"));
#if defined(BOTAN_EXT_TIMER_HARDWARE)
- randpool->add_entropy_source(new Hardware_Timer);
+ rng->add_entropy_source(new Hardware_Timer);
#elif defined(BOTAN_EXT_TIMER_POSIX)
- randpool->add_entropy_source(new POSIX_Timer);
+ rng->add_entropy_source(new POSIX_Timer);
#elif defined(BOTAN_EXT_TIMER_UNIX)
- randpool->add_entropy_source(new Unix_Timer);
+ rng->add_entropy_source(new Unix_Timer);
#elif defined(BOTAN_EXT_TIMER_WIN32)
- randpool->add_entropy_source(new Win32_Timer);
+ rng->add_entropy_source(new Win32_Timer);
#else
- randpool->add_entropy_source(new Timer);
+ rng->add_entropy_source(new Timer);
#endif
#if defined(BOTAN_EXT_ENTROPY_SRC_DEVICE)
- randpool->add_entropy_source(
+ rng->add_entropy_source(
new Device_EntropySource(
split_on("/dev/random:/dev/srandom:/dev/urandom", ':')
)
@@ -95,34 +97,34 @@ RandomNumberGenerator* RandomNumberGener
#endif
#if defined(BOTAN_EXT_ENTROPY_SRC_EGD)
- randpool->add_entropy_source(
+ rng->add_entropy_source(
new EGD_EntropySource(split_on("/var/run/egd-pool:/dev/egd-pool", ':'))
);
#endif
#if defined(BOTAN_EXT_ENTROPY_SRC_CAPI)
- randpool->add_entropy_source(new Win32_CAPI_EntropySource);
+ rng->add_entropy_source(new Win32_CAPI_EntropySource);
#endif
#if defined(BOTAN_EXT_ENTROPY_SRC_WIN32)
- randpool->add_entropy_source(new Win32_EntropySource);
+ rng->add_entropy_source(new Win32_EntropySource);
#endif
#if defined(BOTAN_EXT_ENTROPY_SRC_UNIX)
- randpool->add_entropy_source(
+ rng->add_entropy_source(
new Unix_EntropySource(split_on("/bin:/sbin:/usr/bin:/usr/sbin", ':'))
);
#endif
#if defined(BOTAN_EXT_ENTROPY_SRC_BEOS)
- randpool->add_entropy_source(new BeOS_EntropySource);
+ rng->add_entropy_source(new BeOS_EntropySource);
#endif
#if defined(BOTAN_EXT_ENTROPY_SRC_FTW)
- randpool->add_entropy_source(new FTW_EntropySource("/proc"));
+ rng->add_entropy_source(new FTW_EntropySource("/proc"));
#endif
- return new ANSI_X931_RNG("AES-256", randpool);
+ return rng;
}
}