summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/expspeed.c
diff options
context:
space:
mode:
authorbeck <>1999-09-29 04:37:45 +0000
committerbeck <>1999-09-29 04:37:45 +0000
commitde8f24ea083384bb66b32ec105dc4743c5663cdf (patch)
tree1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/bn/expspeed.c
parentcb929d29896bcb87c2a97417fbd03e50078fc178 (diff)
downloadopenbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/bn/expspeed.c')
-rw-r--r--src/lib/libcrypto/bn/expspeed.c55
1 files changed, 19 insertions, 36 deletions
diff --git a/src/lib/libcrypto/bn/expspeed.c b/src/lib/libcrypto/bn/expspeed.c
index 344f883d35..3656d5bb4c 100644
--- a/src/lib/libcrypto/bn/expspeed.c
+++ b/src/lib/libcrypto/bn/expspeed.c
@@ -66,14 +66,13 @@
66#include <stdlib.h> 66#include <stdlib.h>
67#include <signal.h> 67#include <signal.h>
68#include <string.h> 68#include <string.h>
69#include "crypto.h" 69#include <openssl/crypto.h>
70#include "err.h" 70#include <openssl/err.h>
71 71
72#ifndef MSDOS 72#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
73#define TIMES 73#define TIMES
74#endif 74#endif
75 75
76#ifndef VMS
77#ifndef _IRIX 76#ifndef _IRIX
78#include <time.h> 77#include <time.h>
79#endif 78#endif
@@ -81,36 +80,33 @@
81#include <sys/types.h> 80#include <sys/types.h>
82#include <sys/times.h> 81#include <sys/times.h>
83#endif 82#endif
84#else /* VMS */ 83
85#include <types.h> 84/* Depending on the VMS version, the tms structure is perhaps defined.
86struct tms { 85 The __TMS macro will show if it was. If it wasn't defined, we should
87 time_t tms_utime; 86 undefine TIMES, since that tells the rest of the program how things
88 time_t tms_stime; 87 should be handled. -- Richard Levitte */
89 time_t tms_uchild; /* I dunno... */ 88#if defined(VMS) && defined(__DECC) && !defined(__TMS)
90 time_t tms_uchildsys; /* so these names are a guess :-) */ 89#undef TIMES
91 }
92#endif 90#endif
91
93#ifndef TIMES 92#ifndef TIMES
94#include <sys/timeb.h> 93#include <sys/timeb.h>
95#endif 94#endif
96 95
97#ifdef sun 96#if defined(sun) || defined(__ultrix)
97#define _POSIX_SOURCE
98#include <limits.h> 98#include <limits.h>
99#include <sys/param.h> 99#include <sys/param.h>
100#endif 100#endif
101 101
102#include "bn.h" 102#include <openssl/bn.h>
103#include "x509.h" 103#include <openssl/x509.h>
104 104
105/* The following if from times(3) man page. It may need to be changed */ 105/* The following if from times(3) man page. It may need to be changed */
106#ifndef HZ 106#ifndef HZ
107# ifndef CLK_TCK 107# ifndef CLK_TCK
108# ifndef _BSD_CLK_TCK_ /* FreeBSD hack */ 108# ifndef _BSD_CLK_TCK_ /* FreeBSD hack */
109# ifndef VMS 109# define HZ 100.0
110# define HZ 100.0
111# else /* VMS */
112# define HZ 100.0
113# endif
114# else /* _BSD_CLK_TCK_ */ 110# else /* _BSD_CLK_TCK_ */
115# define HZ ((double)_BSD_CLK_TCK_) 111# define HZ ((double)_BSD_CLK_TCK_)
116# endif 112# endif
@@ -123,17 +119,11 @@ struct tms {
123#define BUFSIZE ((long)1024*8) 119#define BUFSIZE ((long)1024*8)
124int run=0; 120int run=0;
125 121
126#ifndef NOPROTO
127static double Time_F(int s); 122static double Time_F(int s);
128#else
129static double Time_F();
130#endif
131
132#define START 0 123#define START 0
133#define STOP 1 124#define STOP 1
134 125
135static double Time_F(s) 126static double Time_F(int s)
136int s;
137 { 127 {
138 double ret; 128 double ret;
139#ifdef TIMES 129#ifdef TIMES
@@ -176,9 +166,7 @@ static int mul_c[NUM_SIZES]={8*8*8*8*8,8*8*8*8,8*8*8,8*8,8,1};
176 166
177void do_mul_exp(BIGNUM *r,BIGNUM *a,BIGNUM *b,BIGNUM *c,BN_CTX *ctx); 167void do_mul_exp(BIGNUM *r,BIGNUM *a,BIGNUM *b,BIGNUM *c,BN_CTX *ctx);
178 168
179int main(argc,argv) 169int main(int argc, char **argv)
180int argc;
181char **argv;
182 { 170 {
183 BN_CTX *ctx; 171 BN_CTX *ctx;
184 BIGNUM *a,*b,*c,*r; 172 BIGNUM *a,*b,*c,*r;
@@ -192,12 +180,7 @@ char **argv;
192 do_mul_exp(r,a,b,c,ctx); 180 do_mul_exp(r,a,b,c,ctx);
193 } 181 }
194 182
195void do_mul_exp(r,a,b,c,ctx) 183void do_mul_exp(BIGNUM *r, BIGNUM *a, BIGNUM *b, BIGNUM *c, BN_CTX *ctx)
196BIGNUM *r;
197BIGNUM *a;
198BIGNUM *b;
199BIGNUM *c;
200BN_CTX *ctx;
201 { 184 {
202 int i,k; 185 int i,k;
203 double tm; 186 double tm;