aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-06-16 15:00:21 +0000
committerlloyd <[email protected]>2011-06-16 15:00:21 +0000
commit8511c97586bf70394e0144d6edbf6fa56778ffde (patch)
tree178b2a45d4a801057f6893b0ff2f988815c53fa1 /src/utils
parent36ca4c962bf963ad9f76fb2c26202c0679cbd7ae (diff)
Detect (though not using) the CPUID bit for the RDRAND instruction
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/cpuid.h9
1 files changed, 8 insertions, 1 deletions
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
@@ -83,6 +83,12 @@ class BOTAN_DLL CPUID
{ 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
*/
static bool has_altivec() { return altivec_capable; }
@@ -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)