diff options
Diffstat (limited to 'src/lib/libcrypto/arch/i386/crypto_cpu_caps.c')
-rw-r--r-- | src/lib/libcrypto/arch/i386/crypto_cpu_caps.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libcrypto/arch/i386/crypto_cpu_caps.c b/src/lib/libcrypto/arch/i386/crypto_cpu_caps.c index 6bb77411af..01981ace55 100644 --- a/src/lib/libcrypto/arch/i386/crypto_cpu_caps.c +++ b/src/lib/libcrypto/arch/i386/crypto_cpu_caps.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: crypto_cpu_caps.c,v 1.3 2024/11/12 13:14:57 jsing Exp $ */ | 1 | /* $OpenBSD: crypto_cpu_caps.c,v 1.4 2025/06/15 14:18:31 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -19,11 +19,15 @@ | |||
19 | 19 | ||
20 | #include <openssl/crypto.h> | 20 | #include <openssl/crypto.h> |
21 | 21 | ||
22 | #include "crypto_arch.h" | ||
22 | #include "x86_arch.h" | 23 | #include "x86_arch.h" |
23 | 24 | ||
24 | /* Legacy architecture specific capabilities, used by perlasm. */ | 25 | /* Legacy architecture specific capabilities, used by perlasm. */ |
25 | uint64_t OPENSSL_ia32cap_P; | 26 | uint64_t OPENSSL_ia32cap_P; |
26 | 27 | ||
28 | /* Machine dependent CPU capabilities. */ | ||
29 | uint64_t crypto_cpu_caps_i386; | ||
30 | |||
27 | /* Machine independent CPU capabilities. */ | 31 | /* Machine independent CPU capabilities. */ |
28 | extern uint64_t crypto_cpu_caps; | 32 | extern uint64_t crypto_cpu_caps; |
29 | 33 | ||
@@ -92,8 +96,10 @@ crypto_cpu_caps_init(void) | |||
92 | if ((edx & IA32CAP_MASK0_SSE2) != 0) | 96 | if ((edx & IA32CAP_MASK0_SSE2) != 0) |
93 | caps |= CPUCAP_MASK_SSE2; | 97 | caps |= CPUCAP_MASK_SSE2; |
94 | 98 | ||
95 | if ((ecx & IA32CAP_MASK1_AESNI) != 0) | 99 | if ((ecx & IA32CAP_MASK1_AESNI) != 0) { |
96 | caps |= CPUCAP_MASK_AESNI; | 100 | caps |= CPUCAP_MASK_AESNI; |
101 | crypto_cpu_caps_i386 |= CRYPTO_CPU_CAPS_I386_AES; | ||
102 | } | ||
97 | if ((ecx & IA32CAP_MASK1_PCLMUL) != 0) | 103 | if ((ecx & IA32CAP_MASK1_PCLMUL) != 0) |
98 | caps |= CPUCAP_MASK_PCLMUL; | 104 | caps |= CPUCAP_MASK_PCLMUL; |
99 | if ((ecx & IA32CAP_MASK1_SSSE3) != 0) | 105 | if ((ecx & IA32CAP_MASK1_SSSE3) != 0) |