fixed mdfour code on Cray (64 bit problems)
authorAndrew Tridgell <tridge@samba.org>
Sun, 23 Jan 2000 11:26:10 +0000 (11:26 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 23 Jan 2000 11:26:10 +0000 (11:26 +0000)
Thanks to roebel@kgw.tu-berlin.de

lib/mdfour.c

index d8cbe89..0a059dc 100644 (file)
@@ -37,9 +37,9 @@ static struct mdfour *m;
 #define lshift(x,s) (((x)<<(s)) | ((x)>>(32-(s))))
 #endif
 
-#define ROUND1(a,b,c,d,k,s) a = lshift(a + F(b,c,d) + X[k], s)
-#define ROUND2(a,b,c,d,k,s) a = lshift(a + G(b,c,d) + X[k] + 0x5A827999,s)
-#define ROUND3(a,b,c,d,k,s) a = lshift(a + H(b,c,d) + X[k] + 0x6ED9EBA1,s)
+#define ROUND1(a,b,c,d,k,s) a = lshift((uint32)(a + F(b,c,d) + X[k]), s)
+#define ROUND2(a,b,c,d,k,s) a = lshift((uint32)(a + G(b,c,d) + X[k] + 0x5A827999),s)
+#define ROUND3(a,b,c,d,k,s) a = lshift((uint32)(a + H(b,c,d) + X[k] + 0x6ED9EBA1),s)
 
 /* this applies md4 to 64 byte chunks */
 static void mdfour64(uint32 *M)