github.com/prysmaticlabs/prysm@v1.4.4/shared/keystore/keccak256.go (about)

     1  package keystore
     2  
     3  import (
     4  	"golang.org/x/crypto/sha3"
     5  )
     6  
     7  // Keccak256 calculates and returns the Keccak256 hash of the input data.
     8  func Keccak256(data ...[]byte) []byte {
     9  	d := sha3.NewLegacyKeccak256()
    10  	for _, b := range data {
    11  		// #nosec G104
    12  		d.Write(b)
    13  	}
    14  	return d.Sum(nil)
    15  }