summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/arch/amd64/crypto_cpu_caps.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/arch/amd64/crypto_cpu_caps.c')
-rw-r--r--src/lib/libcrypto/arch/amd64/crypto_cpu_caps.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libcrypto/arch/amd64/crypto_cpu_caps.c b/src/lib/libcrypto/arch/amd64/crypto_cpu_caps.c
index 0bc440d34f..51a2da4616 100644
--- a/src/lib/libcrypto/arch/amd64/crypto_cpu_caps.c
+++ b/src/lib/libcrypto/arch/amd64/crypto_cpu_caps.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: crypto_cpu_caps.c,v 1.7 2025/07/22 09:18:02 jsing Exp $ */ 1/* $OpenBSD: crypto_cpu_caps.c,v 1.8 2025/08/14 15:11:01 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -119,6 +119,10 @@ crypto_cpu_caps_init(void)
119 if (max_cpuid >= 7) { 119 if (max_cpuid >= 7) {
120 cpuid(7, NULL, &ebx, NULL, NULL); 120 cpuid(7, NULL, &ebx, NULL, NULL);
121 121
122 /* Intel ADX feature bit - ebx[19]. */
123 if (((ebx >> 19) & 1) != 0)
124 crypto_cpu_caps_amd64 |= CRYPTO_CPU_CAPS_AMD64_ADX;
125
122 /* Intel SHA extensions feature bit - ebx[29]. */ 126 /* Intel SHA extensions feature bit - ebx[29]. */
123 if (((ebx >> 29) & 1) != 0) 127 if (((ebx >> 29) & 1) != 0)
124 crypto_cpu_caps_amd64 |= CRYPTO_CPU_CAPS_AMD64_SHA; 128 crypto_cpu_caps_amd64 |= CRYPTO_CPU_CAPS_AMD64_SHA;