--- uuid_md5.c 2005/01/13 10:30:41 1.9
+++ uuid_md5.c 2005/01/13 10:36:06 1.10
@@ -78,23 +78,23 @@
typedef unsigned char *POINTER;
/* UINT2 defines a two byte word */
-#if SIZEOF_UNSIGNED_SHORT == 2
+#if SIZEOF_UNSIGNED_SHORT == 2
typedef unsigned short int UINT2;
-#elif SIZEOF_UNSIGNED_INT == 2
-typedef unsigned int UINT2;
-#elif SIZEOF_UNSIGNED_LONG == 2
-typedef unsigned long int UINT2;
+#elif SIZEOF_UNSIGNED_INT == 2
+typedef unsigned int UINT2;
+#elif SIZEOF_UNSIGNED_LONG == 2
+typedef unsigned long int UINT2;
#else
#error ERROR: unable to determine UINT2 type (two byte word)
#endif
/* UINT4 defines a four byte word */
-#if SIZEOF_UNSIGNED_SHORT == 4
-typedef unsigned short int UINT4;
-#elif SIZEOF_UNSIGNED_INT == 4
-typedef unsigned int UINT4;
-#elif SIZEOF_UNSIGNED_LONG == 4
-typedef unsigned long int UINT4;
+#if SIZEOF_UNSIGNED_SHORT == 4
+typedef unsigned short int UINT4;
+#elif SIZEOF_UNSIGNED_INT == 4
+typedef unsigned int UINT4;
+#elif SIZEOF_UNSIGNED_LONG == 4
+typedef unsigned long int UINT4;
#elif SIZEOF_UNSIGNED_LONG_LONG == 4
typedef unsigned long long int UINT4;
#else
@@ -108,14 +108,15 @@
unsigned char buffer[64]; /* input buffer */
} MD5_CTX;
+/* prototypes for internal functions */
static void MD5Init (MD5_CTX *_ctx);
static void MD5Update (MD5_CTX *_ctx, unsigned char *, unsigned int);
static void MD5Final (unsigned char [16], MD5_CTX *);
-
static void MD5Transform (UINT4 [4], unsigned char [64]);
static void Encode (unsigned char *, UINT4 *, unsigned int);
static void Decode (UINT4 *, unsigned char *, unsigned int);
+/* finalization padding */
static unsigned char PADDING[64] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -226,7 +227,7 @@
Encode(digest, context->state, 16);
/* Zeroize sensitive information. */
- memset((POINTER)context, 0, sizeof (*context));
+ memset((POINTER)context, '\0', sizeof (*context));
}
/* MD5 basic transformation. Transforms state based on block. */
@@ -332,7 +333,7 @@
state[3] += d;
/* Zeroize sensitive information. */
- memset((POINTER)x, 0, sizeof (x));
+ memset((POINTER)x, '\0', sizeof (x));
}
/* Encodes input (UINT4) into output (unsigned char).
|