summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/arch/amd64/crypto_arch.h
diff options
context:
space:
mode:
authorjsing <>2024-10-18 13:36:24 +0000
committerjsing <>2024-10-18 13:36:24 +0000
commit8ca2cf944a22a441df7aea76d387ae44564b6b72 (patch)
tree9f24e49a607732139a986f4abb3735d101835046 /src/lib/libcrypto/arch/amd64/crypto_arch.h
parente6bf2a143492c14e535a08bc31d4d0766f703f1a (diff)
downloadopenbsd-8ca2cf944a22a441df7aea76d387ae44564b6b72.tar.gz
openbsd-8ca2cf944a22a441df7aea76d387ae44564b6b72.tar.bz2
openbsd-8ca2cf944a22a441df7aea76d387ae44564b6b72.zip
Provide crypto_cpu_caps_init() for amd64.
This is a CPU capability detection implementation in C, with minimal inline assembly (for cpuid and xgetbv). This replaces the assembly mess generated by x86_64cpuid.pl. Rather than populating OPENSSL_ia32cap_P directly with CPUID output, just set the bits that the remaining perlasm checks (namely AESNI, AVX, FXSR, INTEL, HT, MMX, PCLMUL, SSE, SSE2 and SSSE3). ok joshua@ tb@
Diffstat (limited to 'src/lib/libcrypto/arch/amd64/crypto_arch.h')
-rw-r--r--src/lib/libcrypto/arch/amd64/crypto_arch.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/arch/amd64/crypto_arch.h b/src/lib/libcrypto/arch/amd64/crypto_arch.h
index 8e91c25529..6feeaa209e 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.1 2024/08/11 13:02:39 jsing Exp $ */ 1/* $OpenBSD: crypto_arch.h,v 1.2 2024/10/18 13:36:24 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -18,6 +18,8 @@
18#ifndef HEADER_CRYPTO_ARCH_H 18#ifndef HEADER_CRYPTO_ARCH_H
19#define HEADER_CRYPTO_ARCH_H 19#define HEADER_CRYPTO_ARCH_H
20 20
21#define HAVE_CRYPTO_CPU_CAPS_INIT
22
21#ifndef OPENSSL_NO_ASM 23#ifndef OPENSSL_NO_ASM
22 24
23#define HAVE_AES_CBC_ENCRYPT_INTERNAL 25#define HAVE_AES_CBC_ENCRYPT_INTERNAL