Skip to content

Commit

Permalink
Tweak loop for proof
Browse files Browse the repository at this point in the history
  • Loading branch information
upamanyus committed Dec 5, 2024
1 parent 079de24 commit be08c6e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion merkle/merkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ func (t *Tree) Put(label []byte, mapVal []byte) ([]byte, []byte, bool) {
// correct hashes of interior nodes, bubbling up.
// +1/-1 offsets for Goosable uint64 loop var.
var loopBuf = make([]byte, 0, numChildren*cryptoffi.HashLen+1)
for depth := cryptoffi.HashLen; depth >= 1; depth-- {
var depth = cryptoffi.HashLen
for depth >= 1 {
loopBuf = t.ctx.updInteriorHash(loopBuf, interiors[depth-1])
loopBuf = loopBuf[:0]
depth--
}

dig := t.ctx.getHash(t.root)
Expand Down

0 comments on commit be08c6e

Please sign in to comment.