64bit (mac) fix: long is not an int32 here
authorClaus Gittinger <cg@exept.de>
Tue, 02 Apr 2013 11:26:59 +0200
changeset 15025 552103f2ae6e
parent 15024 492d300c4d50
child 15026 03842e0011b1
64bit (mac) fix: long is not an int32 here
SHA1Stream.st
--- a/SHA1Stream.st	Tue Apr 02 10:56:09 2013 +0200
+++ b/SHA1Stream.st	Tue Apr 02 11:26:59 2013 +0200
@@ -33,8 +33,8 @@
 #include <string.h>
 
 typedef struct {
-    unsigned long state[5];
-    unsigned long count[2];
+    unsigned int32 state[5];
+    unsigned int32 count[2];
     unsigned char buffer[64];
 } SHA1_CTX;
 
@@ -90,14 +90,14 @@
 
 static void
 #if USE_ANSI_C
-SHA1Transform (unsigned long state[5], unsigned char buffer[64])
+SHA1Transform (unsigned int32 state[5], unsigned char buffer[64])
 #else
 SHA1Transform (state, buffer)
-    unsigned long state[5];
+    unsigned int32 state[5];
     unsigned char buffer[64];
 #endif
 {
-    unsigned long a, b, c, d, e;
+    unsigned int32 a, b, c, d, e;
     typedef union {
 	unsigned char c[64];
 	unsigned int32 /* long */ l[16];
@@ -209,7 +209,7 @@
     SHA1_CTX* context;
 #endif
 {
-    unsigned long i, j;
+    unsigned int32 i, j;
     unsigned char finalcount[8];
 
     for (i = 0; i < 8; i++) {
@@ -308,29 +308,29 @@
     This may be used as checksum or for generating cryptographic signatures.
 
     Notice (2005):
-        Be aware that SHA-1 is considered broken and may not be appropriate in some applications.
-        Especially it should no longer be used for security stuff.
+	Be aware that SHA-1 is considered broken and may not be appropriate in some applications.
+	Especially it should no longer be used for security stuff.
 
     performance: roughly
-          120400 Kb/s on a 2.5Ghz 64X2 Athlon 4800+ (64bit)
-           47400 Kb/s on a 2Ghz Duo (old measure)
-            9580 Kb/s on a 400Mhz PIII
-            3970 Kb/s on a 300Mhz Sparc
+	  120400 Kb/s on a 2.5Ghz 64X2 Athlon 4800+ (64bit)
+	   47400 Kb/s on a 2Ghz Duo (old measure)
+	    9580 Kb/s on a 400Mhz PIII
+	    3970 Kb/s on a 300Mhz Sparc
 
     [author:]
-        Stefan Vogel
+	Stefan Vogel
 
     [see also:]
-        MD5Stream
-        SHA256Stream SHA512Stream (in libcrypt)
+	MD5Stream
+	SHA256Stream SHA512Stream (in libcrypt)
 
     [class variables:]
-        HashSize        size of returned hash value
-        ContextSize     (implementation) size of hash context
+	HashSize        size of returned hash value
+	ContextSize     (implementation) size of hash context
 
     [instance variables:]
-        hashContext     (implementation)
-                        internal buffer for computation of the hash value
+	hashContext     (implementation)
+			internal buffer for computation of the hash value
 "
 !
 
@@ -582,11 +582,11 @@
 !SHA1Stream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.36 2013-02-21 10:44:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.37 2013-04-02 09:26:59 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.36 2013-02-21 10:44:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.37 2013-04-02 09:26:59 cg Exp $'
 ! !