From 6b691a5c85ddc4e407e32781841fee5c029506cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulf=20M=C3=B6ller?= Date: Mon, 19 Apr 1999 21:31:43 +0000 Subject: Change functions to ANSI C. --- crypto/idea/i_cbc.c | 13 +++---------- crypto/idea/i_cfb64.c | 11 +++-------- crypto/idea/i_ecb.c | 8 +++----- crypto/idea/i_ofb64.c | 9 ++------- crypto/idea/i_skey.c | 11 +++-------- crypto/idea/idea_spd.c | 10 +++------- crypto/idea/ideatest.c | 10 +++------- 7 files changed, 20 insertions(+), 52 deletions(-) (limited to 'crypto/idea') diff --git a/crypto/idea/i_cbc.c b/crypto/idea/i_cbc.c index 716ea3f474..13b255e948 100644 --- a/crypto/idea/i_cbc.c +++ b/crypto/idea/i_cbc.c @@ -59,13 +59,8 @@ #include "idea.h" #include "idea_lcl.h" -void idea_cbc_encrypt(in, out, length, ks, iv, encrypt) -unsigned char *in; -unsigned char *out; -long length; -IDEA_KEY_SCHEDULE *ks; -unsigned char *iv; -int encrypt; +void idea_cbc_encrypt(unsigned char *in, unsigned char *out, long length, + IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int encrypt) { register unsigned long tin0,tin1; register unsigned long tout0,tout1,xor0,xor1; @@ -138,9 +133,7 @@ int encrypt; tin[0]=tin[1]=0; } -void idea_encrypt(d,key) -unsigned long *d; -IDEA_KEY_SCHEDULE *key; +void idea_encrypt(unsigned long *d, IDEA_KEY_SCHEDULE *key) { register IDEA_INT *p; register unsigned long x1,x2,x3,x4,t0,t1,ul; diff --git a/crypto/idea/i_cfb64.c b/crypto/idea/i_cfb64.c index 8dfa7ece48..8dda0fbe70 100644 --- a/crypto/idea/i_cfb64.c +++ b/crypto/idea/i_cfb64.c @@ -64,14 +64,9 @@ * 64bit block we have used is contained in *num; */ -void idea_cfb64_encrypt(in, out, length, schedule, ivec, num, encrypt) -unsigned char *in; -unsigned char *out; -long length; -IDEA_KEY_SCHEDULE *schedule; -unsigned char *ivec; -int *num; -int encrypt; +void idea_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, + IDEA_KEY_SCHEDULE *schedule, unsigned char *ivec, int *num, + int encrypt) { register unsigned long v0,v1,t; register int n= *num; diff --git a/crypto/idea/i_ecb.c b/crypto/idea/i_ecb.c index 17d014a3f3..9ebaf40913 100644 --- a/crypto/idea/i_ecb.c +++ b/crypto/idea/i_ecb.c @@ -62,7 +62,7 @@ const char *IDEA_version="IDEA" OPENSSL_VERSION_PTEXT; -const char *idea_options() +const char *idea_options(void) { if (sizeof(short) != sizeof(IDEA_INT)) return("idea(int)"); @@ -70,10 +70,8 @@ const char *idea_options() return("idea(short)"); } -void idea_ecb_encrypt(in, out, ks) -unsigned char *in; -unsigned char *out; -IDEA_KEY_SCHEDULE *ks; +void idea_ecb_encrypt(unsigned char *in, unsigned char *out, + IDEA_KEY_SCHEDULE *ks) { unsigned long l0,l1,d[2]; diff --git a/crypto/idea/i_ofb64.c b/crypto/idea/i_ofb64.c index d687adb22d..cf60ff98e2 100644 --- a/crypto/idea/i_ofb64.c +++ b/crypto/idea/i_ofb64.c @@ -63,13 +63,8 @@ * used. The extra state information to record how much of the * 64bit block we have used is contained in *num; */ -void idea_ofb64_encrypt(in, out, length, schedule, ivec, num) -unsigned char *in; -unsigned char *out; -long length; -IDEA_KEY_SCHEDULE *schedule; -unsigned char *ivec; -int *num; +void idea_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, + IDEA_KEY_SCHEDULE *schedule, unsigned char *ivec, int *num) { register unsigned long v0,v1,t; register int n= *num; diff --git a/crypto/idea/i_skey.c b/crypto/idea/i_skey.c index 00fcc1e586..3733be0b60 100644 --- a/crypto/idea/i_skey.c +++ b/crypto/idea/i_skey.c @@ -65,9 +65,7 @@ static IDEA_INT inverse(unsigned int xin); static IDEA_INT inverse(); #endif -void idea_set_encrypt_key(key, ks) -unsigned char *key; -IDEA_KEY_SCHEDULE *ks; +void idea_set_encrypt_key(unsigned char *key, IDEA_KEY_SCHEDULE *ks) { int i; register IDEA_INT *kt,*kf,r0,r1,r2; @@ -101,9 +99,7 @@ IDEA_KEY_SCHEDULE *ks; } } -void idea_set_decrypt_key(ek, dk) -IDEA_KEY_SCHEDULE *ek; -IDEA_KEY_SCHEDULE *dk; +void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk) { int r; register IDEA_INT *fp,*tp,t; @@ -133,8 +129,7 @@ IDEA_KEY_SCHEDULE *dk; } /* taken directly from the 'paper' I'll have a look at it later */ -static IDEA_INT inverse(xin) -unsigned int xin; +static IDEA_INT inverse(unsigned int xin) { long n1,n2,q,r,b1,b2,t; diff --git a/crypto/idea/idea_spd.c b/crypto/idea/idea_spd.c index 98060d9b8c..704538d41f 100644 --- a/crypto/idea/idea_spd.c +++ b/crypto/idea/idea_spd.c @@ -135,8 +135,7 @@ SIGRETTYPE sig_done(int sig); SIGRETTYPE sig_done(); #endif -SIGRETTYPE sig_done(sig) -int sig; +SIGRETTYPE sig_done(int sig) { signal(SIGALRM,sig_done); run=0; @@ -149,8 +148,7 @@ int sig; #define START 0 #define STOP 1 -double Time_F(s) -int s; +double Time_F(int s) { double ret; #ifdef TIMES @@ -186,9 +184,7 @@ int s; #endif } -int main(argc,argv) -int argc; -char **argv; +int main(int argc, char **argv) { long count; static unsigned char buf[BUFSIZE]; diff --git a/crypto/idea/ideatest.c b/crypto/idea/ideatest.c index 6eff9029cc..542ece4aa3 100644 --- a/crypto/idea/ideatest.c +++ b/crypto/idea/ideatest.c @@ -103,9 +103,7 @@ static int cfb64_test(); static char *pt(); #endif -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,err=0; IDEA_KEY_SCHEDULE key,dkey; @@ -171,8 +169,7 @@ char *argv[]; return(err); } -static int cfb64_test(cfb_cipher) -unsigned char *cfb_cipher; +static int cfb64_test(unsigned char *cfb_cipher) { IDEA_KEY_SCHEDULE eks,dks; int err=0,i,n; @@ -210,8 +207,7 @@ unsigned char *cfb_cipher; return(err); } -static char *pt(p) -unsigned char *p; +static char *pt(unsigned char *p) { static char bufs[10][20]; static int bnum=0; -- cgit v1.2.3