From 6be8153a8bddf7be43aca1efb829ba719409787a Mon Sep 17 00:00:00 2001 From: cryptonotefoundation Date: Fri, 5 Sep 2014 13:46:10 +0000 Subject: [PATCH] CryptoC-3: fix for Merkle tree root issue --- src/crypto/tree-hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/tree-hash.c b/src/crypto/tree-hash.c index a2b0eeaa..87423fb8 100644 --- a/src/crypto/tree-hash.c +++ b/src/crypto/tree-hash.c @@ -19,7 +19,7 @@ void tree_hash(const char (*hashes)[HASH_SIZE], size_t count, char *root_hash) { size_t i, j; size_t cnt = count - 1; char (*ints)[HASH_SIZE]; - for (i = 1; i < sizeof(size_t); i <<= 1) { + for (i = 1; i < 8 * sizeof(size_t); i <<= 1) { cnt |= cnt >> i; } cnt &= ~(cnt >> 1);