crypto: fix variable shadowing in Keccak256 functions

This commit is contained in:
Bilog WEB3 2025-11-26 09:12:13 +01:00 committed by GitHub
parent 960c87a944
commit 0093739829
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,8 +41,8 @@ func Keccak256(data ...[]byte) []byte {
b := make([]byte, 32) b := make([]byte, 32)
d := hasherPool.Get().(KeccakState) d := hasherPool.Get().(KeccakState)
d.Reset() d.Reset()
for _, b := range data { for _, chunk := range data {
d.Write(b) d.Write(chunk)
} }
d.Read(b) d.Read(b)
hasherPool.Put(d) hasherPool.Put(d)
@ -54,8 +54,8 @@ func Keccak256(data ...[]byte) []byte {
func Keccak256Hash(data ...[]byte) (h common.Hash) { func Keccak256Hash(data ...[]byte) (h common.Hash) {
d := hasherPool.Get().(KeccakState) d := hasherPool.Get().(KeccakState)
d.Reset() d.Reset()
for _, b := range data { for _, chunk := range data {
d.Write(b) d.Write(chunk)
} }
d.Read(h[:]) d.Read(h[:])
hasherPool.Put(d) hasherPool.Put(d)