]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
polyval: clean up cpuid code
authorNick Mathewson <nickm@torproject.org>
Thu, 22 May 2025 16:05:12 +0000 (12:05 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 22 May 2025 16:06:29 +0000 (12:06 -0400)
(Based on comments by Alex Xu)

src/ext/polyval/polyval.c

index 900a50385b508d37e141d8231a9516a91e60f974..69e6e0c2c5821bb623b52811866e6c8c702c864f 100644 (file)
@@ -431,10 +431,10 @@ PV_DECLARE(, , u128_from_bytes_ctmul,
 void
 polyval_detect_implementation(void)
 {
-  unsigned int eax, ebc, ecx, edx;
+  unsigned int eax, ebx, ecx, edx;
   use_pclmul = false;
-  if (__get_cpuid(1, &eax, &ebc, &ecx, &edx)) {
-    if (0 != (ecx & (1<<1))) {
+  if (__get_cpuid(1, &eax, &ebx, &ecx, &edx)) {
+    if (0 != (ecx & bit_PCLMUL)) {
       use_pclmul = true;
     }
   }