* pcbc_encrypt.c, quad_cksum.c: Punt duplicates of definitions;
authorTom Yu <tlyu@mit.edu>
Mon, 27 Oct 1997 06:16:27 +0000 (06:16 +0000)
committerTom Yu <tlyu@mit.edu>
Mon, 27 Oct 1997 06:16:27 +0000 (06:16 +0000)
  use local des.h only, as that appears to be safe.  Also, replace
uses of KRB_INT32 with DES_INT32 to remove temptation to misuse.

* des.h: Don't include k5-int.h any longer, as des_int.h already
gets it.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10253 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/des425/ChangeLog
src/lib/des425/des.h
src/lib/des425/pcbc_encrypt.c
src/lib/des425/quad_cksum.c

index eb4f22b15b4c83768fb19f88613cdc7a2ebac165..a23b57c77ae4c3a07f1fc42a512b5d7265a9c49a 100644 (file)
@@ -1,3 +1,12 @@
+Mon Oct 27 01:14:16 1997  Tom Yu  <tlyu@mit.edu>
+
+       * pcbc_encrypt.c, quad_cksum.c: Punt duplicates of definitions;
+       use local des.h only, as that appears to be safe.  Also, replace
+       uses of KRB_INT32 with DES_INT32 to remove temptation to misuse.
+
+       * des.h: Don't include k5-int.h any longer, as des_int.h already
+       gets it.
+
 Tue Oct 14 15:40:46 1997  Tom Yu  <tlyu@voltage-multiplier.mit.edu>
 
        * Makefile.in (LIBMAJOR): Bump major version due to possible
index 4e85536be9ae29d9a54d38a80d9730aa4bf9c18a..f9f65124705ab065c6f0302dc3affc2303f70d2a 100644 (file)
@@ -31,8 +31,7 @@
 #ifndef DES_DEFS
 #define DES_DEFS
 
-#include "k5-int.h"
-#include "des_int.h"
+#include <des_int.h>
 
 typedef mit_des_cblock des_cblock;     /* crypto-block size */
 
index 62d2f038e98d2538f07471d27833eff39bb63977..c4972fc0b659e13e8c2c4eaef60a45d0cfa88337 100644 (file)
  * des_pcbc_encrypt.c - encrypt a string of characters in error propagation mode
  */
 
-/* 
- * copy of include/des.h to avoid collision with local one
- */
-#include "krb5.h"
-
-#ifndef KRB_INT32
-#if (SIZEOF_LONG == 4)
-#define KRB_INT32 long
-#elif (SIZEOF_INT == 4)
-#define KRB_INT32 int
-#elif (SIZEOF_SHORT == 4)
-#define KRB_INT32 short
-#else
-  ?== No 32 bit type available
-#endif
-#endif /* !KRB_INT32 */
-
-       
-#ifndef KRB_UINT32
-#define KRB_UINT32 unsigned KRB_INT32
-#endif
-
-typedef unsigned char des_cblock[8];   /* crypto-block size */
-/* Key schedule */
-typedef struct des_ks_struct { union { KRB_INT32 pad; des_cblock _;} __; } des_key_schedule[16];
-
-#define DES_KEY_SZ     (sizeof(des_cblock))
-#define DES_ENCRYPT    1
-#define DES_DECRYPT    0
-
-#ifndef NCOMPAT
-#define C_Block des_cblock
-#define Key_schedule des_key_schedule
-#define ENCRYPT DES_ENCRYPT
-#define DECRYPT DES_DECRYPT
-#define KEY_SZ DES_KEY_SZ
-#define string_to_key des_string_to_key
-#define read_pw_string des_read_pw_string
-#define random_key des_random_key
-#define pcbc_encrypt des_pcbc_encrypt
-#define key_sched des_key_sched
-#define cbc_encrypt des_cbc_encrypt
-#define cbc_cksum des_cbc_cksum
-#define C_Block_print des_cblock_print
-#define quad_cksum des_quad_cksum
-typedef struct des_ks_struct bit_64;
-#endif
-
-#define des_cblock_print(x) des_cblock_print_file(x, stdout)
-
-#include "f_tables.h"
+#include "des.h"
+#include <f_tables.h>
 
 /*
  * des_pcbc_encrypt - {en,de}crypt a stream in PCBC mode
@@ -79,22 +30,22 @@ des_pcbc_encrypt(in, out, length, schedule, ivec, encrypt)
        des_cblock ivec;
        int encrypt;
 {
-       register unsigned KRB_INT32 left, right;
-       register unsigned KRB_INT32 temp;
-       register unsigned KRB_INT32 *kp;
+       register unsigned DES_INT32 left, right;
+       register unsigned DES_INT32 temp;
+       register unsigned DES_INT32 *kp;
        register unsigned char *ip, *op;
 
        /*
         * Copy the key pointer, just once
         */
