]> git.ozlabs.org Git - ppp.git/blobdiff - linux/mppe/sha1.c
Don't use unsigned long in the SHA1 code; we want 32-bit variables
[ppp.git] / linux / mppe / sha1.c
index 7e8b03cf30a053b3ce53a529df78701de1e28a13..a895c87363c3466baaed32ad0a1b08060201edc4 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "sha1.h"
 
-static void SHA1_Transform(unsigned long[5], const unsigned char[64]);
+static void SHA1_Transform(unsigned int[5], const unsigned char[64]);
 
 #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
 
@@ -57,12 +57,12 @@ static void SHA1_Transform(unsigned long[5], const unsigned char[64]);
 /* Hash a single 512-bit block. This is the core of the algorithm. */
 
 static void
-SHA1_Transform(unsigned long state[5], const unsigned char buffer[64])
+SHA1_Transform(unsigned int state[5], const unsigned char buffer[64])
 {
-    unsigned long a, b, c, d, e;
+    unsigned int a, b, c, d, e;
     typedef union {
        unsigned char c[64];
-       unsigned long l[16];
+       unsigned int l[16];
     } CHAR64LONG16;
     CHAR64LONG16 *block;
 
@@ -156,7 +156,7 @@ SHA1_Update(SHA1_CTX *context, const unsigned char *data, unsigned int len)
 void
 SHA1_Final(unsigned char digest[20], SHA1_CTX *context)
 {
-    unsigned long i, j;
+    unsigned int i, j;
     unsigned char finalcount[8];
 
     for (i = 0; i < 8; i++) {