purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
certificate_nonce_parent_accumulation.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
5#pragma once
6
7#include <bit>
8#include <concepts>
9#include <cstddef>
10#include <cstdint>
11#include <optional>
12#include <ranges>
13#include <span>
14#include <type_traits>
15#include <utility>
16#include <vector>
17
21
23
25enum class CertificateNonceParentScope : std::uint8_t {
27};
28
40
42class CertificateNonceResponseAuthorization {
43public:
55 create(
58 const accountable::ConflictContext& context,
59 std::span<const PublicKey> ordered_hosts,
60 std::span<const unsigned char> canonical_body,
61 const accountable::ScalarSignature& response,
62 purify_secp_context* secp_context);
63
64 [[nodiscard]] const CertificateNonceResponseFrame& frame()
65 const noexcept
66 {
67 return frame_;
68 }
70 const noexcept
71 {
72 return common_digest_;
73 }
75 const noexcept
76 {
77 return response_digest_;
78 }
80 const noexcept
81 {
82 return response_binding_;
83 }
84 [[nodiscard]] std::span<const bppp::accumulation::Digest>
85 member_digests() const noexcept
86 {
87 return member_digests_;
88 }
89
90private:
96 std::vector<bppp::accumulation::Digest> member_digests)
97 : frame_(std::move(frame)),
98 common_digest_(common_digest),
99 response_digest_(response_digest),
100 response_binding_(response_binding),
101 member_digests_(std::move(member_digests))
102 {
103 }
104
105 CertificateNonceResponseFrame frame_;
106 bppp::accumulation::Digest common_digest_{};
107 bppp::accumulation::Digest response_digest_{};
108 bppp::accumulation::Digest response_binding_{};
109 std::vector<bppp::accumulation::Digest> member_digests_;
110};
111
120 const CertificateNonceResponseAuthorization& authorization,
121 std::uint32_t member_ordinal, const PublicKey& host,
123 const accountable::ConflictContext& context,
124 purify_secp_context* secp_context);
125
134 const CertificateNonceLeafAccumulator& leaf_accumulator,
135 const CertificateNonceResponseAuthorization& authorization,
136 std::uint32_t member_ordinal, const PublicKey& host,
137 const CertificateNoncePublicLeafDescriptor& descriptor,
138 const accountable::ConflictContext& context,
139 purify_secp_context* secp_context);
140
152 const CertificateNonceResponseAuthorization& authorization,
153 const accountable::ConflictContext& context,
154 std::span<const unsigned char> canonical_body,
155 const accountable::ScalarSignature& response,
156 const bppp::accumulation::Digest& member_digest,
157 purify_secp_context* secp_context);
158
166{
167public:
168 template <
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> &&
175 std::same_as<
176 std::ranges::range_value_t<Hosts>, PublicKey> &&
177 std::same_as<
178 std::ranges::range_value_t<Body>, unsigned char> &&
179 std::same_as<
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>)
191 Hosts&& ordered_hosts, Body&& canonical_body,
193 Leaves&& ordered_leaves)
194 : authorization_(&authorization), context_(&context),
195 ordered_hosts_(ordered_hosts), canonical_body_(canonical_body),
196 response_(&response), ordered_leaves_(ordered_leaves)
197 {
198 }
199 template <typename Hosts, typename Body, typename Leaves>
203 Hosts&&, Body&&,
205 Leaves&&) = delete;
206 template <typename Hosts, typename Body, typename Leaves>
210 Hosts&&, Body&&,
212 Leaves&&) = delete;
213 template <typename Hosts, typename Body, typename Leaves>
217 Hosts&&, Body&&,
219 Leaves&&) = delete;
220
221 [[nodiscard]] const CertificateNonceResponseAuthorization&
222 authorization() const noexcept
223 {
224 return *authorization_;
225 }
227 const noexcept
228 {
229 return *context_;
230 }
231 [[nodiscard]] std::span<const PublicKey> ordered_hosts()
232 const noexcept
233 {
234 return ordered_hosts_;
235 }
236 [[nodiscard]] std::span<const unsigned char> canonical_body()
237 const noexcept
238 {
239 return canonical_body_;
240 }
242 const noexcept
243 {
244 return *response_;
245 }
246 [[nodiscard]] std::span<const CertificateNoncePublicLeafDescriptor>
247 ordered_leaves() const noexcept
248 {
249 return ordered_leaves_;
250 }
251
252private:
253 const CertificateNonceResponseAuthorization* authorization_;
254 const accountable::ConflictContext* context_;
255 std::span<const PublicKey> ordered_hosts_;
256 std::span<const unsigned char> canonical_body_;
257 const accountable::ScalarSignature* response_;
258 std::span<const CertificateNoncePublicLeafDescriptor> ordered_leaves_;
259};
260
262class CertificateNonceRecursiveManifest
263{
264public:
265 [[nodiscard]] const bppp::ScalarBytes& bytes() const noexcept
266 {
267 return bytes_;
268 }
269
270 friend bool operator==(
271 const CertificateNonceRecursiveManifest&,
272 const CertificateNonceRecursiveManifest&) = default;
273
274private:
275 explicit CertificateNonceRecursiveManifest(bppp::ScalarBytes bytes)
276 : bytes_(bytes)
277 {
278 }
279
280 bppp::ScalarBytes bytes_{};
281
284 const bppp::accumulation::Digest&, std::uint64_t);
287 const CertificateNonceRecursiveManifest&, std::uint64_t,
288 std::uint32_t, const bppp::accumulation::Digest&);
289};
290
292class CertificateNonceRecursiveManifestResolution
293{
294public:
295 [[nodiscard]] const bppp::accumulation::Digest&
297 {
298 return certificate_context_digest_;
299 }
300 [[nodiscard]] std::uint64_t total_responses() const noexcept
301 {
302 return total_responses_;
303 }
304 [[nodiscard]] std::span<const bppp::accumulation::Digest>
305 step_digests() const noexcept
306 {
307 return step_digests_;
308 }
310 const noexcept
311 {
312 return manifest_;
313 }
314
315private:
318 std::uint64_t total_responses,
319 std::vector<bppp::accumulation::Digest> step_digests,
321 : certificate_context_digest_(certificate_context_digest),
322 total_responses_(total_responses),
323 step_digests_(std::move(step_digests)),
324 manifest_(std::move(manifest))
325 {
326 }
327
328 bppp::accumulation::Digest certificate_context_digest_{};
329 std::uint64_t total_responses_ = 0;
330 std::vector<bppp::accumulation::Digest> step_digests_;
331 CertificateNonceRecursiveManifest manifest_;
332
335 const CertificateNonceLeafAccumulator&,
337 std::span<const CertificateNonceRecursiveResponseView>,
339};
340
344 const bppp::accumulation::Digest& certificate_context_digest,
345 std::uint64_t total_responses);
346
351 std::uint64_t response_ordinal, std::uint32_t member_ordinal,
352 const bppp::accumulation::Digest& step_digest);
353
357 const CertificateNonceLeafAccumulator& leaf_accumulator,
359 purify_secp_context* secp_context);
360
364 const CertificateNonceLeafAccumulator& leaf_accumulator,
365 const bppp::accumulation::Digest& certificate_context_digest,
366 std::span<const CertificateNonceRecursiveResponseView>
367 ordered_responses,
368 purify_secp_context* secp_context);
369
372
376 const bppp::accumulation::Digest& certificate_context_digest,
377 std::uint64_t total_responses);
378
383 std::uint64_t response_ordinal, std::uint32_t member_ordinal,
384 const bppp::accumulation::Digest& member_digest);
385
389 const bppp::accumulation::Digest& certificate_context_digest,
390 std::uint64_t total_responses,
391 std::span<const CertificateNonceResponseAuthorization> responses);
392
402class CertificateNonceParentPublicInputs {
403public:
404 static constexpr std::size_t kMemberBatchCapacity = 128;
405
409 const accountable::ConflictContext& context,
410 std::span<const PublicKey> ordered_hosts,
411 std::span<const unsigned char> canonical_body,
412 const accountable::ScalarSignature& response,
413 std::span<const PreparedCertificateNonceLeaf> ordered_leaves,
414 purify_secp_context* secp_context);
415
417 const noexcept {
418 return frame_;
419 }
420 [[nodiscard]] std::span<const unsigned char> canonical_bytes()
421 const noexcept {
422 return canonical_bytes_;
423 }
425 const noexcept {
426 return statement_digest_;
427 }
428 [[nodiscard]] const CertificateNonceResponseAuthorization&
429 authorization() const noexcept
430 {
431 return authorization_;
432 }
433 [[nodiscard]] const bppp::PointBytes& aggregate_nonce()
434 const noexcept {
435 return aggregate_nonce_;
436 }
437 [[nodiscard]] std::span<const bppp::accumulation::Digest>
438 leaf_bindings() const noexcept {
439 return leaf_bindings_;
440 }
441 [[nodiscard]] std::span<const bppp::PointBytes> member_nonces()
442 const noexcept {
443 return member_nonces_;
444 }
445 [[nodiscard]] std::span<const bppp::accumulation::Digest>
446 recursive_step_digests() const noexcept {
447 return recursive_step_digests_;
448 }
449
450private:
456 std::vector<bppp::accumulation::Digest> leaf_bindings,
457 std::vector<bppp::PointBytes> member_nonces,
458 std::vector<bppp::accumulation::Digest> recursive_step_digests)
459 : frame_(std::move(frame)),
460 canonical_bytes_(std::move(canonical_bytes)),
461 statement_digest_(statement_digest),
462 authorization_(std::move(authorization)),
463 aggregate_nonce_(aggregate_nonce),
464 leaf_bindings_(std::move(leaf_bindings)),
465 member_nonces_(std::move(member_nonces)),
466 recursive_step_digests_(std::move(recursive_step_digests)) {}
467
468 CertificateNonceResponseFrame frame_;
469 Bytes canonical_bytes_;
470 bppp::accumulation::Digest statement_digest_{};
471 CertificateNonceResponseAuthorization authorization_;
472 bppp::PointBytes aggregate_nonce_{};
473 std::vector<bppp::accumulation::Digest> leaf_bindings_;
474 std::vector<bppp::PointBytes> member_nonces_;
475 std::vector<bppp::accumulation::Digest> recursive_step_digests_;
476};
477
480 std::vector<bppp::accumulation::AlgebraicNormReductionProof>
483};
484
489
491
493class CertificateNonceNativeResponse
494{
495public:
499
501 const noexcept
502 {
503 return statement_digest_;
504 }
506 const noexcept
507 {
508 return proof_;
509 }
510
511private:
515 : statement_digest_(statement_digest),
516 proof_(std::move(proof)) {}
517
518 bppp::accumulation::Digest statement_digest_{};
519 CertificateNonceResponseProof proof_;
520};
521
533class CertificateNonceNativeReceipt
534{
535public:
536 static constexpr std::size_t kHeaderSerializedSize = 88;
537 static constexpr std::size_t kResponseHeaderSerializedSize = 33;
538 static constexpr std::size_t kReductionSerializedSize = 890;
539 static constexpr std::size_t kStepSerializedSize = 924;
540
543 std::vector<CertificateNonceNativeResponse> responses,
544 std::vector<CertificateNonceTreeProof> tree_proofs);
545
546 [[nodiscard]] const bppp::accumulation::Digest&
548 {
549 return certificate_context_digest_;
550 }
551 [[nodiscard]] std::span<const CertificateNonceNativeResponse>
552 responses() const noexcept
553 {
554 return responses_;
555 }
556 [[nodiscard]] std::span<const CertificateNonceTreeProof>
557 tree_proofs() const noexcept
558 {
559 return tree_proofs_;
560 }
561
562private:
565 std::vector<CertificateNonceNativeResponse> responses,
566 std::vector<CertificateNonceTreeProof> tree_proofs)
567 : certificate_context_digest_(certificate_context_digest),
568 responses_(std::move(responses)),
569 tree_proofs_(std::move(tree_proofs)) {}
570
571 bppp::accumulation::Digest certificate_context_digest_{};
572 std::vector<CertificateNonceNativeResponse> responses_;
573 std::vector<CertificateNonceTreeProof> tree_proofs_;
574};
575
577[[nodiscard]] Result<std::size_t>
579 std::span<const std::size_t> member_counts);
580
583 const CertificateNonceParentAccumulator& accumulator,
584 const CertificateNonceNativeReceipt& receipt,
585 purify_secp_context* secp_context);
586
590 const CertificateNonceParentAccumulator& accumulator,
591 std::span<const unsigned char> encoded,
592 purify_secp_context* secp_context);
593
599
602 std::vector<CertificateNonceLinearMemberProof> members;
603};
604
613class CertificateNonceLinearReceipt {
614public:
615 static constexpr std::size_t kReductionSerializedSize = 890;
616 static constexpr std::size_t kStepSerializedSize = 924;
617
620 std::vector<CertificateNonceLinearResponseProof> responses);
621
622 [[nodiscard]] const bppp::accumulation::Digest&
623 certificate_context_digest() const noexcept {
624 return certificate_context_digest_;
625 }
626 [[nodiscard]] std::span<const CertificateNonceLinearResponseProof>
627 responses() const noexcept
628 {
629 return responses_;
630 }
631
632private:
635 std::vector<CertificateNonceLinearResponseProof> responses)
636 : certificate_context_digest_(certificate_context_digest),
637 responses_(std::move(responses))
638 {
639 }
640
641 bppp::accumulation::Digest certificate_context_digest_{};
642 std::vector<CertificateNonceLinearResponseProof> responses_;
643};
644
647{
648public:
649 template <std::ranges::contiguous_range Leaves>
650 requires std::ranges::sized_range<Leaves> &&
651 std::same_as<
652 std::ranges::range_value_t<Leaves>,
654 (std::is_lvalue_reference_v<Leaves> ||
655 std::ranges::borrowed_range<Leaves>)
660 template <typename Leaves>
663 Leaves&&) = delete;
664
666 const noexcept
667 {
668 return *inputs_;
669 }
670 [[nodiscard]] std::span<const PreparedCertificateNonceLeaf>
671 ordered_leaves() const noexcept
672 {
673 return ordered_leaves_;
674 }
675
676private:
678 std::span<const PreparedCertificateNonceLeaf> ordered_leaves_;
679};
680
689public:
691 const PendingCertificateNonceParent&) = delete;
693 const PendingCertificateNonceParent&) = delete;
695 PendingCertificateNonceParent&&) noexcept = default;
697 PendingCertificateNonceParent&&) noexcept = default;
698
699 [[nodiscard]] const bppp::accumulation::Digest&
700 certificate_context_digest() const noexcept {
701 return certificate_context_digest_;
702 }
704 const noexcept {
705 return node_digest_;
706 }
707 [[nodiscard]] std::uint64_t total_responses() const noexcept {
708 return total_responses_;
709 }
710 [[nodiscard]] std::uint32_t level() const noexcept { return level_; }
711 [[nodiscard]] std::uint64_t first_response() const noexcept {
712 return first_response_;
713 }
714 [[nodiscard]] std::uint64_t response_count() const noexcept {
715 return response_count_;
716 }
717 [[nodiscard]] const std::optional<bppp::PointBytes>& aggregate_nonce()
718 const noexcept {
719 return aggregate_nonce_;
720 }
721
722private:
726 std::uint64_t total_responses, std::uint32_t level,
727 std::uint64_t first_response, std::uint64_t response_count,
728 std::optional<bppp::PointBytes> aggregate_nonce,
730 : certificate_context_digest_(certificate_context_digest),
731 node_digest_(node_digest), total_responses_(total_responses),
732 level_(level), first_response_(first_response),
733 response_count_(response_count),
734 aggregate_nonce_(std::move(aggregate_nonce)),
735 claim_(std::move(claim)) {}
736
737 bppp::accumulation::Digest certificate_context_digest_{};
738 bppp::accumulation::Digest node_digest_{};
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_;
745
747};
748
757public:
758 static constexpr std::size_t kTreeFanout = 16;
759 static constexpr std::size_t kRootClaimRounds = std::bit_width(
761 static constexpr std::size_t kRootClaimSerializedSize =
762 33 + 32 + kRootClaimRounds * 32;
763 static_assert(kRootClaimSerializedSize == 481);
765 static constexpr std::uint64_t kMaxResponses{
766 std::uint64_t{1} << 60};
767
769 const CertificateNonceParentAccumulator&) = delete;
771 const CertificateNonceParentAccumulator&) = delete;
773 CertificateNonceParentAccumulator&&) noexcept = default;
775 CertificateNonceParentAccumulator&&) noexcept = default;
776
777 [[nodiscard]] static Result<CertificateNonceParentAccumulator> create(
778 purify_secp_context* secp_context);
779
781 const noexcept {
782 return leaves_;
783 }
784
787 std::span<const PreparedCertificateNonceLeaf> ordered_leaves,
788 purify_secp_context* secp_context) const;
789
792 std::span<const PreparedCertificateNonceLeaf> ordered_leaves,
794 purify_secp_context* secp_context) const;
795
797 std::span<const PendingCertificateNonceParent> ordered_children,
798 purify_secp_context* secp_context) const;
799
801 std::span<const PendingCertificateNonceParent> ordered_children,
802 const CertificateNonceTreeProof& proof,
803 purify_secp_context* secp_context) const;
804
810 [[nodiscard]] Status decide_root(
812 purify_secp_context* secp_context) const;
813
815 [[nodiscard]] Status verify_native_receipt(
816 const CertificateNonceNativeReceipt& receipt,
817 std::span<const CertificateNonceResponseVerificationView>
818 ordered_responses,
819 purify_secp_context* secp_context) const;
820
824 std::span<const CertificateNonceResponseVerificationView>
825 ordered_responses,
826 purify_secp_context* secp_context) const;
827
829 [[nodiscard]] Status verify_linear_receipt(
830 const CertificateNonceLinearReceipt& receipt,
831 std::span<const CertificateNonceResponseVerificationView>
832 ordered_responses,
833 purify_secp_context* secp_context) const;
834
835private:
838 : leaves_(std::move(leaves)) {}
839
840 CertificateNonceLeafAccumulator leaves_;
841};
842
843} // namespace purify::puresign_plusplus
An ordered signing roster bound to one core and nonce-host list.
Canonical 32-byte scalar response; carries no nonce or proof.
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
std::span< const CertificateNonceTreeProof > tree_proofs() const noexcept
const bppp::accumulation::Digest & certificate_context_digest() const noexcept
std::span< const CertificateNonceNativeResponse > responses() const noexcept
static Result< CertificateNonceNativeReceipt > create(bppp::accumulation::Digest certificate_context_digest, std::vector< CertificateNonceNativeResponse > responses, std::vector< CertificateNonceTreeProof > tree_proofs)
static Result< CertificateNonceNativeResponse > create(bppp::accumulation::Digest statement_digest, CertificateNonceResponseProof proof)
Status verify_native_receipt(const CertificateNonceNativeReceipt &receipt, std::span< const CertificateNonceResponseVerificationView > ordered_responses, purify_secp_context *secp_context) const
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)
CertificateNonceParentAccumulator(CertificateNonceParentAccumulator &&) noexcept=default
Status verify_linear_receipt(const CertificateNonceLinearReceipt &receipt, std::span< const CertificateNonceResponseVerificationView > ordered_responses, purify_secp_context *secp_context) const
CertificateNonceParentAccumulator(const CertificateNonceParentAccumulator &)=delete
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
std::span< const bppp::accumulation::Digest > recursive_step_digests() const noexcept
static Result< CertificateNonceParentPublicInputs > 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, std::span< const PreparedCertificateNonceLeaf > ordered_leaves, purify_secp_context *secp_context)
std::span< const bppp::accumulation::Digest > leaf_bindings() const noexcept
const CertificateNonceResponseAuthorization & authorization() 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 *)
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)
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
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 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)
CertificateNonceResponseVerificationView(const CertificateNonceParentPublicInputs &&, Leaves &&)=delete
std::span< const PreparedCertificateNonceLeaf > ordered_leaves() const noexcept
const std::optional< bppp::PointBytes > & aggregate_nonce() const noexcept
const bppp::accumulation::Digest & certificate_context_digest() const noexcept
PendingCertificateNonceParent & operator=(const PendingCertificateNonceParent &)=delete
PendingCertificateNonceParent(const PendingCertificateNonceParent &)=delete
PendingCertificateNonceParent(PendingCertificateNonceParent &&) noexcept=default
std::array< unsigned char, 32 > Digest
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
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)
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)
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.
Definition error.hpp:99
Expected< void, Error > Status
Expected-returning convenience alias for Purify status-only APIs.
Definition error.hpp:102
std::vector< unsigned char > Bytes
Dynamically sized byte string used for messages, serialized witnesses, and proofs.
Definition common.hpp:99
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.
std::vector< bppp::accumulation::AlgebraicNormReductionProof > reductions