summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/arch/arm/arm_arch.h
diff options
context:
space:
mode:
authorjsing <>2025-05-24 07:07:18 +0000
committerjsing <>2025-05-24 07:07:18 +0000
commit8ed7978ba9261ae91449f542e06d0cd25c7e1b62 (patch)
tree236cfffcebf0e6f3642a69eda1a0bf667229950e /src/lib/libcrypto/arch/arm/arm_arch.h
parent5cff19849712572985ae477d2a126ea82eb5a96c (diff)
downloadopenbsd-8ed7978ba9261ae91449f542e06d0cd25c7e1b62.tar.gz
openbsd-8ed7978ba9261ae91449f542e06d0cd25c7e1b62.tar.bz2
openbsd-8ed7978ba9261ae91449f542e06d0cd25c7e1b62.zip
Disable libcrypto assembly on arm.
The arm CPU capability detection is uses SIGILL and is unsafe to call from some contexts. Furthermore, this is only useful to detect NEON support, which is then unused on OpenBSD due to __STRICT_ALIGNMENT. Requiring a minimum of ARMv7+VFP+NEON is also not unreasonable. The SHA-1, SHA-256 and SHA-512 (non-NEON) C code performs within ~5% of the assembly, as does RSA when using the C based Montgomery multiplication. The C versions of AES and GHASH code are around ~40-50% of the assembly, howeer if you care about performance you really want to use Chacha20Poly1305 on this platform. This will enable further clean up to proceed. ok joshua@ kinjiro@ tb@
Diffstat (limited to 'src/lib/libcrypto/arch/arm/arm_arch.h')
-rw-r--r--src/lib/libcrypto/arch/arm/arm_arch.h59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/lib/libcrypto/arch/arm/arm_arch.h b/src/lib/libcrypto/arch/arm/arm_arch.h
deleted file mode 100644
index 5ac3b935f1..0000000000
--- a/src/lib/libcrypto/arch/arm/arm_arch.h
+++ /dev/null
@@ -1,59 +0,0 @@
1/* $OpenBSD: arm_arch.h,v 1.1 2022/03/23 15:13:31 tb Exp $ */
2#ifndef __ARM_ARCH_H__
3#define __ARM_ARCH_H__
4
5#if !defined(__ARM_ARCH__)
6# if defined(__CC_ARM)
7# define __ARM_ARCH__ __TARGET_ARCH_ARM
8# if defined(__BIG_ENDIAN)
9# define __ARMEB__
10# else
11# define __ARMEL__
12# endif
13# elif defined(__GNUC__)
14 /*
15 * Why doesn't gcc define __ARM_ARCH__? Instead it defines
16 * bunch of below macros. See all_architectures[] table in
17 * gcc/config/arm/arm.c. On a side note it defines
18 * __ARMEL__/__ARMEB__ for little-/big-endian.
19 */
20# if defined(__ARM_ARCH)
21# define __ARM_ARCH__ __ARM_ARCH
22# elif defined(__ARM_ARCH_8A__)
23# define __ARM_ARCH__ 8
24# elif defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
25 defined(__ARM_ARCH_7R__)|| defined(__ARM_ARCH_7M__) || \
26 defined(__ARM_ARCH_7EM__)
27# define __ARM_ARCH__ 7
28# elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
29 defined(__ARM_ARCH_6K__)|| defined(__ARM_ARCH_6M__) || \
30 defined(__ARM_ARCH_6Z__)|| defined(__ARM_ARCH_6ZK__) || \
31 defined(__ARM_ARCH_6T2__)
32# define __ARM_ARCH__ 6
33# elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \
34 defined(__ARM_ARCH_5E__)|| defined(__ARM_ARCH_5TE__) || \
35 defined(__ARM_ARCH_5TEJ__)
36# define __ARM_ARCH__ 5
37# elif defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
38# define __ARM_ARCH__ 4
39# else
40# error "unsupported ARM architecture"
41# endif
42# endif
43#endif
44
45#if !defined(__ASSEMBLER__)
46extern unsigned int OPENSSL_armcap_P;
47
48#define ARMV7_NEON (1<<0)
49#define ARMV8_AES (1<<1)
50#define ARMV8_SHA1 (1<<2)
51#define ARMV8_SHA256 (1<<3)
52#define ARMV8_PMULL (1<<4)
53#endif
54
55#if defined(__OpenBSD__)
56#define __STRICT_ALIGNMENT
57#endif
58
59#endif