mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +00:00
crypto: fix variable shadowing in Keccak256 functions
This commit is contained in:
parent
960c87a944
commit
0093739829
1 changed files with 4 additions and 4 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue