KRB_INT32; also don't assume that a key schedule element is
exactly 64 bits wide... use instead 2 * KRB_INT32, since that is
what the code uses internally.
* des.h: Use better logic to find an appropriate type for
KRB_INT32.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10228
dc483132-0cff-0310-8789-
dd5450dbe970
+Tue Oct 14 15:35:53 1997 Tom Yu <tlyu@voltage-multiplier.mit.edu>
+
+ * des_int.h: Use better logic to find an appropriate type for
+ KRB_INT32; also don't assume that a key schedule element is
+ exactly 64 bits wide... use instead 2 * KRB_INT32, since that is
+ what the code uses internally.
+
+ * des.h: Use better logic to find an appropriate type for
+ KRB_INT32.
+
Mon Oct 6 11:32:51 1997 Ezra Peisach <epeisach@mit.edu>
* destest.c (main): Initialize context to 0 so it will not be
#include "k5-int.h"
#ifndef KRB_INT32
-#if (SIZEOF_LONG == 4)
+#ifdef SIZEOF_INT
+#if SIZEOF_INT >= 4
+#define KRB_INT32 int
+#else
#define KRB_INT32 long
-#elif (SIZEOF_INT == 4)
+#endif
+#else /* !defined(SIZEOF_INT) */
+#include <limits.h>
+#if (UINT_MAX >= 0xffffffff)
#define KRB_INT32 int
-#elif (SIZEOF_SHORT == 4)
-#define KRB_INT32 short
#else
- ?== No 32 bit type available
+#define KRB_INT32 long
#endif
-#endif /* !KRB_INT32 */
+#endif /* !defined(SIZEOF_INT) */
+#endif /* !defined(KRB_INT32) */
+
#ifndef KRB_UINT32
#define KRB_UINT32 unsigned KRB_INT32
#endif
#ifndef DES_INTERNAL_DEFS
#define DES_INTERNAL_DEFS
+#include "des.h"
+
/*
* Begin "mit-des.h"
*/
typedef krb5_octet mit_des_cblock[8]; /* crypto-block size */
+#ifndef KRB_INT32
+#ifdef SIZEOF_INT
+#if SIZEOF_INT >= 4
+#define KRB_INT32 int
+#else
+#define KRB_INT32 long
+#endif
+#else /* !defined(SIZEOF_INT) */
+#include <limits.h>
+#if (UINT_MAX >= 0xffffffff)
+#define KRB_INT32 int
+#else
+#define KRB_INT32 long
+#endif
+#endif /* !defined(SIZEOF_INT) */
+#endif /* !defined(KRB_INT32) */
+
/* Key schedule--used internally by DES routines to gain some speed */
typedef struct mit_des_ks_struct {
- mit_des_cblock _;
+ KRB_INT32 _[2];
} mit_des_key_schedule[16];
/* Triple-DES structures */