Browse Source

Add check for PCLMUL instruction too. Virtually all CPUs with AES-NI have it but good to be sure.

Adam Ierymenko 6 years ago
parent
commit
8faaaec710
1 changed files with 1 additions and 1 deletions
  1. 1 1
      node/AES.cpp

+ 1 - 1
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();