btcec/schnorr/musig2: pass in aux info during nonce generation

This commit is contained in:
Olaoluwa Osuntokun 2022-04-27 16:51:53 -07:00
parent 953e2dd94a
commit ba20c75aaf
No known key found for this signature in database
GPG Key ID: 3BBD59E99B280306

View File

@ -481,7 +481,13 @@ func (c *Context) NewSession(options ...SessionOption) (*Session, error) {
// specified nonce, or generate a fresh set. // specified nonce, or generate a fresh set.
var err error var err error
if localNonces == nil { if localNonces == nil {
localNonces, err = GenNonces() // At this point we need to generate a fresh nonce. We'll pass
// in some auxiliary information to strengthen the nonce
// generated.
localNonces, err = GenNonces(
WithNonceSecretKeyAux(c.signingKey),
WithNonceCombinedKeyAux(c.combinedKey.FinalKey),
)
if err != nil { if err != nil {
return nil, err return nil, err
} }