+2001-03-14 Ken Raeburn <raeburn@mit.edu>
+
+ * md4.c (GG, HH, krb5_MD4Init): Use UL suffix on numbers, don't
+ bother with UL macro.
+ (UL): Macro deleted.
+ (Transform): Always declare with prototype.
+
+ * rsa-md4.h: Always use prototypes.
+
2000-01-21 Ken Raeburn <raeburn@mit.edu>
* md4.c (PADDING): Now const.
#include "k5-int.h"
#include "rsa-md4.h"
-#if defined(__STDC__) || defined(_MSDOS) || defined(_WIN32)
-#define UL(x) x##UL
-#else
-#define UL(x) ((krb5_ui_4) x)
-#endif
-
/* forward declaration */
-#if (defined(__STDC__) || defined(_MSDOS) || defined(_WIN32)) && !defined(KRB5_NO_PROTOTYPES)
static void Transform (krb5_ui_4 FAR *, krb5_ui_4 FAR *);
-#else
-static void Transform ();
-#endif
static const unsigned char PADDING[64] = {
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
(a) &= 0xffffffff; \
(a) = ROTATE_LEFT ((a), (s));}
#define GG(a, b, c, d, x, s) \
- {(a) += G ((b), (c), (d)) + (x) + UL(013240474631); \
+ {(a) += G ((b), (c), (d)) + (x) + 013240474631UL; \
(a) &= 0xffffffff; \
(a) = ROTATE_LEFT ((a), (s));}
#define HH(a, b, c, d, x, s) \
- {(a) += H ((b), (c), (d)) + (x) + UL(015666365641); \
+ {(a) += H ((b), (c), (d)) + (x) + 015666365641UL; \
(a) &= 0xffffffff; \
(a) = ROTATE_LEFT ((a), (s));}
/* Load magic initialization constants.
*/
- mdContext->buf[0] = UL(0x67452301);
- mdContext->buf[1] = UL(0xefcdab89);
- mdContext->buf[2] = UL(0x98badcfe);
- mdContext->buf[3] = UL(0x10325476);
+ mdContext->buf[0] = 0x67452301UL;
+ mdContext->buf[1] = 0xefcdab89UL;
+ mdContext->buf[2] = 0x98badcfeUL;
+ mdContext->buf[3] = 0x10325476UL;
}
void
unsigned char digest[16]; /* actual digest after MD4Final call */
} krb5_MD4_CTX;
-#if defined(__STDC__) || defined(_MSDOS) || defined(_WIN32)
extern void krb5_MD4Init(krb5_MD4_CTX FAR *);
extern void krb5_MD4Update(krb5_MD4_CTX FAR *, const unsigned char FAR *, unsigned int);
extern void krb5_MD4Final(krb5_MD4_CTX FAR *);
-#else
-void krb5_MD4Init ();
-void krb5_MD4Update ();
-void krb5_MD4Final ();
-#endif
/*
**********************************************************************