diff --git a/tree.go b/tree.go index cb568d2b..c76fed3b 100644 --- a/tree.go +++ b/tree.go @@ -40,12 +40,6 @@ type ( NodeResolverFn func([]byte) ([]byte, error) ) -// Committer represents an object that is able to create the -// commitment to a polynomial. -type Committer interface { - CommitToPoly([]Fr, int) Point -} - type keylist [][]byte func (kl keylist) Len() int { @@ -932,7 +926,6 @@ func (n *LeafNode) getOldCn(index byte) (*Point, *Fr) { func (n *LeafNode) updateC(stem []byte, index byte, c *Point, oldc *Fr) { var ( newc Fr - diff Point poly [256]Fr ) @@ -943,12 +936,10 @@ func (n *LeafNode) updateC(stem []byte, index byte, c *Point, oldc *Fr) { if n.commitment == nil { poly[0].SetUint64(1) StemFromBytes(&poly[1], stem) - comm := cfg.conf.Commit(poly[:]) - n.commitment = &comm + n.commitment = cfg.CommitToPoly(poly[:], 0) return } - diff = cfg.conf.Commit(poly[:]) - n.commitment.Add(n.commitment, &diff) + n.commitment.Add(n.commitment, cfg.CommitToPoly(poly[:], 0)) } func (n *LeafNode) updateCn(index byte, oldValue []byte, c *Point) {