X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilccrypt%2Fsha1.c;h=ef51330d3dea7088ed1d0a2267cd7ca49699976a;hb=72cfa31520ebc0058763a30e21c13f6e9a964aa0;hp=f22df0b8b6c4a60e779c376a6953310fa646229b;hpb=2be0be2432fff760084c4093291e79f1fa6262d8;p=silc.git diff --git a/lib/silccrypt/sha1.c b/lib/silccrypt/sha1.c index f22df0b8..ef51330d 100644 --- a/lib/silccrypt/sha1.c +++ b/lib/silccrypt/sha1.c @@ -59,12 +59,12 @@ SILC_HASH_API_CONTEXT_LEN(sha1) /* 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(uint32 state[5], unsigned char buffer[64]) { -unsigned long a, b, c, d, e; +uint32 a, b, c, d, e; typedef union { unsigned char c[64]; - unsigned long l[16]; + uint32 l[16]; } CHAR64LONG16; CHAR64LONG16* block; static unsigned char workspace[64]; @@ -124,9 +124,9 @@ void SHA1Init(SHA1_CTX* context) /* Run your data through this. */ -void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len) +void SHA1Update(SHA1_CTX* context, unsigned char* data, uint32 len) { -unsigned int i, j; +uint32 i, j; j = (context->count[0] >> 3) & 63; if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++; @@ -148,7 +148,7 @@ unsigned int i, j; void SHA1Final(unsigned char digest[20], SHA1_CTX* context) { -unsigned long i, j; +uint32 i, j; unsigned char finalcount[8]; for (i = 0; i < 8; i++) {