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

#include <bppp.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 BPPP-backed public nonce proof.
 

Detailed Description

Definition at line 361 of file bppp.hpp.

Constructor & Destructor Documentation

◆ PreparedNonceWithProof() [1/2]

purify::puresign_plusplus::PreparedNonceWithProof::PreparedNonceWithProof ( const PreparedNonceWithProof )
delete

◆ PreparedNonceWithProof() [2/2]

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

◆ ~PreparedNonceWithProof()

purify::puresign_plusplus::PreparedNonceWithProof::~PreparedNonceWithProof ( )
default

Member Function Documentation

◆ from_parts()

PreparedNonceWithProof purify::puresign_plusplus::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 396 of file bppp.cpp.

References proof().

Referenced by purify::puresign_plusplus::api_impl::prepare_message_nonce_with_proof(), purify::puresign_plusplus::api_impl::prepare_message_nonce_with_proof(), purify::puresign_plusplus::api_impl::prepare_topic_nonce_with_proof(), and purify::puresign_plusplus::api_impl::prepare_topic_nonce_with_proof().

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ proof()

const NonceProof & purify::puresign_plusplus::PreparedNonceWithProof::proof ( ) const
inlinenoexcept
Returns
The BPPP-backed nonce proof paired with the prepared nonce.

Definition at line 382 of file bppp.hpp.

Referenced by from_parts().

◆ public_nonce()

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

Definition at line 374 of file bppp.hpp.

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

◆ scalar()

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

Definition at line 390 of file bppp.hpp.

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

◆ sign_message()

Result< ProvenSignature > purify::puresign_plusplus::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 400 of file bppp.cpp.

References purify::InternalMismatch, purify::puresign_plusplus::NonceProof::nonce, PURIFY_ASSIGN_OR_RETURN, purify::puresign_plusplus::api_impl::sign_message_with_prepared(), purify::unexpected_error(), and purify::puresign_plusplus::Nonce::xonly.

◆ sign_topic_message()

Result< ProvenSignature > purify::puresign_plusplus::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 413 of file bppp.cpp.

References purify::InternalMismatch, purify::puresign_plusplus::NonceProof::nonce, PURIFY_ASSIGN_OR_RETURN, purify::puresign_plusplus::api_impl::sign_with_prepared_topic(), purify::unexpected_error(), and purify::puresign_plusplus::Nonce::xonly.


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