mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-10 16:01:28 +01:00
Fix MerkleTree leaf index calculation
This commit is contained in:
@@ -130,7 +130,7 @@ impl<P: MerkleTreeConfig> MerkleHashTree<P> {
|
||||
}
|
||||
|
||||
// Compute and store the hash values for each leaf.
|
||||
let last_level_index = level_indices.pop().unwrap();
|
||||
let last_level_index = level_indices.pop().unwrap_or(0);
|
||||
let mut buffer = [0u8; 128];
|
||||
for (i, leaf) in leaves.iter().enumerate() {
|
||||
tree[last_level_index + i] = hash_leaf::<P::H, _>(¶meters, leaf, &mut buffer)?;
|
||||
|
||||
Reference in New Issue
Block a user