diff options
Diffstat (limited to 'src/lib/libcrypto/des/des_opts.c')
-rw-r--r-- | src/lib/libcrypto/des/des_opts.c | 212 |
1 files changed, 106 insertions, 106 deletions
diff --git a/src/lib/libcrypto/des/des_opts.c b/src/lib/libcrypto/des/des_opts.c index 138ee1c6b4..79278b920e 100644 --- a/src/lib/libcrypto/des/des_opts.c +++ b/src/lib/libcrypto/des/des_opts.c | |||
@@ -59,12 +59,12 @@ | |||
59 | /* define PART1, PART2, PART3 or PART4 to build only with a few of the options. | 59 | /* define PART1, PART2, PART3 or PART4 to build only with a few of the options. |
60 | * This is for machines with 64k code segment size restrictions. */ | 60 | * This is for machines with 64k code segment size restrictions. */ |
61 | 61 | ||
62 | #if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) | 62 | #if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) && !defined(OPENSSL_SYS_MACOSX) |
63 | #define TIMES | 63 | #define TIMES |
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | #include <stdio.h> | 66 | #include <stdio.h> |
67 | #ifndef MSDOS | 67 | #ifndef OPENSSL_SYS_MSDOS |
68 | #include <openssl/e_os2.h> | 68 | #include <openssl/e_os2.h> |
69 | #include OPENSSL_UNISTD | 69 | #include OPENSSL_UNISTD |
70 | #else | 70 | #else |
@@ -84,7 +84,7 @@ extern void exit(); | |||
84 | The __TMS macro will show if it was. If it wasn't defined, we should | 84 | The __TMS macro will show if it was. If it wasn't defined, we should |
85 | undefine TIMES, since that tells the rest of the program how things | 85 | undefine TIMES, since that tells the rest of the program how things |
86 | should be handled. -- Richard Levitte */ | 86 | should be handled. -- Richard Levitte */ |
87 | #if defined(VMS) && defined(__DECC) && !defined(__TMS) | 87 | #if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS) |
88 | #undef TIMES | 88 | #undef TIMES |
89 | #endif | 89 | #endif |
90 | 90 | ||
@@ -118,10 +118,10 @@ extern void exit(); | |||
118 | #undef DES_RISC2 | 118 | #undef DES_RISC2 |
119 | #undef DES_PTR | 119 | #undef DES_PTR |
120 | #undef D_ENCRYPT | 120 | #undef D_ENCRYPT |
121 | #define des_encrypt1 des_encrypt_u4_cisc_idx | 121 | #define DES_encrypt1 des_encrypt_u4_cisc_idx |
122 | #define des_encrypt2 des_encrypt2_u4_cisc_idx | 122 | #define DES_encrypt2 des_encrypt2_u4_cisc_idx |
123 | #define des_encrypt3 des_encrypt3_u4_cisc_idx | 123 | #define DES_encrypt3 des_encrypt3_u4_cisc_idx |
124 | #define des_decrypt3 des_decrypt3_u4_cisc_idx | 124 | #define DES_decrypt3 des_decrypt3_u4_cisc_idx |
125 | #undef HEADER_DES_LOCL_H | 125 | #undef HEADER_DES_LOCL_H |
126 | #include "des_enc.c" | 126 | #include "des_enc.c" |
127 | 127 | ||
@@ -130,14 +130,14 @@ extern void exit(); | |||
130 | #undef DES_RISC2 | 130 | #undef DES_RISC2 |
131 | #undef DES_PTR | 131 | #undef DES_PTR |
132 | #undef D_ENCRYPT | 132 | #undef D_ENCRYPT |
133 | #undef des_encrypt1 | 133 | #undef DES_encrypt1 |
134 | #undef des_encrypt2 | 134 | #undef DES_encrypt2 |
135 | #undef des_encrypt3 | 135 | #undef DES_encrypt3 |
136 | #undef des_decrypt3 | 136 | #undef DES_decrypt3 |
137 | #define des_encrypt1 des_encrypt_u16_cisc_idx | 137 | #define DES_encrypt1 des_encrypt_u16_cisc_idx |
138 | #define des_encrypt2 des_encrypt2_u16_cisc_idx | 138 | #define DES_encrypt2 des_encrypt2_u16_cisc_idx |
139 | #define des_encrypt3 des_encrypt3_u16_cisc_idx | 139 | #define DES_encrypt3 des_encrypt3_u16_cisc_idx |
140 | #define des_decrypt3 des_decrypt3_u16_cisc_idx | 140 | #define DES_decrypt3 des_decrypt3_u16_cisc_idx |
141 | #undef HEADER_DES_LOCL_H | 141 | #undef HEADER_DES_LOCL_H |
142 | #include "des_enc.c" | 142 | #include "des_enc.c" |
143 | 143 | ||
@@ -146,14 +146,14 @@ extern void exit(); | |||
146 | #undef DES_RISC2 | 146 | #undef DES_RISC2 |
147 | #undef DES_PTR | 147 | #undef DES_PTR |
148 | #undef D_ENCRYPT | 148 | #undef D_ENCRYPT |
149 | #undef des_encrypt1 | 149 | #undef DES_encrypt1 |
150 | #undef des_encrypt2 | 150 | #undef DES_encrypt2 |
151 | #undef des_encrypt3 | 151 | #undef DES_encrypt3 |
152 | #undef des_decrypt3 | 152 | #undef DES_decrypt3 |
153 | #define des_encrypt1 des_encrypt_u4_risc1_idx | 153 | #define DES_encrypt1 des_encrypt_u4_risc1_idx |
154 | #define des_encrypt2 des_encrypt2_u4_risc1_idx | 154 | #define DES_encrypt2 des_encrypt2_u4_risc1_idx |
155 | #define des_encrypt3 des_encrypt3_u4_risc1_idx | 155 | #define DES_encrypt3 des_encrypt3_u4_risc1_idx |
156 | #define des_decrypt3 des_decrypt3_u4_risc1_idx | 156 | #define DES_decrypt3 des_decrypt3_u4_risc1_idx |
157 | #undef HEADER_DES_LOCL_H | 157 | #undef HEADER_DES_LOCL_H |
158 | #include "des_enc.c" | 158 | #include "des_enc.c" |
159 | 159 | ||
@@ -166,14 +166,14 @@ extern void exit(); | |||
166 | #define DES_RISC2 | 166 | #define DES_RISC2 |
167 | #undef DES_PTR | 167 | #undef DES_PTR |
168 | #undef D_ENCRYPT | 168 | #undef D_ENCRYPT |
169 | #undef des_encrypt1 | 169 | #undef DES_encrypt1 |
170 | #undef des_encrypt2 | 170 | #undef DES_encrypt2 |
171 | #undef des_encrypt3 | 171 | #undef DES_encrypt3 |
172 | #undef des_decrypt3 | 172 | #undef DES_decrypt3 |
173 | #define des_encrypt1 des_encrypt_u4_risc2_idx | 173 | #define DES_encrypt1 des_encrypt_u4_risc2_idx |
174 | #define des_encrypt2 des_encrypt2_u4_risc2_idx | 174 | #define DES_encrypt2 des_encrypt2_u4_risc2_idx |
175 | #define des_encrypt3 des_encrypt3_u4_risc2_idx | 175 | #define DES_encrypt3 des_encrypt3_u4_risc2_idx |
176 | #define des_decrypt3 des_decrypt3_u4_risc2_idx | 176 | #define DES_decrypt3 des_decrypt3_u4_risc2_idx |
177 | #undef HEADER_DES_LOCL_H | 177 | #undef HEADER_DES_LOCL_H |
178 | #include "des_enc.c" | 178 | #include "des_enc.c" |
179 | 179 | ||
@@ -182,14 +182,14 @@ extern void exit(); | |||
182 | #undef DES_RISC2 | 182 | #undef DES_RISC2 |
183 | #undef DES_PTR | 183 | #undef DES_PTR |
184 | #undef D_ENCRYPT | 184 | #undef D_ENCRYPT |
185 | #undef des_encrypt1 | 185 | #undef DES_encrypt1 |
186 | #undef des_encrypt2 | 186 | #undef DES_encrypt2 |
187 | #undef des_encrypt3 | 187 | #undef DES_encrypt3 |
188 | #undef des_decrypt3 | 188 | #undef DES_decrypt3 |
189 | #define des_encrypt1 des_encrypt_u16_risc1_idx | 189 | #define DES_encrypt1 des_encrypt_u16_risc1_idx |
190 | #define des_encrypt2 des_encrypt2_u16_risc1_idx | 190 | #define DES_encrypt2 des_encrypt2_u16_risc1_idx |
191 | #define des_encrypt3 des_encrypt3_u16_risc1_idx | 191 | #define DES_encrypt3 des_encrypt3_u16_risc1_idx |
192 | #define des_decrypt3 des_decrypt3_u16_risc1_idx | 192 | #define DES_decrypt3 des_decrypt3_u16_risc1_idx |
193 | #undef HEADER_DES_LOCL_H | 193 | #undef HEADER_DES_LOCL_H |
194 | #include "des_enc.c" | 194 | #include "des_enc.c" |
195 | 195 | ||
@@ -198,14 +198,14 @@ extern void exit(); | |||
198 | #define DES_RISC2 | 198 | #define DES_RISC2 |
199 | #undef DES_PTR | 199 | #undef DES_PTR |
200 | #undef D_ENCRYPT | 200 | #undef D_ENCRYPT |
201 | #undef des_encrypt1 | 201 | #undef DES_encrypt1 |
202 | #undef des_encrypt2 | 202 | #undef DES_encrypt2 |
203 | #undef des_encrypt3 | 203 | #undef DES_encrypt3 |
204 | #undef des_decrypt3 | 204 | #undef DES_decrypt3 |
205 | #define des_encrypt1 des_encrypt_u16_risc2_idx | 205 | #define DES_encrypt1 des_encrypt_u16_risc2_idx |
206 | #define des_encrypt2 des_encrypt2_u16_risc2_idx | 206 | #define DES_encrypt2 des_encrypt2_u16_risc2_idx |
207 | #define des_encrypt3 des_encrypt3_u16_risc2_idx | 207 | #define DES_encrypt3 des_encrypt3_u16_risc2_idx |
208 | #define des_decrypt3 des_decrypt3_u16_risc2_idx | 208 | #define DES_decrypt3 des_decrypt3_u16_risc2_idx |
209 | #undef HEADER_DES_LOCL_H | 209 | #undef HEADER_DES_LOCL_H |
210 | #include "des_enc.c" | 210 | #include "des_enc.c" |
211 | 211 | ||
@@ -218,14 +218,14 @@ extern void exit(); | |||
218 | #undef DES_RISC2 | 218 | #undef DES_RISC2 |
219 | #define DES_PTR | 219 | #define DES_PTR |
220 | #undef D_ENCRYPT | 220 | #undef D_ENCRYPT |
221 | #undef des_encrypt1 | 221 | #undef DES_encrypt1 |
222 | #undef des_encrypt2 | 222 | #undef DES_encrypt2 |
223 | #undef des_encrypt3 | 223 | #undef DES_encrypt3 |
224 | #undef des_decrypt3 | 224 | #undef DES_decrypt3 |
225 | #define des_encrypt1 des_encrypt_u4_cisc_ptr | 225 | #define DES_encrypt1 des_encrypt_u4_cisc_ptr |
226 | #define des_encrypt2 des_encrypt2_u4_cisc_ptr | 226 | #define DES_encrypt2 des_encrypt2_u4_cisc_ptr |
227 | #define des_encrypt3 des_encrypt3_u4_cisc_ptr | 227 | #define DES_encrypt3 des_encrypt3_u4_cisc_ptr |
228 | #define des_decrypt3 des_decrypt3_u4_cisc_ptr | 228 | #define DES_decrypt3 des_decrypt3_u4_cisc_ptr |
229 | #undef HEADER_DES_LOCL_H | 229 | #undef HEADER_DES_LOCL_H |
230 | #include "des_enc.c" | 230 | #include "des_enc.c" |
231 | 231 | ||
@@ -234,14 +234,14 @@ extern void exit(); | |||
234 | #undef DES_RISC2 | 234 | #undef DES_RISC2 |
235 | #define DES_PTR | 235 | #define DES_PTR |
236 | #undef D_ENCRYPT | 236 | #undef D_ENCRYPT |
237 | #undef des_encrypt1 | 237 | #undef DES_encrypt1 |
238 | #undef des_encrypt2 | 238 | #undef DES_encrypt2 |
239 | #undef des_encrypt3 | 239 | #undef DES_encrypt3 |
240 | #undef des_decrypt3 | 240 | #undef DES_decrypt3 |
241 | #define des_encrypt1 des_encrypt_u16_cisc_ptr | 241 | #define DES_encrypt1 des_encrypt_u16_cisc_ptr |
242 | #define des_encrypt2 des_encrypt2_u16_cisc_ptr | 242 | #define DES_encrypt2 des_encrypt2_u16_cisc_ptr |
243 | #define des_encrypt3 des_encrypt3_u16_cisc_ptr | 243 | #define DES_encrypt3 des_encrypt3_u16_cisc_ptr |
244 | #define des_decrypt3 des_decrypt3_u16_cisc_ptr | 244 | #define DES_decrypt3 des_decrypt3_u16_cisc_ptr |
245 | #undef HEADER_DES_LOCL_H | 245 | #undef HEADER_DES_LOCL_H |
246 | #include "des_enc.c" | 246 | #include "des_enc.c" |
247 | 247 | ||
@@ -250,14 +250,14 @@ extern void exit(); | |||
250 | #undef DES_RISC2 | 250 | #undef DES_RISC2 |
251 | #define DES_PTR | 251 | #define DES_PTR |
252 | #undef D_ENCRYPT | 252 | #undef D_ENCRYPT |
253 | #undef des_encrypt1 | 253 | #undef DES_encrypt1 |
254 | #undef des_encrypt2 | 254 | #undef DES_encrypt2 |
255 | #undef des_encrypt3 | 255 | #undef DES_encrypt3 |
256 | #undef des_decrypt3 | 256 | #undef DES_decrypt3 |
257 | #define des_encrypt1 des_encrypt_u4_risc1_ptr | 257 | #define DES_encrypt1 des_encrypt_u4_risc1_ptr |
258 | #define des_encrypt2 des_encrypt2_u4_risc1_ptr | 258 | #define DES_encrypt2 des_encrypt2_u4_risc1_ptr |
259 | #define des_encrypt3 des_encrypt3_u4_risc1_ptr | 259 | #define DES_encrypt3 des_encrypt3_u4_risc1_ptr |
260 | #define des_decrypt3 des_decrypt3_u4_risc1_ptr | 260 | #define DES_decrypt3 des_decrypt3_u4_risc1_ptr |
261 | #undef HEADER_DES_LOCL_H | 261 | #undef HEADER_DES_LOCL_H |
262 | #include "des_enc.c" | 262 | #include "des_enc.c" |
263 | 263 | ||
@@ -270,14 +270,14 @@ extern void exit(); | |||
270 | #define DES_RISC2 | 270 | #define DES_RISC2 |
271 | #define DES_PTR | 271 | #define DES_PTR |
272 | #undef D_ENCRYPT | 272 | #undef D_ENCRYPT |
273 | #undef des_encrypt1 | 273 | #undef DES_encrypt1 |
274 | #undef des_encrypt2 | 274 | #undef DES_encrypt2 |
275 | #undef des_encrypt3 | 275 | #undef DES_encrypt3 |
276 | #undef des_decrypt3 | 276 | #undef DES_decrypt3 |
277 | #define des_encrypt1 des_encrypt_u4_risc2_ptr | 277 | #define DES_encrypt1 des_encrypt_u4_risc2_ptr |
278 | #define des_encrypt2 des_encrypt2_u4_risc2_ptr | 278 | #define DES_encrypt2 des_encrypt2_u4_risc2_ptr |
279 | #define des_encrypt3 des_encrypt3_u4_risc2_ptr | 279 | #define DES_encrypt3 des_encrypt3_u4_risc2_ptr |
280 | #define des_decrypt3 des_decrypt3_u4_risc2_ptr | 280 | #define DES_decrypt3 des_decrypt3_u4_risc2_ptr |
281 | #undef HEADER_DES_LOCL_H | 281 | #undef HEADER_DES_LOCL_H |
282 | #include "des_enc.c" | 282 | #include "des_enc.c" |
283 | 283 | ||
@@ -286,14 +286,14 @@ extern void exit(); | |||
286 | #undef DES_RISC2 | 286 | #undef DES_RISC2 |
287 | #define DES_PTR | 287 | #define DES_PTR |
288 | #undef D_ENCRYPT | 288 | #undef D_ENCRYPT |
289 | #undef des_encrypt1 | 289 | #undef DES_encrypt1 |
290 | #undef des_encrypt2 | 290 | #undef DES_encrypt2 |
291 | #undef des_encrypt3 | 291 | #undef DES_encrypt3 |
292 | #undef des_decrypt3 | 292 | #undef DES_decrypt3 |
293 | #define des_encrypt1 des_encrypt_u16_risc1_ptr | 293 | #define DES_encrypt1 des_encrypt_u16_risc1_ptr |
294 | #define des_encrypt2 des_encrypt2_u16_risc1_ptr | 294 | #define DES_encrypt2 des_encrypt2_u16_risc1_ptr |
295 | #define des_encrypt3 des_encrypt3_u16_risc1_ptr | 295 | #define DES_encrypt3 des_encrypt3_u16_risc1_ptr |
296 | #define des_decrypt3 des_decrypt3_u16_risc1_ptr | 296 | #define DES_decrypt3 des_decrypt3_u16_risc1_ptr |
297 | #undef HEADER_DES_LOCL_H | 297 | #undef HEADER_DES_LOCL_H |
298 | #include "des_enc.c" | 298 | #include "des_enc.c" |
299 | 299 | ||
@@ -302,14 +302,14 @@ extern void exit(); | |||
302 | #define DES_RISC2 | 302 | #define DES_RISC2 |
303 | #define DES_PTR | 303 | #define DES_PTR |
304 | #undef D_ENCRYPT | 304 | #undef D_ENCRYPT |
305 | #undef des_encrypt1 | 305 | #undef DES_encrypt1 |
306 | #undef des_encrypt2 | 306 | #undef DES_encrypt2 |
307 | #undef des_encrypt3 | 307 | #undef DES_encrypt3 |
308 | #undef des_decrypt3 | 308 | #undef DES_decrypt3 |
309 | #define des_encrypt1 des_encrypt_u16_risc2_ptr | 309 | #define DES_encrypt1 des_encrypt_u16_risc2_ptr |
310 | #define des_encrypt2 des_encrypt2_u16_risc2_ptr | 310 | #define DES_encrypt2 des_encrypt2_u16_risc2_ptr |
311 | #define des_encrypt3 des_encrypt3_u16_risc2_ptr | 311 | #define DES_encrypt3 des_encrypt3_u16_risc2_ptr |
312 | #define des_decrypt3 des_decrypt3_u16_risc2_ptr | 312 | #define DES_decrypt3 des_decrypt3_u16_risc2_ptr |
313 | #undef HEADER_DES_LOCL_H | 313 | #undef HEADER_DES_LOCL_H |
314 | #include "des_enc.c" | 314 | #include "des_enc.c" |
315 | 315 | ||
@@ -401,7 +401,7 @@ double Time_F(int s) | |||
401 | for (count=0,run=1; COND(cb); count++) \ | 401 | for (count=0,run=1; COND(cb); count++) \ |
402 | { \ | 402 | { \ |
403 | unsigned long d[2]; \ | 403 | unsigned long d[2]; \ |
404 | func(d,&(sch[0]),DES_ENCRYPT); \ | 404 | func(d,&sch,DES_ENCRYPT); \ |
405 | } \ | 405 | } \ |
406 | tm[index]=Time_F(STOP); \ | 406 | tm[index]=Time_F(STOP); \ |
407 | fprintf(stderr,"%ld %s's in %.2f second\n",count,name,tm[index]); \ | 407 | fprintf(stderr,"%ld %s's in %.2f second\n",count,name,tm[index]); \ |
@@ -415,10 +415,10 @@ int main(int argc, char **argv) | |||
415 | { | 415 | { |
416 | long count; | 416 | long count; |
417 | static unsigned char buf[BUFSIZE]; | 417 | static unsigned char buf[BUFSIZE]; |
418 | static des_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0}; | 418 | static DES_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0}; |
419 | static des_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12}; | 419 | static DES_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12}; |
420 | static des_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34}; | 420 | static DES_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34}; |
421 | des_key_schedule sch,sch2,sch3; | 421 | DES_key_schedule sch,sch2,sch3; |
422 | double d,tm[16],max=0; | 422 | double d,tm[16],max=0; |
423 | int rank[16]; | 423 | int rank[16]; |
424 | char *str[16]; | 424 | char *str[16]; |
@@ -438,13 +438,13 @@ int main(int argc, char **argv) | |||
438 | fprintf(stderr,"program when this computer is idle.\n"); | 438 | fprintf(stderr,"program when this computer is idle.\n"); |
439 | #endif | 439 | #endif |
440 | 440 | ||
441 | des_set_key_unchecked(&key,sch); | 441 | DES_set_key_unchecked(&key,&sch); |
442 | des_set_key_unchecked(&key2,sch2); | 442 | DES_set_key_unchecked(&key2,&sch2); |
443 | des_set_key_unchecked(&key3,sch3); | 443 | DES_set_key_unchecked(&key3,&sch3); |
444 | 444 | ||
445 | #ifndef SIGALRM | 445 | #ifndef SIGALRM |
446 | fprintf(stderr,"First we calculate the approximate speed ...\n"); | 446 | fprintf(stderr,"First we calculate the approximate speed ...\n"); |
447 | des_set_key_unchecked(&key,sch); | 447 | DES_set_key_unchecked(&key,sch); |
448 | count=10; | 448 | count=10; |
449 | do { | 449 | do { |
450 | long i; | 450 | long i; |
@@ -453,7 +453,7 @@ int main(int argc, char **argv) | |||
453 | count*=2; | 453 | count*=2; |
454 | Time_F(START); | 454 | Time_F(START); |
455 | for (i=count; i; i--) | 455 | for (i=count; i; i--) |
456 | des_encrypt1(data,&(sch[0]),DES_ENCRYPT); | 456 | DES_encrypt1(data,&(sch[0]),DES_ENCRYPT); |
457 | d=Time_F(STOP); | 457 | d=Time_F(STOP); |
458 | } while (d < 3.0); | 458 | } while (d < 3.0); |
459 | ca=count; | 459 | ca=count; |
@@ -598,7 +598,7 @@ int main(int argc, char **argv) | |||
598 | break; | 598 | break; |
599 | } | 599 | } |
600 | exit(0); | 600 | exit(0); |
601 | #if defined(LINT) || defined(MSDOS) | 601 | #if defined(LINT) || defined(OPENSSL_SYS_MSDOS) |
602 | return(0); | 602 | return(0); |
603 | #endif | 603 | #endif |
604 | } | 604 | } |