mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-13 07:37:22 +01:00
multi: replace usage of fastsha256 with crypto/sha256
This commit removes all instances of the fastsha256 library and replaces it with the sha256 library in the standard library. This change should see a number of performance improvements as the standard library has highly optimized assembly instructions with use vectorized instructions as the platform supports.
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
|
||||
"golang.org/x/crypto/hkdf"
|
||||
|
||||
"github.com/btcsuite/fastsha256"
|
||||
"github.com/roasbeef/btcd/btcec"
|
||||
"github.com/roasbeef/btcd/chaincfg/chainhash"
|
||||
"github.com/roasbeef/btcd/txscript"
|
||||
@@ -56,7 +55,7 @@ func witnessScriptHash(witnessScript []byte) ([]byte, error) {
|
||||
bldr := txscript.NewScriptBuilder()
|
||||
|
||||
bldr.AddOp(txscript.OP_0)
|
||||
scriptHash := fastsha256.Sum256(witnessScript)
|
||||
scriptHash := sha256.Sum256(witnessScript)
|
||||
bldr.AddData(scriptHash[:])
|
||||
return bldr.Script()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user