aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/entropy/rdrand/rdrand.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-08-13 16:25:55 -0400
committerJack Lloyd <[email protected]>2018-08-13 16:25:55 -0400
commit3f313ff9ef28f00cf7a4822d95eb0af29e3a5e41 (patch)
treee37a511f6fb9824ab201eeefd1479205ade86d3f /src/lib/entropy/rdrand/rdrand.cpp
parentb34fc175d8a5bef2ab148afef9e5aa4faf1d392f (diff)
Expose RDRAND RNG through FFI
Diffstat (limited to 'src/lib/entropy/rdrand/rdrand.cpp')
-rw-r--r--src/lib/entropy/rdrand/rdrand.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/entropy/rdrand/rdrand.cpp b/src/lib/entropy/rdrand/rdrand.cpp
index 6a5b0f7c4..b8a74ce2f 100644
--- a/src/lib/entropy/rdrand/rdrand.cpp
+++ b/src/lib/entropy/rdrand/rdrand.cpp
@@ -8,12 +8,12 @@
#include <botan/internal/rdrand.h>
#include <botan/rdrand_rng.h>
-#include <botan/cpuid.h>
namespace Botan {
-size_t Intel_Rdrand::poll(RandomNumberGenerator& rng) {
- if(CPUID::has_rdrand() && BOTAN_ENTROPY_INTEL_RNG_POLLS > 0)
+size_t Intel_Rdrand::poll(RandomNumberGenerator& rng)
+ {
+ if(BOTAN_ENTROPY_INTEL_RNG_POLLS > 0 && RDRAND_RNG::available())
{
RDRAND_RNG rdrand_rng;
secure_vector<uint8_t> buf(4 * BOTAN_ENTROPY_INTEL_RNG_POLLS);