X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/dc2f0497fdfded94ef783b9a34943f26c85aba2b..80be023065ced106a4078a36371c135a60d2bd6c:/sha.c diff --git a/sha.c b/sha.c index 2fe1846..02f51bc 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.4 2004/04/08 01:36:15 mdw Exp $ * * Implementation of the SHA-1 hash function * @@ -27,17 +27,6 @@ * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: sha.c,v $ - * Revision 1.2 1999/12/10 23:20:03 mdw - * New hash interface requirements. - * - * Revision 1.1 1999/09/03 08:41:12 mdw - * Initial import. - * - */ - /*----- Header files ------------------------------------------------------*/ #include @@ -240,7 +229,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@ --- *