From: Nick Mathewson Date: Thu, 22 May 2025 16:05:12 +0000 (-0400) Subject: polyval: clean up cpuid code X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81ab782a6375d6c788573ef2c04c93cc89cb5cc4;p=thirdparty%2Ftor.git polyval: clean up cpuid code (Based on comments by Alex Xu) --- diff --git a/src/ext/polyval/polyval.c b/src/ext/polyval/polyval.c index 900a50385b..69e6e0c2c5 100644 --- a/src/ext/polyval/polyval.c +++ b/src/ext/polyval/polyval.c @@ -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; } }