prysm-pulse/crypto/keystore/keccak256.go
terence tsao ee5d75732d
Add pkg crypto (#9603)
* Add pkg crypto

* Update go.yml

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-15 22:55:11 +00:00

16 lines
284 B
Go

package keystore
import (
"golang.org/x/crypto/sha3"
)
// Keccak256 calculates and returns the Keccak256 hash of the input data.
func Keccak256(data ...[]byte) []byte {
d := sha3.NewLegacyKeccak256()
for _, b := range data {
// #nosec G104
d.Write(b)
}
return d.Sum(nil)
}