diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-05-05 23:23:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-05 23:23:08 +0800 |
commit | 2ec5cf1673e19da85471892875934fe0564a209d (patch) | |
tree | ca8ee6c330cf6d91df8d74200ab69b67218e07a5 /consensus/ethash/algorithm.go | |
parent | 93832b633e1bfa4ec32a937f0cd9d90644c39c73 (diff) | |
parent | 36a800a1d299836e6fef226db54390044829a00e (diff) | |
download | dexon-2ec5cf1673e19da85471892875934fe0564a209d.tar dexon-2ec5cf1673e19da85471892875934fe0564a209d.tar.gz dexon-2ec5cf1673e19da85471892875934fe0564a209d.tar.bz2 dexon-2ec5cf1673e19da85471892875934fe0564a209d.tar.lz dexon-2ec5cf1673e19da85471892875934fe0564a209d.tar.xz dexon-2ec5cf1673e19da85471892875934fe0564a209d.tar.zst dexon-2ec5cf1673e19da85471892875934fe0564a209d.zip |
Merge pull request #14423 from karalabe/bitutil
common/bitutil, consensus/ethash: reusable bitutil package
Diffstat (limited to 'consensus/ethash/algorithm.go')
-rw-r--r-- | consensus/ethash/algorithm.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/consensus/ethash/algorithm.go b/consensus/ethash/algorithm.go index 7e8fbfc37..365fe5520 100644 --- a/consensus/ethash/algorithm.go +++ b/consensus/ethash/algorithm.go @@ -27,6 +27,7 @@ import ( "unsafe" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/bitutil" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/sha3" "github.com/ethereum/go-ethereum/log" @@ -142,7 +143,7 @@ func generateCache(dest []uint32, epoch uint64, seed []byte) { dstOff = j * hashBytes xorOff = (binary.LittleEndian.Uint32(cache[dstOff:]) % uint32(rows)) * hashBytes ) - xorBytes(temp, cache[srcOff:srcOff+hashBytes], cache[xorOff:xorOff+hashBytes]) + bitutil.XORBytes(temp, cache[srcOff:srcOff+hashBytes], cache[xorOff:xorOff+hashBytes]) keccak512(cache[dstOff:], temp) atomic.AddUint32(&progress, 1) |