4 ms·
Okay, I guess in mathematical terms a better way to express the whole thing would be in terms of two hash functions: h_leaf(leaf) which takes a leaf. h_branch
by kerkeslager 9y ago
Okay, I guess in mathematical terms a better way to express the whole thing would be in terms of two hash functions:
h_leaf(leaf) which takes a leaf.
h_branch(branch_left, branch_right) which takes the two branches.
The important point being that one should not be able to find a leaf such that h_leaf(leaf) = h_branch(branch_left, branch_right) for any branch_left, branch_right.
Prefixes versus suffixes are just implementation details of the hash functions (i.e. h_leaf(x) = "\00" + sha256(x), h_branch(x,y) = "\01" + sha256(x + y) would also work).