mirror of
https://github.com/mii443/merkle.rs.git
synced 2025-08-22 16:05:30 +00:00
Separate the leafs hash domain from the internal nodes' one (#22)
* Separate the leafs hash domain from the internal nodes' one. This change prevents an internal node from having the same hash as a leaf, and thus from potentially ending up with two different trees with the same root hash. Close #20 * Align with the CT spec, and allows building a tree from an empty dataset. Fixes #20. Prepares #24.
This commit is contained in:
committed by
Frederic Jacobs
parent
bebbcde461
commit
bce59c9f39
@ -16,7 +16,7 @@ static digest: &'static Algorithm = &SHA512;
|
||||
fn test_protobuf_inverse() {
|
||||
let values = (1..10).map(|x| vec![x]).collect::<Vec<_>>();
|
||||
|
||||
let tree = MerkleTree::from_vec(digest, values.clone()).unwrap();
|
||||
let tree = MerkleTree::from_vec(digest, values.clone());
|
||||
|
||||
for value in values {
|
||||
let proof = tree.gen_proof(value).unwrap();
|
||||
|
Reference in New Issue
Block a user