xref: /openbsd/lib/libcrypto/arch/sh/opensslconf.h (revision e0aac349)
12d03d1cbStedu #include <openssl/opensslfeatures.h>
2252ab50eSmiod /* crypto/opensslconf.h.in */
3252ab50eSmiod 
4*e0aac349Stb #if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR)
5252ab50eSmiod #define OPENSSLDIR "/etc/ssl"
6252ab50eSmiod #endif
7252ab50eSmiod 
8252ab50eSmiod #undef OPENSSL_EXPORT_VAR_AS_FUNCTION
9252ab50eSmiod 
10252ab50eSmiod #if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
11252ab50eSmiod #define IDEA_INT unsigned int
12252ab50eSmiod #endif
13252ab50eSmiod 
14252ab50eSmiod #if defined(HEADER_MD2_H) && !defined(MD2_INT)
15252ab50eSmiod #define MD2_INT unsigned int
16252ab50eSmiod #endif
17252ab50eSmiod 
18252ab50eSmiod #if defined(HEADER_RC2_H) && !defined(RC2_INT)
19252ab50eSmiod /* I need to put in a mod for the alpha - eay */
20252ab50eSmiod #define RC2_INT unsigned int
21252ab50eSmiod #endif
22252ab50eSmiod 
23252ab50eSmiod #if defined(HEADER_RC4_H)
24252ab50eSmiod #if !defined(RC4_INT)
25252ab50eSmiod /* using int types make the structure larger but make the code faster
26252ab50eSmiod  * on most boxes I have tested - up to %20 faster. */
27252ab50eSmiod /*
28252ab50eSmiod  * I don't know what does "most" mean, but declaring "int" is a must on:
29252ab50eSmiod  * - Intel P6 because partial register stalls are very expensive;
30252ab50eSmiod  * - elder Alpha because it lacks byte load/store instructions;
31252ab50eSmiod  */
32252ab50eSmiod #define RC4_INT unsigned int
33252ab50eSmiod #endif
34252ab50eSmiod #if !defined(RC4_CHUNK)
35252ab50eSmiod /*
36252ab50eSmiod  * This enables code handling data aligned at natural CPU word
37252ab50eSmiod  * boundary. See crypto/rc4/rc4_enc.c for further details.
38252ab50eSmiod  */
39252ab50eSmiod #undef RC4_CHUNK
40252ab50eSmiod #endif
41252ab50eSmiod #endif
42252ab50eSmiod 
43252ab50eSmiod #if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG)
44252ab50eSmiod /* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
45252ab50eSmiod  * %20 speed up (longs are 8 bytes, int's are 4). */
46252ab50eSmiod #ifndef DES_LONG
47252ab50eSmiod #define DES_LONG unsigned int
48252ab50eSmiod #endif
49252ab50eSmiod #endif
50252ab50eSmiod 
51252ab50eSmiod #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
52252ab50eSmiod #define CONFIG_HEADER_BN_H
53252ab50eSmiod #define BN_LLONG
54252ab50eSmiod 
55252ab50eSmiod /* Should we define BN_DIV2W here? */
56252ab50eSmiod 
57252ab50eSmiod /* Only one for the following should be defined */
58252ab50eSmiod /* The prime number generation stuff may not work when
59252ab50eSmiod  * EIGHT_BIT but I don't care since I've only used this mode
6071743258Sjmc  * for debugging the bignum libraries */
61252ab50eSmiod #undef SIXTY_FOUR_BIT_LONG
62252ab50eSmiod #undef SIXTY_FOUR_BIT
63252ab50eSmiod #define THIRTY_TWO_BIT
64252ab50eSmiod #undef SIXTEEN_BIT
65252ab50eSmiod #undef EIGHT_BIT
66252ab50eSmiod #endif
67252ab50eSmiod 
68252ab50eSmiod #if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
69252ab50eSmiod #define CONFIG_HEADER_RC4_LOCL_H
70252ab50eSmiod /* if this is defined data[i] is used instead of *data, this is a %20
71252ab50eSmiod  * speedup on x86 */
72252ab50eSmiod #define RC4_INDEX
73252ab50eSmiod #endif
74252ab50eSmiod 
75252ab50eSmiod #if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
76252ab50eSmiod #define CONFIG_HEADER_BF_LOCL_H
77252ab50eSmiod #undef BF_PTR
78252ab50eSmiod #endif /* HEADER_BF_LOCL_H */
79252ab50eSmiod 
80252ab50eSmiod #if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
81252ab50eSmiod #define CONFIG_HEADER_DES_LOCL_H
82252ab50eSmiod #ifndef DES_DEFAULT_OPTIONS
83252ab50eSmiod /* the following is tweaked from a config script, that is why it is a
84252ab50eSmiod  * protected undef/define */
85252ab50eSmiod #ifndef DES_PTR
86252ab50eSmiod #undef DES_PTR
87252ab50eSmiod #endif
88252ab50eSmiod 
89252ab50eSmiod /* This helps C compiler generate the correct code for multiple functional
9071743258Sjmc  * units.  It reduces register dependencies at the expense of 2 more
91252ab50eSmiod  * registers */
92252ab50eSmiod #ifndef DES_RISC1
93252ab50eSmiod #undef DES_RISC1
94252ab50eSmiod #endif
95252ab50eSmiod 
96252ab50eSmiod #ifndef DES_RISC2
97252ab50eSmiod #undef DES_RISC2
98252ab50eSmiod #endif
99252ab50eSmiod 
100252ab50eSmiod #if defined(DES_RISC1) && defined(DES_RISC2)
101252ab50eSmiod YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
102252ab50eSmiod #endif
103252ab50eSmiod 
104252ab50eSmiod /* Unroll the inner loop, this sometimes helps, sometimes hinders.
10571743258Sjmc  * Very much CPU dependent */
106252ab50eSmiod #ifndef DES_UNROLL
107252ab50eSmiod #define DES_UNROLL
108252ab50eSmiod #endif
109252ab50eSmiod 
110252ab50eSmiod /* These default values were supplied by
111252ab50eSmiod  * Peter Gutman <pgut001@cs.auckland.ac.nz>
112252ab50eSmiod  * They are only used if nothing else has been defined */
113252ab50eSmiod #if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL)
114252ab50eSmiod /* Special defines which change the way the code is built depending on the
115252ab50eSmiod    CPU and OS.  For SGI machines you can use _MIPS_SZLONG (32 or 64) to find
116252ab50eSmiod    even newer MIPS CPU's, but at the moment one size fits all for
117252ab50eSmiod    optimization options.  Older Sparc's work better with only UNROLL, but
118252ab50eSmiod    there's no way to tell at compile time what it is you're running on */
119252ab50eSmiod 
120252ab50eSmiod #if defined( sun )		/* Newer Sparc's */
121252ab50eSmiod #  define DES_PTR
122252ab50eSmiod #  define DES_RISC1
123252ab50eSmiod #  define DES_UNROLL
124252ab50eSmiod #elif defined( __ultrix )	/* Older MIPS */
125252ab50eSmiod #  define DES_PTR
126252ab50eSmiod #  define DES_RISC2
127252ab50eSmiod #  define DES_UNROLL
128252ab50eSmiod #elif defined( __osf1__ )	/* Alpha */
129252ab50eSmiod #  define DES_PTR
130252ab50eSmiod #  define DES_RISC2
131252ab50eSmiod #elif defined ( _AIX )		/* RS6000 */
132252ab50eSmiod   /* Unknown */
133252ab50eSmiod #elif defined( __hpux )		/* HP-PA */
134252ab50eSmiod   /* Unknown */
135252ab50eSmiod #elif defined( __aux )		/* 68K */
136252ab50eSmiod   /* Unknown */
137252ab50eSmiod #elif defined( __dgux )		/* 88K (but P6 in latest boxes) */
138252ab50eSmiod #  define DES_UNROLL
139252ab50eSmiod #elif defined( __sgi )		/* Newer MIPS */
140252ab50eSmiod #  define DES_PTR
141252ab50eSmiod #  define DES_RISC2
142252ab50eSmiod #  define DES_UNROLL
143252ab50eSmiod #elif defined(i386) || defined(__i386__)	/* x86 boxes, should be gcc */
144252ab50eSmiod #  define DES_PTR
145252ab50eSmiod #  define DES_RISC1
146252ab50eSmiod #  define DES_UNROLL
147252ab50eSmiod #endif /* Systems-specific speed defines */
148252ab50eSmiod #endif
149252ab50eSmiod 
150252ab50eSmiod #endif /* DES_DEFAULT_OPTIONS */
151252ab50eSmiod #endif /* HEADER_DES_LOCL_H */
152