summaryrefslogtreecommitdiffstats
path: root/crypto/des/xcbc_enc.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>1999-02-13 18:52:38 +0000
committerBen Laurie <ben@openssl.org>1999-02-13 18:52:38 +0000
commit4e31df2cd73dbb659fd8a6eca6270fac661c072d (patch)
treee27cb10012ceeaf8dd433b5cf12b6fd7e73fdb8a /crypto/des/xcbc_enc.c
parente4119b931172a6a28e2ecb65ef41c6f23b89d09c (diff)
Fix ghastly DES declarations, and all consequential warnings.
Diffstat (limited to 'crypto/des/xcbc_enc.c')
-rw-r--r--crypto/des/xcbc_enc.c55
1 files changed, 24 insertions, 31 deletions
diff --git a/crypto/des/xcbc_enc.c b/crypto/des/xcbc_enc.c
index 031589bf50..9a9480ec3a 100644
--- a/crypto/des/xcbc_enc.c
+++ b/crypto/des/xcbc_enc.c
@@ -79,19 +79,14 @@ 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(des_key,in_white,out_white)
-des_cblock (*des_key);
-des_cblock (*in_white);
-des_cblock (*out_white);
+void des_xwhite_in2out(key,in,out)
+const des_cblock key;
+const des_cblock in;
+des_cblock out;
{
- unsigned char *key,*in,*out;
int out0,out1;
int i;
- key=(unsigned char *)des_key;
- in=(unsigned char *)in_white;
- out=(unsigned char *)out_white;
-
out[0]=out[1]=out[2]=out[3]=out[4]=out[5]=out[6]=out[7]=0;
out0=out1=0;
for (i=0; i<8; i++)
@@ -111,34 +106,32 @@ des_cblock (*out_white);
}
}
-void des_xcbc_encrypt(input, output, length, schedule, ivec, inw,outw,enc)
-des_cblock (*input);
-des_cblock (*output);
+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);
-des_cblock (*inw);
-des_cblock (*outw);
+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;
register DES_LONG inW0,inW1,outW0,outW1;
- register unsigned char *in,*out;
+ register const unsigned char *in2;
register long l=length;
DES_LONG tin[2];
unsigned char *iv;
- in=(unsigned char *)inw;
- c2l(in,inW0);
- c2l(in,inW1);
- in=(unsigned char *)outw;
- c2l(in,outW0);
- c2l(in,outW1);
+ in2=inw;
+ c2l(in2,inW0);
+ c2l(in2,inW1);
+ in2=outw;
+ c2l(in2,outW0);
+ c2l(in2,outW1);
- in=(unsigned char *)input;
- out=(unsigned char *)output;
- iv=(unsigned char *)ivec;
+ iv=ivec;
if (enc)
{
@@ -150,7 +143,7 @@ int enc;
c2l(in,tin1);
tin0^=tout0^inW0; tin[0]=tin0;
tin1^=tout1^inW1; tin[1]=tin1;
- des_encrypt((DES_LONG *)tin,schedule,DES_ENCRYPT);
+ des_encrypt(tin,schedule,DES_ENCRYPT);
tout0=tin[0]^outW0; l2c(tout0,out);
tout1=tin[1]^outW1; l2c(tout1,out);
}
@@ -159,11 +152,11 @@ int enc;
c2ln(in,tin0,tin1,l+8);
tin0^=tout0^inW0; tin[0]=tin0;
tin1^=tout1^inW1; tin[1]=tin1;
- des_encrypt((DES_LONG *)tin,schedule,DES_ENCRYPT);
+ des_encrypt(tin,schedule,DES_ENCRYPT);
tout0=tin[0]^outW0; l2c(tout0,out);
tout1=tin[1]^outW1; l2c(tout1,out);
}
- iv=(unsigned char *)ivec;
+ iv=ivec;
l2c(tout0,iv);
l2c(tout1,iv);
}
@@ -175,7 +168,7 @@ int enc;
{
c2l(in,tin0); tin[0]=tin0^outW0;
c2l(in,tin1); tin[1]=tin1^outW1;
- des_encrypt((DES_LONG *)tin,schedule,DES_DECRYPT);
+ des_encrypt(tin,schedule,DES_DECRYPT);
tout0=tin[0]^xor0^inW0;
tout1=tin[1]^xor1^inW1;
l2c(tout0,out);
@@ -187,7 +180,7 @@ int enc;
{
c2l(in,tin0); tin[0]=tin0^outW0;
c2l(in,tin1); tin[1]=tin1^outW1;
- des_encrypt((DES_LONG *)tin,schedule,DES_DECRYPT);
+ des_encrypt(tin,schedule,DES_DECRYPT);
tout0=tin[0]^xor0^inW0;
tout1=tin[1]^xor1^inW1;
l2cn(tout0,tout1,out,l+8);
@@ -195,7 +188,7 @@ int enc;
xor1=tin1;
}
- iv=(unsigned char *)ivec;
+ iv=ivec;
l2c(xor0,iv);
l2c(xor1,iv);
}