From ffbedbbd4e74bf695499ba34775880060175eb91 Mon Sep 17 00:00:00 2001 From: Jason Self Date: Sun, 27 Sep 2015 17:56:26 -0700 Subject: [PATCH] Critical bugfix: call Hash routine with BitsCount instead of BytesCount. --- skein_cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } -- 2.31.1