Skip to content

Commit

Permalink
lints
Browse files Browse the repository at this point in the history
Signed-off-by: Ignacio Hagopian <[email protected]>
  • Loading branch information
jsign committed Jan 11, 2023
1 parent 4c8f1f5 commit bf4de31
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand All @@ -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.
Expand All @@ -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)
}
}
}
Expand Down

0 comments on commit bf4de31

Please sign in to comment.