From 8faaaec7109ad93a59e5d74e96add52986363e92 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 26 Aug 2019 19:48:56 -0700 Subject: [PATCH] Add check for PCLMUL instruction too. Virtually all CPUs with AES-NI have it but good to be sure. --- node/AES.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/AES.cpp b/node/AES.cpp index ee9cd12a..fd4b32e0 100644 --- a/node/AES.cpp +++ b/node/AES.cpp @@ -62,7 +62,7 @@ static bool _zt_aesni_supported() : "=a"(eax),"=b"(ebx),"=c"(ecx),"=d"(edx) : "a"(1),"c"(0) ); - return ((ecx & (1 << 25)) != 0); + return (((ecx & (1 << 25)) != 0) && ((ecx & (1 << 1)) != 0)); // check for both AES-NI and PCLMUL #endif } const bool AES::HW_ACCEL = _zt_aesni_supported();