-       kp = (unsigned KRB_INT32 *)schedule;
+       kp = (unsigned DES_INT32 *)schedule;
 
        /*
         * Deal with encryption and decryption separately.
         */
        if (encrypt) {
-               register unsigned KRB_INT32 plainl;
-               register unsigned KRB_INT32 plainr;
+               register unsigned DES_INT32 plainl;
+               register unsigned DES_INT32 plainr;
 
                /*
                 * Initialize left and right with the contents of the initial
@@ -176,8 +127,8 @@ des_pcbc_encrypt(in, out, length, schedule, ivec, encrypt)
                 * the necessity of remembering a lot more things.
                 * Should think about this a little more...
                 */
-               unsigned KRB_INT32 ocipherl, ocipherr;
-               unsigned KRB_INT32 cipherl, cipherr;
+               unsigned DES_INT32 ocipherl, ocipherr;
+               unsigned DES_INT32 cipherl, cipherr;
 
                if (length <= 0)
                        return 0;
index 447ea774d4693a32d60d7e0663181323b113f6f4..0f92c56f0d87fcb40d7e5e0c20d8cdabaef077ae 100644 (file)
 #include <stdio.h>
 #include <errno.h>
 
-/* Application include files */
-#include "k5-int.h"
 #include "des.h"
 
-
-#ifndef KRB_INT32
-#if (SIZEOF_LONG == 4)
-#define KRB_INT32 long
-#elif (SIZEOF_INT == 4)
-#define KRB_INT32 int
-#elif (SIZEOF_SHORT == 4)
-#define KRB_INT32 short
-#else
-  ?== No 32 bit type available
-#endif
-#endif /* !KRB_INT32 */
-
 /* Definitions for byte swapping */
 
 /* vax byte order is LSB first. This is not performance critical, and
@@ -124,7 +109,7 @@ KRB5_DLLIMP unsigned long KRB5_CALLCONV
 des_quad_cksum(in,out,length,out_count,c_seed)
     mit_des_cblock FAR *c_seed;                /* secret seed, 8 bytes */
     unsigned char FAR *in;             /* input block */
-    unsigned KRB_INT32 FAR *out;       /* optional longer output */
+    unsigned DES_INT32 FAR *out;       /* optional longer output */
     int out_count;                     /* number of iterations */
     long length;                       /* original length in bytes */
 {
@@ -136,12 +121,12 @@ des_quad_cksum(in,out,length,out_count,c_seed)
      * checksum is written unto the address pointed to.
      */
 
-    register unsigned KRB_INT32 z;
-    register unsigned KRB_INT32 z2;
-    register unsigned KRB_INT32 x;
-    register unsigned KRB_INT32 x2;
+    register unsigned DES_INT32 z;
+    register unsigned DES_INT32 z2;
+    register unsigned DES_INT32 x;
+    register unsigned DES_INT32 x2;
     register unsigned char *p;
-    register KRB_INT32 len;
+    register DES_INT32 len;
     register int i;
 
     /* use all 8 bytes of seed */