From c3d61ef78a1f3492c9ffe21387f70997aae4930f Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 19 May 2016 08:32:51 -0400 Subject: Fix AMD RDRAND detection. Add VIA Padlock extension detection --- cpu.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'cpu.h') 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) -- cgit v1.2.1