mmr: optimized peak hash for Miden VM

This commit is contained in:
Augusto F. Hack
2023-04-06 15:41:24 +02:00
parent 86dba195b4
commit ab903a2229
3 changed files with 92 additions and 15 deletions

View File

@@ -174,7 +174,7 @@ impl Mmr {
self.forest += 1;
}
/// Returns an accumulator representing the current state of the MMMR.
/// Returns an accumulator representing the current state of the MMR.
pub fn accumulator(&self) -> MmrPeaks {
let peaks: Vec<Word> = TrueBitPositionIterator::new(self.forest)
.rev()
@@ -192,7 +192,7 @@ impl Mmr {
}
}
/// An iterator over inner nodes in the [Mmm]. The order of iteration is unspecified.
/// An iterator over inner nodes in the MMR. The order of iteration is unspecified.
pub fn inner_nodes(&self) -> MmrNodes {
MmrNodes {
mmr: self,