X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fsha1.c;h=cc92ae1ce582995ed3214726e35dee4d0b1c7d42;hp=dd2dd249c9ab5f4c36bb0b0273459de90b7c3342;hb=cc83d5eb50869a6168be5c3b45a449fa2a5d2c97;hpb=604aaba2df983e5490ac76f58a8803dc352b85f3 diff --git a/src/sha1.c b/src/sha1.c index dd2dd249..cc92ae1c 100644 --- a/src/sha1.c +++ b/src/sha1.c @@ -201,14 +201,6 @@ static void sha1_final(u8 *md, SHA_CTX* context) for (i = 0; i < SHA1_HASH_SIZE; i++) { md[i] = (u8)((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255); } - - i = 0; - memset(context->buffer, 0, 64); - memset(context->state, 0, 20); - memset(context->count, 0, 8); - memset(finalcount, 0, 8); /* SWR */ - - sha1_transform(context->state, context->buffer); } void sha1_buffer(const void *buffer, size_t len, void *md) @@ -241,9 +233,8 @@ static int sha1_stream(FILE *fp, void *md) } -/* Calculates the SHA1 message digest given the name of a file. - * @buf must point to a buffer of length 20 bytes into which the message digest - * is written. +/* Calculates the SHA1 message digest given the name of a file. @md must point + * to a buffer of length 20 bytes into which the message digest is written. */ int sha1sum(const char *filename, void *md) {