Files
go-iden3-crypto/keccak256/keccac256.go
Oleksandr Brezhniev 64e757cc4a Better keccac256 (#41)
* Switch to keccac256 implementation from golang.org/x/crypto instead of go-ethereum
2021-11-19 17:00:10 +02:00

15 lines
275 B
Go

package keccak256
import (
"golang.org/x/crypto/sha3"
)
// Hash generates a Keccak256 hash from a byte array
func Hash(data ...[]byte) []byte {
hash := sha3.NewLegacyKeccak256()
for _, d := range data {
hash.Write(d) //nolint:errcheck,gosec
}
return hash.Sum(nil)
}