From 8511c97586bf70394e0144d6edbf6fa56778ffde Mon Sep 17 00:00:00 2001 From: lloyd Date: Thu, 16 Jun 2011 15:00:21 +0000 Subject: Detect (though not using) the CPUID bit for the RDRAND instruction --- src/utils/cpuid.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/utils') diff --git a/src/utils/cpuid.h b/src/utils/cpuid.h index 863ba5b63..ad85ac4fe 100644 --- a/src/utils/cpuid.h +++ b/src/utils/cpuid.h @@ -82,6 +82,12 @@ class BOTAN_DLL CPUID static bool has_movbe() { return x86_processor_flags_has(CPUID_MOVBE_BIT); } + /** + * Check if the processor supports RDRAND + */ + static bool has_rdrand() + { return x86_processor_flags_has(CPUID_RDRAND_BIT); } + /** * Check if the processor supports AltiVec/VMX */ @@ -96,7 +102,8 @@ class BOTAN_DLL CPUID CPUID_SSE42_BIT = 52, CPUID_MOVBE_BIT = 54, CPUID_AESNI_BIT = 57, - CPUID_AVX_BIT = 60 + CPUID_AVX_BIT = 60, + CPUID_RDRAND_BIT = 61 }; static bool x86_processor_flags_has(u64bit bit) -- cgit v1.2.3