Critical bugfix: call Hash routine with BitsCount instead of BytesCount.
authorJason Self <j@jxself.org>
Mon, 28 Sep 2015 00:56:26 +0000 (17:56 -0700)
committerJason Self <j@jxself.org>
Mon, 28 Sep 2015 00:56:26 +0000 (17:56 -0700)
skein_cli.c

index d761fd79b652d4f93bc8cd093d38661ff1700526..04f815621f9d459e8f91338986b44ce41442ac98 100644 (file)
@@ -166,7 +166,7 @@ int HashFile(const char file_name[], char MsgDigest[], char mode)
        }
 
        unsigned char output[hashbitlen/4];
-       Hash(hashbitlen, (unsigned char*) readbuf, total_readed, output);
+       Hash(hashbitlen, (unsigned char*) readbuf, total_readed * 8, output);
 
        free(readbuf);
 
@@ -370,7 +370,7 @@ void PrintStringHash(const char *s)
 {
        unsigned char output[hashbitlen/4];
        char digest[hashbitlen/4 + 1];
-       Hash(hashbitlen, s, strlen(s), output);
+       Hash(hashbitlen, s, strlen(s) * 8, output);
        hash2hexstr(output, digest);
        printf("%s -%s\n", digest, s);
 }