42class CertificateNonceResponseAuthorization {
59 std::span<const PublicKey> ordered_hosts,
60 std::span<const unsigned char> canonical_body,
72 return common_digest_;
77 return response_digest_;
82 return response_binding_;
84 [[nodiscard]] std::span<const bppp::accumulation::Digest>
87 return member_digests_;
97 : frame_(std::move(
frame)),
105 CertificateNonceResponseFrame frame_;
109 std::vector<bppp::accumulation::Digest> member_digests_;
121 std::uint32_t member_ordinal,
const PublicKey& host,
123 const accountable::ConflictContext& context,
136 std::uint32_t member_ordinal,
const PublicKey& host,
138 const accountable::ConflictContext& context,
153 const accountable::ConflictContext& context,
154 std::span<const unsigned char> canonical_body,
155 const accountable::ScalarSignature& response,
169 std::ranges::contiguous_range Hosts,
170 std::ranges::contiguous_range Body,
171 std::ranges::contiguous_range Leaves>
172 requires std::ranges::sized_range<Hosts> &&
173 std::ranges::sized_range<Body> &&
174 std::ranges::sized_range<Leaves> &&
176 std::ranges::range_value_t<Hosts>,
PublicKey> &&
178 std::ranges::range_value_t<Body>,
unsigned char> &&
180 std::ranges::range_value_t<Leaves>,
182 (std::is_lvalue_reference_v<Hosts> ||
183 std::ranges::borrowed_range<Hosts>) &&
184 (std::is_lvalue_reference_v<Body> ||
185 std::ranges::borrowed_range<Body>) &&
186 (std::is_lvalue_reference_v<Leaves> ||
187 std::ranges::borrowed_range<Leaves>)
199 template <
typename Hosts,
typename Body,
typename Leaves>
206 template <
typename Hosts,
typename Body,
typename Leaves>
213 template <
typename Hosts,
typename Body,
typename Leaves>
224 return *authorization_;
234 return ordered_hosts_;
239 return canonical_body_;
246 [[nodiscard]] std::span<const CertificateNoncePublicLeafDescriptor>
249 return ordered_leaves_;
255 std::span<const PublicKey> ordered_hosts_;
256 std::span<const unsigned char> canonical_body_;
258 std::span<const CertificateNoncePublicLeafDescriptor> ordered_leaves_;
262class CertificateNonceRecursiveManifest
271 const CertificateNonceRecursiveManifest&,
272 const CertificateNonceRecursiveManifest&) =
default;
287 const CertificateNonceRecursiveManifest&, std::uint64_t,
292class CertificateNonceRecursiveManifestResolution
298 return certificate_context_digest_;
302 return total_responses_;
304 [[nodiscard]] std::span<const bppp::accumulation::Digest>
307 return step_digests_;
329 std::uint64_t total_responses_ = 0;
330 std::vector<bppp::accumulation::Digest> step_digests_;
331 CertificateNonceRecursiveManifest manifest_;
335 const CertificateNonceLeafAccumulator&,
337 std::span<const CertificateNonceRecursiveResponseView>,
345 std::uint64_t total_responses);
351 std::uint64_t response_ordinal, std::uint32_t member_ordinal,
366 std::span<const CertificateNonceRecursiveResponseView>
377 std::uint64_t total_responses);
383 std::uint64_t response_ordinal, std::uint32_t member_ordinal,
390 std::uint64_t total_responses,
391 std::span<const CertificateNonceResponseAuthorization> responses);
402class CertificateNonceParentPublicInputs {
410 std::span<const PublicKey> ordered_hosts,
411 std::span<const unsigned char> canonical_body,
413 std::span<const PreparedCertificateNonceLeaf> ordered_leaves,
422 return canonical_bytes_;
426 return statement_digest_;
431 return authorization_;
435 return aggregate_nonce_;
437 [[nodiscard]] std::span<const bppp::accumulation::Digest>
439 return leaf_bindings_;
443 return member_nonces_;
445 [[nodiscard]] std::span<const bppp::accumulation::Digest>
447 return recursive_step_digests_;
459 : frame_(std::move(
frame)),
468 CertificateNonceResponseFrame frame_;
469 Bytes canonical_bytes_;
471 CertificateNonceResponseAuthorization authorization_;
473 std::vector<bppp::accumulation::Digest> leaf_bindings_;
474 std::vector<bppp::PointBytes> member_nonces_;
475 std::vector<bppp::accumulation::Digest> recursive_step_digests_;
480 std::vector<bppp::accumulation::AlgebraicNormReductionProof>
493class CertificateNonceNativeResponse
503 return statement_digest_;
516 proof_(std::move(
proof)) {}
519 CertificateNonceResponseProof proof_;
533class CertificateNonceNativeReceipt
543 std::vector<CertificateNonceNativeResponse>
responses,
544 std::vector<CertificateNonceTreeProof>
tree_proofs);
549 return certificate_context_digest_;
551 [[nodiscard]] std::span<const CertificateNonceNativeResponse>
556 [[nodiscard]] std::span<const CertificateNonceTreeProof>
565 std::vector<CertificateNonceNativeResponse>
responses,
566 std::vector<CertificateNonceTreeProof>
tree_proofs)
572 std::vector<CertificateNonceNativeResponse> responses_;
573 std::vector<CertificateNonceTreeProof> tree_proofs_;
579 std::span<const std::size_t> member_counts);
591 std::span<const unsigned char> encoded,
602 std::vector<CertificateNonceLinearMemberProof>
members;
613class CertificateNonceLinearReceipt {
620 std::vector<CertificateNonceLinearResponseProof>
responses);
624 return certificate_context_digest_;
626 [[nodiscard]] std::span<const CertificateNonceLinearResponseProof>
635 std::vector<CertificateNonceLinearResponseProof>
responses)
642 std::vector<CertificateNonceLinearResponseProof> responses_;
649 template <std::ranges::contiguous_range Leaves>
650 requires std::ranges::sized_range<Leaves> &&
652 std::ranges::range_value_t<Leaves>,
654 (std::is_lvalue_reference_v<Leaves> ||
655 std::ranges::borrowed_range<Leaves>)
660 template <
typename Leaves>
670 [[nodiscard]] std::span<const PreparedCertificateNonceLeaf>
673 return ordered_leaves_;
678 std::span<const PreparedCertificateNonceLeaf> ordered_leaves_;
699 [[nodiscard]] const
bppp::accumulation::Digest&
701 return certificate_context_digest_;
708 return total_responses_;
710 [[nodiscard]] std::uint32_t
level() const noexcept {
return level_; }
712 return first_response_;
715 return response_count_;
719 return aggregate_nonce_;
735 claim_(std::move(claim)) {}
739 std::uint64_t total_responses_ = 0;
740 std::uint32_t level_ = 0;
741 std::uint64_t first_response_ = 0;
742 std::uint64_t response_count_ = 0;
743 std::optional<bppp::PointBytes> aggregate_nonce_;
744 bppp::accumulation::PendingClaim claim_;
766 std::uint64_t{1} << 60};
787 std::span<const PreparedCertificateNonceLeaf> ordered_leaves,
792 std::span<const PreparedCertificateNonceLeaf> ordered_leaves,
797 std::span<const PendingCertificateNonceParent> ordered_children,
801 std::span<const PendingCertificateNonceParent> ordered_children,
817 std::span<const CertificateNonceResponseVerificationView>
824 std::span<const CertificateNonceResponseVerificationView>
831 std::span<const CertificateNonceResponseVerificationView>
838 : leaves_(std::move(
leaves)) {}
840 CertificateNonceLeafAccumulator leaves_;
An ordered signing roster bound to one core and nonce-host list.
Canonical 32-byte scalar response; carries no nonce or proof.
static constexpr std::size_t kNormVectorLength
static constexpr std::size_t kReductionSerializedSize
static Result< CertificateNonceLinearReceipt > create(bppp::accumulation::Digest certificate_context_digest, std::vector< CertificateNonceLinearResponseProof > responses)
std::span< const CertificateNonceLinearResponseProof > responses() const noexcept
const bppp::accumulation::Digest & certificate_context_digest() const noexcept
static constexpr std::size_t kStepSerializedSize
std::span< const CertificateNonceTreeProof > tree_proofs() const noexcept
const bppp::accumulation::Digest & certificate_context_digest() const noexcept
static constexpr std::size_t kResponseHeaderSerializedSize
static constexpr std::size_t kHeaderSerializedSize
std::span< const CertificateNonceNativeResponse > responses() const noexcept
static constexpr std::size_t kStepSerializedSize
static constexpr std::size_t kReductionSerializedSize
static Result< CertificateNonceNativeReceipt > create(bppp::accumulation::Digest certificate_context_digest, std::vector< CertificateNonceNativeResponse > responses, std::vector< CertificateNonceTreeProof > tree_proofs)
const bppp::accumulation::Digest & statement_digest() const noexcept
static Result< CertificateNonceNativeResponse > create(bppp::accumulation::Digest statement_digest, CertificateNonceResponseProof proof)
const CertificateNonceResponseProof & proof() const noexcept
Status verify_native_receipt(const CertificateNonceNativeReceipt &receipt, std::span< const CertificateNonceResponseVerificationView > ordered_responses, purify_secp_context *secp_context) const
static constexpr std::uint64_t kMaxResponses
CertificateNonceParentAccumulator & operator=(const CertificateNonceParentAccumulator &)=delete
Result< CertificateNonceTreeProof > prove_parent(std::span< const PendingCertificateNonceParent > ordered_children, purify_secp_context *secp_context) const
static Result< CertificateNonceParentAccumulator > create(purify_secp_context *secp_context)
static constexpr std::size_t kRootClaimRounds
CertificateNonceParentAccumulator(CertificateNonceParentAccumulator &&) noexcept=default
const CertificateNonceLeafAccumulator & leaves() const noexcept
Status verify_linear_receipt(const CertificateNonceLinearReceipt &receipt, std::span< const CertificateNonceResponseVerificationView > ordered_responses, purify_secp_context *secp_context) const
CertificateNonceParentAccumulator(const CertificateNonceParentAccumulator &)=delete
static constexpr std::size_t kRootClaimSerializedSize
Result< CertificateNonceResponseProof > prove_response(const CertificateNonceParentPublicInputs &inputs, std::span< const PreparedCertificateNonceLeaf > ordered_leaves, purify_secp_context *secp_context) const
Result< PendingCertificateNonceParent > verify_response(const CertificateNonceParentPublicInputs &inputs, std::span< const PreparedCertificateNonceLeaf > ordered_leaves, const CertificateNonceResponseProof &proof, purify_secp_context *secp_context) const
Result< PendingCertificateNonceParent > verify_parent(std::span< const PendingCertificateNonceParent > ordered_children, const CertificateNonceTreeProof &proof, purify_secp_context *secp_context) const
Status decide_root(const PendingCertificateNonceParent &root, purify_secp_context *secp_context) const
Result< CertificateNonceLinearReceipt > prove_linear_receipt(std::span< const CertificateNonceResponseVerificationView > ordered_responses, purify_secp_context *secp_context) const
static constexpr std::size_t kTreeFanout
const bppp::accumulation::Digest & certificate_context_digest() const noexcept
std::span< const bppp::accumulation::Digest > step_digests() const noexcept
friend Result< CertificateNonceRecursiveManifestResolution > certificate_nonce_recursive_manifest(const CertificateNonceLeafAccumulator &, const bppp::accumulation::Digest &, std::span< const CertificateNonceRecursiveResponseView >, purify_secp_context *)
const CertificateNonceRecursiveManifest & manifest() const noexcept
std::uint64_t total_responses() const noexcept
const bppp::ScalarBytes & bytes() const noexcept
friend bool operator==(const CertificateNonceRecursiveManifest &, const CertificateNonceRecursiveManifest &)=default
friend Result< CertificateNonceRecursiveManifest > certificate_nonce_recursive_manifest_step(const CertificateNonceRecursiveManifest &, std::uint64_t, std::uint32_t, const bppp::accumulation::Digest &)
friend Result< CertificateNonceRecursiveManifest > certificate_nonce_recursive_manifest_seed(const bppp::accumulation::Digest &, std::uint64_t)
const accountable::ScalarSignature & response() const noexcept
std::span< const PublicKey > ordered_hosts() const noexcept
CertificateNonceRecursiveResponseView(const CertificateNonceResponseAuthorization &&, const accountable::ConflictContext &, Hosts &&, Body &&, const accountable::ScalarSignature &, Leaves &&)=delete
const CertificateNonceResponseAuthorization & authorization() const noexcept
CertificateNonceRecursiveResponseView(const CertificateNonceResponseAuthorization &, const accountable::ConflictContext &, Hosts &&, Body &&, const accountable::ScalarSignature &&, Leaves &&)=delete
const accountable::ConflictContext & context() const noexcept
CertificateNonceRecursiveResponseView(const CertificateNonceResponseAuthorization &authorization, const accountable::ConflictContext &context, Hosts &&ordered_hosts, Body &&canonical_body, const accountable::ScalarSignature &response, Leaves &&ordered_leaves)
CertificateNonceRecursiveResponseView(const CertificateNonceResponseAuthorization &, const accountable::ConflictContext &&, Hosts &&, Body &&, const accountable::ScalarSignature &, Leaves &&)=delete
std::span< const CertificateNoncePublicLeafDescriptor > ordered_leaves() const noexcept
std::span< const unsigned char > canonical_body() const noexcept
const bppp::accumulation::Digest & common_digest() const noexcept
const CertificateNonceResponseFrame & frame() const noexcept
const bppp::accumulation::Digest & response_digest() const noexcept
const bppp::accumulation::Digest & response_binding() const noexcept
std::span< const bppp::accumulation::Digest > member_digests() const noexcept
static Result< CertificateNonceResponseAuthorization > create(CertificateNonceResponseFrame frame, const accountable::NonceHostBoundSigningRoster &roster, const accountable::ConflictContext &context, std::span< const PublicKey > ordered_hosts, std::span< const unsigned char > canonical_body, const accountable::ScalarSignature &response, purify_secp_context *secp_context)
CertificateNonceResponseVerificationView(const CertificateNonceParentPublicInputs &inputs, Leaves &&ordered_leaves)
const CertificateNonceParentPublicInputs & inputs() const noexcept
CertificateNonceResponseVerificationView(const CertificateNonceParentPublicInputs &&, Leaves &&)=delete
std::span< const PreparedCertificateNonceLeaf > ordered_leaves() const noexcept
std::uint64_t response_count() const noexcept
const std::optional< bppp::PointBytes > & aggregate_nonce() const noexcept
std::uint32_t level() const noexcept
std::uint64_t first_response() const noexcept
const bppp::accumulation::Digest & node_digest() const noexcept
const bppp::accumulation::Digest & certificate_context_digest() const noexcept
std::uint64_t total_responses() const noexcept
PendingCertificateNonceParent & operator=(const PendingCertificateNonceParent &)=delete
PendingCertificateNonceParent(const PendingCertificateNonceParent &)=delete
friend class CertificateNonceParentAccumulator
PendingCertificateNonceParent(PendingCertificateNonceParent &&) noexcept=default
std::array< unsigned char, 32 > Digest
std::array< unsigned char, 33 > PointBytes
Compressed 33-byte curve-point encoding.
std::array< unsigned char, 32 > ScalarBytes
Big-endian 32-byte scalar encoding.
Result< std::size_t > certificate_nonce_native_receipt_size(std::span< const std::size_t > member_counts)
Result< bppp::accumulation::Digest > certificate_nonce_recursive_step_digest(const CertificateNonceResponseAuthorization &authorization, const accountable::ConflictContext &context, std::span< const unsigned char > canonical_body, const accountable::ScalarSignature &response, const bppp::accumulation::Digest &member_digest, purify_secp_context *secp_context)
CertificateNonceParentScope
Result< std::vector< bppp::accumulation::Digest > > certificate_nonce_recursive_response_step_digests(const CertificateNonceLeafAccumulator &leaf_accumulator, const CertificateNonceRecursiveResponseView &response, purify_secp_context *secp_context)
Result< CertificateNonceRecursiveManifest > certificate_nonce_recursive_manifest_seed(const bppp::accumulation::Digest &certificate_context_digest, std::uint64_t total_responses)
Result< CertificateNonceAuthorizationManifest > certificate_nonce_authorization_manifest_seed(const bppp::accumulation::Digest &certificate_context_digest, std::uint64_t total_responses)
bppp::ScalarBytes CertificateNonceAuthorizationManifest
Result< CertificateNonceAuthorizationManifest > certificate_nonce_authorization_manifest_step(const CertificateNonceAuthorizationManifest &prior, std::uint64_t response_ordinal, std::uint32_t member_ordinal, const bppp::accumulation::Digest &member_digest)
Result< CertificateNonceRecursiveManifest > certificate_nonce_recursive_manifest_step(const CertificateNonceRecursiveManifest &prior, std::uint64_t response_ordinal, std::uint32_t member_ordinal, const bppp::accumulation::Digest &step_digest)
Result< Bytes > serialize_certificate_nonce_native_receipt(const CertificateNonceParentAccumulator &accumulator, const CertificateNonceNativeReceipt &receipt, purify_secp_context *secp_context)
Result< CertificateNonceRecursiveManifestResolution > certificate_nonce_recursive_manifest(const CertificateNonceLeafAccumulator &leaf_accumulator, const bppp::accumulation::Digest &certificate_context_digest, std::span< const CertificateNonceRecursiveResponseView > ordered_responses, purify_secp_context *secp_context)
Result< CertificateNonceNativeReceipt > parse_certificate_nonce_native_receipt(const CertificateNonceParentAccumulator &accumulator, std::span< const unsigned char > encoded, purify_secp_context *secp_context)
Result< CertificateNonceAuthorizationManifest > certificate_nonce_authorization_manifest(const bppp::accumulation::Digest &certificate_context_digest, std::uint64_t total_responses, std::span< const CertificateNonceResponseAuthorization > responses)
Result< bppp::accumulation::Digest > certificate_nonce_recursive_member_digest(const CertificateNonceResponseAuthorization &authorization, std::uint32_t member_ordinal, const PublicKey &host, const PreparedCertificateNonceLeaf &leaf, const accountable::ConflictContext &context, purify_secp_context *secp_context)
Expected< T, Error > Result
Expected-returning convenience alias for Purify value-producing APIs.
Expected< void, Error > Status
Expected-returning convenience alias for Purify status-only APIs.
std::vector< unsigned char > Bytes
Dynamically sized byte string used for messages, serialized witnesses, and proofs.
struct purify_secp_context purify_secp_context
Caller-owned reusable secp256k1 context handle shared across Purify C and C++ APIs.
Public context shared by conflicting statements in one slashable slot.
bppp::accumulation::AlgebraicNormReductionProof reduction
bppp::accumulation::AlgebraicStepProof accumulation
std::vector< CertificateNonceLinearMemberProof > members
bppp::accumulation::Digest certificate_context_digest
std::uint64_t total_responses
std::uint64_t electorate_weight
CertificateNonceParentScope scope
std::uint64_t response_ordinal
std::uint32_t electorate_index
std::vector< bppp::accumulation::AlgebraicNormReductionProof > reductions
bppp::accumulation::AlgebraicStepProof accumulation
bppp::accumulation::AlgebraicStepProof accumulation