From eb8dd9dca1228af0cd132f515509051ecfabf6f6 Mon Sep 17 00:00:00 2001 From: cvs2svn Date: Mon, 14 Apr 2025 17:32:06 +0000 Subject: This commit was manufactured by cvs2git to create tag 'tb_20250414'. --- src/lib/libcrypto/arch/arm/Makefile.inc | 28 ------ src/lib/libcrypto/arch/arm/arm_arch.h | 59 ------------ src/lib/libcrypto/arch/arm/armcap.c | 88 ------------------ src/lib/libcrypto/arch/arm/armv4cpuid.S | 69 -------------- src/lib/libcrypto/arch/arm/crypto_arch.h | 39 -------- src/lib/libcrypto/arch/arm/opensslconf.h | 154 ------------------------------- 6 files changed, 437 deletions(-) delete mode 100644 src/lib/libcrypto/arch/arm/Makefile.inc delete mode 100644 src/lib/libcrypto/arch/arm/arm_arch.h delete mode 100644 src/lib/libcrypto/arch/arm/armcap.c delete mode 100644 src/lib/libcrypto/arch/arm/armv4cpuid.S delete mode 100644 src/lib/libcrypto/arch/arm/crypto_arch.h delete mode 100644 src/lib/libcrypto/arch/arm/opensslconf.h (limited to 'src/lib/libcrypto/arch/arm') diff --git a/src/lib/libcrypto/arch/arm/Makefile.inc b/src/lib/libcrypto/arch/arm/Makefile.inc deleted file mode 100644 index e078c51d98..0000000000 --- a/src/lib/libcrypto/arch/arm/Makefile.inc +++ /dev/null @@ -1,28 +0,0 @@ -# $oPenBSD: Makefile.inc,v 1.2 2014/05/02 18:21:39 miod Exp $ - -# arm-specific libcrypto build rules - -# aes -CFLAGS+= -DAES_ASM -SSLASM+= aes aes-armv4 -# bn -CFLAGS+= -DOPENSSL_BN_ASM_MONT -SSLASM+= bn armv4-mont -# modes -CFLAGS+= -DGHASH_ASM -SSLASM+= modes ghash-armv4 -# sha -SSLASM+= sha sha1-armv4-large -SSLASM+= sha sha256-armv4 -SSLASM+= sha sha512-armv4 - -.for dir f in ${SSLASM} -SRCS+= ${f}.S -GENERATED+=${f}.S -${f}.S: ${LCRYPTO_SRC}/${dir}/asm/${f}.pl - /usr/bin/perl \ - ${LCRYPTO_SRC}/${dir}/asm/${f}.pl void ${.TARGET} > ${.TARGET} -.endfor - -CFLAGS+= -DOPENSSL_CPUID_OBJ -SRCS+= armv4cpuid.S armcap.c 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 @@ -/* $OpenBSD: arm_arch.h,v 1.1 2022/03/23 15:13:31 tb Exp $ */ -#ifndef __ARM_ARCH_H__ -#define __ARM_ARCH_H__ - -#if !defined(__ARM_ARCH__) -# if defined(__CC_ARM) -# define __ARM_ARCH__ __TARGET_ARCH_ARM -# if defined(__BIG_ENDIAN) -# define __ARMEB__ -# else -# define __ARMEL__ -# endif -# elif defined(__GNUC__) - /* - * Why doesn't gcc define __ARM_ARCH__? Instead it defines - * bunch of below macros. See all_architectures[] table in - * gcc/config/arm/arm.c. On a side note it defines - * __ARMEL__/__ARMEB__ for little-/big-endian. - */ -# if defined(__ARM_ARCH) -# define __ARM_ARCH__ __ARM_ARCH -# elif defined(__ARM_ARCH_8A__) -# define __ARM_ARCH__ 8 -# elif defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \ - defined(__ARM_ARCH_7R__)|| defined(__ARM_ARCH_7M__) || \ - defined(__ARM_ARCH_7EM__) -# define __ARM_ARCH__ 7 -# elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \ - defined(__ARM_ARCH_6K__)|| defined(__ARM_ARCH_6M__) || \ - defined(__ARM_ARCH_6Z__)|| defined(__ARM_ARCH_6ZK__) || \ - defined(__ARM_ARCH_6T2__) -# define __ARM_ARCH__ 6 -# elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \ - defined(__ARM_ARCH_5E__)|| defined(__ARM_ARCH_5TE__) || \ - defined(__ARM_ARCH_5TEJ__) -# define __ARM_ARCH__ 5 -# elif defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) -# define __ARM_ARCH__ 4 -# else -# error "unsupported ARM architecture" -# endif -# endif -#endif - -#if !defined(__ASSEMBLER__) -extern unsigned int OPENSSL_armcap_P; - -#define ARMV7_NEON (1<<0) -#define ARMV8_AES (1<<1) -#define ARMV8_SHA1 (1<<2) -#define ARMV8_SHA256 (1<<3) -#define ARMV8_PMULL (1<<4) -#endif - -#if defined(__OpenBSD__) -#define __STRICT_ALIGNMENT -#endif - -#endif diff --git a/src/lib/libcrypto/arch/arm/armcap.c b/src/lib/libcrypto/arch/arm/armcap.c deleted file mode 100644 index 0238195397..0000000000 --- a/src/lib/libcrypto/arch/arm/armcap.c +++ /dev/null @@ -1,88 +0,0 @@ -/* $OpenBSD: armcap.c,v 1.3 2024/08/29 03:30:05 deraadt Exp $ */ -#include -#include -#include -#include -#include -#include - -#include "arm_arch.h" - -unsigned int OPENSSL_armcap_P; - -#if __ARM_ARCH__ >= 7 -static sigset_t all_masked; - -static sigjmp_buf ill_jmp; - -static void -ill_handler(int sig) -{ - siglongjmp(ill_jmp, sig); -} - -/* - * Following subroutines could have been inlined, but it's not all - * ARM compilers support inline assembler... - */ -void _armv7_neon_probe(void); -void _armv8_aes_probe(void); -void _armv8_sha1_probe(void); -void _armv8_sha256_probe(void); -void _armv8_pmull_probe(void); -#endif - -void -OPENSSL_cpuid_setup(void) -{ -#if __ARM_ARCH__ >= 7 - struct sigaction ill_oact, ill_act; - sigset_t oset; -#endif - static int trigger = 0; - - if (trigger) - return; - trigger = 1; - - OPENSSL_armcap_P = 0; - -#if __ARM_ARCH__ >= 7 - sigfillset(&all_masked); - sigdelset(&all_masked, SIGILL); - sigdelset(&all_masked, SIGTRAP); - sigdelset(&all_masked, SIGFPE); - sigdelset(&all_masked, SIGBUS); - sigdelset(&all_masked, SIGSEGV); - - memset(&ill_act, 0, sizeof(ill_act)); - ill_act.sa_handler = ill_handler; - ill_act.sa_mask = all_masked; - - sigprocmask(SIG_SETMASK, &ill_act.sa_mask, &oset); - sigaction(SIGILL, &ill_act, &ill_oact); - - if (sigsetjmp(ill_jmp, 1) == 0) { - _armv7_neon_probe(); - OPENSSL_armcap_P |= ARMV7_NEON; - if (sigsetjmp(ill_jmp, 1) == 0) { - _armv8_pmull_probe(); - OPENSSL_armcap_P |= ARMV8_PMULL | ARMV8_AES; - } else if (sigsetjmp(ill_jmp, 1) == 0) { - _armv8_aes_probe(); - OPENSSL_armcap_P |= ARMV8_AES; - } - if (sigsetjmp(ill_jmp, 1) == 0) { - _armv8_sha1_probe(); - OPENSSL_armcap_P |= ARMV8_SHA1; - } - if (sigsetjmp(ill_jmp, 1) == 0) { - _armv8_sha256_probe(); - OPENSSL_armcap_P |= ARMV8_SHA256; - } - } - - sigaction (SIGILL, &ill_oact, NULL); - sigprocmask(SIG_SETMASK, &oset, NULL); -#endif -} diff --git a/src/lib/libcrypto/arch/arm/armv4cpuid.S b/src/lib/libcrypto/arch/arm/armv4cpuid.S deleted file mode 100644 index db0b54e496..0000000000 --- a/src/lib/libcrypto/arch/arm/armv4cpuid.S +++ /dev/null @@ -1,69 +0,0 @@ -#include "arm_arch.h" - -.text -#if defined(__thumb2__) && !defined(__APPLE__) -.syntax unified -.thumb -#else -.code 32 -#undef __thumb2__ -#endif - -#if __ARM_ARCH__>=7 -.arch armv7-a -.fpu neon - -.align 5 -.globl _armv7_neon_probe -.type _armv7_neon_probe,%function -_armv7_neon_probe: - vorr q0,q0,q0 - bx lr -.size _armv7_neon_probe,.-_armv7_neon_probe - -.globl _armv8_aes_probe -.type _armv8_aes_probe,%function -_armv8_aes_probe: -#if defined(__thumb2__) && !defined(__APPLE__) -.byte 0xb0,0xff,0x00,0x03 @ aese.8 q0,q0 -#else -.byte 0x00,0x03,0xb0,0xf3 @ aese.8 q0,q0 -#endif - bx lr -.size _armv8_aes_probe,.-_armv8_aes_probe - -.globl _armv8_sha1_probe -.type _armv8_sha1_probe,%function -_armv8_sha1_probe: -#if defined(__thumb2__) && !defined(__APPLE__) -.byte 0x00,0xef,0x40,0x0c @ sha1c.32 q0,q0,q0 -#else -.byte 0x40,0x0c,0x00,0xf2 @ sha1c.32 q0,q0,q0 -#endif - bx lr -.size _armv8_sha1_probe,.-_armv8_sha1_probe - -.globl _armv8_sha256_probe -.type _armv8_sha256_probe,%function -_armv8_sha256_probe: -#if defined(__thumb2__) && !defined(__APPLE__) -.byte 0x00,0xff,0x40,0x0c @ sha256h.32 q0,q0,q0 -#else -.byte 0x40,0x0c,0x00,0xf3 @ sha256h.32 q0,q0,q0 -#endif - bx lr -.size _armv8_sha256_probe,.-_armv8_sha256_probe -.globl _armv8_pmull_probe -.type _armv8_pmull_probe,%function -_armv8_pmull_probe: -#if defined(__thumb2__) && !defined(__APPLE__) -.byte 0xa0,0xef,0x00,0x0e @ vmull.p64 q0,d0,d0 -#else -.byte 0x00,0x0e,0xa0,0xf2 @ vmull.p64 q0,d0,d0 -#endif - bx lr -.size _armv8_pmull_probe,.-_armv8_pmull_probe -#endif - -.comm OPENSSL_armcap_P,4,4 -.hidden OPENSSL_armcap_P diff --git a/src/lib/libcrypto/arch/arm/crypto_arch.h b/src/lib/libcrypto/arch/arm/crypto_arch.h deleted file mode 100644 index 07d7829fe3..0000000000 --- a/src/lib/libcrypto/arch/arm/crypto_arch.h +++ /dev/null @@ -1,39 +0,0 @@ -/* $OpenBSD: crypto_arch.h,v 1.2 2025/02/14 12:01:58 jsing Exp $ */ -/* - * Copyright (c) 2024 Joel Sing - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef HEADER_CRYPTO_ARCH_H -#define HEADER_CRYPTO_ARCH_H - -#ifndef OPENSSL_NO_ASM - -#define HAVE_AES_SET_ENCRYPT_KEY_INTERNAL -#define HAVE_AES_SET_DECRYPT_KEY_INTERNAL -#define HAVE_AES_ENCRYPT_INTERNAL -#define HAVE_AES_DECRYPT_INTERNAL - -#define HAVE_SHA1_BLOCK_DATA_ORDER -#define HAVE_SHA1_BLOCK_GENERIC - -#define HAVE_SHA256_BLOCK_DATA_ORDER -#define HAVE_SHA256_BLOCK_GENERIC - -#define HAVE_SHA512_BLOCK_DATA_ORDER -#define HAVE_SHA512_BLOCK_GENERIC - -#endif - -#endif diff --git a/src/lib/libcrypto/arch/arm/opensslconf.h b/src/lib/libcrypto/arch/arm/opensslconf.h deleted file mode 100644 index a5d26b6fdc..0000000000 --- a/src/lib/libcrypto/arch/arm/opensslconf.h +++ /dev/null @@ -1,154 +0,0 @@ -#include -/* crypto/opensslconf.h.in */ - -#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) -#define OPENSSLDIR "/etc/ssl" -#endif - -#undef OPENSSL_EXPORT_VAR_AS_FUNCTION - -#ifndef OPENSSL_FILE -#ifdef OPENSSL_NO_FILENAMES -#define OPENSSL_FILE "" -#define OPENSSL_LINE 0 -#else -#define OPENSSL_FILE __FILE__ -#define OPENSSL_LINE __LINE__ -#endif -#endif - -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_INT unsigned int -#endif - -#if defined(HEADER_MD2_H) && !defined(MD2_INT) -#define MD2_INT unsigned int -#endif - -#if defined(HEADER_RC2_H) && !defined(RC2_INT) -/* I need to put in a mod for the alpha - eay */ -#define RC2_INT unsigned int -#endif - -#if defined(HEADER_RC4_H) -#if !defined(RC4_INT) -/* using int types make the structure larger but make the code faster - * on most boxes I have tested - up to %20 faster. */ -/* - * I don't know what does "most" mean, but declaring "int" is a must on: - * - Intel P6 because partial register stalls are very expensive; - * - elder Alpha because it lacks byte load/store instructions; - */ -#define RC4_INT unsigned int -#endif -#if !defined(RC4_CHUNK) -/* - * This enables code handling data aligned at natural CPU word - * boundary. See crypto/rc4/rc4_enc.c for further details. - */ -#undef RC4_CHUNK -#endif -#endif - -#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) -/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a - * %20 speed up (longs are 8 bytes, int's are 4). */ -#ifndef DES_LONG -#define DES_LONG unsigned int -#endif -#endif - -#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) -#define CONFIG_HEADER_BN_H -#define BN_LLONG - -/* Should we define BN_DIV2W here? */ - -/* Only one for the following should be defined */ -/* The prime number generation stuff may not work when - * EIGHT_BIT but I don't care since I've only used this mode - * for debugging the bignum libraries */ -#undef SIXTY_FOUR_BIT_LONG -#undef SIXTY_FOUR_BIT -#define THIRTY_TWO_BIT -#undef SIXTEEN_BIT -#undef EIGHT_BIT -#endif - -#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) -#define CONFIG_HEADER_BF_LOCL_H -#undef BF_PTR -#endif /* HEADER_BF_LOCL_H */ - -#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) -#define CONFIG_HEADER_DES_LOCL_H -#ifndef DES_DEFAULT_OPTIONS -/* the following is tweaked from a config script, that is why it is a - * protected undef/define */ -#ifndef DES_PTR -#undef DES_PTR -#endif - -/* This helps C compiler generate the correct code for multiple functional - * units. It reduces register dependencies at the expense of 2 more - * registers */ -#ifndef DES_RISC1 -#undef DES_RISC1 -#endif - -#ifndef DES_RISC2 -#undef DES_RISC2 -#endif - -#if defined(DES_RISC1) && defined(DES_RISC2) -YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! -#endif - -/* Unroll the inner loop, this sometimes helps, sometimes hinders. - * Very much CPU dependent */ -#ifndef DES_UNROLL -#define DES_UNROLL -#endif - -/* These default values were supplied by - * Peter Gutman - * They are only used if nothing else has been defined */ -#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) -/* Special defines which change the way the code is built depending on the - CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find - even newer MIPS CPU's, but at the moment one size fits all for - optimization options. Older Sparc's work better with only UNROLL, but - there's no way to tell at compile time what it is you're running on */ - -#if defined( sun ) /* Newer Sparc's */ -# define DES_PTR -# define DES_RISC1 -# define DES_UNROLL -#elif defined( __ultrix ) /* Older MIPS */ -# define DES_PTR -# define DES_RISC2 -# define DES_UNROLL -#elif defined( __osf1__ ) /* Alpha */ -# define DES_PTR -# define DES_RISC2 -#elif defined ( _AIX ) /* RS6000 */ - /* Unknown */ -#elif defined( __hpux ) /* HP-PA */ - /* Unknown */ -#elif defined( __aux ) /* 68K */ - /* Unknown */ -#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ -# define DES_UNROLL -#elif defined( __sgi ) /* Newer MIPS */ -# define DES_PTR -# define DES_RISC2 -# define DES_UNROLL -#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ -# define DES_PTR -# define DES_RISC1 -# define DES_UNROLL -#endif /* Systems-specific speed defines */ -#endif - -#endif /* DES_DEFAULT_OPTIONS */ -#endif /* HEADER_DES_LOCL_H */ -- cgit v1.2.3-55-g6feb