From 01b512a85a1dee836bfcfcb0c73f0ff66df54ccf Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sun, 15 Jun 2025 14:16:11 +0000 Subject: Provide CRYPTO_CPU_CAPS_AMD64_AES in machine dependent CPU capabilities. ok tb@ --- src/lib/libcrypto/arch/amd64/crypto_arch.h | 5 +++-- src/lib/libcrypto/arch/amd64/crypto_cpu_caps.c | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/lib/libcrypto') diff --git a/src/lib/libcrypto/arch/amd64/crypto_arch.h b/src/lib/libcrypto/arch/amd64/crypto_arch.h index 951374250d..da1a22e003 100644 --- a/src/lib/libcrypto/arch/amd64/crypto_arch.h +++ b/src/lib/libcrypto/arch/amd64/crypto_arch.h @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto_arch.h,v 1.5 2025/02/14 12:01:58 jsing Exp $ */ +/* $OpenBSD: crypto_arch.h,v 1.6 2025/06/15 14:16:11 jsing Exp $ */ /* * Copyright (c) 2024 Joel Sing * @@ -27,7 +27,8 @@ extern uint64_t crypto_cpu_caps_amd64; #endif -#define CRYPTO_CPU_CAPS_AMD64_SHA (1ULL << 0) +#define CRYPTO_CPU_CAPS_AMD64_AES (1ULL << 0) +#define CRYPTO_CPU_CAPS_AMD64_SHA (1ULL << 1) #ifndef OPENSSL_NO_ASM diff --git a/src/lib/libcrypto/arch/amd64/crypto_cpu_caps.c b/src/lib/libcrypto/arch/amd64/crypto_cpu_caps.c index 63b7b64cda..942454badd 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 @@ -/* $OpenBSD: crypto_cpu_caps.c,v 1.4 2024/11/16 13:05:35 jsing Exp $ */ +/* $OpenBSD: crypto_cpu_caps.c,v 1.5 2025/06/15 14:16:11 jsing Exp $ */ /* * Copyright (c) 2024 Joel Sing * @@ -98,8 +98,10 @@ crypto_cpu_caps_init(void) if ((edx & IA32CAP_MASK0_SSE2) != 0) caps |= CPUCAP_MASK_SSE2; - if ((ecx & IA32CAP_MASK1_AESNI) != 0) + if ((ecx & IA32CAP_MASK1_AESNI) != 0) { caps |= CPUCAP_MASK_AESNI; + crypto_cpu_caps_amd64 |= CRYPTO_CPU_CAPS_AMD64_AES; + } if ((ecx & IA32CAP_MASK1_PCLMUL) != 0) caps |= CPUCAP_MASK_PCLMUL; if ((ecx & IA32CAP_MASK1_SSSE3) != 0) -- cgit v1.2.3-55-g6feb