summaryrefslogtreecommitdiff
path: root/cpu.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2010-07-07 22:46:18 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2010-07-07 22:46:18 +0000
commit83f195aa17878ca7d4c8c03b2b871df7bfbe5fb0 (patch)
treed56925f3aa0a89a54957762199893dfc84d62d78 /cpu.h
parent987106e079fcc3d30f32122eb33df59fe9dd86dd (diff)
downloadcryptopp-83f195aa17878ca7d4c8c03b2b871df7bfbe5fb0.tar.gz
add AESNI and CLMUL detection
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@503 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'cpu.h')
-rwxr-xr-xcpu.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/cpu.h b/cpu.h
index 7f01dad..79e5ea8 100755
--- a/cpu.h
+++ b/cpu.h
@@ -28,6 +28,8 @@ extern CRYPTOPP_DLL bool g_hasSSE2;
extern CRYPTOPP_DLL bool g_hasISSE;
extern CRYPTOPP_DLL bool g_hasMMX;
extern CRYPTOPP_DLL bool g_hasSSSE3;
+extern CRYPTOPP_DLL bool g_hasAESNI;
+extern CRYPTOPP_DLL bool g_hasCLMUL;
extern CRYPTOPP_DLL bool g_isP4;
extern CRYPTOPP_DLL word32 g_cacheLineSize;
CRYPTOPP_DLL void CRYPTOPP_API DetectX86Features();
@@ -70,6 +72,20 @@ inline bool HasSSSE3()
return g_hasSSSE3;
}
+inline bool HasAESNI()
+{
+ if (!g_x86DetectionDone)
+ DetectX86Features();
+ return g_hasAESNI;
+}
+
+inline bool HasCLMUL()
+{
+ if (!g_x86DetectionDone)
+ DetectX86Features();
+ return g_hasCLMUL;
+}
+
inline bool IsP4()
{
if (!g_x86DetectionDone)