make update
[openssl.git] / crypto / des / xcbc_enc.c
index 9a9480ec3af0d6bb37498dc1e581b90b570cff58..47246eb466497c0667c1221aa83bc5b7811a36a2 100644 (file)
@@ -79,13 +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(key,in,out)
-const des_cblock key;
-const des_cblock in;
-des_cblock out;
+void DES_xwhite_in2out(const_DES_cblock *des_key, const_DES_cblock *in_white,
+            DES_cblock *out_white)
        {
        int out0,out1;
        int i;
+       const unsigned char *key = &(*des_key)[0];
+       const unsigned char *in = &(*in_white)[0];
+       unsigned char *out = &(*out_white)[0];
 
        out[0]=out[1]=out[2]=out[3]=out[4]=out[5]=out[6]=out[7]=0;
        out0=out1=0;
@@ -106,15 +107,10 @@ 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;
@@ -124,14 +120,14 @@ int enc;
        DES_LONG tin[2];
        unsigned char *iv;
 
-       in2=inw;
+       in2 = &(*inw)[0];
        c2l(in2,inW0);
        c2l(in2,inW1);
-       in2=outw;
+       in2 = &(*outw)[0];
        c2l(in2,outW0);
        c2l(in2,outW1);
 
-       iv=ivec;
+       iv = &(*ivec)[0];
 
        if (enc)
                {
@@ -143,7 +139,7 @@ int enc;
                        c2l(in,tin1);
                        tin0^=tout0^inW0; tin[0]=tin0;
                        tin1^=tout1^inW1; tin[1]=tin1;
-                       des_encrypt(tin,schedule,DES_ENCRYPT);
+                       DES_encrypt1(tin,schedule,DES_ENCRYPT);
                        tout0=tin[0]^outW0; l2c(tout0,out);
                        tout1=tin[1]^outW1; l2c(tout1,out);
                        }
@@ -152,11 +148,11 @@ int enc;
                        c2ln(in,tin0,tin1,l+8);
                        tin0^=tout0^inW0; tin[0]=tin0;
                        tin1^=tout1^inW1; tin[1]=tin1;
-                       des_encrypt(tin,schedule,DES_ENCRYPT);
+                       DES_encrypt1(tin,schedule,DES_ENCRYPT);
                        tout0=tin[0]^outW0; l2c(tout0,out);
                        tout1=tin[1]^outW1; l2c(tout1,out);
                        }
-               iv=ivec;
+               iv = &(*ivec)[0];
                l2c(tout0,iv);
                l2c(tout1,iv);
                }
@@ -168,7 +164,7 @@ int enc;
                        {
                        c2l(in,tin0); tin[0]=tin0^outW0;
                        c2l(in,tin1); tin[1]=tin1^outW1;
-                       des_encrypt(tin,schedule,DES_DECRYPT);
+                       DES_encrypt1(tin,schedule,DES_DECRYPT);
                        tout0=tin[0]^xor0^inW0;
                        tout1=tin[1]^xor1^inW1;
                        l2c(tout0,out);
@@ -180,7 +176,7 @@ int enc;
                        {
                        c2l(in,tin0); tin[0]=tin0^outW0;
                        c2l(in,tin1); tin[1]=tin1^outW1;
-                       des_encrypt(tin,schedule,DES_DECRYPT);
+                       DES_encrypt1(tin,schedule,DES_DECRYPT);
                        tout0=tin[0]^xor0^inW0;
                        tout1=tin[1]^xor1^inW1;
                        l2cn(tout0,tout1,out,l+8);
@@ -188,7 +184,7 @@ int enc;
                        xor1=tin1;
                        }
 
-               iv=ivec;
+               iv = &(*ivec)[0];
                l2c(xor0,iv);
                l2c(xor1,iv);
                }