summaryrefslogtreecommitdiff
path: root/cpu.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-05-19 08:32:51 -0400
committerJeffrey Walton <noloader@gmail.com>2016-05-19 08:32:51 -0400
commitc3d61ef78a1f3492c9ffe21387f70997aae4930f (patch)
tree030f826fea231d7107737c92331d867d9d320fb9 /cpu.h
parent2a163e0b1494aeec9c49437b68a0261687585520 (diff)
downloadcryptopp-git-c3d61ef78a1f3492c9ffe21387f70997aae4930f.tar.gz
Fix AMD RDRAND detection. Add VIA Padlock extension detection
Diffstat (limited to 'cpu.h')
-rw-r--r--cpu.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/cpu.h b/cpu.h
index cbb80d9a..8e261d9d 100644
--- a/cpu.h
+++ b/cpu.h
@@ -143,6 +143,11 @@ extern CRYPTOPP_DLL bool g_hasCLMUL;
extern CRYPTOPP_DLL bool g_isP4;
extern CRYPTOPP_DLL bool g_hasRDRAND;
extern CRYPTOPP_DLL bool g_hasRDSEED;
+extern CRYPTOPP_DLL bool g_hasPadlockRNG;
+extern CRYPTOPP_DLL bool g_hasPadlockACE;
+extern CRYPTOPP_DLL bool g_hasPadlockACE2;
+extern CRYPTOPP_DLL bool g_hasPadlockPHE;
+extern CRYPTOPP_DLL bool g_hasPadlockPMM;
extern CRYPTOPP_DLL word32 g_cacheLineSize;
CRYPTOPP_DLL void CRYPTOPP_API DetectX86Features();
@@ -230,6 +235,41 @@ inline bool HasRDSEED()
return g_hasRDSEED;
}
+inline bool HasPadlockRNG()
+{
+ if (!g_x86DetectionDone)
+ DetectX86Features();
+ return g_hasPadlockRNG;
+}
+
+inline bool HasPadlockACE()
+{
+ if (!g_x86DetectionDone)
+ DetectX86Features();
+ return g_hasPadlockACE;
+}
+
+inline bool HasPadlockACE2()
+{
+ if (!g_x86DetectionDone)
+ DetectX86Features();
+ return g_hasPadlockACE2;
+}
+
+inline bool HasPadlockPHE()
+{
+ if (!g_x86DetectionDone)
+ DetectX86Features();
+ return g_hasPadlockPHE;
+}
+
+inline bool HasPadlockPMM()
+{
+ if (!g_x86DetectionDone)
+ DetectX86Features();
+ return g_hasPadlockPMM;
+}
+
inline int GetCacheLineSize()
{
if (!g_x86DetectionDone)