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
PreparedNonceWithProof & operator= (const PreparedNonceWithProof &)=delete
 PreparedNonceWithProof (PreparedNonceWithProof &&other) noexcept=default
PreparedNonceWithProof & operator= (PreparedNonceWithProof &&other) noexcept=default
 ~PreparedNonceWithProof ()=default
const Nonce & public_nonce () const noexcept
 Returns the public nonce proved by this bundle.
bool available () const noexcept
 Returns whether the wrapped secret nonce remains available.
const NonceProof & proof () const noexcept
 Returns the public nonce proof carried by this bundle.
Result< Scalar32 > scalar () const
 Explicitly exports the secret nonce scalar from the wrapped prepared nonce.
Result< ProvenSignature > sign_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< ProvenSignature > sign_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 387 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

◆ available()

bool purify::puresign::PreparedNonceWithProof::available ( ) const
inlinenodiscardnoexcept

Definition at line 405 of file legacy.hpp.

◆ from_parts()

PreparedNonceWithProof purify::puresign::PreparedNonceWithProof::from_parts ( PreparedNonce prepared,
NonceProof proof )
staticnodiscard
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 381 of file legacy.cpp.

References PreparedNonceWithProof(), and proof().

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

◆ 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
inlinenodiscardnoexcept
Returns
The nonce proof paired with the prepared nonce.

Definition at line 413 of file legacy.hpp.

Referenced by from_parts().

◆ public_nonce()

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

Definition at line 400 of file legacy.hpp.

◆ scalar()

Result< Scalar32 > purify::puresign::PreparedNonceWithProof::scalar ( ) const
inlinenodiscard
Returns
A scalar copy, or UninitializedState after the nonce is consumed.

Definition at line 421 of file legacy.hpp.

◆ sign_message()

Result< ProvenSignature > purify::puresign::PreparedNonceWithProof::sign_message ( const SecretKey & secret,
std::span< const unsigned char > message,
purify_secp_context * secp_context ) &&
nodiscard
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 385 of file legacy.cpp.

References purify::InternalMismatch, purify::puresign::NonceProof::nonce, PURIFY_ASSIGN_OR_RETURN, purify::puresign::api_impl::sign_message_with_prepared(), 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 ) &&
nodiscard
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 398 of file legacy.cpp.

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


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