From aebc753f454ae74fa2cf0f2a53f3ad3eaf7886d3 Mon Sep 17 00:00:00 2001 From: tb <> Date: Mon, 9 Jun 2025 14:37:49 +0000 Subject: Move (mostly) MI constants to proper headers Most of the constants here are only defined if a specific header is in scope. So move the machine-independent macros to those headers and lose the header guards. Most of these should actually be typedefs but let's change this when we're bumping the major since this technically has ABI impact. IDEA_INT RC2_INT and RC4_INT are always unsigned int DES_LONG is always unsigned int except on i386 This preserves the existing situation on OpenBSD. If you're using portable on i386 with a compiler that does not define __i386__, there's an ABI break. ok jsing --- src/lib/libcrypto/arch/aarch64/opensslconf.h | 32 -------------------------- src/lib/libcrypto/arch/alpha/opensslconf.h | 32 -------------------------- src/lib/libcrypto/arch/amd64/opensslconf.h | 32 -------------------------- src/lib/libcrypto/arch/arm/opensslconf.h | 32 -------------------------- src/lib/libcrypto/arch/hppa/opensslconf.h | 32 -------------------------- src/lib/libcrypto/arch/i386/opensslconf.h | 32 -------------------------- src/lib/libcrypto/arch/m88k/opensslconf.h | 32 -------------------------- src/lib/libcrypto/arch/mips64/opensslconf.h | 32 -------------------------- src/lib/libcrypto/arch/powerpc/opensslconf.h | 32 -------------------------- src/lib/libcrypto/arch/powerpc64/opensslconf.h | 32 -------------------------- src/lib/libcrypto/arch/riscv64/opensslconf.h | 32 -------------------------- src/lib/libcrypto/arch/sh/opensslconf.h | 24 ------------------- src/lib/libcrypto/arch/sparc64/opensslconf.h | 32 -------------------------- src/lib/libcrypto/crypto_local.h | 6 ++++- src/lib/libcrypto/des/des.h | 11 ++++++++- src/lib/libcrypto/idea/idea.h | 9 ++++++-- src/lib/libcrypto/rc2/rc2.h | 9 ++++++-- src/lib/libcrypto/rc4/rc4.h | 9 ++++++-- 18 files changed, 36 insertions(+), 416 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/arch/aarch64/opensslconf.h b/src/lib/libcrypto/arch/aarch64/opensslconf.h index 59555fa1df..3aaa6bd0b8 100644 --- a/src/lib/libcrypto/arch/aarch64/opensslconf.h +++ b/src/lib/libcrypto/arch/aarch64/opensslconf.h @@ -1,9 +1,4 @@ #include -/* crypto/opensslconf.h.in */ - -#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) -#define OPENSSLDIR "/etc/ssl" -#endif #undef OPENSSL_EXPORT_VAR_AS_FUNCTION @@ -17,26 +12,7 @@ #endif #endif -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_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 @@ -46,14 +22,6 @@ #endif #endif -#if 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 #undef BN_LLONG diff --git a/src/lib/libcrypto/arch/alpha/opensslconf.h b/src/lib/libcrypto/arch/alpha/opensslconf.h index e079b1bc6f..47756e45ef 100644 --- a/src/lib/libcrypto/arch/alpha/opensslconf.h +++ b/src/lib/libcrypto/arch/alpha/opensslconf.h @@ -1,9 +1,4 @@ #include -/* crypto/opensslconf.h.in */ - -#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) -#define OPENSSLDIR "/etc/ssl" -#endif #undef OPENSSL_EXPORT_VAR_AS_FUNCTION @@ -17,26 +12,7 @@ #endif #endif -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_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 @@ -46,14 +22,6 @@ #endif #endif -#if 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 #undef BN_LLONG diff --git a/src/lib/libcrypto/arch/amd64/opensslconf.h b/src/lib/libcrypto/arch/amd64/opensslconf.h index 59555fa1df..3aaa6bd0b8 100644 --- a/src/lib/libcrypto/arch/amd64/opensslconf.h +++ b/src/lib/libcrypto/arch/amd64/opensslconf.h @@ -1,9 +1,4 @@ #include -/* crypto/opensslconf.h.in */ - -#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) -#define OPENSSLDIR "/etc/ssl" -#endif #undef OPENSSL_EXPORT_VAR_AS_FUNCTION @@ -17,26 +12,7 @@ #endif #endif -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_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 @@ -46,14 +22,6 @@ #endif #endif -#if 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 #undef BN_LLONG diff --git a/src/lib/libcrypto/arch/arm/opensslconf.h b/src/lib/libcrypto/arch/arm/opensslconf.h index 576f49b0ec..ee2111390a 100644 --- a/src/lib/libcrypto/arch/arm/opensslconf.h +++ b/src/lib/libcrypto/arch/arm/opensslconf.h @@ -1,9 +1,4 @@ #include -/* crypto/opensslconf.h.in */ - -#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) -#define OPENSSLDIR "/etc/ssl" -#endif #undef OPENSSL_EXPORT_VAR_AS_FUNCTION @@ -17,26 +12,7 @@ #endif #endif -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_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 @@ -46,14 +22,6 @@ #endif #endif -#if 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 diff --git a/src/lib/libcrypto/arch/hppa/opensslconf.h b/src/lib/libcrypto/arch/hppa/opensslconf.h index 576f49b0ec..ee2111390a 100644 --- a/src/lib/libcrypto/arch/hppa/opensslconf.h +++ b/src/lib/libcrypto/arch/hppa/opensslconf.h @@ -1,9 +1,4 @@ #include -/* crypto/opensslconf.h.in */ - -#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) -#define OPENSSLDIR "/etc/ssl" -#endif #undef OPENSSL_EXPORT_VAR_AS_FUNCTION @@ -17,26 +12,7 @@ #endif #endif -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_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 @@ -46,14 +22,6 @@ #endif #endif -#if 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 diff --git a/src/lib/libcrypto/arch/i386/opensslconf.h b/src/lib/libcrypto/arch/i386/opensslconf.h index 538b5c9104..ee2111390a 100644 --- a/src/lib/libcrypto/arch/i386/opensslconf.h +++ b/src/lib/libcrypto/arch/i386/opensslconf.h @@ -1,9 +1,4 @@ #include -/* crypto/opensslconf.h.in */ - -#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) -#define OPENSSLDIR "/etc/ssl" -#endif #undef OPENSSL_EXPORT_VAR_AS_FUNCTION @@ -17,26 +12,7 @@ #endif #endif -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_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 @@ -46,14 +22,6 @@ #endif #endif -#if 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 long -#endif -#endif - #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) #define CONFIG_HEADER_BN_H #define BN_LLONG diff --git a/src/lib/libcrypto/arch/m88k/opensslconf.h b/src/lib/libcrypto/arch/m88k/opensslconf.h index 576f49b0ec..ee2111390a 100644 --- a/src/lib/libcrypto/arch/m88k/opensslconf.h +++ b/src/lib/libcrypto/arch/m88k/opensslconf.h @@ -1,9 +1,4 @@ #include -/* crypto/opensslconf.h.in */ - -#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) -#define OPENSSLDIR "/etc/ssl" -#endif #undef OPENSSL_EXPORT_VAR_AS_FUNCTION @@ -17,26 +12,7 @@ #endif #endif -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_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 @@ -46,14 +22,6 @@ #endif #endif -#if 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 diff --git a/src/lib/libcrypto/arch/mips64/opensslconf.h b/src/lib/libcrypto/arch/mips64/opensslconf.h index e079b1bc6f..47756e45ef 100644 --- a/src/lib/libcrypto/arch/mips64/opensslconf.h +++ b/src/lib/libcrypto/arch/mips64/opensslconf.h @@ -1,9 +1,4 @@ #include -/* crypto/opensslconf.h.in */ - -#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) -#define OPENSSLDIR "/etc/ssl" -#endif #undef OPENSSL_EXPORT_VAR_AS_FUNCTION @@ -17,26 +12,7 @@ #endif #endif -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_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 @@ -46,14 +22,6 @@ #endif #endif -#if 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 #undef BN_LLONG diff --git a/src/lib/libcrypto/arch/powerpc/opensslconf.h b/src/lib/libcrypto/arch/powerpc/opensslconf.h index 576f49b0ec..ee2111390a 100644 --- a/src/lib/libcrypto/arch/powerpc/opensslconf.h +++ b/src/lib/libcrypto/arch/powerpc/opensslconf.h @@ -1,9 +1,4 @@ #include -/* crypto/opensslconf.h.in */ - -#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) -#define OPENSSLDIR "/etc/ssl" -#endif #undef OPENSSL_EXPORT_VAR_AS_FUNCTION @@ -17,26 +12,7 @@ #endif #endif -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_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 @@ -46,14 +22,6 @@ #endif #endif -#if 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 diff --git a/src/lib/libcrypto/arch/powerpc64/opensslconf.h b/src/lib/libcrypto/arch/powerpc64/opensslconf.h index 59555fa1df..3aaa6bd0b8 100644 --- a/src/lib/libcrypto/arch/powerpc64/opensslconf.h +++ b/src/lib/libcrypto/arch/powerpc64/opensslconf.h @@ -1,9 +1,4 @@ #include -/* crypto/opensslconf.h.in */ - -#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) -#define OPENSSLDIR "/etc/ssl" -#endif #undef OPENSSL_EXPORT_VAR_AS_FUNCTION @@ -17,26 +12,7 @@ #endif #endif -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_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 @@ -46,14 +22,6 @@ #endif #endif -#if 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 #undef BN_LLONG diff --git a/src/lib/libcrypto/arch/riscv64/opensslconf.h b/src/lib/libcrypto/arch/riscv64/opensslconf.h index 59555fa1df..3aaa6bd0b8 100644 --- a/src/lib/libcrypto/arch/riscv64/opensslconf.h +++ b/src/lib/libcrypto/arch/riscv64/opensslconf.h @@ -1,9 +1,4 @@ #include -/* crypto/opensslconf.h.in */ - -#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) -#define OPENSSLDIR "/etc/ssl" -#endif #undef OPENSSL_EXPORT_VAR_AS_FUNCTION @@ -17,26 +12,7 @@ #endif #endif -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_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 @@ -46,14 +22,6 @@ #endif #endif -#if 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 #undef BN_LLONG diff --git a/src/lib/libcrypto/arch/sh/opensslconf.h b/src/lib/libcrypto/arch/sh/opensslconf.h index 576f49b0ec..57e562d776 100644 --- a/src/lib/libcrypto/arch/sh/opensslconf.h +++ b/src/lib/libcrypto/arch/sh/opensslconf.h @@ -1,9 +1,4 @@ #include -/* crypto/opensslconf.h.in */ - -#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) -#define OPENSSLDIR "/etc/ssl" -#endif #undef OPENSSL_EXPORT_VAR_AS_FUNCTION @@ -17,26 +12,7 @@ #endif #endif -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_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 diff --git a/src/lib/libcrypto/arch/sparc64/opensslconf.h b/src/lib/libcrypto/arch/sparc64/opensslconf.h index e079b1bc6f..47756e45ef 100644 --- a/src/lib/libcrypto/arch/sparc64/opensslconf.h +++ b/src/lib/libcrypto/arch/sparc64/opensslconf.h @@ -1,9 +1,4 @@ #include -/* crypto/opensslconf.h.in */ - -#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) -#define OPENSSLDIR "/etc/ssl" -#endif #undef OPENSSL_EXPORT_VAR_AS_FUNCTION @@ -17,26 +12,7 @@ #endif #endif -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_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 @@ -46,14 +22,6 @@ #endif #endif -#if 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 #undef BN_LLONG diff --git a/src/lib/libcrypto/crypto_local.h b/src/lib/libcrypto/crypto_local.h index d549102da0..606f17cefb 100644 --- a/src/lib/libcrypto/crypto_local.h +++ b/src/lib/libcrypto/crypto_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto_local.h,v 1.5 2025/05/24 07:23:14 jsing Exp $ */ +/* $OpenBSD: crypto_local.h,v 1.6 2025/06/09 14:37:48 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -65,6 +65,10 @@ extern "C" { #endif +#ifndef OPENSSLDIR +#define OPENSSLDIR "/etc/ssl" +#endif + #define X509_CERT_AREA OPENSSLDIR #define X509_CERT_DIR OPENSSLDIR "/certs" #define X509_CERT_FILE OPENSSLDIR "/cert.pem" diff --git a/src/lib/libcrypto/des/des.h b/src/lib/libcrypto/des/des.h index 277702f87b..4ff4ceca19 100644 --- a/src/lib/libcrypto/des/des.h +++ b/src/lib/libcrypto/des/des.h @@ -1,4 +1,4 @@ -/* $OpenBSD: des.h,v 1.24 2025/06/05 06:37:26 tb Exp $ */ +/* $OpenBSD: des.h,v 1.25 2025/06/09 14:37:49 tb Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -61,6 +61,15 @@ #include +#ifndef DES_LONG +/* XXX - typedef to int everywhere. */ +#ifdef __i386__ +#define DES_LONG unsigned long +#else +#define DES_LONG unsigned int +#endif +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/src/lib/libcrypto/idea/idea.h b/src/lib/libcrypto/idea/idea.h index 2bdd3647fd..fccef8fc73 100644 --- a/src/lib/libcrypto/idea/idea.h +++ b/src/lib/libcrypto/idea/idea.h @@ -1,4 +1,4 @@ -/* $OpenBSD: idea.h,v 1.13 2025/01/25 17:59:44 tb Exp $ */ +/* $OpenBSD: idea.h,v 1.14 2025/06/09 14:37:49 tb Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -59,7 +59,12 @@ #ifndef HEADER_IDEA_H #define HEADER_IDEA_H -#include /* IDEA_INT, OPENSSL_NO_IDEA */ +#include /* OPENSSL_NO_IDEA */ + +#ifndef IDEA_INT +/* XXX - typedef */ +#define IDEA_INT unsigned int +#endif #define IDEA_ENCRYPT 1 #define IDEA_DECRYPT 0 diff --git a/src/lib/libcrypto/rc2/rc2.h b/src/lib/libcrypto/rc2/rc2.h index 96e395f32d..ead308cf51 100644 --- a/src/lib/libcrypto/rc2/rc2.h +++ b/src/lib/libcrypto/rc2/rc2.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rc2.h,v 1.13 2025/01/25 17:59:44 tb Exp $ */ +/* $OpenBSD: rc2.h,v 1.14 2025/06/09 14:37:49 tb Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -59,7 +59,12 @@ #ifndef HEADER_RC2_H #define HEADER_RC2_H -#include /* OPENSSL_NO_RC2, RC2_INT */ +#include /* OPENSSL_NO_RC2 */ + +#ifndef RC2_INT +/* XXX - typedef */ +#define RC2_INT unsigned int +#endif #define RC2_ENCRYPT 1 #define RC2_DECRYPT 0 diff --git a/src/lib/libcrypto/rc4/rc4.h b/src/lib/libcrypto/rc4/rc4.h index a20472372b..c994b39a31 100644 --- a/src/lib/libcrypto/rc4/rc4.h +++ b/src/lib/libcrypto/rc4/rc4.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rc4.h,v 1.16 2025/01/25 17:59:44 tb Exp $ */ +/* $OpenBSD: rc4.h,v 1.17 2025/06/09 14:37:49 tb Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -59,10 +59,15 @@ #ifndef HEADER_RC4_H #define HEADER_RC4_H -#include /* OPENSSL_NO_RC4, RC4_INT */ +#include /* OPENSSL_NO_RC4 */ #include +#ifndef RC4_INT +/* XXX - typedef */ +#define RC4_INT unsigned int +#endif + #ifdef __cplusplus extern "C" { #endif -- cgit v1.2.3-55-g6feb