Skip to content

Commit

Permalink
checks the data after reseting the hash
Browse files Browse the repository at this point in the history
  • Loading branch information
staheri14 committed Feb 28, 2023
1 parent 4f2141e commit 177d317
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ func (n *Hasher) IsNamespacedData(data []byte) (err error) {
//
//nolint:errcheck
func (n *Hasher) HashLeaf(ndata []byte) []byte {
h := n.baseHasher
h.Reset()

if err := n.IsNamespacedData(ndata); err != nil {
panic(err)
}

h := n.baseHasher
h.Reset()

nID := ndata[:n.NamespaceLen]
resLen := int(2*n.NamespaceLen) + n.baseHasher.Size()
Expand Down

0 comments on commit 177d317

Please sign in to comment.