purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
bppp.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 Judica, Inc.
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or https://opensource.org/license/mit/.
4
9
10#pragma once
11
12#include <array>
13#include <cstddef>
14#include <cstdint>
15#include <span>
16#include <utility>
17
18#include "purify/api.hpp"
19#include "purify/bppp.hpp"
20
22
23using Scalar32 = std::array<unsigned char, 32>;
24using XOnly32 = std::array<unsigned char, 32>;
25using Signature64 = std::array<unsigned char, 64>;
26
28struct TopicProofCache;
29struct Signature;
30class PreparedNonce;
31
32struct NonceProof;
33struct ProvenSignature;
34
42class NonceHost {
43public:
44 static constexpr std::size_t kSerializedSize = 64;
45
46 [[nodiscard]] static Result<NonceHost> deserialize(
47 std::span<const unsigned char> serialized);
48
49 [[nodiscard]] const UInt512& public_key() const noexcept {
50 return public_key_;
51 }
52
54 std::span<const unsigned char> topic,
55 const NonceProof& nonce_proof,
56 purify_secp_context* secp_context,
57 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
58
60 const TopicProofCache& cache,
61 const NonceProof& nonce_proof,
62 purify_secp_context* secp_context,
63 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
64
65private:
67 : public_key_(std::move(public_key)) {}
68
69 UInt512 public_key_;
70};
71
72struct PublicKey {
73 static constexpr std::size_t kSerializedSize = 96;
74
77
82 [[nodiscard]] Bytes serialize() const;
83
89 [[nodiscard]] static Result<PublicKey> deserialize(std::span<const unsigned char> serialized,
90 purify_secp_context* secp_context);
91
97 [[nodiscard]] static Result<PublicKey> from_secret(const SecretKey& secret,
98 purify_secp_context* secp_context);
99
106 [[nodiscard]] Result<bool> verify_signature(std::span<const unsigned char> message,
107 const Signature& signature,
108 purify_secp_context* secp_context) const;
109
118 std::span<const unsigned char> message,
119 const NonceProof& nonce_proof,
120 purify_secp_context* secp_context,
121 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
122
131 const MessageProofCache& cache,
132 const NonceProof& nonce_proof,
133 purify_secp_context* secp_context,
134 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
135
144 std::span<const unsigned char> topic,
145 const NonceProof& nonce_proof,
146 purify_secp_context* secp_context,
147 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
148
157 const TopicProofCache& cache,
158 const NonceProof& nonce_proof,
159 purify_secp_context* secp_context,
160 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
161
170 std::span<const unsigned char> message,
171 const ProvenSignature& signature,
172 purify_secp_context* secp_context,
173 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
174
183 const MessageProofCache& cache,
184 const ProvenSignature& signature,
185 purify_secp_context* secp_context,
186 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
187
197 std::span<const unsigned char> message,
198 std::span<const unsigned char> topic,
199 const ProvenSignature& signature,
200 purify_secp_context* secp_context,
201 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
202
212 const TopicProofCache& cache,
213 std::span<const unsigned char> message,
214 const ProvenSignature& signature,
215 purify_secp_context* secp_context,
216 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
217};
218
220struct Nonce {
221 static constexpr std::size_t kSerializedSize = 32;
222
224
226 [[nodiscard]] Bytes serialize() const;
228 [[nodiscard]] static Result<Nonce> deserialize(std::span<const unsigned char> serialized,
229 purify_secp_context* secp_context);
230};
231
233struct Signature {
234 static constexpr std::size_t kSerializedSize = 64;
235
237
239 [[nodiscard]] Nonce nonce() const;
241 [[nodiscard]] Scalar32 s() const;
243 [[nodiscard]] Bytes serialize() const;
245 [[nodiscard]] static Result<Signature> deserialize(std::span<const unsigned char> serialized,
246 purify_secp_context* secp_context);
247};
248
270
292
294 // V4 uses the typed-SHA-256 algebraic transcript accepted by recursive
295 // certificate leaves. V3 proofs are intentionally not accepted.
296 static constexpr unsigned char kSerializationVersion = 4;
297 static constexpr std::size_t kNormProofSize = 844;
298 static constexpr std::size_t kSerializedSize = 228 + kNormProofSize;
299
308
309 [[nodiscard]] Result<Bytes> serialize(purify_secp_context* secp_context) const;
310 [[nodiscard]] static Result<NonceProof> deserialize(std::span<const unsigned char> serialized,
311 purify_secp_context* secp_context);
312};
313
315 static constexpr unsigned char kSerializationVersion = 3;
316 static constexpr std::size_t kSerializedSize =
318
321
322 [[nodiscard]] Result<Bytes> serialize(purify_secp_context* secp_context) const;
323 [[nodiscard]] static Result<ProvenSignature> deserialize(std::span<const unsigned char> serialized,
324 purify_secp_context* secp_context);
325};
326
334public:
335 enum class Scope : std::uint8_t {
338 };
339
340 PreparedNonce(const PreparedNonce&) = delete;
342
343 PreparedNonce(PreparedNonce&& other) noexcept;
344 PreparedNonce& operator=(PreparedNonce&& other) noexcept;
346
351 [[nodiscard]] const Nonce& public_nonce() const noexcept {
352 return nonce_;
353 }
354
356 [[nodiscard]] bool available() const noexcept {
357 return available_;
358 }
359
367 [[nodiscard]] Result<Scalar32> scalar() const {
368 if (!available_) {
370 "PreparedNonce::scalar:consumed");
371 }
372 return scalar_;
373 }
374
384 [[nodiscard]] static PreparedNonce from_parts(Scope scope, const Scalar32& scalar, const Nonce& nonce,
385 const XOnly32& signer_pubkey, const XOnly32& binding_digest);
386
393 [[nodiscard]] Result<Signature> sign_message(const Bip340Key& signer,
394 std::span<const unsigned char> message,
395 purify_secp_context* secp_context) &&;
396
403 [[nodiscard]] Result<Signature> sign_topic_message(const Bip340Key& signer,
404 std::span<const unsigned char> message,
405 purify_secp_context* secp_context) &&;
406
407private:
408 PreparedNonce(Scope scope, const Scalar32& scalar, const Nonce& nonce,
409 const XOnly32& signer_pubkey, const XOnly32& binding_digest);
410
411 void clear() noexcept;
412
413 Scope scope_{Scope::Message};
414 Scalar32 scalar_{};
415 Nonce nonce_{};
416 XOnly32 signer_pubkey_{};
417 XOnly32 binding_digest_{};
418 bool available_{false};
419};
420
422public:
425
429
434 [[nodiscard]] const Nonce& public_nonce() const noexcept {
435 return prepared_.public_nonce();
436 }
437
439 [[nodiscard]] bool available() const noexcept {
440 return prepared_.available();
441 }
442
447 [[nodiscard]] const NonceProof& proof() const noexcept {
448 return proof_;
449 }
450
455 [[nodiscard]] Result<Scalar32> scalar() const {
456 return prepared_.scalar();
457 }
458
467 [[nodiscard]] Result<Scalar32> raw_scalar() const;
468
475 [[nodiscard]] static PreparedNonceWithProof from_parts(PreparedNonce prepared, NonceProof proof);
476
483 [[nodiscard]] Result<ProvenSignature> sign_message(const SecretKey& secret,
484 std::span<const unsigned char> message,
485 purify_secp_context* secp_context) &&;
486
493 [[nodiscard]] Result<ProvenSignature> sign_topic_message(const SecretKey& secret,
494 std::span<const unsigned char> message,
495 purify_secp_context* secp_context) &&;
496
497private:
499 : prepared_(std::move(prepared)), proof_(std::move(proof)) {}
500
501 PreparedNonce prepared_;
502 NonceProof proof_;
503};
504
505class KeyPair {
506public:
507 KeyPair(const KeyPair&) = delete;
508 KeyPair& operator=(const KeyPair&) = delete;
509 KeyPair(KeyPair&& other) noexcept = default;
510 KeyPair& operator=(KeyPair&& other) noexcept = default;
511 ~KeyPair() = default;
512
518 [[nodiscard]] static Result<KeyPair> from_secret(const SecretKey& secret,
519 purify_secp_context* secp_context);
520
526 [[nodiscard]] static Result<KeyPair> from_secret(SecretKey&& secret,
527 purify_secp_context* secp_context);
528
533 [[nodiscard]] const PublicKey& public_key() const noexcept {
534 return public_key_;
535 }
536
542 [[nodiscard]] Result<PreparedNonce> prepare_message_nonce(std::span<const unsigned char> message,
543 purify_secp_context* secp_context) const;
544
552 std::span<const unsigned char> message,
553 purify_secp_context* secp_context,
554 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
555
563 const MessageProofCache& cache,
564 purify_secp_context* secp_context,
565 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
566
572 [[nodiscard]] Result<PreparedNonce> prepare_topic_nonce(std::span<const unsigned char> topic,
573 purify_secp_context* secp_context) const;
574
582 std::span<const unsigned char> topic,
583 purify_secp_context* secp_context,
584 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
585
593 const TopicProofCache& cache,
594 purify_secp_context* secp_context,
595 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
596
602 [[nodiscard]] Result<Signature> sign_message(std::span<const unsigned char> message,
603 purify_secp_context* secp_context) const;
604
611 [[nodiscard]] Result<Signature> sign_message_with_prepared(std::span<const unsigned char> message,
612 PreparedNonce&& prepared,
613 purify_secp_context* secp_context) const;
614
622 std::span<const unsigned char> message,
623 PreparedNonceWithProof&& prepared,
624 purify_secp_context* secp_context) const;
625
632 [[nodiscard]] Result<Signature> sign_with_topic(std::span<const unsigned char> message,
633 std::span<const unsigned char> topic,
634 purify_secp_context* secp_context) const;
641 [[nodiscard]] Result<Signature> sign_with_prepared_topic(std::span<const unsigned char> message,
642 PreparedNonce&& prepared,
643 purify_secp_context* secp_context) const;
644
652 std::span<const unsigned char> message,
653 PreparedNonceWithProof&& prepared,
654 purify_secp_context* secp_context) const;
655
663 std::span<const unsigned char> message,
664 purify_secp_context* secp_context,
665 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
666
674 const MessageProofCache& cache,
675 purify_secp_context* secp_context,
676 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
677
686 std::span<const unsigned char> message,
687 std::span<const unsigned char> topic,
688 purify_secp_context* secp_context,
689 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
690
699 std::span<const unsigned char> message,
700 const TopicProofCache& cache,
701 purify_secp_context* secp_context,
702 bppp::ExperimentalCircuitBackend* circuit_cache = nullptr) const;
703
704private:
706 : secret_(std::move(secret)), public_key_(std::move(public_key)) {}
707
708 SecretKey secret_;
709 PublicKey public_key_{};
710};
711
712} // namespace purify::puresign_plusplus
High-level Purify key generation, evaluation, witness generation, and circuit helpers.
C++ wrappers for the BPPP functionality used by Purify.
Public-key-agnostic native verifier-circuit template.
Move-only packed Purify secret stored in dedicated heap memory.
Definition secret.hpp:95
Common interface for reusable experimental BPPP backend state.
Definition bppp.hpp:129
Caller-owned cache for reusable experimental circuit reduction and BPPP backend data.
Definition bppp.hpp:196
Result< PreparedNonce > prepare_message_nonce(std::span< const unsigned char > message, purify_secp_context *secp_context) const
Deterministically prepares a message-bound nonce.
Definition bppp.cpp:966
Result< PreparedNonce > prepare_topic_nonce(std::span< const unsigned char > topic, purify_secp_context *secp_context) const
Deterministically prepares a topic-bound nonce.
Definition bppp.cpp:985
Result< ProvenSignature > sign_message_with_proof(std::span< const unsigned char > message, purify_secp_context *secp_context, bppp::ExperimentalCircuitBackend *circuit_cache=nullptr) const
Signs a message and returns the signature bundled with its BPPP nonce proof.
Definition bppp.cpp:1043
const PublicKey & public_key() const noexcept
Returns the public key bundle associated with this signer.
Definition bppp.hpp:533
Result< Signature > sign_with_prepared_topic(std::span< const unsigned char > message, PreparedNonce &&prepared, purify_secp_context *secp_context) const
Signs a message using an already prepared topic-bound nonce.
Definition bppp.cpp:1030
KeyPair & operator=(KeyPair &&other) noexcept=default
KeyPair & operator=(const KeyPair &)=delete
static Result< KeyPair > from_secret(const SecretKey &secret, purify_secp_context *secp_context)
Derives a PureSign++ signing key pair from one packed Purify secret.
Definition bppp.cpp:956
Result< PreparedNonceWithProof > prepare_message_nonce_with_proof(std::span< const unsigned char > message, purify_secp_context *secp_context, bppp::ExperimentalCircuitBackend *circuit_cache=nullptr) const
Deterministically prepares a message-bound nonce together with its BPPP proof.
Definition bppp.cpp:971
Result< ProvenSignature > sign_with_prepared_topic_proof(std::span< const unsigned char > message, PreparedNonceWithProof &&prepared, purify_secp_context *secp_context) const
Signs a message using an already prepared topic-bound nonce proof bundle.
Definition bppp.cpp:1037
Result< Signature > sign_message_with_prepared(std::span< const unsigned char > message, PreparedNonce &&prepared, purify_secp_context *secp_context) const
Signs a message using an already prepared message-bound nonce.
Definition bppp.cpp:1010
Result< ProvenSignature > sign_with_topic_proof(std::span< const unsigned char > message, std::span< const unsigned char > topic, purify_secp_context *secp_context, bppp::ExperimentalCircuitBackend *circuit_cache=nullptr) const
Signs a message with a topic-bound nonce proof.
Definition bppp.cpp:1059
Result< Signature > sign_message(std::span< const unsigned char > message, purify_secp_context *secp_context) const
Signs a message with a deterministically derived message-bound nonce.
Definition bppp.cpp:1004
Result< PreparedNonceWithProof > prepare_topic_nonce_with_proof(std::span< const unsigned char > topic, purify_secp_context *secp_context, bppp::ExperimentalCircuitBackend *circuit_cache=nullptr) const
Deterministically prepares a topic-bound nonce together with its BPPP proof.
Definition bppp.cpp:990
KeyPair(const KeyPair &)=delete
Result< Signature > sign_with_topic(std::span< const unsigned char > message, std::span< const unsigned char > topic, purify_secp_context *secp_context) const
Signs a message using a topic-bound deterministic nonce.
Definition bppp.cpp:1023
KeyPair(KeyPair &&other) noexcept=default
Result< ProvenSignature > sign_message_with_prepared_proof(std::span< const unsigned char > message, PreparedNonceWithProof &&prepared, purify_secp_context *secp_context) const
Signs a message using an already prepared message-bound nonce proof bundle.
Definition bppp.cpp:1017
static constexpr std::size_t kSerializedSize
Definition bppp.hpp:44
const UInt512 & public_key() const noexcept
Definition bppp.hpp:49
static Result< NonceHost > deserialize(std::span< const unsigned char > serialized)
Definition bppp.cpp:57
Result< bool > verify_topic_nonce_proof(std::span< const unsigned char > topic, const NonceProof &nonce_proof, purify_secp_context *secp_context, bppp::ExperimentalCircuitBackend *circuit_cache=nullptr) const
Definition bppp.cpp:1077
Result< Scalar32 > scalar() const
Explicitly exports the secret nonce scalar from the wrapped prepared nonce.
Definition bppp.hpp:455
PreparedNonceWithProof(const PreparedNonceWithProof &)=delete
const NonceProof & proof() const noexcept
Returns the public nonce proof carried by this bundle.
Definition bppp.hpp:447
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.
Definition bppp.cpp:558
static PreparedNonceWithProof from_parts(PreparedNonce prepared, NonceProof proof)
Bundles a prepared nonce with its matching BPPP-backed public nonce proof.
Definition bppp.cpp:517
PreparedNonceWithProof & operator=(PreparedNonceWithProof &&other) noexcept=default
Result< Scalar32 > raw_scalar() const
Explicitly exports the scalar for the proof's full raw point.
Definition bppp.cpp:521
PreparedNonceWithProof(PreparedNonceWithProof &&other) noexcept=default
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.
Definition bppp.cpp:571
const Nonce & public_nonce() const noexcept
Returns the public nonce proved by this bundle.
Definition bppp.hpp:434
bool available() const noexcept
Returns whether the wrapped secret nonce remains available.
Definition bppp.hpp:439
PreparedNonceWithProof & operator=(const PreparedNonceWithProof &)=delete
Move-only prepared nonce bound to either a message or a topic.
Definition bppp.hpp:333
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.
Definition bppp.cpp:447
bool available() const noexcept
Returns whether the secret nonce remains available to consume.
Definition bppp.hpp:356
Result< Scalar32 > scalar() const
Explicitly exports the secret nonce scalar.
Definition bppp.hpp:367
const Nonce & public_nonce() const noexcept
Returns the public nonce corresponding to this prepared secret nonce scalar.
Definition bppp.hpp:351
PreparedNonce & operator=(const PreparedNonce &)=delete
PreparedNonce(const PreparedNonce &)=delete
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.
Definition bppp.cpp:483
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.
Definition bppp.cpp:412
std::array< unsigned char, 33 > PointBytes
Compressed 33-byte curve-point encoding.
Definition bppp.hpp:32
std::array< unsigned char, 32 > ScalarBytes
Big-endian 32-byte scalar encoding.
Definition bppp.hpp:30
std::array< unsigned char, 32 > XOnly32
Definition bppp.hpp:24
std::array< unsigned char, 32 > Scalar32
Definition bppp.hpp:23
std::array< unsigned char, 64 > Signature64
Definition bppp.hpp:25
constexpr Unexpected< Error > unexpected_error(ErrorCode code, const char *context=nullptr)
Constructs an unexpected Error value from a machine-readable code.
Definition error.hpp:293
BigUInt< 8 > UInt512
512-bit unsigned integer used for private and packed public keys.
Definition numeric.hpp:821
Expected< T, Error > Result
Expected-returning convenience alias for Purify value-producing APIs.
Definition error.hpp:99
std::vector< unsigned char > Bytes
Dynamically sized byte string used for messages, serialized witnesses, and proofs.
Definition common.hpp:99
Canonical BIP340 keypair derived deterministically from a packed Purify secret.
Definition api.hpp:38
Cacheable message-bound nonce-proof template for the BPPP-backed PureSign++ proof(R) flow.
Definition bppp.hpp:256
bppp::ExperimentalCircuitCache backend_cache
Definition bppp.hpp:261
NativeBulletproofCircuitTemplate circuit_template
Definition bppp.hpp:259
static Result< MessageProofCache > build(std::span< const unsigned char > message)
Builds a reusable verifier template for one exact message.
Definition bppp.cpp:375
static Result< NonceProof > deserialize(std::span< const unsigned char > serialized, purify_secp_context *secp_context)
Definition bppp.cpp:175
Result< Bytes > serialize(purify_secp_context *secp_context) const
Definition bppp.cpp:148
bppp::ScalarBytes public_commitment_dlog_response
Definition bppp.hpp:306
static constexpr std::size_t kNormProofSize
Definition bppp.hpp:297
static constexpr unsigned char kSerializationVersion
Definition bppp.hpp:296
static constexpr std::size_t kSerializedSize
Definition bppp.hpp:298
Public BIP340 nonce point in x-only form.
Definition bppp.hpp:220
static Result< Nonce > deserialize(std::span< const unsigned char > serialized, purify_secp_context *secp_context)
Parses a serialized x-only nonce.
Definition bppp.cpp:102
Bytes serialize() const
Serializes this x-only nonce into its fixed-size wire format.
Definition bppp.cpp:98
static constexpr std::size_t kSerializedSize
Definition bppp.hpp:221
Result< Bytes > serialize(purify_secp_context *secp_context) const
Definition bppp.cpp:215
static constexpr unsigned char kSerializationVersion
Definition bppp.hpp:315
static Result< ProvenSignature > deserialize(std::span< const unsigned char > serialized, purify_secp_context *secp_context)
Definition bppp.cpp:227
static constexpr std::size_t kSerializedSize
Definition bppp.hpp:316
static Result< PublicKey > from_secret(const SecretKey &secret, purify_secp_context *secp_context)
Derives both public identities from one packed Purify secret.
Definition bppp.cpp:891
Result< bool > verify_message_nonce_proof(std::span< const unsigned char > message, const NonceProof &nonce_proof, purify_secp_context *secp_context, bppp::ExperimentalCircuitBackend *circuit_cache=nullptr) const
Verifies a message-bound BPPP nonce proof against this public key.
Definition bppp.cpp:900
static Result< PublicKey > deserialize(std::span< const unsigned char > serialized, purify_secp_context *secp_context)
Parses a serialized PureSign++ public-key bundle.
Definition bppp.cpp:80
Result< bool > verify_topic_nonce_proof(std::span< const unsigned char > topic, const NonceProof &nonce_proof, purify_secp_context *secp_context, bppp::ExperimentalCircuitBackend *circuit_cache=nullptr) const
Verifies a topic-bound BPPP nonce proof against this public key.
Definition bppp.cpp:913
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.
Definition bppp.cpp:895
Bytes serialize() const
Serializes this PureSign++ public-key bundle into its fixed-size wire format.
Definition bppp.cpp:71
Result< bool > verify_message_signature_with_proof(std::span< const unsigned char > message, const ProvenSignature &signature, purify_secp_context *secp_context, bppp::ExperimentalCircuitBackend *circuit_cache=nullptr) const
Verifies a message signature bundled with its BPPP nonce proof.
Definition bppp.cpp:926
static constexpr std::size_t kSerializedSize
Definition bppp.hpp:73
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, bppp::ExperimentalCircuitBackend *circuit_cache=nullptr) const
Verifies a topic-bound signature bundled with its BPPP nonce proof.
Definition bppp.cpp:940
Standard 64-byte BIP340 signature.
Definition bppp.hpp:233
Bytes serialize() const
Serializes this signature into its fixed-size wire format.
Definition bppp.cpp:129
static constexpr std::size_t kSerializedSize
Definition bppp.hpp:234
Scalar32 s() const
Returns the 32-byte Schnorr s scalar encoded in the last 32 signature bytes.
Definition bppp.cpp:123
Nonce nonce() const
Returns the x-only public nonce encoded in the first 32 signature bytes.
Definition bppp.cpp:117
static Result< Signature > deserialize(std::span< const unsigned char > serialized, purify_secp_context *secp_context)
Parses a serialized BIP340 signature.
Definition bppp.cpp:133
Cacheable topic-bound nonce-proof template for the BPPP-backed PureSign++ proof(R) flow.
Definition bppp.hpp:278
bppp::ExperimentalCircuitCache backend_cache
Definition bppp.hpp:283
NativeBulletproofCircuitTemplate circuit_template
Definition bppp.hpp:281
static Result< TopicProofCache > build(std::span< const unsigned char > topic)
Builds a reusable verifier template for one exact topic.
Definition bppp.cpp:389