summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/des/des_opts.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/des/des_opts.c')
-rw-r--r--src/lib/libcrypto/des/des_opts.c62
1 files changed, 23 insertions, 39 deletions
diff --git a/src/lib/libcrypto/des/des_opts.c b/src/lib/libcrypto/des/des_opts.c
index fdf0fbf461..746c456f8f 100644
--- a/src/lib/libcrypto/des/des_opts.c
+++ b/src/lib/libcrypto/des/des_opts.c
@@ -59,19 +59,19 @@
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#ifndef MSDOS 62#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
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 MSDOS
68#include <unistd.h> 68#include <openssl/e_os2.h>
69#include OPENSSL_UNISTD
69#else 70#else
70#include <io.h> 71#include <io.h>
71extern void exit(); 72extern void exit();
72#endif 73#endif
73#include <signal.h> 74#include <signal.h>
74#ifndef VMS
75#ifndef _IRIX 75#ifndef _IRIX
76#include <time.h> 76#include <time.h>
77#endif 77#endif
@@ -79,25 +79,27 @@ extern void exit();
79#include <sys/types.h> 79#include <sys/types.h>
80#include <sys/times.h> 80#include <sys/times.h>
81#endif 81#endif
82#else /* VMS */ 82
83#include <types.h> 83/* Depending on the VMS version, the tms structure is perhaps defined.
84struct tms { 84 The __TMS macro will show if it was. If it wasn't defined, we should
85 time_t tms_utime; 85 undefine TIMES, since that tells the rest of the program how things
86 time_t tms_stime; 86 should be handled. -- Richard Levitte */
87 time_t tms_uchild; /* I dunno... */ 87#if defined(VMS) && defined(__DECC) && !defined(__TMS)
88 time_t tms_uchildsys; /* so these names are a guess :-) */ 88#undef TIMES
89 }
90#endif 89#endif
90
91#ifndef TIMES 91#ifndef TIMES
92#include <sys/timeb.h> 92#include <sys/timeb.h>
93#endif 93#endif
94 94
95#ifdef sun 95
96#if defined(sun) || defined(__ultrix)
97#define _POSIX_SOURCE
96#include <limits.h> 98#include <limits.h>
97#include <sys/param.h> 99#include <sys/param.h>
98#endif 100#endif
99 101
100#include "des.h" 102#include <openssl/des.h>
101#include "spr.h" 103#include "spr.h"
102 104
103#define DES_DEFAULT_OPTIONS 105#define DES_DEFAULT_OPTIONS
@@ -317,11 +319,7 @@ struct tms {
317#ifndef HZ 319#ifndef HZ
318# ifndef CLK_TCK 320# ifndef CLK_TCK
319# ifndef _BSD_CLK_TCK_ /* FreeBSD fix */ 321# ifndef _BSD_CLK_TCK_ /* FreeBSD fix */
320# ifndef VMS 322# define HZ 100.0
321# define HZ 100.0
322# else /* VMS */
323# define HZ 100.0
324# endif
325# else /* _BSD_CLK_TCK_ */ 323# else /* _BSD_CLK_TCK_ */
326# define HZ ((double)_BSD_CLK_TCK_) 324# define HZ ((double)_BSD_CLK_TCK_)
327# endif 325# endif
@@ -333,12 +331,7 @@ struct tms {
333#define BUFSIZE ((long)1024) 331#define BUFSIZE ((long)1024)
334long run=0; 332long run=0;
335 333
336#ifndef NOPROTO
337double Time_F(int s); 334double Time_F(int s);
338#else
339double Time_F();
340#endif
341
342#ifdef SIGALRM 335#ifdef SIGALRM
343#if defined(__STDC__) || defined(sgi) 336#if defined(__STDC__) || defined(sgi)
344#define SIGRETTYPE void 337#define SIGRETTYPE void
@@ -346,14 +339,8 @@ double Time_F();
346#define SIGRETTYPE int 339#define SIGRETTYPE int
347#endif 340#endif
348 341
349#ifndef NOPROTO
350SIGRETTYPE sig_done(int sig); 342SIGRETTYPE sig_done(int sig);
351#else 343SIGRETTYPE sig_done(int sig)
352SIGRETTYPE sig_done();
353#endif
354
355SIGRETTYPE sig_done(sig)
356int sig;
357 { 344 {
358 signal(SIGALRM,sig_done); 345 signal(SIGALRM,sig_done);
359 run=0; 346 run=0;
@@ -366,8 +353,7 @@ int sig;
366#define START 0 353#define START 0
367#define STOP 1 354#define STOP 1
368 355
369double Time_F(s) 356double Time_F(int s)
370int s;
371 { 357 {
372 double ret; 358 double ret;
373#ifdef TIMES 359#ifdef TIMES
@@ -425,9 +411,7 @@ int s;
425 fprintf(stderr,"%s bytes per sec = %12.2f (%5.1fuS)\n",name, \ 411 fprintf(stderr,"%s bytes per sec = %12.2f (%5.1fuS)\n",name, \
426 tm[index]*8,1.0e6/tm[index]); 412 tm[index]*8,1.0e6/tm[index]);
427 413
428int main(argc,argv) 414int main(int argc, char **argv)
429int argc;
430char **argv;
431 { 415 {
432 long count; 416 long count;
433 static unsigned char buf[BUFSIZE]; 417 static unsigned char buf[BUFSIZE];
@@ -454,13 +438,13 @@ char **argv;
454 fprintf(stderr,"program when this computer is idle.\n"); 438 fprintf(stderr,"program when this computer is idle.\n");
455#endif 439#endif
456 440
457 des_set_key((C_Block *)key,sch); 441 des_set_key(&key,sch);
458 des_set_key((C_Block *)key2,sch2); 442 des_set_key(&key2,sch2);
459 des_set_key((C_Block *)key3,sch3); 443 des_set_key(&key3,sch3);
460 444
461#ifndef SIGALRM 445#ifndef SIGALRM
462 fprintf(stderr,"First we calculate the approximate speed ...\n"); 446 fprintf(stderr,"First we calculate the approximate speed ...\n");
463 des_set_key((C_Block *)key,sch); 447 des_set_key(&key,sch);
464 count=10; 448 count=10;
465 do { 449 do {
466 long i; 450 long i;