diff --git a/tree.go b/tree.go index 8f92c62d..7064a1a1 100644 --- a/tree.go +++ b/tree.go @@ -1154,14 +1154,14 @@ func (leaf *LeafNode) Commit() *Point { frPool.Put(c1polyp) }() - count = fillSuffixTreePoly(c1poly[:], leaf.values[:128]) - leaf.c1 = cfg.CommitToPoly(c1poly[:], 256-count) + count = fillSuffixTreePoly(c1poly, leaf.values[:128]) + leaf.c1 = cfg.CommitToPoly(c1poly, 256-count) for i := 0; i < 256; i++ { c1poly[i] = Fr{} } - count = fillSuffixTreePoly(c1poly[:], leaf.values[128:]) - leaf.c2 = cfg.CommitToPoly(c1poly[:], 256-count) + count = fillSuffixTreePoly(c1poly, leaf.values[128:]) + leaf.c2 = cfg.CommitToPoly(c1poly, 256-count) for i := 0; i < 256; i++ { c1poly[i] = Fr{} @@ -1170,7 +1170,7 @@ func (leaf *LeafNode) Commit() *Point { StemFromBytes(&c1poly[1], leaf.stem) toFrMultiple([]*Fr{&c1poly[2], &c1poly[3]}, []*Point{leaf.c1, leaf.c2}) - leaf.commitment = cfg.CommitToPoly(c1poly[:], 252) + leaf.commitment = cfg.CommitToPoly(c1poly, 252) } else if len(leaf.cow) != 0 { // If we've already have a calculated commitment, and there're touched leaf values, we do a diff update. @@ -1180,14 +1180,14 @@ func (leaf *LeafNode) Commit() *Point { if !bytes.Equal(oldValue, leaf.values[i]) { if i < 128 { if c1 == nil { - c1, old1 = leaf.getOldCn(byte(i)) + c1, old1 = leaf.getOldCn(i) } - leaf.updateCn(byte(i), oldValue, c1) + leaf.updateCn(i, oldValue, c1) } else { if c2 == nil { - c2, old2 = leaf.getOldCn(byte(i)) + c2, old2 = leaf.getOldCn(i) } - leaf.updateCn(byte(i), oldValue, c2) + leaf.updateCn(i, oldValue, c2) } } }