summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/arch/amd64/crypto_arch.h9
-rw-r--r--src/lib/libcrypto/arch/amd64/crypto_cpu_caps.c6
2 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/libcrypto/arch/amd64/crypto_arch.h b/src/lib/libcrypto/arch/amd64/crypto_arch.h
index e869fbba35..a8f64cf235 100644
--- a/src/lib/libcrypto/arch/amd64/crypto_arch.h
+++ b/src/lib/libcrypto/arch/amd64/crypto_arch.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: crypto_arch.h,v 1.13 2025/07/22 09:18:02 jsing Exp $ */ 1/* $OpenBSD: crypto_arch.h,v 1.14 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 *
@@ -26,9 +26,10 @@
26extern uint64_t crypto_cpu_caps_amd64; 26extern uint64_t crypto_cpu_caps_amd64;
27#endif 27#endif
28 28
29#define CRYPTO_CPU_CAPS_AMD64_AES (1ULL << 0) 29#define CRYPTO_CPU_CAPS_AMD64_ADX (1ULL << 0)
30#define CRYPTO_CPU_CAPS_AMD64_CLMUL (1ULL << 1) 30#define CRYPTO_CPU_CAPS_AMD64_AES (1ULL << 1)
31#define CRYPTO_CPU_CAPS_AMD64_SHA (1ULL << 2) 31#define CRYPTO_CPU_CAPS_AMD64_CLMUL (1ULL << 2)
32#define CRYPTO_CPU_CAPS_AMD64_SHA (1ULL << 3)
32 33
33#ifndef OPENSSL_NO_ASM 34#ifndef OPENSSL_NO_ASM
34 35
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;