multi: use btcd's btcec/v2 and btcutil modules
This commit was previously split into the following parts to ease review: - 2d746f68: replace imports - 4008f0fd: use ecdsa.Signature - 849e33d1: remove btcec.S256() - b8f6ebbd: use v2 library correctly - fa80bca9: bump go modules
This commit is contained in:
350 files changed
+2421
-1289
No files matched your search
@@ -1,7 +1,8 @@
|
||||
package mock
|
||||
|
||||
import (
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
"github.com/btcsuite/btcd/btcec/v2/ecdsa"
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/lightningnetwork/lnd/keychain"
|
||||
)
|
||||
@@ -45,7 +46,7 @@ func (s *SecretKeyRing) ECDH(_ keychain.KeyDescriptor,
|
||||
|
||||
// SignMessage signs the passed message and ignores the KeyDescriptor.
|
||||
func (s *SecretKeyRing) SignMessage(_ keychain.KeyLocator,
|
||||
msg []byte, doubleHash bool) (*btcec.Signature, error) {
|
||||
msg []byte, doubleHash bool) (*ecdsa.Signature, error) {
|
||||
|
||||
var digest []byte
|
||||
if doubleHash {
|
||||
@@ -53,7 +54,7 @@ func (s *SecretKeyRing) SignMessage(_ keychain.KeyLocator,
|
||||
} else {
|
||||
digest = chainhash.HashB(msg)
|
||||
}
|
||||
return s.RootKey.Sign(digest)
|
||||
return ecdsa.Sign(s.RootKey, digest), nil
|
||||
}
|
||||
|
||||
// SignMessageCompact signs the passed message.
|
||||
@@ -66,5 +67,5 @@ func (s *SecretKeyRing) SignMessageCompact(_ keychain.KeyLocator,
|
||||
} else {
|
||||
digest = chainhash.HashB(msg)
|
||||
}
|
||||
return btcec.SignCompact(btcec.S256(), s.RootKey, digest, true)
|
||||
return ecdsa.SignCompact(s.RootKey, digest, true)
|
||||
}
|
||||
Reference in new issue
Block a user