mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 07:35:07 +02:00
multi: add tag option to SignMessageSchnorr
This commit is contained in:
@@ -74,13 +74,17 @@ func (s *SecretKeyRing) SignMessageCompact(_ keychain.KeyLocator,
|
||||
|
||||
// SignMessageSchnorr signs the passed message and ignores the KeyDescriptor.
|
||||
func (s *SecretKeyRing) SignMessageSchnorr(_ keychain.KeyLocator,
|
||||
msg []byte, doubleHash bool, taprootTweak []byte) (*schnorr.Signature,
|
||||
error) {
|
||||
msg []byte, doubleHash bool, taprootTweak []byte,
|
||||
tag []byte) (*schnorr.Signature, error) {
|
||||
|
||||
var digest []byte
|
||||
if doubleHash {
|
||||
switch {
|
||||
case len(tag) > 0:
|
||||
taggedHash := chainhash.TaggedHash(tag, msg)
|
||||
digest = taggedHash[:]
|
||||
case doubleHash:
|
||||
digest = chainhash.DoubleHashB(msg)
|
||||
} else {
|
||||
default:
|
||||
digest = chainhash.HashB(msg)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user