purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
purify::puresign::PreparedNonceWithProof Class Reference

Move-only prepared nonce bundled with its public statement proof. More...

#include <legacy.hpp>

Public Member Functions

 PreparedNonceWithProof (const PreparedNonceWithProof &)=delete
 
PreparedNonceWithProofoperator= (const PreparedNonceWithProof &)=delete
 
 PreparedNonceWithProof (PreparedNonceWithProof &&other) noexcept=default
 
PreparedNonceWithProofoperator= (PreparedNonceWithProof &&other) noexcept=default
 
 ~PreparedNonceWithProof ()=default
 
const Noncepublic_nonce () const noexcept
 Returns the public nonce proved by this bundle.
 
const NonceProofproof () const noexcept
 Returns the public nonce proof carried by this bundle.
 
Scalar32 scalar () const
 Explicitly exports the secret nonce scalar from the wrapped prepared nonce.
 
Result< ProvenSignaturesign_message (const SecretKey &secret, std::span< const unsigned char > message, purify_secp_context *secp_context) &&
 Consumes this message-bound prepared proof bundle and signs the message.
 
Result< ProvenSignaturesign_topic_message (const SecretKey &secret, std::span< const unsigned char > message, purify_secp_context *secp_context) &&
 Consumes this topic-bound prepared proof bundle and signs the message.
 

Static Public Member Functions

static PreparedNonceWithProof from_parts (PreparedNonce prepared, NonceProof proof)
 Bundles a prepared nonce with its matching public nonce proof.
 

Detailed Description

The proof is always present and the secret nonce scalar remains non-serializable. This avoids forcing callers to branch on a maybe-present proof after the type has already crossed an API boundary.

Definition at line 376 of file legacy.hpp.

Constructor & Destructor Documentation

◆ PreparedNonceWithProof() [1/2]

purify::puresign::PreparedNonceWithProof::PreparedNonceWithProof ( const PreparedNonceWithProof )
delete

◆ PreparedNonceWithProof() [2/2]

purify::puresign::PreparedNonceWithProof::PreparedNonceWithProof ( PreparedNonceWithProof &&  other)
defaultnoexcept

◆ ~PreparedNonceWithProof()

purify::puresign::PreparedNonceWithProof::~PreparedNonceWithProof ( )
default

Member Function Documentation

◆ from_parts()

PreparedNonceWithProof purify::puresign::PreparedNonceWithProof::from_parts ( PreparedNonce  prepared,
NonceProof  proof 
)
static
Parameters
preparedThe prepared nonce carrying the secret scalar.
proofThe public nonce proof matching prepared.
Returns
The constructed move-only prepared nonce-plus-proof bundle.

Definition at line 358 of file legacy.cpp.

◆ operator=() [1/2]

PreparedNonceWithProof & purify::puresign::PreparedNonceWithProof::operator= ( const PreparedNonceWithProof )
delete

◆ operator=() [2/2]

PreparedNonceWithProof & purify::puresign::PreparedNonceWithProof::operator= ( PreparedNonceWithProof &&  other)
defaultnoexcept

◆ proof()

const NonceProof & purify::puresign::PreparedNonceWithProof::proof ( ) const
inlinenoexcept
Returns
The nonce proof paired with the prepared nonce.

Definition at line 397 of file legacy.hpp.

◆ public_nonce()

const Nonce & purify::puresign::PreparedNonceWithProof::public_nonce ( ) const
inlinenoexcept
Returns
The x-only public nonce that the bundled proof refers to.

Definition at line 389 of file legacy.hpp.

References purify::puresign::PreparedNonce::public_nonce().

◆ scalar()

Scalar32 purify::puresign::PreparedNonceWithProof::scalar ( ) const
inline
Returns
A copy of the secret nonce scalar.

Definition at line 405 of file legacy.hpp.

References purify::puresign::PreparedNonce::scalar().

◆ sign_message()

Result< ProvenSignature > purify::puresign::PreparedNonceWithProof::sign_message ( const SecretKey secret,
std::span< const unsigned char >  message,
purify_secp_context secp_context 
) &&
Parameters
secretThe owned secret corresponding to the prepared nonce.
messageThe message that must match the nonce binding.
Returns
The resulting signature bundled with its nonce proof.

Definition at line 362 of file legacy.cpp.

References purify::puresign::NonceProof::nonce, PURIFY_ASSIGN_OR_RETURN, purify::unexpected_error(), and purify::puresign::Nonce::xonly.

◆ sign_topic_message()

Result< ProvenSignature > purify::puresign::PreparedNonceWithProof::sign_topic_message ( const SecretKey secret,
std::span< const unsigned char >  message,
purify_secp_context secp_context 
) &&
Parameters
secretThe owned secret corresponding to the prepared nonce.
messageThe message to sign.
Returns
The resulting signature bundled with its nonce proof.

Definition at line 375 of file legacy.cpp.

References purify::puresign::NonceProof::nonce, PURIFY_ASSIGN_OR_RETURN, purify::unexpected_error(), and purify::puresign::Nonce::xonly.


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