Stupid typo
[oweals/openssl.git] / crypto / des / ede_cbcm_enc.c
index caaf6daccec624a47d1d0efec0f670c5a2c36cd8..adfcb75cf3878f53f86f5759ca8210871166be4b 100644 (file)
@@ -68,18 +68,15 @@ http://www.cs.technion.ac.il/users/wwwb/cgi-bin/tr-get.cgi/1998/CS/CS0928.ps.gz
 
 */
 
+#include <openssl/opensslconf.h> /* To see if OPENSSL_NO_DESCBCM is defined */
+
+#ifndef OPENSSL_NO_DESCBCM
 #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;
@@ -87,8 +84,8 @@ int enc;
     DES_LONG tin[2];
     unsigned char *iv1,*iv2;
 
-    iv1=ivec1;
-    iv2=ivec2;
+    iv1 = &(*ivec1)[0];
+    iv2 = &(*ivec2)[0];
 
     if (enc)
        {
@@ -100,7 +97,7 @@ int enc;
            {
            tin[0]=m0;
            tin[1]=m1;
-           des_encrypt(tin,ks3,1);
+           DES_encrypt1(tin,ks3,1);
            m0=tin[0];
            m1=tin[1];
 
@@ -118,24 +115,24 @@ int enc;
 
            tin[0]=tin0;
            tin[1]=tin1;
-           des_encrypt(tin,ks1,1);
+           DES_encrypt1(tin,ks1,1);
            tin[0]^=m0;
            tin[1]^=m1;
-           des_encrypt(tin,ks2,0);
+           DES_encrypt1(tin,ks2,0);
            tin[0]^=m0;
            tin[1]^=m1;
-           des_encrypt(tin,ks1,1);
+           DES_encrypt1(tin,ks1,1);
            tout0=tin[0];
            tout1=tin[1];
 
            l2c(tout0,out);
            l2c(tout1,out);
            }
-       iv1=ivec1;
+       iv1=&(*ivec1)[0];
        l2c(m0,iv1);
        l2c(m1,iv1);
 
-       iv2=ivec2;
+       iv2=&(*ivec2)[0];
        l2c(tout0,iv2);
        l2c(tout1,iv2);
        }
@@ -151,7 +148,7 @@ int enc;
            {
            tin[0]=m0;
            tin[1]=m1;
-           des_encrypt(tin,ks3,1);
+           DES_encrypt1(tin,ks3,1);
            m0=tin[0];
            m1=tin[1];
 
@@ -163,13 +160,13 @@ int enc;
 
            tin[0]=tin0;
            tin[1]=tin1;
-           des_encrypt(tin,ks1,0);
+           DES_encrypt1(tin,ks1,0);
            tin[0]^=m0;
            tin[1]^=m1;
-           des_encrypt(tin,ks2,1);
+           DES_encrypt1(tin,ks2,1);
            tin[0]^=m0;
            tin[1]^=m1;
-           des_encrypt(tin,ks1,0);
+           DES_encrypt1(tin,ks1,0);
            tout0=tin[0];
            tout1=tin[1];
 
@@ -188,14 +185,15 @@ int enc;
            xor1=t1;
            }
 
-       iv1=ivec1;
+       iv1=&(*ivec1)[0];
        l2c(m0,iv1);
        l2c(m1,iv1);
 
-       iv2=ivec2;
+       iv2=&(*ivec2)[0];
        l2c(xor0,iv2);
        l2c(xor1,iv2);
        }
     tin0=tin1=tout0=tout1=xor0=xor1=0;
     tin[0]=tin[1]=0;
     }
+#endif