arnaucube
arnaucube/miden-cryptoPublic Self-hosted repository
fmt
Paul-Henry Kajfasz kajfaszph@gmail.com
Wed, 21 Aug 2024 14:04:23 +0100
commit

8bf6ef890d8921e3a73716f52565bf8a34dd925b

parent

e2aeb25e01fa5e59412653265ea7eed318ed7bfc

1 files changed, 6 insertions(+), 6 deletions(-)

jump to
M src/merkle/mmr/peaks.rs → src/merkle/mmr/peaks.rs

@@ -19,12 +19,12 @@ /// bits in `num_leaves` conveniently encode the size of each individual tree.

/// /// Examples: /// - /// - With 5 leaves, the binary `0b101`. The number of set bits is equal the number of - /// peaks, in this case there are 2 peaks. The 0-indexed least-significant position of the - /// bit determines the number of elements of a tree, so the rightmost tree has `2**0` - /// elements and the left most has `2**2`. - /// - With 12 leaves, the binary is `0b1100`, this case also has 2 peaks, the leftmost tree - /// has `2**3=8` elements, and the right most has `2**2=4` elements. + /// - With 5 leaves, the binary `0b101`. The number of set bits is equal the number of peaks, + /// in this case there are 2 peaks. The 0-indexed least-significant position of the bit + /// determines the number of elements of a tree, so the rightmost tree has `2**0` elements + /// and the left most has `2**2`. + /// - With 12 leaves, the binary is `0b1100`, this case also has 2 peaks, the leftmost tree has + /// `2**3=8` elements, and the right most has `2**2=4` elements. num_leaves: usize, /// All the peaks of every tree in the MMR forest. The peaks are always ordered by number of