Don't #define _, and eliminate casts.
authorUlf Möller <ulf@openssl.org>
Tue, 8 Jun 1999 15:52:47 +0000 (15:52 +0000)
committerUlf Möller <ulf@openssl.org>
Tue, 8 Jun 1999 15:52:47 +0000 (15:52 +0000)
crypto/des/des.h
crypto/des/des_enc.c
crypto/evp/evp.h

index 8d3ca115674837149fa09412c56713bd07e5c91d..c2aae6595e011ee925710f87788c8950bdbe3e07 100644 (file)
@@ -87,15 +87,11 @@ typedef /* const */ unsigned char const_des_cblock[8];
 typedef struct des_ks_struct
        {
        union   {
-               des_cblock _;
+               des_cblock cblock;
                /* make sure things are correct size on machines with
                 * 8 byte longs */
-               DES_LONG pad[2];
+               DES_LONG deslong[2];
                } ks;
-#if defined _
-# error "_ is defined, but some strange definition the DES library cannot handle that."
-#endif
-#define _      ks._
        int weak_key;
        } des_key_schedule[16];
 
@@ -120,7 +116,6 @@ typedef struct des_ks_struct
 #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
        des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
 
-#define C_Block des_cblock
 #define Key_schedule des_key_schedule
 #ifdef KERBEROS
 #define ENCRYPT DES_ENCRYPT
index 3a30e64e568d5b57f01032514573e9ca4d5f6689..f47d2a02da3e67f7c6b63bdcf7335c784667eb01 100644 (file)
@@ -84,7 +84,7 @@ void des_encrypt(DES_LONG *data, des_key_schedule ks, int enc)
        r=ROTATE(r,29)&0xffffffffL;
        l=ROTATE(l,29)&0xffffffffL;
 
-       s=(DES_LONG *)ks;
+       s=ks->ks.deslong;
        /* I don't know if it is worth the effort of loop unrolling the
         * inner loop */
        if (enc)
@@ -180,7 +180,7 @@ void des_encrypt2(DES_LONG *data, des_key_schedule ks, int enc)
        r=ROTATE(r,29)&0xffffffffL;
        l=ROTATE(l,29)&0xffffffffL;
 
-       s=(DES_LONG *)ks;
+       s=ks->ks.deslong;
        /* I don't know if it is worth the effort of loop unrolling the
         * inner loop */
        if (enc)
index b38ea6e999568cb38f3d554b174a3f90689617d7..28814c80736cd4744de49c289ef60a1039217592 100644 (file)
@@ -355,8 +355,8 @@ typedef struct evp_cipher_ctx_st
                struct
                        {
                        des_key_schedule ks;/* key schedule */
-                       C_Block inw;
-                       C_Block outw;
+                       des_cblock inw;
+                       des_cblock outw;
                        } desx_cbc;
                struct
                        {