]> wimlib.net Git - wimlib/commitdiff
SHA1 minor fixes
authorEric Biggers <ebiggers3@gmail.com>
Sat, 26 May 2012 18:53:45 +0000 (13:53 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 26 May 2012 18:53:45 +0000 (13:53 -0500)
README
src/sha1.c

diff --git a/README b/README
index 1ed9e23ec313cef5fa26165fbecfd349e46b3bac..8e7f45424682068f9db82b3e1201fa07d1fa08a9 100644 (file)
--- a/README
+++ b/README
@@ -161,10 +161,6 @@ originally based on code written by Matthew Russotto (www.russotto.net/chm/).
 
 lz.c, the code to find LZ77 matches, is based on code from zlib.
 
-sha1.c and sha1.h, the code to compute SHA1 message digests of WIM resources or
-of the WIM file itself in the case of integrity checks, are based on code from
-GNU coreutils.
-
 A very limited number of other free programs can handle some parts of the WIM
 file format.  7-zip is able to extract and create WIMs and files in many other
 archive formats.  However, WIMLIB is designed specifically to handle WIM files
index dd2dd249c9ab5f4c36bb0b0273459de90b7c3342..cc92ae1ce582995ed3214726e35dee4d0b1c7d42 100644 (file)
@@ -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)
 {