input+lnrpc: make key sorting optional in input pkg

To allow us to properly test all test vectors, we can't default to true
on key sorting. Instead we add a parameter to the input package and move
the default value to the RPC server.
This commit is contained in:
Oliver Gugger
2023-01-27 16:13:14 +01:00
parent 13789f5d95
commit cb9f2d0398
3 changed files with 30 additions and 10 deletions

View File

@@ -167,7 +167,7 @@ func MuSig2ParsePubKeys(rawPubKeys [][]byte) ([]*btcec.PublicKey, error) {
// MuSig2CombineKeys combines the given set of public keys into a single
// combined MuSig2 combined public key, applying the given tweaks.
func MuSig2CombineKeys(allSignerPubKeys []*btcec.PublicKey,
func MuSig2CombineKeys(allSignerPubKeys []*btcec.PublicKey, sortKeys bool,
tweaks *MuSig2Tweaks) (*musig2.AggregateKey, error) {
// Convert the tweak options into the appropriate MuSig2 API functional
@@ -188,7 +188,7 @@ func MuSig2CombineKeys(allSignerPubKeys []*btcec.PublicKey,
// Then we'll use this information to compute the aggregated public key.
combinedKey, _, _, err := musig2.AggregateKeys(
allSignerPubKeys, true, keyAggOpts...,
allSignerPubKeys, sortKeys, keyAggOpts...,
)
return combinedKey, err
}