quux00 / merkle-tree

Merkle Tree implementation in Java
MIT License
135 stars 50 forks source link

Hash Function #1

Open mehranshakeri opened 5 years ago

mehranshakeri commented 5 years ago

Hi,

In your documentation you mention adding 0x00 and 0x01 to children and inner nodes and apply it in you hash function as well H(0x01, X). However in your code you don't bring this byte in your CRC calculation. You only show it in serialization.

Based on my googling, we need to add this prefix to the data and the run hashing on it which is what you have in your README file. But your implementation is missing this byte.

Is this a bug?

Godstimendako commented 1 month ago

node ./verify.js ./output_merkle_tree_small.txt 64b3993941c4989c