mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 09:37:38 +00:00
231e468e19
git-subtree-dir: erigon-lib git-subtree-mainline:3c8cbda809
git-subtree-split:93d9c9d9fe
22 lines
314 B
Go
22 lines
314 B
Go
package cryptopool
|
|
|
|
import (
|
|
"hash"
|
|
"sync"
|
|
|
|
"golang.org/x/crypto/sha3"
|
|
)
|
|
|
|
var pool = sync.Pool{
|
|
New: func() interface{} {
|
|
return sha3.NewLegacyKeccak256()
|
|
},
|
|
}
|
|
|
|
func GetLegacyKeccak256() hash.Hash {
|
|
h := pool.Get().(hash.Hash)
|
|
h.Reset()
|
|
return h
|
|
}
|
|
func ReturnLegacyKeccak256(h hash.Hash) { pool.Put(h) }
|