Skip to content

Commit

Permalink
expander,tkn20: remove superfluous Reset calls
Browse files Browse the repository at this point in the history
These are both called when the blake2b.XOF / hash.Hash has just been
freshly created.
  • Loading branch information
tmthrgd authored and armfazh committed Mar 7, 2023
1 parent 547dd87 commit 055862b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion abe/cpabe/tkn20/internal/tkn/util.go
Expand Up @@ -30,7 +30,6 @@ func HashStringToScalar(key []byte, value string) *pairing.Scalar {
if err != nil {
return nil
}
xof.Reset()
_, err = xof.Write([]byte(value))
if err != nil {
return nil
Expand Down
1 change: 0 additions & 1 deletion expander/expander.go
Expand Up @@ -54,7 +54,6 @@ func (e *expanderMD) Expand(in []byte, n uint) []byte {
libStr[1] = byte(n & 0xFF)
dstPrime := e.calcDSTPrime()

H.Reset()
mustWrite(H, zPad)
mustWrite(H, in)
mustWrite(H, libStr)
Expand Down

0 comments on commit 055862b

Please sign in to comment.