diff --git a/crypto/crypto.go b/crypto/crypto.go index 22849aa6ea..29d2b75ecd 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -75,7 +75,7 @@ func HashData(kh KeccakState, data []byte) (h common.Hash) { // Keccak256 calculates and returns the Keccak256 hash of the input data. func Keccak256(data ...[]byte) []byte { b := make([]byte, 32) - d := NewKeccakState() + d := sha3.NewLegacyKeccak256().(KeccakState) for _, b := range data { d.Write(b) } @@ -86,7 +86,7 @@ func Keccak256(data ...[]byte) []byte { // Keccak256Hash calculates and returns the Keccak256 hash of the input data, // converting it to an internal Hash data structure. func Keccak256Hash(data ...[]byte) (h common.Hash) { - d := NewKeccakState() + d := sha3.NewLegacyKeccak256().(KeccakState) for _, b := range data { d.Write(b) }