btcec/schnorr/musig2: always pass in priv key for early nonce gen

This helps mitigate an issue discovered in musig2 under certain
scenarios:
https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-October/021000.html.
This commit is contained in:
Olaoluwa Osuntokun 2022-10-25 16:33:21 -07:00
parent 323871ff16
commit eef9fbc5c9
No known key found for this signature in database
GPG key ID: 3BBD59E99B280306

View file

@ -239,7 +239,9 @@ func NewContext(signingKey *btcec.PrivateKey, shouldSort bool,
// are known.
if opts.earlyNonce {
var err error
ctx.sessionNonce, err = GenNonces()
ctx.sessionNonce, err = GenNonces(
WithNonceSecretKeyAux(signingKey),
)
if err != nil {
return nil, err
}