summaryrefslogtreecommitdiffstats
path: root/crypto/des
diff options
context:
space:
mode:
authorUlf Möller <ulf@openssl.org>1999-04-19 23:31:43 +0200
committerUlf Möller <ulf@openssl.org>1999-04-19 23:31:43 +0200
commit6b691a5c85ddc4e407e32781841fee5c029506cd (patch)
tree436f1127406e1cacfe83dfcbfff824d89c47d834 /crypto/des
parentFinish off support for Certificate Policies extension. (diff)
downloadopenssl-6b691a5c85ddc4e407e32781841fee5c029506cd.tar.xz
openssl-6b691a5c85ddc4e407e32781841fee5c029506cd.zip
Change functions to ANSI C.
Diffstat (limited to 'crypto/des')
-rw-r--r--crypto/des/cbc3_enc.c12
-rw-r--r--crypto/des/cbc_cksm.c8
-rw-r--r--crypto/des/cbc_enc.c9
-rw-r--r--crypto/des/cfb64ede.c22
-rw-r--r--crypto/des/cfb64enc.c11
-rw-r--r--crypto/des/cfb_enc.c10
-rw-r--r--crypto/des/des.c39
-rw-r--r--crypto/des/des_enc.c45
-rw-r--r--crypto/des/des_opts.c10
-rw-r--r--crypto/des/destest.c17
-rw-r--r--crypto/des/ecb3_enc.c10
-rw-r--r--crypto/des/ecb_enc.c7
-rw-r--r--crypto/des/ede_cbcm_enc.c13
-rw-r--r--crypto/des/ede_enc.c23
-rw-r--r--crypto/des/enc_read.c8
-rw-r--r--crypto/des/enc_writ.c8
-rw-r--r--crypto/des/fcrypt.c12
-rw-r--r--crypto/des/fcrypt_b.c7
-rw-r--r--crypto/des/ncbc_enc.c9
-rw-r--r--crypto/des/ofb64ede.c20
-rw-r--r--crypto/des/ofb64enc.c10
-rw-r--r--crypto/des/ofb_enc.c9
-rw-r--r--crypto/des/pcbc_enc.c9
-rw-r--r--crypto/des/qud_cksm.c8
-rw-r--r--crypto/des/rand_key.c6
-rw-r--r--crypto/des/read2pwd.c12
-rw-r--r--crypto/des/read_pwd.c37
-rw-r--r--crypto/des/rpc_enc.c5
-rw-r--r--crypto/des/rpw.c4
-rw-r--r--crypto/des/set_key.c17
-rw-r--r--crypto/des/speed.c10
-rw-r--r--crypto/des/str2key.c9
-rw-r--r--crypto/des/supp.c6
-rw-r--r--crypto/des/xcbc_enc.c18
34 files changed, 121 insertions, 339 deletions
diff --git a/crypto/des/cbc3_enc.c b/crypto/des/cbc3_enc.c
index 92a78b05d6..50ed156c7a 100644
--- a/crypto/des/cbc3_enc.c
+++ b/crypto/des/cbc3_enc.c
@@ -59,15 +59,9 @@
#include "des_locl.h"
/* HAS BUGS? DON'T USE - this is only present for use in des.c */
-void des_3cbc_encrypt(input, output, length, ks1, ks2, iv1, iv2, enc)
-des_cblock (*input);
-des_cblock (*output);
-long length;
-des_key_schedule ks1;
-des_key_schedule ks2;
-des_cblock (*iv1);
-des_cblock (*iv2);
-int enc;
+void des_3cbc_encrypt(des_cblock (*input), des_cblock (*output), long length,
+ des_key_schedule ks1, des_key_schedule ks2, des_cblock (*iv1),
+ des_cblock (*iv2), int enc)
{
int off=((int)length-1)/8;
long l8=((length+7)/8)*8;
diff --git a/crypto/des/cbc_cksm.c b/crypto/des/cbc_cksm.c
index b7048c8a3f..aeb0a79df9 100644
--- a/crypto/des/cbc_cksm.c
+++ b/crypto/des/cbc_cksm.c
@@ -58,12 +58,8 @@
#include "des_locl.h"
-DES_LONG des_cbc_cksum(in, out, length, schedule, iv)
-const unsigned char *in;
-des_cblock out;
-long length;
-des_key_schedule schedule;
-const des_cblock iv;
+DES_LONG des_cbc_cksum(const unsigned char *in, des_cblock out, long length,
+ des_key_schedule schedule, const des_cblock iv)
{
register DES_LONG tout0,tout1,tin0,tin1;
register long l=length;
diff --git a/crypto/des/cbc_enc.c b/crypto/des/cbc_enc.c
index 96939f34df..c989a7fd34 100644
--- a/crypto/des/cbc_enc.c
+++ b/crypto/des/cbc_enc.c
@@ -60,13 +60,8 @@
/* Note that this is inconsistent with other DES functions, in that it doesn't
update ivec */
-void des_cbc_encrypt(in, out, length, schedule, ivec, enc)
-const unsigned char *in;
-unsigned char *out;
-long length;
-des_key_schedule schedule;
-des_cblock ivec;
-int enc;
+void des_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
+ des_key_schedule schedule, des_cblock ivec, int enc)
{
register DES_LONG tin0,tin1;
register DES_LONG tout0,tout1,xor0,xor1;
diff --git a/crypto/des/cfb64ede.c b/crypto/des/cfb64ede.c
index f19a55ef52..1f936fa74b 100644
--- a/crypto/des/cfb64ede.c
+++ b/crypto/des/cfb64ede.c
@@ -63,14 +63,9 @@
* 64bit block we have used is contained in *num;
*/
-void des_ede3_cfb64_encrypt(in, out, length, ks1,ks2,ks3, ivec, num, enc)
-const unsigned char *in;
-unsigned char *out;
-long length;
-des_key_schedule ks1,ks2,ks3;
-des_cblock ivec;
-int *num;
-int enc;
+void des_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, des_key_schedule ks1, des_key_schedule ks2,
+ des_key_schedule ks3, des_cblock ivec, int *num, int enc)
{
register DES_LONG v0,v1;
register long l=length;
@@ -137,14 +132,9 @@ int enc;
}
#ifdef undef /* MACRO */
-void des_ede2_cfb64_encrypt(in, out, length, ks1,ks2, ivec, num, enc)
-unsigned char *in;
-unsigned char *out;
-long length;
-des_key_schedule ks1,ks2;
-des_cblock (*ivec);
-int *num;
-int enc;
+void des_ede2_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
+ des_key_schedule ks1, des_key_schedule ks2, des_cblock (*ivec),
+ int *num, int enc)
{
des_ede3_cfb64_encrypt(in,out,length,ks1,ks2,ks1,ivec,num,enc);
}
diff --git a/crypto/des/cfb64enc.c b/crypto/des/cfb64enc.c
index 9434ddad9e..e2525a781a 100644
--- a/crypto/des/cfb64enc.c
+++ b/crypto/des/cfb64enc.c
@@ -63,14 +63,9 @@
* 64bit block we have used is contained in *num;
*/
-void des_cfb64_encrypt(in, out, length, schedule, ivec, num, enc)
-const unsigned char *in;
-unsigned char *out;
-long length;
-des_key_schedule schedule;
-des_cblock ivec;
-int *num;
-int enc;
+void des_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, des_key_schedule schedule, des_cblock ivec, int *num,
+ int enc)
{
register DES_LONG v0,v1;
register long l=length;
diff --git a/crypto/des/cfb_enc.c b/crypto/des/cfb_enc.c
index df0c65ee82..12c1d5e500 100644
--- a/crypto/des/cfb_enc.c
+++ b/crypto/des/cfb_enc.c
@@ -64,14 +64,8 @@
* the second. The second 12 bits will come from the 3rd and half the 4th
* byte.
*/
-void des_cfb_encrypt(in, out, numbits, length, schedule, ivec, enc)
-const unsigned char *in;
-unsigned char *out;
-int numbits;
-long length;
-des_key_schedule schedule;
-des_cblock ivec;
-int enc;
+void des_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
+ long length, des_key_schedule schedule, des_cblock ivec, int enc)
{
register DES_LONG d0,d1,v0,v1,n=(numbits+7)/8;
register DES_LONG mask0,mask1;
diff --git a/crypto/des/des.c b/crypto/des/des.c
index 9b47cb3465..7dc3b565ba 100644
--- a/crypto/des/des.c
+++ b/crypto/des/des.c
@@ -138,9 +138,7 @@ char cksumname[200]="";
int vflag,cflag,eflag,dflag,kflag,bflag,fflag,sflag,uflag,flag3,hflag,error;
-int main(argc, argv)
-int argc;
-char **argv;
+int main(int argc, char **argv)
{
int i;
struct stat ins,outs;
@@ -331,7 +329,7 @@ char **argv;
EXIT(0);
}
-void usage()
+void usage(void)
{
char **u;
static const char *Usage[]={
@@ -369,7 +367,7 @@ NULL
EXIT(1);
}
-void doencryption()
+void doencryption(void)
{
#ifdef _LIBC
extern int srandom();
@@ -696,15 +694,8 @@ problems:
if (Exit) EXIT(Exit);
}
-int uufwrite(data, size, num, fp)
-unsigned char *data;
-int size;
-unsigned int num;
-FILE *fp;
-
- /* We ignore this parameter but it should be > ~50 I believe */
-
-
+/* We ignore this parameter but it should be > ~50 I believe */
+int uufwrite(unsigned char *data, int size, unsigned int num, FILE *fp)
{
int i,j,left,rem,ret=num;
static int start=1;
@@ -757,8 +748,7 @@ FILE *fp;
return(ret);
}
-void uufwriteEnd(fp)
-FILE *fp;
+void uufwriteEnd(FILE *fp)
{
int j;
static const char *end=" \nend\n";
@@ -774,11 +764,8 @@ FILE *fp;
fwrite(end,1,strlen(end),fp);
}
-int uufread(out, size, num, fp)
-unsigned char *out;
-int size; /* should always be > ~ 60; I actually ignore this parameter :-) */
-unsigned int num;
-FILE *fp;
+/* int size: should always be > ~ 60; I actually ignore this parameter :-) */
+int uufread(unsigned char *out, int size, unsigned int num, FILE *fp)
{
int i,j,tot;
static int done=0;
@@ -850,10 +837,7 @@ FILE *fp;
*((c)++)=(unsigned char)(((l) )&0xff))
-int uuencode(in, num, out)
-unsigned char *in;
-int num;
-unsigned char *out;
+int uuencode(unsigned char *in, int num, unsigned char *out)
{
int j,i,n,tot=0;
DES_LONG l;
@@ -883,10 +867,7 @@ unsigned char *out;
return(tot);
}
-int uudecode(in, num, out)
-unsigned char *in;
-int num;
-unsigned char *out;
+int uudecode(unsigned char *in, int num, unsigned char *out)
{
int j,i,k;
unsigned int n=0,space=0;
diff --git a/crypto/des/des_enc.c b/crypto/des/des_enc.c
index 935e83ff8e..a0ecfbc6ec 100644
--- a/crypto/des/des_enc.c
+++ b/crypto/des/des_enc.c
@@ -58,10 +58,7 @@
#include "des_locl.h"
-void des_encrypt(data, ks, enc)
-DES_LONG *data;
-des_key_schedule ks;
-int enc;
+void des_encrypt(DES_LONG *data, des_key_schedule ks, int enc)
{
register DES_LONG l,r,t,u;
#ifdef DES_PTR
@@ -159,10 +156,7 @@ int enc;
l=r=t=u=0;
}
-void des_encrypt2(data, ks, enc)
-DES_LONG *data;
-des_key_schedule ks;
-int enc;
+void des_encrypt2(DES_LONG *data, des_key_schedule ks, int enc)
{
register DES_LONG l,r,t,u;
#ifdef DES_PTR
@@ -253,11 +247,8 @@ int enc;
l=r=t=u=0;
}
-void des_encrypt3(data,ks1,ks2,ks3)
-DES_LONG *data;
-des_key_schedule ks1;
-des_key_schedule ks2;
-des_key_schedule ks3;
+void des_encrypt3(DES_LONG *data, des_key_schedule ks1, des_key_schedule ks2,
+ des_key_schedule ks3)
{
register DES_LONG l,r;
@@ -276,11 +267,8 @@ des_key_schedule ks3;
data[1]=r;
}
-void des_decrypt3(data,ks1,ks2,ks3)
-DES_LONG *data;
-des_key_schedule ks1;
-des_key_schedule ks2;
-des_key_schedule ks3;
+void des_decrypt3(DES_LONG *data, des_key_schedule ks1, des_key_schedule ks2,
+ des_key_schedule ks3)
{
register DES_LONG l,r;
@@ -301,13 +289,8 @@ des_key_schedule ks3;
#ifndef DES_DEFAULT_OPTIONS
-void des_ncbc_encrypt(in, out, length, schedule, ivec, enc)
-const unsigned char *in;
-unsigned char *out;
-long length;
-des_key_schedule schedule;
-des_cblock ivec;
-int enc;
+void des_ncbc_encrypt(const unsigned char *in, unsigned char *out, long length,
+ des_key_schedule schedule, des_cblock ivec, int enc)
{
register DES_LONG tin0,tin1;
register DES_LONG tout0,tout1,xor0,xor1;
@@ -380,15 +363,9 @@ int enc;
tin[0]=tin[1]=0;
}
-void des_ede3_cbc_encrypt(input, output, length, ks1, ks2, ks3, ivec, enc)
-const unsigned char *input;
-unsigned char *output;
-long length;
-des_key_schedule ks1;
-des_key_schedule ks2;
-des_key_schedule ks3;
-des_cblock ivec;
-int enc;
+void des_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
+ long length, des_key_schedule ks1, des_key_schedule ks2,
+ des_key_schedule ks3, des_cblock ivec, int enc)
{
register DES_LONG tin0,tin1;
register DES_LONG tout0,tout1,xor0,xor1;
diff --git a/crypto/des/des_opts.c b/crypto/des/des_opts.c
index 29d9461d29..7ef05c1876 100644
--- a/crypto/des/des_opts.c
+++ b/crypto/des/des_opts.c
@@ -353,8 +353,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;
@@ -367,8 +366,7 @@ int sig;
#define START 0
#define STOP 1
-double Time_F(s)
-int s;
+double Time_F(int s)
{
double ret;
#ifdef TIMES
@@ -426,9 +424,7 @@ int s;
fprintf(stderr,"%s bytes per sec = %12.2f (%5.1fuS)\n",name, \
tm[index]*8,1.0e6/tm[index]);
-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/des/destest.c b/crypto/des/destest.c
index a2e4d13f4b..fb69b123d5 100644
--- a/crypto/des/destest.c
+++ b/crypto/des/destest.c
@@ -313,9 +313,7 @@ static int cfb64_test();
static int ede_cfb64_test();
#endif
-int main(argc,argv)
-int argc;
-char *argv[];
+int main(int argc, char *argv[])
{
int i,j,err=0;
des_cblock in,out,outin,iv3,iv2;
@@ -794,8 +792,7 @@ plain[8+4], plain[8+5], plain[8+6], plain[8+7]);
return(0);
}
-static char *pt(p)
-unsigned char *p;
+static char *pt(unsigned char *p)
{
static char bufs[10][20];
static int bnum=0;
@@ -816,9 +813,7 @@ unsigned char *p;
#ifndef LIBDES_LIT
-static int cfb_test(bits, cfb_cipher)
-int bits;
-unsigned char *cfb_cipher;
+static int cfb_test(int bits, unsigned char *cfb_cipher)
{
des_key_schedule ks;
int i,err=0;
@@ -847,8 +842,7 @@ unsigned char *cfb_cipher;
return(err);
}
-static int cfb64_test(cfb_cipher)
-unsigned char *cfb_cipher;
+static int cfb64_test(unsigned char *cfb_cipher)
{
des_key_schedule ks;
int err=0,i,n;
@@ -881,8 +875,7 @@ unsigned char *cfb_cipher;
return(err);
}
-static int ede_cfb64_test(cfb_cipher)
-unsigned char *cfb_cipher;
+static int ede_cfb64_test(unsigned char *cfb_cipher)
{
des_key_schedule ks;
int err=0,i,n;
diff --git a/crypto/des/ecb3_enc.c b/crypto/des/ecb3_enc.c
index 7a0dfd6dd3..16e784fe80 100644
--- a/crypto/des/ecb3_enc.c
+++ b/crypto/des/ecb3_enc.c
@@ -58,13 +58,9 @@
#include "des_locl.h"
-void des_ecb3_encrypt(in, out, ks1, ks2, ks3, enc)
-const unsigned char *in;
-unsigned char *out;
-des_key_schedule ks1;
-des_key_schedule ks2;
-des_key_schedule ks3;
-int enc;
+void des_ecb3_encrypt(const unsigned char *in, unsigned char *out,
+ des_key_schedule ks1, des_key_schedule ks2, des_key_schedule ks3,
+ int enc)
{
register DES_LONG l0,l1;
DES_LONG ll[2];
diff --git a/crypto/des/ecb_enc.c b/crypto/des/ecb_enc.c
index 573a9f6bc9..6c0e5a4106 100644
--- a/crypto/des/ecb_enc.c
+++ b/crypto/des/ecb_enc.c
@@ -103,11 +103,8 @@ const char *des_options(void)
}
-void des_ecb_encrypt(in, out, ks, enc)
-const des_cblock in;
-des_cblock out;
-des_key_schedule ks;
-int enc;
+void des_ecb_encrypt(const des_cblock in, des_cblock out, des_key_schedule ks,
+ int enc)
{
register DES_LONG l;
DES_LONG ll[2];
diff --git a/crypto/des/ede_cbcm_enc.c b/crypto/des/ede_cbcm_enc.c
index caaf6dacce..82ef96188c 100644
--- a/crypto/des/ede_cbcm_enc.c
+++ b/crypto/des/ede_cbcm_enc.c
@@ -70,16 +70,9 @@ http://www.cs.technion.ac.il/users/wwwb/cgi-bin/tr-get.cgi/1998/CS/CS0928.ps.gz
#include "des_locl.h"
-void des_ede3_cbcm_encrypt(in, out, length, ks1, ks2, ks3, ivec1, ivec2, enc)
-const unsigned char *in;
-unsigned char *out;
-long length;
-des_key_schedule ks1;
-des_key_schedule ks2;
-des_key_schedule ks3;
-des_cblock ivec1;
-des_cblock ivec2;
-int enc;
+void des_ede3_cbcm_encrypt(const unsigned char *in, unsigned char *out,
+ long length, des_key_schedule ks1, des_key_schedule ks2,
+ des_key_schedule ks3, des_cblock ivec1, des_cblock ivec2, int enc)
{
register DES_LONG tin0,tin1;
register DES_LONG tout0,tout1,xor0,xor1,m0,m1;
diff --git a/crypto/des/ede_enc.c b/crypto/des/ede_enc.c
index 9f75dd1037..2d3ceae198 100644
--- a/crypto/des/ede_enc.c
+++ b/crypto/des/ede_enc.c
@@ -58,15 +58,9 @@
#include "des_locl.h"
-void des_ede3_cbc_encrypt(input, output, length, ks1, ks2, ks3, ivec, enc)
-des_cblock (*input);
-des_cblock (*output);
-long length;
-des_key_schedule ks1;
-des_key_schedule ks2;
-des_key_schedule ks3;
-des_cblock (*ivec);
-int enc;
+void des_ede3_cbc_encrypt(des_cblock (*input), des_cblock (*output),
+ long length, des_key_schedule ks1, des_key_schedule ks2,
+ des_key_schedule ks3, des_cblock (*ivec), int enc)
{
register DES_LONG tin0,tin1;
register DES_LONG tout0,tout1,xor0,xor1;
@@ -175,14 +169,9 @@ int enc;
}
#ifdef undef /* MACRO */
-void des_ede2_cbc_encrypt(input, output, length, ks1, ks2, ivec, enc)
-des_cblock (*input);
-des_cblock (*output);
-long length;
-des_key_schedule ks1;
-des_key_schedule ks2;
-des_cblock (*ivec);
-int enc;
+void des_ede2_cbc_encrypt(des_cblock (*input), des_cblock (*output),
+ long length, des_key_schedule ks1, des_key_schedule ks2,
+ des_cblock (*ivec), int enc)
{
des_ede3_cbc_encrypt(input,output,length,ks1,ks2,ks1,ivec,enc);
}
diff --git a/crypto/des/enc_read.c b/crypto/des/enc_read.c
index 3e5ac09875..a33e2496b4 100644
--- a/crypto/des/enc_read.c
+++ b/crypto/des/enc_read.c
@@ -84,12 +84,8 @@ int des_rw_mode=DES_PCBC_MODE;
*/
-int des_enc_read(fd, buf, len, sched, iv)
-int fd;
-char *buf;
-int len;
-des_key_schedule sched;
-des_cblock iv;
+int des_enc_read(int fd, char *buf, int len, des_key_schedule sched,
+ des_cblock iv)
{
/* data to be unencrypted */
int net_num=0;
diff --git a/crypto/des/enc_writ.c b/crypto/des/enc_writ.c
index d40dc273c0..238c0a9c09 100644
--- a/crypto/des/enc_writ.c
+++ b/crypto/des/enc_writ.c
@@ -76,12 +76,8 @@
* - This code cannot handle non-blocking sockets.
*/
-int des_enc_write(fd, buf, len, sched, iv)
-int fd;
-const char *buf;
-int len;
-des_key_schedule sched;
-des_cblock iv;
+int des_enc_write(int fd, const char *buf, int len, des_key_schedule sched,
+ des_cblock iv)
{
#ifdef _LIBC
extern int srandom();
diff --git a/crypto/des/fcrypt.c b/crypto/des/fcrypt.c
index e276a08653..87fe923eb3 100644
--- a/crypto/des/fcrypt.c
+++ b/crypto/des/fcrypt.c
@@ -70,12 +70,9 @@ char *crypt();
#endif
#if defined(PERL5) || defined(__FreeBSD__)
-char *des_crypt(buf,salt)
+char *des_crypt(const char *buf, const char *salt)
#else
-char *crypt(buf,salt)
-#endif
-const char *buf;
-const char *salt;
+char *crypt(const char *buf, const char *salt)
{
static char buff[14];
@@ -83,10 +80,7 @@ const char *salt;
}
-char *des_fcrypt(buf,salt,ret)
-const char *buf;
-const char *salt;
-char *ret;
+char *des_fcrypt(const char *buf, const char *salt, char *ret)
{
unsigned int i,j,x,y;
DES_LONG Eswap0,Eswap1;
diff --git a/crypto/des/fcrypt_b.c b/crypto/des/fcrypt_b.c
index 2197b98bf1..9cbea97c1f 100644
--- a/crypto/des/fcrypt_b.c
+++ b/crypto/des/fcrypt_b.c
@@ -77,11 +77,8 @@
#define HPERM_OP(a,t,n,m) ((t)=((((a)<<(16-(n)))^(a))&(m)),\
(a)=(a)^(t)^(t>>(16-(n))))\
-void fcrypt_body(out, ks, Eswap0, Eswap1)
-DES_LONG *out;
-des_key_schedule ks;
-DES_LONG Eswap0;
-DES_LONG Eswap1;
+void fcrypt_body(DES_LONG *out, des_key_schedule ks, DES_LONG Eswap0,
+ DES_LONG Eswap1)
{
register DES_LONG l,r,t,u;
#ifdef DES_PTR
diff --git a/crypto/des/ncbc_enc.c b/crypto/des/ncbc_enc.c
index 1d1a368c22..a13e4fc22b 100644
--- a/crypto/des/ncbc_enc.c
+++ b/crypto/des/ncbc_enc.c
@@ -58,13 +58,8 @@
#include "des_locl.h"
-void des_ncbc_encrypt(input, output, length, schedule, ivec, enc)
-des_cblock (*input);
-des_cblock (*output);
-long length;
-des_key_schedule schedule;
-des_cblock (*ivec);
-int enc;
+void des_ncbc_encrypt(des_cblock (*input), des_cblock (*output), long length,
+ des_key_schedule schedule, des_cblock (*ivec), int enc)
{
register DES_LONG tin0,tin1;
register DES_LONG tout0,tout1,xor0,xor1;
diff --git a/crypto/des/ofb64ede.c b/crypto/des/ofb64ede.c
index 1fa20e6acf..36245de793 100644
--- a/crypto/des/ofb64ede.c
+++ b/crypto/des/ofb64ede.c
@@ -62,13 +62,9 @@
* used. The extra state information to record how much of the
* 64bit block we have used is contained in *num;
*/
-void des_ede3_ofb64_encrypt(in, out, length, k1,k2,k3, ivec, num)
-register const unsigned char *in;
-register unsigned char *out;
-long length;
-des_key_schedule k1,k2,k3;
-des_cblock ivec;
-int *num;
+void des_ede3_ofb64_encrypt(register const unsigned char *in,
+ register unsigned char *out, long length, des_key_schedule k1,
+ des_key_schedule k2, des_key_schedule k3, des_cblock ivec, int *num)
{
register DES_LONG v0,v1;
register int n= *num;
@@ -118,13 +114,9 @@ int *num;
}
#ifdef undef /* MACRO */
-void des_ede2_ofb64_encrypt(in, out, length, k1,k2, ivec, num)
-register unsigned char *in;
-register unsigned char *out;
-long length;
-des_key_schedule k1,k2;
-des_cblock (*ivec);
-int *num;
+void des_ede2_ofb64_encrypt(register unsigned char *in,
+ register unsigned char *out, long length, des_key_schedule k1,
+ des_key_schedule k2, des_cblock (*ivec), int *num)
{
des_ede3_ofb64_encrypt(in, out, length, k1,k2,k1, ivec, num);
}
diff --git a/crypto/des/ofb64enc.c b/crypto/des/ofb64enc.c
index b6a2f639eb..545c749c55 100644
--- a/crypto/des/ofb64enc.c
+++ b/crypto/des/ofb64enc.c
@@ -62,13 +62,9 @@
* used. The extra state information to record how much of the
* 64bit block we have used is contained in *num;
*/
-void des_ofb64_encrypt(in, out, length, schedule, ivec, num)
-register const unsigned char *in;
-register unsigned char *out;
-long length;
-des_key_schedule schedule;
-des_cblock ivec;
-int *num;
+void des_ofb64_encrypt(register const unsigned char *in,
+ register unsigned char *out, long length, des_key_schedule schedule,
+ des_cblock ivec, int *num)
{
register DES_LONG v0,v1,t;
register int n= *num;
diff --git a/crypto/des/ofb_enc.c b/crypto/des/ofb_enc.c
index 75b32f06da..9ee221ea8f 100644
--- a/crypto/des/ofb_enc.c
+++ b/crypto/des/ofb_enc.c
@@ -64,13 +64,8 @@
* the second. The second 12 bits will come from the 3rd and half the 4th
* byte.
*/
-void des_ofb_encrypt(in, out, numbits, length, schedule, ivec)
-const unsigned char *in;
-unsigned char *out;
-int numbits;
-long length;
-des_key_schedule schedule;
-des_cblock ivec;
+void des_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
+ long length, des_key_schedule schedule, des_cblock ivec)
{
register DES_LONG d0,d1,vv0,vv1,v0,v1,n=(numbits+7)/8;
register DES_LONG mask0,mask1;
diff --git a/crypto/des/pcbc_enc.c b/crypto/des/pcbc_enc.c
index 2d5bb40e5f..1880217560 100644
--- a/crypto/des/pcbc_enc.c
+++ b/crypto/des/pcbc_enc.c
@@ -58,13 +58,8 @@
#include "des_locl.h"
-void des_pcbc_encrypt(input, output, length, schedule, ivec, enc)
-const unsigned char *input;
-unsigned char *output;
-long length;
-des_key_schedule schedule;
-des_cblock ivec;
-int enc;
+void des_pcbc_encrypt(const unsigned char *input, unsigned char *output,
+ long length, des_key_schedule schedule, des_cblock ivec, int enc)
{
register DES_LONG sin0,sin1,xor0,xor1,tout0,tout1;
DES_LONG tin[2];
diff --git a/crypto/des/qud_cksm.c b/crypto/des/qud_cksm.c
index d5e38c952f..09797f2257 100644
--- a/crypto/des/qud_cksm.c
+++ b/crypto/des/qud_cksm.c
@@ -73,12 +73,8 @@
/* Got the value MIT uses via brute force :-) 2/10/90 eay */
#define NOISE ((DES_LONG)83653421L)
-DES_LONG des_quad_cksum(input, output, length, out_count, seed)
-const unsigned char *input;
-des_cblocks output;
-long length;
-int out_count;
-des_cblock seed;
+DES_LONG des_quad_cksum(const unsigned char *input, des_cblocks output,
+ long length, int out_count, des_cblock seed)
{
DES_LONG z0,z1,t0,t1;
int i;
diff --git a/crypto/des/rand_key.c b/crypto/des/rand_key.c
index 8259f1a849..00db2bef77 100644
--- a/crypto/des/rand_key.c
+++ b/crypto/des/rand_key.c
@@ -62,15 +62,13 @@
static int seed=0;
static des_cblock init;
-void des_random_seed(key)
-des_cblock key;
+void des_random_seed(des_cblock key)
{
memcpy(init,key,sizeof(des_cblock));
seed=1;
}
-void des_random_key(ret)
-unsigned char *ret;
+void des_random_key(unsigned char *ret)
{
des_key_schedule ks;
static DES_LONG c=0;
diff --git a/crypto/des/read2pwd.c b/crypto/des/read2pwd.c
index 440173afdc..1534f79e65 100644
--- a/crypto/des/read2pwd.c
+++ b/crypto/des/read2pwd.c
@@ -58,10 +58,7 @@
#include "des_locl.h"
-int des_read_password(key, prompt, verify)
-des_cblock key;
-const char *prompt;
-int verify;
+int des_read_password(des_cblock key, const char *prompt, int verify)
{
int ok;
char buf[BUFSIZ],buff[BUFSIZ];
@@ -73,11 +70,8 @@ int verify;
return(ok);
}
-int des_read_2passwords(key1, key2, prompt, verify)
-des_cblock key1;
-des_cblock key2;
-const char *prompt;
-int verify;
+int des_read_2passwords(des_cblock key1, des_cblock key2, const char *prompt,
+ int verify)
{
int ok;
char buf[BUFSIZ],buff[BUFSIZ];
diff --git a/crypto/des/read_pwd.c b/crypto/des/read_pwd.c
index ac6a548fc3..b44b937a49 100644
--- a/crypto/des/read_pwd.c
+++ b/crypto/des/read_pwd.c
@@ -198,11 +198,8 @@ static int noecho_fgets();
#endif
static jmp_buf save;
-int des_read_pw_string(buf, length, prompt, verify)
-char *buf;
-int length;
-const char *prompt;
-int verify;
+int des_read_pw_string(char *buf, int length, const char *prompt,
+ int verify)
{
char buff[BUFSIZ];
int ret;
@@ -214,8 +211,7 @@ int verify;
#ifndef WIN16
-static void read_till_nl(in)
-FILE *in;
+static void read_till_nl(FILE *in)
{
#define SIZE 4
char buf[SIZE+1];
@@ -227,12 +223,8 @@ FILE *in;
/* return 0 if ok, 1 (or -1) otherwise */
-int des_read_pw(buf, buff, size, prompt, verify)
-char *buf;
-char *buff;
-int size;
-const char *prompt;
-int verify;
+int des_read_pw(char *buf, char *buff, int size, const char *prompt,
+ int verify)
{
#ifdef VMS
struct IOSB iosb;
@@ -382,12 +374,7 @@ error:
#else /* WIN16 */
-int des_read_pw(buf, buff, size, prompt, verify)
-char *buf;
-char *buff;
-int size;
-char *prompt;
-int verify;
+int des_read_pw(char *buf, char *buff, int size, char *prompt, int verify)
{
memset(buf,0,size);
memset(buff,0,size);
@@ -396,7 +383,7 @@ int verify;
#endif
-static void pushsig()
+static void pushsig(void)
{
int i;
#ifdef SIGACTION
@@ -428,7 +415,7 @@ static void pushsig()
#endif
}
-static void popsig()
+static void popsig(void)
{
int i;
@@ -450,8 +437,7 @@ static void popsig()
}
}
-static void recsig(i)
-int i;
+static void recsig(int i)
{
longjmp(save,1);
#ifdef LINT
@@ -460,10 +446,7 @@ int i;
}
#if defined(MSDOS) && !defined(WIN16)
-static int noecho_fgets(buf,size,tty)
-char *buf;
-int size;
-FILE *tty;
+static int noecho_fgets(char *buf, int size, FILE *tty)
{
int i;
char *p;
diff --git a/crypto/des/rpc_enc.c b/crypto/des/rpc_enc.c
index 9c1dbb29f2..51f560a84f 100644
--- a/crypto/des/rpc_enc.c
+++ b/crypto/des/rpc_enc.c
@@ -66,10 +66,7 @@ int _des_crypt(char *buf,int len,struct desparams *desp);
int _des_crypt();
#endif
-int _des_crypt(buf, len, desp)
-char *buf;
-int len;
-struct desparams *desp;
+int _des_crypt(char *buf, int len, struct desparams *desp)
{
des_key_schedule ks;
int enc;
diff --git a/crypto/des/rpw.c b/crypto/des/rpw.c
index 6447ed9cf0..bf9d35ca33 100644
--- a/crypto/des/rpw.c
+++ b/crypto/des/rpw.c
@@ -59,9 +59,7 @@
#include <stdio.h>
#include "des.h"
-int main(argc,argv)
-int argc;
-char *argv[];
+int main(int argc, char *argv[])
{
des_cblock k,k1;
int i;
diff --git a/crypto/des/set_key.c b/crypto/des/set_key.c
index cdc3c19233..52f0f8aff9 100644
--- a/crypto/des/set_key.c
+++ b/crypto/des/set_key.c
@@ -75,8 +75,7 @@ static int check_parity();
int des_check_key=0;
-void des_set_odd_parity(key)
-des_cblock key;
+void des_set_odd_parity(des_cblock key)
{
int i;
@@ -84,8 +83,7 @@ des_cblock key;
key[i]=odd_parity[key[i]];
}
-static int check_parity(key)
-const des_cblock key;
+static int check_parity(const des_cblock key)
{
int i;
@@ -127,8 +125,7 @@ static des_cblock weak_keys[NUM_WEAK_KEY]={
{0xE0,0xFE,0xE0,0xFE,0xF1,0xFE,0xF1,0xFE},
{0xFE,0xE0,0xFE,0xE0,0xFE,0xF1,0xFE,0xF1}};
-int des_is_weak_key(key)
-const des_cblock key;
+int des_is_weak_key(const des_cblock key)
{
int i;
@@ -157,9 +154,7 @@ const des_cblock key;
* return -1 if key parity error,
* return -2 if illegal weak key.
*/
-int des_set_key(key, schedule)
-const des_cblock key;
-des_key_schedule schedule;
+int des_set_key(const des_cblock key, des_key_schedule schedule)
{
static int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0};
register DES_LONG c,d,t,s,t2;
@@ -238,9 +233,7 @@ des_key_schedule schedule;
return(0);
}
-int des_key_sched(key, schedule)
-const des_cblock key;
-des_key_schedule schedule;
+int des_key_sched(const des_cblock key, des_key_schedule schedule)
{
return(des_set_key(key,schedule));
}
diff --git a/crypto/des/speed.c b/crypto/des/speed.c
index bac078e054..1384c9419e 100644
--- a/crypto/des/speed.c
+++ b/crypto/des/speed.c
@@ -139,8 +139,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;
@@ -153,8 +152,7 @@ int sig;
#define START 0
#define STOP 1
-double Time_F(s)
-int s;
+double Time_F(int s)
{
double ret;
#ifdef TIMES
@@ -190,9 +188,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/des/str2key.c b/crypto/des/str2key.c
index 7701580a8d..40f706beb7 100644
--- a/crypto/des/str2key.c
+++ b/crypto/des/str2key.c
@@ -60,9 +60,7 @@
extern int des_check_key;
-void des_string_to_key(str, key)
-const char *str;
-des_cblock key;
+void des_string_to_key(const char *str, des_cblock key)
{
des_key_schedule ks;
int i,length;
@@ -99,10 +97,7 @@ des_cblock key;
des_set_odd_parity(key);
}
-void des_string_to_2keys(str, key1, key2)
-const char *str;
-des_cblock key1;
-des_cblock key2;
+void des_string_to_2keys(const char *str, des_cblock key1, des_cblock key2)
{
des_key_schedule ks;
int i,length;
diff --git a/crypto/des/supp.c b/crypto/des/supp.c
index 1d9effdd42..8fa0a3e8e4 100644
--- a/crypto/des/supp.c
+++ b/crypto/des/supp.c
@@ -87,15 +87,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: supp.c,v 1.3 1999/04/17 21:25:00 ben Exp $
+ * $Id: supp.c,v 1.4 1999/04/19 21:28:07 ulf Exp $
*/
#include <stdio.h>
#include "des_locl.h"
-void des_cblock_print_file(cb, fp)
- const des_cblock cb;
- FILE *fp;
+void des_cblock_print_file(const des_cblock cb, FILE *fp)
{
int i;
const unsigned int *p = (const unsigned int *)cb;
diff --git a/crypto/des/xcbc_enc.c b/crypto/des/xcbc_enc.c
index 9a9480ec3a..0d3b6a4d04 100644
--- a/crypto/des/xcbc_enc.c
+++ b/crypto/des/xcbc_enc.c
@@ -79,10 +79,8 @@ static unsigned char desx_white_in2out[256]={
0xA7,0x1C,0xC9,0x09,0x69,0x9A,0x83,0xCF,0x29,0x39,0xB9,0xE9,0x4C,0xFF,0x43,0xAB,
};
-void des_xwhite_in2out(key,in,out)
-const des_cblock key;
-const des_cblock in;
-des_cblock out;
+void des_xwhite_in2out(const des_cblock key, const des_cblock in,
+ des_cblock out)
{
int out0,out1;
int i;
@@ -106,15 +104,9 @@ des_cblock out;
}
}
-void des_xcbc_encrypt(in, out, length, schedule, ivec, inw,outw,enc)
-const unsigned char *in;
-unsigned char *out;
-long length;
-des_key_schedule schedule;
-des_cblock ivec;
-const des_cblock inw;
-const des_cblock outw;
-int enc;
+void des_xcbc_encrypt(const unsigned char *in, unsigned char *out, long length,
+ des_key_schedule schedule, des_cblock ivec, const des_cblock inw,
+ const des_cblock outw, int enc)
{
register DES_LONG tin0,tin1;
register DES_LONG tout0,tout1,xor0,xor1;