@@ -30,8 +30,8 @@ import (
3030 "github.com/ethereum/go-ethereum/common"
3131 "github.com/ethereum/go-ethereum/common/bitutil"
3232 "github.com/ethereum/go-ethereum/crypto"
33- "github.com/ethereum/go-ethereum/crypto/sha3"
3433 "github.com/ethereum/go-ethereum/log"
34+ "golang.org/x/crypto/sha3"
3535)
3636
3737const (
@@ -123,7 +123,7 @@ func seedHash(block uint64) []byte {
123123 if block < epochLength {
124124 return seed
125125 }
126- keccak256 := makeHasher (sha3 .NewKeccak256 ())
126+ keccak256 := makeHasher (sha3 .NewLegacyKeccak256 ())
127127 for i := 0 ; i < int (block / epochLength ); i ++ {
128128 keccak256 (seed , seed )
129129 }
@@ -177,7 +177,7 @@ func generateCache(dest []uint32, epoch uint64, seed []byte) {
177177 }
178178 }()
179179 // Create a hasher to reuse between invocations
180- keccak512 := makeHasher (sha3 .NewKeccak512 ())
180+ keccak512 := makeHasher (sha3 .NewLegacyKeccak512 ())
181181
182182 // Sequentially produce the initial dataset
183183 keccak512 (cache , seed )
@@ -301,7 +301,7 @@ func generateDataset(dest []uint32, epoch uint64, cache []uint32) {
301301 defer pend .Done ()
302302
303303 // Create a hasher to reuse between invocations
304- keccak512 := makeHasher (sha3 .NewKeccak512 ())
304+ keccak512 := makeHasher (sha3 .NewLegacyKeccak512 ())
305305
306306 // Calculate the data segment this thread should generate
307307 batch := uint32 ((size + hashBytes * uint64 (threads ) - 1 ) / (hashBytes * uint64 (threads )))
@@ -375,7 +375,7 @@ func hashimoto(hash []byte, nonce uint64, size uint64, lookup func(index uint32)
375375// in-memory cache) in order to produce our final value for a particular header
376376// hash and nonce.
377377func hashimotoLight (size uint64 , cache []uint32 , hash []byte , nonce uint64 ) ([]byte , []byte ) {
378- keccak512 := makeHasher (sha3 .NewKeccak512 ())
378+ keccak512 := makeHasher (sha3 .NewLegacyKeccak512 ())
379379
380380 lookup := func (index uint32 ) []uint32 {
381381 rawData := generateDatasetItem (cache , index , keccak512 )
0 commit comments