diff options
Diffstat (limited to 'toys')
-rw-r--r-- | toys/sha1.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/toys/sha1.c b/toys/sha1.c index 35357aab..d4a96840 100644 --- a/toys/sha1.c +++ b/toys/sha1.c @@ -12,19 +12,19 @@ A million repetitions of "a" 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F */ -/* #define LITTLE_ENDIAN * This should be #define'd if true. */ +#define LITTLE_ENDIAN /* This should be #define'd if true. */ /* #define SHA1HANDSOFF * Copies data before messing with it. */ #include <stdio.h> #include <string.h> typedef struct { - unsigned long state[5]; - unsigned long count[2]; + unsigned int state[5]; + unsigned int count[2]; unsigned char buffer[64]; } SHA1_CTX; -void SHA1Transform(unsigned long state[5], unsigned char buffer[64]); +void SHA1Transform(unsigned int state[5], unsigned char buffer[64]); void SHA1Init(SHA1_CTX* context); void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len); void SHA1Final(unsigned char digest[20], SHA1_CTX* context); @@ -52,12 +52,12 @@ void SHA1Final(unsigned char digest[20], SHA1_CTX* context); /* Hash a single 512-bit block. This is the core of the algorithm. */ -void SHA1Transform(unsigned long state[5], unsigned char buffer[64]) +void SHA1Transform(unsigned int state[5], 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; #ifdef SHA1HANDSOFF @@ -145,7 +145,7 @@ unsigned int i, j; void SHA1Final(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++) { |