summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2025-06-28 12:20:39 +0000
committerjsing <>2025-06-28 12:20:39 +0000
commiteb97ecd403152f20801799509a51fed03b7aa451 (patch)
treefec7b6fce7f03b0d7e349ca966b8d90f9918667b /src
parent46423017b02650c68ef2ac67a7c84b1a34ce9679 (diff)
downloadopenbsd-eb97ecd403152f20801799509a51fed03b7aa451.tar.gz
openbsd-eb97ecd403152f20801799509a51fed03b7aa451.tar.bz2
openbsd-eb97ecd403152f20801799509a51fed03b7aa451.zip
Add CLMUL to machine dependent CPU capabilities for amd64.
ok tb@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/arch/amd64/crypto_arch.h5
-rw-r--r--src/lib/libcrypto/arch/amd64/crypto_cpu_caps.c6
2 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/libcrypto/arch/amd64/crypto_arch.h b/src/lib/libcrypto/arch/amd64/crypto_arch.h
index 9eb99229d1..213a5d903e 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.7 2025/06/27 17:10:45 jsing Exp $ */ 1/* $OpenBSD: crypto_arch.h,v 1.8 2025/06/28 12:20:39 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -28,7 +28,8 @@ extern uint64_t crypto_cpu_caps_amd64;
28#endif 28#endif
29 29
30#define CRYPTO_CPU_CAPS_AMD64_AES (1ULL << 0) 30#define CRYPTO_CPU_CAPS_AMD64_AES (1ULL << 0)
31#define CRYPTO_CPU_CAPS_AMD64_SHA (1ULL << 1) 31#define CRYPTO_CPU_CAPS_AMD64_CLMUL (1ULL << 1)
32#define CRYPTO_CPU_CAPS_AMD64_SHA (1ULL << 2)
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 942454badd..b7323be5d0 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.5 2025/06/15 14:16:11 jsing Exp $ */ 1/* $OpenBSD: crypto_cpu_caps.c,v 1.6 2025/06/28 12:20:39 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -102,8 +102,10 @@ crypto_cpu_caps_init(void)
102 caps |= CPUCAP_MASK_AESNI; 102 caps |= CPUCAP_MASK_AESNI;
103 crypto_cpu_caps_amd64 |= CRYPTO_CPU_CAPS_AMD64_AES; 103 crypto_cpu_caps_amd64 |= CRYPTO_CPU_CAPS_AMD64_AES;
104 } 104 }
105 if ((ecx & IA32CAP_MASK1_PCLMUL) != 0) 105 if ((ecx & IA32CAP_MASK1_PCLMUL) != 0) {
106 caps |= CPUCAP_MASK_PCLMUL; 106 caps |= CPUCAP_MASK_PCLMUL;
107 crypto_cpu_caps_amd64 |= CRYPTO_CPU_CAPS_AMD64_CLMUL;
108 }
107 if ((ecx & IA32CAP_MASK1_SSSE3) != 0) 109 if ((ecx & IA32CAP_MASK1_SSSE3) != 0)
108 caps |= CPUCAP_MASK_SSSE3; 110 caps |= CPUCAP_MASK_SSSE3;
109 111