This commit was manufactured by cvs2svn to create branch
[openssl.git] / crypto / des / des_enc.c
index dfabd491986f02e4da11d62ae81421ca9689ccdd..828feba208af3ff066173f4b42919eccc29e4618 100644 (file)
  */
 
 #include "des_locl.h"
+#include "spr.h"
 
 void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
        {
        register DES_LONG l,r,t,u;
 #ifdef DES_PTR
-       register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
+       register const unsigned char *des_SP=(const unsigned char *)DES_SPtrans;
 #endif
 #ifndef DES_UNROLL
        register int i;
@@ -75,7 +76,7 @@ void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
        IP(r,l);
        /* Things have been modified so that the initial rotate is
         * done outside the loop.  This required the
-        * des_SPtrans values in sp.h to be rotated 1 bit to the right.
+        * DES_SPtrans values in sp.h to be rotated 1 bit to the right.
         * One perl script later and things have a 5% speed up on a sparc2.
         * Thanks to Richard Outerbridge <71755.204@CompuServe.COM>
         * for pointing this out. */
@@ -107,12 +108,10 @@ void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
                D_ENCRYPT(l,r,28); /*  15 */
                D_ENCRYPT(r,l,30); /*  16 */
 #else
-               for (i=0; i<32; i+=8)
+               for (i=0; i<32; i+=4)
                        {
                        D_ENCRYPT(l,r,i+0); /*  1 */
                        D_ENCRYPT(r,l,i+2); /*  2 */
-                       D_ENCRYPT(l,r,i+4); /*  3 */
-                       D_ENCRYPT(r,l,i+6); /*  4 */
                        }
 #endif
                }
@@ -136,12 +135,10 @@ void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
                D_ENCRYPT(l,r, 2); /*  2 */
                D_ENCRYPT(r,l, 0); /*  1 */
 #else
-               for (i=30; i>0; i-=8)
+               for (i=30; i>0; i-=4)
                        {
                        D_ENCRYPT(l,r,i-0); /* 16 */
                        D_ENCRYPT(r,l,i-2); /* 15 */
-                       D_ENCRYPT(l,r,i-4); /* 14 */
-                       D_ENCRYPT(r,l,i-6); /* 13 */
                        }
 #endif
                }
@@ -160,7 +157,7 @@ void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
        {
        register DES_LONG l,r,t,u;
 #ifdef DES_PTR
-       register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
+       register const unsigned char *des_SP=(const unsigned char *)DES_SPtrans;
 #endif
 #ifndef DES_UNROLL
        register int i;
@@ -172,7 +169,7 @@ void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
 
        /* Things have been modified so that the initial rotate is
         * done outside the loop.  This required the
-        * des_SPtrans values in sp.h to be rotated 1 bit to the right.
+        * DES_SPtrans values in sp.h to be rotated 1 bit to the right.
         * One perl script later and things have a 5% speed up on a sparc2.
         * Thanks to Richard Outerbridge <71755.204@CompuServe.COM>
         * for pointing this out. */
@@ -203,12 +200,10 @@ void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
                D_ENCRYPT(l,r,28); /*  15 */
                D_ENCRYPT(r,l,30); /*  16 */
 #else
-               for (i=0; i<32; i+=8)
+               for (i=0; i<32; i+=4)
                        {
                        D_ENCRYPT(l,r,i+0); /*  1 */
                        D_ENCRYPT(r,l,i+2); /*  2 */
-                       D_ENCRYPT(l,r,i+4); /*  3 */
-                       D_ENCRYPT(r,l,i+6); /*  4 */
                        }
 #endif
                }
@@ -232,12 +227,10 @@ void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
                D_ENCRYPT(l,r, 2); /*  2 */
                D_ENCRYPT(r,l, 0); /*  1 */
 #else
-               for (i=30; i>0; i-=8)
+               for (i=30; i>0; i-=4)
                        {
                        D_ENCRYPT(l,r,i-0); /* 16 */
                        D_ENCRYPT(r,l,i-2); /* 15 */
-                       D_ENCRYPT(l,r,i-4); /* 14 */
-                       D_ENCRYPT(r,l,i-6); /* 13 */
                        }
 #endif
                }