From: Jason Self Date: Mon, 28 Sep 2015 00:56:26 +0000 (-0700) Subject: Critical bugfix: call Hash routine with BitsCount instead of BytesCount. X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=ffbedbbd4e74bf695499ba34775880060175eb91;p=skeinsum.git Critical bugfix: call Hash routine with BitsCount instead of BytesCount. --- diff --git a/skein_cli.c b/skein_cli.c index d761fd7..04f8156 100644 --- a/skein_cli.c +++ b/skein_cli.c @@ -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); }