Bitcoin Core 30.99.0
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
MuSig2SecNonce Class Reference

MuSig2SecNonce encapsulates a secret nonce in use in a MuSig2 signing session. More...

#include <musig.h>

Public Member Functions

 MuSig2SecNonce ()
 
 MuSig2SecNonce (MuSig2SecNonce &&) noexcept
 
MuSig2SecNonceoperator= (MuSig2SecNonce &&) noexcept
 
 ~MuSig2SecNonce ()
 
 MuSig2SecNonce (const MuSig2SecNonce &)=delete
 
MuSig2SecNonceoperator= (const MuSig2SecNonce &)=delete
 
secp256k1_musig_secnonceGet () const
 
void Invalidate ()
 
bool IsValid ()
 

Private Attributes

std::unique_ptr< MuSig2SecNonceImplm_impl
 

Detailed Description

MuSig2SecNonce encapsulates a secret nonce in use in a MuSig2 signing session.

Since this nonce persists outside of libsecp256k1 signing code, we must handle its construction and destruction ourselves. The secret nonce must be kept a secret, otherwise the private key may be leaked. As such, it needs to be treated in the same way that CKeys are treated. So this class handles the secure allocation of the secp256k1_musig_secnonce object that libsecp256k1 uses, and only gives out references to this object to avoid any possibility of copies being made. Furthermore, objects of this class are not copyable to avoid nonce reuse.

Definition at line 48 of file musig.h.

Constructor & Destructor Documentation

◆ MuSig2SecNonce() [1/3]

MuSig2SecNonce::MuSig2SecNonce ( )

Definition at line 93 of file musig.cpp.

◆ MuSig2SecNonce() [2/3]

MuSig2SecNonce::MuSig2SecNonce ( MuSig2SecNonce &&  )
defaultnoexcept

◆ ~MuSig2SecNonce()

MuSig2SecNonce::~MuSig2SecNonce ( )
default

◆ MuSig2SecNonce() [3/3]

MuSig2SecNonce::MuSig2SecNonce ( const MuSig2SecNonce )
delete

Member Function Documentation

◆ Get()

secp256k1_musig_secnonce * MuSig2SecNonce::Get ( ) const

Definition at line 100 of file musig.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Invalidate()

void MuSig2SecNonce::Invalidate ( )

Definition at line 105 of file musig.cpp.

Here is the caller graph for this function:

◆ IsValid()

bool MuSig2SecNonce::IsValid ( )

Definition at line 110 of file musig.cpp.

◆ operator=() [1/2]

MuSig2SecNonce & MuSig2SecNonce::operator= ( const MuSig2SecNonce )
delete

◆ operator=() [2/2]

MuSig2SecNonce & MuSig2SecNonce::operator= ( MuSig2SecNonce &&  )
defaultnoexcept

Member Data Documentation

◆ m_impl

std::unique_ptr<MuSig2SecNonceImpl> MuSig2SecNonce::m_impl
private

Definition at line 51 of file musig.h.


The documentation for this class was generated from the following files: