From d69d10da5510517830f98435b4984052c2d21825 Mon Sep 17 00:00:00 2001 From: miod <> Date: Fri, 4 Nov 2016 13:56:05 +0000 Subject: Remove I386_ONLY define. It was only used to prefer a faster-on-genuine-80386-but-slower-on-80486-onwards innstruction sequence in the SHA512 code, and had not been enabled in years, if at all. ok tom@ bcook@ --- src/lib/libcrypto/arch/alpha/opensslconf.h | 3 --- src/lib/libcrypto/arch/amd64/opensslconf.h | 3 --- src/lib/libcrypto/arch/arm/opensslconf.h | 3 --- src/lib/libcrypto/arch/hppa/opensslconf.h | 3 --- src/lib/libcrypto/arch/i386/opensslconf.h | 3 --- src/lib/libcrypto/arch/m88k/opensslconf.h | 3 --- src/lib/libcrypto/arch/mips64/opensslconf.h | 3 --- src/lib/libcrypto/arch/powerpc/opensslconf.h | 3 --- src/lib/libcrypto/arch/sh/opensslconf.h | 3 --- src/lib/libcrypto/arch/sparc/opensslconf.h | 3 --- src/lib/libcrypto/arch/sparc64/opensslconf.h | 3 --- src/lib/libcrypto/cryptlib.c | 4 ++-- src/lib/libcrypto/engine/eng_padlock.c | 4 ++-- src/lib/libcrypto/evp/e_aes.c | 6 +++--- src/lib/libcrypto/md32_common.h | 6 +++--- src/lib/libcrypto/modes/gcm128.c | 5 ++--- src/lib/libcrypto/modes/modes_lcl.h | 4 ++-- src/lib/libcrypto/sha/sha512.c | 13 +------------ 18 files changed, 15 insertions(+), 60 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/arch/alpha/opensslconf.h b/src/lib/libcrypto/arch/alpha/opensslconf.h index a74c6df644..a1331118f4 100644 --- a/src/lib/libcrypto/arch/alpha/opensslconf.h +++ b/src/lib/libcrypto/arch/alpha/opensslconf.h @@ -1,9 +1,6 @@ #include /* crypto/opensslconf.h.in */ -/* Generate 80386 code? */ -#undef I386_ONLY - #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) #define OPENSSLDIR "/etc/ssl" #endif diff --git a/src/lib/libcrypto/arch/amd64/opensslconf.h b/src/lib/libcrypto/arch/amd64/opensslconf.h index cbd5d53ca4..f8cbb5d652 100644 --- a/src/lib/libcrypto/arch/amd64/opensslconf.h +++ b/src/lib/libcrypto/arch/amd64/opensslconf.h @@ -1,9 +1,6 @@ #include /* crypto/opensslconf.h.in */ -/* Generate 80386 code? */ -#undef I386_ONLY - #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) #define OPENSSLDIR "/etc/ssl" #endif diff --git a/src/lib/libcrypto/arch/arm/opensslconf.h b/src/lib/libcrypto/arch/arm/opensslconf.h index e3795ce73a..78cd6d856f 100644 --- a/src/lib/libcrypto/arch/arm/opensslconf.h +++ b/src/lib/libcrypto/arch/arm/opensslconf.h @@ -1,9 +1,6 @@ #include /* crypto/opensslconf.h.in */ -/* Generate 80386 code? */ -#undef I386_ONLY - #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) #define OPENSSLDIR "/etc/ssl" #endif diff --git a/src/lib/libcrypto/arch/hppa/opensslconf.h b/src/lib/libcrypto/arch/hppa/opensslconf.h index e3795ce73a..78cd6d856f 100644 --- a/src/lib/libcrypto/arch/hppa/opensslconf.h +++ b/src/lib/libcrypto/arch/hppa/opensslconf.h @@ -1,9 +1,6 @@ #include /* crypto/opensslconf.h.in */ -/* Generate 80386 code? */ -#undef I386_ONLY - #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) #define OPENSSLDIR "/etc/ssl" #endif diff --git a/src/lib/libcrypto/arch/i386/opensslconf.h b/src/lib/libcrypto/arch/i386/opensslconf.h index 37137ff102..bf439696d8 100644 --- a/src/lib/libcrypto/arch/i386/opensslconf.h +++ b/src/lib/libcrypto/arch/i386/opensslconf.h @@ -1,9 +1,6 @@ #include /* crypto/opensslconf.h.in */ -/* Generate 80386 code? */ -#undef I386_ONLY - #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) #define OPENSSLDIR "/etc/ssl" #endif diff --git a/src/lib/libcrypto/arch/m88k/opensslconf.h b/src/lib/libcrypto/arch/m88k/opensslconf.h index e3795ce73a..78cd6d856f 100644 --- a/src/lib/libcrypto/arch/m88k/opensslconf.h +++ b/src/lib/libcrypto/arch/m88k/opensslconf.h @@ -1,9 +1,6 @@ #include /* crypto/opensslconf.h.in */ -/* Generate 80386 code? */ -#undef I386_ONLY - #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) #define OPENSSLDIR "/etc/ssl" #endif diff --git a/src/lib/libcrypto/arch/mips64/opensslconf.h b/src/lib/libcrypto/arch/mips64/opensslconf.h index ef7a679d94..226951eded 100644 --- a/src/lib/libcrypto/arch/mips64/opensslconf.h +++ b/src/lib/libcrypto/arch/mips64/opensslconf.h @@ -1,9 +1,6 @@ #include /* crypto/opensslconf.h.in */ -/* Generate 80386 code? */ -#undef I386_ONLY - #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) #define OPENSSLDIR "/etc/ssl" #endif diff --git a/src/lib/libcrypto/arch/powerpc/opensslconf.h b/src/lib/libcrypto/arch/powerpc/opensslconf.h index e3795ce73a..78cd6d856f 100644 --- a/src/lib/libcrypto/arch/powerpc/opensslconf.h +++ b/src/lib/libcrypto/arch/powerpc/opensslconf.h @@ -1,9 +1,6 @@ #include /* crypto/opensslconf.h.in */ -/* Generate 80386 code? */ -#undef I386_ONLY - #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) #define OPENSSLDIR "/etc/ssl" #endif diff --git a/src/lib/libcrypto/arch/sh/opensslconf.h b/src/lib/libcrypto/arch/sh/opensslconf.h index e3795ce73a..78cd6d856f 100644 --- a/src/lib/libcrypto/arch/sh/opensslconf.h +++ b/src/lib/libcrypto/arch/sh/opensslconf.h @@ -1,9 +1,6 @@ #include /* crypto/opensslconf.h.in */ -/* Generate 80386 code? */ -#undef I386_ONLY - #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) #define OPENSSLDIR "/etc/ssl" #endif diff --git a/src/lib/libcrypto/arch/sparc/opensslconf.h b/src/lib/libcrypto/arch/sparc/opensslconf.h index e3795ce73a..78cd6d856f 100644 --- a/src/lib/libcrypto/arch/sparc/opensslconf.h +++ b/src/lib/libcrypto/arch/sparc/opensslconf.h @@ -1,9 +1,6 @@ #include /* crypto/opensslconf.h.in */ -/* Generate 80386 code? */ -#undef I386_ONLY - #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) #define OPENSSLDIR "/etc/ssl" #endif diff --git a/src/lib/libcrypto/arch/sparc64/opensslconf.h b/src/lib/libcrypto/arch/sparc64/opensslconf.h index ef7a679d94..226951eded 100644 --- a/src/lib/libcrypto/arch/sparc64/opensslconf.h +++ b/src/lib/libcrypto/arch/sparc64/opensslconf.h @@ -1,9 +1,6 @@ #include /* crypto/opensslconf.h.in */ -/* Generate 80386 code? */ -#undef I386_ONLY - #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) #define OPENSSLDIR "/etc/ssl" #endif diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c index 0f2c5970bc..fa091fbaea 100644 --- a/src/lib/libcrypto/cryptlib.c +++ b/src/lib/libcrypto/cryptlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptlib.c,v 1.37 2015/09/13 16:56:11 miod Exp $ */ +/* $OpenBSD: cryptlib.c,v 1.38 2016/11/04 13:56:04 miod Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -635,7 +635,7 @@ OPENSSL_cpu_caps(void) return *(uint64_t *)OPENSSL_ia32cap_P; } -#if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) && !defined(I386_ONLY) +#if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) #define OPENSSL_CPUID_SETUP typedef unsigned long long IA32CAP; void diff --git a/src/lib/libcrypto/engine/eng_padlock.c b/src/lib/libcrypto/engine/eng_padlock.c index 1c86a343df..4f2d426a06 100644 --- a/src/lib/libcrypto/engine/eng_padlock.c +++ b/src/lib/libcrypto/engine/eng_padlock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eng_padlock.c,v 1.14 2015/02/07 13:19:15 doug Exp $ */ +/* $OpenBSD: eng_padlock.c,v 1.15 2016/11/04 13:56:05 miod Exp $ */ /* * Support for VIA PadLock Advanced Cryptography Engine (ACE) * Written by Michal Ludvig @@ -100,7 +100,7 @@ In addition, because of the heavy use of inline assembler, compiler choice is limited to GCC and Microsoft C. */ #undef COMPILE_HW_PADLOCK -#if !defined(I386_ONLY) && !defined(OPENSSL_NO_INLINE_ASM) +#if !defined(OPENSSL_NO_INLINE_ASM) # if (defined(__GNUC__) && (defined(__i386__) || defined(__i386))) # define COMPILE_HW_PADLOCK # endif diff --git a/src/lib/libcrypto/evp/e_aes.c b/src/lib/libcrypto/evp/e_aes.c index a6d48085c3..25199dca36 100644 --- a/src/lib/libcrypto/evp/e_aes.c +++ b/src/lib/libcrypto/evp/e_aes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_aes.c,v 1.29 2015/09/10 15:56:25 jsing Exp $ */ +/* $OpenBSD: e_aes.c,v 1.30 2016/11/04 13:56:05 miod Exp $ */ /* ==================================================================== * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. * @@ -143,14 +143,14 @@ void AES_xts_decrypt(const char *inp, char *out, size_t len, const AES_KEY *key1, const AES_KEY *key2, const unsigned char iv[16]); #endif -#if defined(AES_ASM) && !defined(I386_ONLY) && ( \ +#if defined(AES_ASM) && ( \ ((defined(__i386) || defined(__i386__) || \ defined(_M_IX86)) && defined(OPENSSL_IA32_SSE2))|| \ defined(__x86_64) || defined(__x86_64__) || \ defined(_M_AMD64) || defined(_M_X64) || \ defined(__INTEL__) ) -extern unsigned int OPENSSL_ia32cap_P[2]; +extern unsigned int OPENSSL_ia32cap_P[]; #ifdef VPAES_ASM #define VPAES_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(41-32))) diff --git a/src/lib/libcrypto/md32_common.h b/src/lib/libcrypto/md32_common.h index bad34d22d6..0dca61710f 100644 --- a/src/lib/libcrypto/md32_common.h +++ b/src/lib/libcrypto/md32_common.h @@ -1,4 +1,4 @@ -/* $OpenBSD: md32_common.h,v 1.21 2016/09/04 14:31:29 jsing Exp $ */ +/* $OpenBSD: md32_common.h,v 1.22 2016/11/04 13:56:04 miod Exp $ */ /* ==================================================================== * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. * @@ -152,8 +152,8 @@ static inline uint32_t ROTATE(uint32_t a, uint32_t n) #if defined(DATA_ORDER_IS_BIG_ENDIAN) #if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) -# if ((defined(__i386) || defined(__i386__)) && !defined(I386_ONLY)) || \ - (defined(__x86_64) || defined(__x86_64__)) +# if (defined(__i386) || defined(__i386__) || \ + defined(__x86_64) || defined(__x86_64__)) /* * This gives ~30-40% performance improvement in SHA-256 compiled * with gcc [on P4]. Well, first macro to be frank. We can pull diff --git a/src/lib/libcrypto/modes/gcm128.c b/src/lib/libcrypto/modes/gcm128.c index dd6d91e880..6f8a8dd7f4 100644 --- a/src/lib/libcrypto/modes/gcm128.c +++ b/src/lib/libcrypto/modes/gcm128.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gcm128.c,v 1.13 2015/09/10 15:56:25 jsing Exp $ */ +/* $OpenBSD: gcm128.c,v 1.14 2016/11/04 13:56:05 miod Exp $ */ /* ==================================================================== * Copyright (c) 2010 The OpenSSL Project. All rights reserved. * @@ -638,8 +638,7 @@ static void gcm_gmult_1bit(u64 Xi[2],const u64 H[2]) #endif #if TABLE_BITS==4 && defined(GHASH_ASM) -# if !defined(I386_ONLY) && \ - (defined(__i386) || defined(__i386__) || \ +# if (defined(__i386) || defined(__i386__) || \ defined(__x86_64) || defined(__x86_64__) || \ defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64)) # define GHASH_ASM_X86_OR_64 diff --git a/src/lib/libcrypto/modes/modes_lcl.h b/src/lib/libcrypto/modes/modes_lcl.h index 8e43e480fc..a90f4a2b37 100644 --- a/src/lib/libcrypto/modes/modes_lcl.h +++ b/src/lib/libcrypto/modes/modes_lcl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: modes_lcl.h,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ +/* $OpenBSD: modes_lcl.h,v 1.9 2016/11/04 13:56:05 miod Exp $ */ /* ==================================================================== * Copyright (c) 2010 The OpenSSL Project. All rights reserved. * @@ -34,7 +34,7 @@ typedef unsigned char u8; # define BSWAP4(x) ({ u32 ret=(x); \ asm ("bswapl %0" \ : "+r"(ret)); ret; }) -# elif (defined(__i386) || defined(__i386__)) && !defined(I386_ONLY) +# elif (defined(__i386) || defined(__i386__)) # define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \ asm ("bswapl %0; bswapl %1" \ : "+r"(hi),"+r"(lo)); \ diff --git a/src/lib/libcrypto/sha/sha512.c b/src/lib/libcrypto/sha/sha512.c index 7a55c0acc9..6b95cfa72e 100644 --- a/src/lib/libcrypto/sha/sha512.c +++ b/src/lib/libcrypto/sha/sha512.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha512.c,v 1.14 2015/09/10 15:56:26 jsing Exp $ */ +/* $OpenBSD: sha512.c,v 1.15 2016/11/04 13:56:05 miod Exp $ */ /* ==================================================================== * Copyright (c) 2004 The OpenSSL Project. All rights reserved * according to the OpenSSL license [found in ../../LICENSE]. @@ -320,23 +320,12 @@ static const SHA_LONG64 K512[80] = { : "=r"(ret) \ : "0"(ret)); ret; }) # elif (defined(__i386) || defined(__i386__)) -# if defined(I386_ONLY) -# define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\ - unsigned int hi=p[0],lo=p[1]; \ - asm("xchgb %%ah,%%al;xchgb %%dh,%%dl;"\ - "roll $16,%%eax; roll $16,%%edx; "\ - "xchgb %%ah,%%al;xchgb %%dh,%%dl;" \ - : "=a"(lo),"=d"(hi) \ - : "0"(lo),"1"(hi) : "cc"); \ - ((SHA_LONG64)hi)<<32|lo; }) -# else # define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\ unsigned int hi=p[0],lo=p[1]; \ asm ("bswapl %0; bswapl %1;" \ : "=r"(lo),"=r"(hi) \ : "0"(lo),"1"(hi)); \ ((SHA_LONG64)hi)<<32|lo; }) -# endif # elif (defined(_ARCH_PPC) && defined(__64BIT__)) || defined(_ARCH_PPC64) # define ROTR(a,n) ({ SHA_LONG64 ret; \ asm ("rotrdi %0,%1,%2" \ -- cgit v1.2.3-55-g6feb