X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/dc2f0497fdfded94ef783b9a34943f26c85aba2b..f41f820e4b3e230d9314cc4323abf59babdd4e67:/sha.c diff --git a/sha.c b/sha.c index 2fe1846..918e6d3 100644 --- a/sha.c +++ b/sha.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: sha.c,v 1.2 1999/12/10 23:20:03 mdw Exp $ + * $Id: sha.c,v 1.3 2000/06/17 11:31:43 mdw Exp $ * * Implementation of the SHA-1 hash function * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: sha.c,v $ + * Revision 1.3 2000/06/17 11:31:43 mdw + * Portability fix for broken compilers. + * * Revision 1.2 1999/12/10 23:20:03 mdw * New hash interface requirements. * @@ -240,7 +243,7 @@ void sha_set(sha_ctx *ctx, const void *buf, unsigned long count) ctx->e = LOAD32(p + 16); ctx->off = 0; ctx->nl = U32(count); - ctx->nh = U32((count >> 16) >> 16); + ctx->nh = U32(((count & ~MASK32) >> 16) >> 16); } /* --- @sha_hash@ --- *