|
purify
C++ Purify implementation with native circuit and BPP support
|
Public key bundle pairing a Purify packed public key with its derived BIP340 x-only key. More...
#include <legacy.hpp>
Public Member Functions | |
| Bytes | serialize () const |
| Serializes this public-key bundle into its fixed-size wire format. | |
| Result< bool > | verify_signature (std::span< const unsigned char > message, const Signature &signature, purify_secp_context *secp_context) const |
| Verifies a plain BIP340 signature against this bundle's x-only public key. | |
| Result< bool > | verify_message_nonce_proof (std::span< const unsigned char > message, const NonceProof &nonce_proof, purify_secp_context *secp_context, ExperimentalBulletproofBackendCache *circuit_cache=nullptr) const |
| Verifies a message-bound nonce proof against this public key. | |
| Result< bool > | verify_message_nonce_proof (const MessageProofCache &cache, const NonceProof &nonce_proof, purify_secp_context *secp_context, ExperimentalBulletproofBackendCache *circuit_cache=nullptr) const |
| Verifies a message-bound nonce proof using a reusable message proof cache. | |
| Result< bool > | verify_topic_nonce_proof (std::span< const unsigned char > topic, const NonceProof &nonce_proof, purify_secp_context *secp_context, ExperimentalBulletproofBackendCache *circuit_cache=nullptr) const |
| Verifies a topic-bound nonce proof against this public key. | |
| Result< bool > | verify_topic_nonce_proof (const TopicProofCache &cache, const NonceProof &nonce_proof, purify_secp_context *secp_context, ExperimentalBulletproofBackendCache *circuit_cache=nullptr) const |
| Verifies a topic-bound nonce proof using a reusable topic proof cache. | |
| Result< bool > | verify_message_signature_with_proof (std::span< const unsigned char > message, const ProvenSignature &signature, purify_secp_context *secp_context, ExperimentalBulletproofBackendCache *circuit_cache=nullptr) const |
| Verifies a message signature bundled with its nonce proof. | |
| Result< bool > | verify_message_signature_with_proof (const MessageProofCache &cache, const ProvenSignature &signature, purify_secp_context *secp_context, ExperimentalBulletproofBackendCache *circuit_cache=nullptr) const |
| Verifies a message signature bundle using a reusable message proof cache. | |
| Result< bool > | verify_topic_signature_with_proof (std::span< const unsigned char > message, std::span< const unsigned char > topic, const ProvenSignature &signature, purify_secp_context *secp_context, ExperimentalBulletproofBackendCache *circuit_cache=nullptr) const |
| Verifies a topic-bound signature bundled with its nonce proof. | |
| Result< bool > | verify_topic_signature_with_proof (const TopicProofCache &cache, std::span< const unsigned char > message, const ProvenSignature &signature, purify_secp_context *secp_context, ExperimentalBulletproofBackendCache *circuit_cache=nullptr) const |
| Verifies a topic-bound signature bundle using a reusable topic proof cache. | |
Static Public Member Functions | |
| static Result< PublicKey > | deserialize (std::span< const unsigned char > serialized, purify_secp_context *secp_context) |
| Parses a serialized public-key bundle. | |
| static Result< PublicKey > | from_secret (const SecretKey &secret, purify_secp_context *secp_context) |
| Derives both public identities from one packed Purify secret. | |
Data Fields | |
| UInt512 | purify_pubkey |
| XOnly32 | bip340_pubkey {} |
Static Public Attributes | |
| static constexpr std::size_t | kSerializedSize = 96 |
This bundle is convenient for applications that need both identities. Third parties can verify signatures against bip340_pubkey, but this convenience type does not by itself prove that the bundled Purify and BIP340 keys came from the same secret.
Definition at line 42 of file legacy.hpp.
|
static |
| serialized | The byte sequence previously produced by serialize(). |
Definition at line 48 of file legacy.cpp.
References purify::BackendRejectedInput, purify::BigUInt< 8 >::from_bytes_be(), purify::InvalidFixedSize, kSerializedSize, purify_bip340_validate_xonly_pubkey(), purify_pubkey, PURIFY_RETURN_IF_ERROR, purify::require_secp_context(), purify::unexpected_error(), and purify::validate_public_key().
|
static |
| secret | The owned secret used to derive the Purify and BIP340 public keys. |
Definition at line 706 of file legacy.cpp.
| Bytes purify::puresign::PublicKey::serialize | ( | ) | const |
(purify_pubkey, bip340_pubkey). Definition at line 39 of file legacy.cpp.
References bip340_pubkey, kSerializedSize, purify_pubkey, and purify::BigUInt< Words >::to_bytes_be().
| Result< bool > purify::puresign::PublicKey::verify_message_nonce_proof | ( | const MessageProofCache & | cache, |
| const NonceProof & | nonce_proof, | ||
| purify_secp_context * | secp_context, | ||
| ExperimentalBulletproofBackendCache * | circuit_cache = nullptr |
||
| ) | const |
| cache | The prebuilt cache for the exact message bound into the proof. |
| nonce_proof | The public nonce proof to verify. |
| circuit_cache | Optional backend verifier cache to reuse across calls. |
true when the proof is valid for this public key and cached message template. Definition at line 722 of file legacy.cpp.
| Result< bool > purify::puresign::PublicKey::verify_message_nonce_proof | ( | std::span< const unsigned char > | message, |
| const NonceProof & | nonce_proof, | ||
| purify_secp_context * | secp_context, | ||
| ExperimentalBulletproofBackendCache * | circuit_cache = nullptr |
||
| ) | const |
| message | The message that defines the nonce binding. |
| nonce_proof | The public nonce proof to verify. |
| circuit_cache | Optional backend verifier cache to reuse across calls. |
true when the proof is valid for this public key and message. Definition at line 715 of file legacy.cpp.
| Result< bool > purify::puresign::PublicKey::verify_message_signature_with_proof | ( | const MessageProofCache & | cache, |
| const ProvenSignature & | signature, | ||
| purify_secp_context * | secp_context, | ||
| ExperimentalBulletproofBackendCache * | circuit_cache = nullptr |
||
| ) | const |
| cache | The prebuilt cache for the exact signed message. |
| signature | The bundled signature and nonce proof to verify. |
| circuit_cache | Optional backend verifier cache to reuse across calls. |
true when both the BIP340 signature and cached nonce proof verify. Definition at line 748 of file legacy.cpp.
| Result< bool > purify::puresign::PublicKey::verify_message_signature_with_proof | ( | std::span< const unsigned char > | message, |
| const ProvenSignature & | signature, | ||
| purify_secp_context * | secp_context, | ||
| ExperimentalBulletproofBackendCache * | circuit_cache = nullptr |
||
| ) | const |
| message | The signed message. |
| signature | The bundled signature and nonce proof to verify. |
| circuit_cache | Optional backend verifier cache to reuse across calls. |
true when both the BIP340 signature and the nonce proof verify. Definition at line 741 of file legacy.cpp.
| Result< bool > purify::puresign::PublicKey::verify_signature | ( | std::span< const unsigned char > | message, |
| const Signature & | signature, | ||
| purify_secp_context * | secp_context | ||
| ) | const |
| message | The message that was signed. |
| signature | The signature to verify. |
true when the signature is valid for (message, bip340_pubkey). Definition at line 710 of file legacy.cpp.
| Result< bool > purify::puresign::PublicKey::verify_topic_nonce_proof | ( | const TopicProofCache & | cache, |
| const NonceProof & | nonce_proof, | ||
| purify_secp_context * | secp_context, | ||
| ExperimentalBulletproofBackendCache * | circuit_cache = nullptr |
||
| ) | const |
| cache | The prebuilt cache for the exact topic bound into the proof. |
| nonce_proof | The public nonce proof to verify. |
| circuit_cache | Optional backend verifier cache to reuse across calls. |
true when the proof is valid for this public key and cached topic template. Definition at line 735 of file legacy.cpp.
| Result< bool > purify::puresign::PublicKey::verify_topic_nonce_proof | ( | std::span< const unsigned char > | topic, |
| const NonceProof & | nonce_proof, | ||
| purify_secp_context * | secp_context, | ||
| ExperimentalBulletproofBackendCache * | circuit_cache = nullptr |
||
| ) | const |
| topic | The topic that defines the nonce binding. |
| nonce_proof | The public nonce proof to verify. |
| circuit_cache | Optional backend verifier cache to reuse across calls. |
true when the proof is valid for this public key and topic. Definition at line 728 of file legacy.cpp.
| Result< bool > purify::puresign::PublicKey::verify_topic_signature_with_proof | ( | const TopicProofCache & | cache, |
| std::span< const unsigned char > | message, | ||
| const ProvenSignature & | signature, | ||
| purify_secp_context * | secp_context, | ||
| ExperimentalBulletproofBackendCache * | circuit_cache = nullptr |
||
| ) | const |
| cache | The prebuilt cache for the exact topic bound into the proof. |
| message | The signed message. |
| signature | The bundled signature and nonce proof to verify. |
| circuit_cache | Optional backend verifier cache to reuse across calls. |
true when both the BIP340 signature and cached topic-bound nonce proof verify. Definition at line 763 of file legacy.cpp.
| Result< bool > purify::puresign::PublicKey::verify_topic_signature_with_proof | ( | std::span< const unsigned char > | message, |
| std::span< const unsigned char > | topic, | ||
| const ProvenSignature & | signature, | ||
| purify_secp_context * | secp_context, | ||
| ExperimentalBulletproofBackendCache * | circuit_cache = nullptr |
||
| ) | const |
| message | The signed message. |
| topic | The topic that defines the nonce binding. |
| signature | The bundled signature and nonce proof to verify. |
| circuit_cache | Optional backend verifier cache to reuse across calls. |
true when both the BIP340 signature and topic-bound nonce proof verify. Definition at line 755 of file legacy.cpp.
| XOnly32 purify::puresign::PublicKey::bip340_pubkey {} |
Definition at line 46 of file legacy.hpp.
Referenced by serialize(), and purify::puresign::api_impl::verify_signature().
|
staticconstexpr |
Definition at line 43 of file legacy.hpp.
Referenced by deserialize(), and serialize().
| UInt512 purify::puresign::PublicKey::purify_pubkey |
Definition at line 45 of file legacy.hpp.
Referenced by deserialize(), serialize(), purify::puresign::api_impl::verify_message_nonce_proof(), purify::puresign::api_impl::verify_message_nonce_proof(), purify::puresign::api_impl::verify_signature(), purify::puresign::api_impl::verify_topic_nonce_proof(), and purify::puresign::api_impl::verify_topic_nonce_proof().