core: use stateless keccak

This commit is contained in:
Piotr Mikołajczyk 2025-11-18 11:29:41 +01:00
parent 455331758d
commit d6d341ea6f
No known key found for this signature in database
GPG key ID: 2E4C2AAD5E71D22D

View file

@ -141,11 +141,8 @@ func Bloom9(data []byte) []byte {
// 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) {
sha := hasherPool.Get().(crypto.KeccakState)
sha.Reset()
sha.Write(data)
sha.Read(hashbuf[:])
hasherPool.Put(sha)
hash := crypto.Keccak256(data)
copy(hashbuf[:], hash[:6])
// The actual bits to flip
v1 := byte(1 << (hashbuf[1] & 0x7))
v2 := byte(1 << (hashbuf[3] & 0x7))