aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2007-11-24 21:26:09 -0600
committerRob Landley <rob@landley.net>2007-11-24 21:26:09 -0600
commit9fe99014ffc382052994189437023ded246629c1 (patch)
tree5cf57af9090ca4225da0c42502557724777783aa /toys
parent509dd1488252b2299d3017270ae790b1a8f811fa (diff)
downloadtoybox-9fe99014ffc382052994189437023ded246629c1.tar.gz
Minimal changes to make it actually work on an x86-64 host.
Diffstat (limited to 'toys')
-rw-r--r--toys/sha1.c16
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++) {