mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
core: use stateless keccak
This commit is contained in:
parent
455331758d
commit
d6d341ea6f
1 changed files with 2 additions and 5 deletions
|
|
@ -141,11 +141,8 @@ func Bloom9(data []byte) []byte {
|
||||||
|
|
||||||
// bloomValues returns the bytes (index-value pairs) to set for the given data
|
// bloomValues returns the bytes (index-value pairs) to set for the given data
|
||||||
func bloomValues(data []byte, hashbuf *[6]byte) (uint, byte, uint, byte, uint, byte) {
|
func bloomValues(data []byte, hashbuf *[6]byte) (uint, byte, uint, byte, uint, byte) {
|
||||||
sha := hasherPool.Get().(crypto.KeccakState)
|
hash := crypto.Keccak256(data)
|
||||||
sha.Reset()
|
copy(hashbuf[:], hash[:6])
|
||||||
sha.Write(data)
|
|
||||||
sha.Read(hashbuf[:])
|
|
||||||
hasherPool.Put(sha)
|
|
||||||
// The actual bits to flip
|
// The actual bits to flip
|
||||||
v1 := byte(1 << (hashbuf[1] & 0x7))
|
v1 := byte(1 << (hashbuf[1] & 0x7))
|
||||||
v2 := byte(1 << (hashbuf[3] & 0x7))
|
v2 := byte(1 << (hashbuf[3] & 0x7))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue