|
purify
C++ Purify implementation with native circuit and BPP support
|
Move-only prepared nonce bound to either a message or a topic. More...
#include <legacy.hpp>
Public Types | |
| enum class | Scope : std::uint8_t { Message , Topic } |
Public Member Functions | |
| PreparedNonce (const PreparedNonce &)=delete | |
| PreparedNonce & | operator= (const PreparedNonce &)=delete |
| PreparedNonce (PreparedNonce &&other) noexcept | |
| PreparedNonce & | operator= (PreparedNonce &&other) noexcept |
| ~PreparedNonce () | |
| const Nonce & | public_nonce () const noexcept |
| Returns the public nonce corresponding to this prepared secret nonce scalar. | |
| Scalar32 | scalar () const |
| Explicitly exports the secret nonce scalar. | |
| Result< Signature > | sign_message (const Bip340Key &signer, std::span< const unsigned char > message, purify_secp_context *secp_context) && |
| Consumes this message-bound nonce and signs the matching message. | |
| Result< Signature > | sign_topic_message (const Bip340Key &signer, std::span< const unsigned char > message, purify_secp_context *secp_context) && |
| Consumes this topic-bound nonce and signs a message under that topic binding. | |
Static Public Member Functions | |
| static PreparedNonce | from_parts (Scope scope, const Scalar32 &scalar, const Nonce &nonce, const XOnly32 &signer_pubkey, const XOnly32 &binding_digest) |
| Builds a prepared nonce from already-derived nonce components. | |
The public nonce is safe to send over the wire. The secret scalar is intentionally not serializable and is wiped on destruction and after moves.
Definition at line 292 of file legacy.hpp.
|
strong |
| Enumerator | |
|---|---|
| Message | |
| Topic | |
Definition at line 294 of file legacy.hpp.
|
delete |
|
noexcept |
Definition at line 273 of file legacy.cpp.
| purify::puresign::PreparedNonce::~PreparedNonce | ( | ) |
Definition at line 292 of file legacy.cpp.
|
static |
| scope | Whether the nonce is message-bound or topic-bound. |
| scalar | The secret nonce scalar to store. |
| nonce | The public x-only nonce corresponding to scalar. |
| signer_pubkey | The signer's BIP340 x-only public key. |
| binding_digest | The binding digest that this nonce must later match. |
Definition at line 268 of file legacy.cpp.
References binding_digest, nonce, scalar, scope, and signer_pubkey.
|
delete |
|
noexcept |
Definition at line 279 of file legacy.cpp.
|
inlinenoexcept |
Definition at line 310 of file legacy.hpp.
Referenced by purify::puresign::PreparedNonceWithProof::public_nonce().
|
inline |
This is intentionally a copy-returning accessor so callers have to opt in to handling the secret value.
Definition at line 320 of file legacy.hpp.
Referenced by purify::puresign::PreparedNonceWithProof::scalar().
| Result< Signature > purify::puresign::PreparedNonce::sign_message | ( | const Bip340Key & | signer, |
| std::span< const unsigned char > | message, | ||
| purify_secp_context * | secp_context | ||
| ) | && |
| signer | The BIP340 signer derived from the same secret as this prepared nonce. |
| message | The message that must match the nonce binding. |
Definition at line 300 of file legacy.cpp.
References binding_digest, purify_bip340_sign_with_fixed_nonce(), purify_bip340_verify(), PURIFY_RETURN_IF_ERROR, purify::require_secp_context(), and purify::unexpected_error().
| Result< Signature > purify::puresign::PreparedNonce::sign_topic_message | ( | const Bip340Key & | signer, |
| std::span< const unsigned char > | message, | ||
| purify_secp_context * | secp_context | ||
| ) | && |
| signer | The BIP340 signer derived from the same secret as this prepared nonce. |
| message | The message to sign. |
Definition at line 330 of file legacy.cpp.
References purify_bip340_sign_with_fixed_nonce(), purify_bip340_verify(), PURIFY_RETURN_IF_ERROR, purify::require_secp_context(), and purify::unexpected_error().