purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
certificate_nonce_parent_prover_input.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 <concepts>
14#include <ranges>
15#include <span>
16#include <type_traits>
17
19
21
23inline constexpr std::size_t kCertificateParentPublicFrameSize = 96;
25 std::array<unsigned char, kCertificateParentPublicFrameSize>;
26
36
39{
40public:
41 template <
42 std::ranges::contiguous_range Hosts,
43 std::ranges::contiguous_range Proofs>
44 requires std::ranges::sized_range<Hosts> &&
45 std::ranges::sized_range<Proofs> &&
46 std::same_as<
47 std::ranges::range_value_t<Hosts>, PublicKey> &&
48 std::same_as<
49 std::ranges::range_value_t<Proofs>, NonceProof> &&
50 (std::is_lvalue_reference_v<Hosts> ||
51 std::ranges::borrowed_range<Hosts>) &&
52 (std::is_lvalue_reference_v<Proofs> ||
53 std::ranges::borrowed_range<Proofs>)
56 const accountable::ConflictContext& context,
57 Hosts&& ordered_hosts, Proofs&& ordered_proofs)
58 : inputs_(&inputs), context_(&context),
59 ordered_hosts_(ordered_hosts), ordered_proofs_(ordered_proofs)
60 {
61 }
62 template <typename Hosts, typename Proofs>
66 Hosts&&, Proofs&&) = delete;
67 template <typename Hosts, typename Proofs>
71 Hosts&&, Proofs&&) = delete;
72
74 const noexcept
75 {
76 return *inputs_;
77 }
79 const noexcept
80 {
81 return *context_;
82 }
83 [[nodiscard]] std::span<const PublicKey> ordered_hosts()
84 const noexcept
85 {
86 return ordered_hosts_;
87 }
88 [[nodiscard]] std::span<const NonceProof> ordered_proofs()
89 const noexcept
90 {
91 return ordered_proofs_;
92 }
93
94private:
96 const accountable::ConflictContext* context_;
97 std::span<const PublicKey> ordered_hosts_;
98 std::span<const NonceProof> ordered_proofs_;
99};
100
114[[nodiscard]] Result<Bytes>
116 const CertificateNonceParentAccumulator& accumulator,
117 const CertificateNonceNativeReceipt& receipt,
118 std::span<const CertificateNonceResponseProverView>
119 ordered_responses,
120 purify_secp_context* secp_context,
121 bppp::ExperimentalCircuitBackend* cache = nullptr);
122
130[[nodiscard]] Result<Bytes>
132 const CertificateNonceParentAccumulator& accumulator,
133 const CertificateNonceLinearReceipt& receipt,
134 std::span<const CertificateNonceResponseProverView>
135 ordered_responses,
136 purify_secp_context* secp_context,
137 bppp::ExperimentalCircuitBackend* cache = nullptr);
138
139} // namespace purify::puresign_plusplus
Common interface for reusable experimental BPPP backend state.
Definition bppp.hpp:129
CertificateNonceResponseProverView(const CertificateNonceParentPublicInputs &inputs, const accountable::ConflictContext &context, Hosts &&ordered_hosts, Proofs &&ordered_proofs)
const CertificateNonceParentPublicInputs & inputs() const noexcept
CertificateNonceResponseProverView(const CertificateNonceParentPublicInputs &&, const accountable::ConflictContext &, Hosts &&, Proofs &&)=delete
CertificateNonceResponseProverView(const CertificateNonceParentPublicInputs &, const accountable::ConflictContext &&, Hosts &&, Proofs &&)=delete
Result< Bytes > serialize_accepted_linear_certificate_nonce_parent_witness(const CertificateNonceParentAccumulator &accumulator, const CertificateNonceLinearReceipt &receipt, std::span< const CertificateNonceResponseProverView > ordered_responses, purify_secp_context *secp_context, bppp::ExperimentalCircuitBackend *cache=nullptr)
Result< Bytes > serialize_accepted_certificate_nonce_parent_witness(const CertificateNonceParentAccumulator &accumulator, const CertificateNonceNativeReceipt &receipt, std::span< const CertificateNonceResponseProverView > ordered_responses, purify_secp_context *secp_context, bppp::ExperimentalCircuitBackend *cache=nullptr)
Result< CertificateParentPublicFrame > serialize_certificate_parent_public_frame(const CertificateNonceRecursiveManifestResolution &resolution)
std::array< unsigned char, kCertificateParentPublicFrameSize > CertificateParentPublicFrame
Expected< T, Error > Result
Expected-returning convenience alias for Purify value-producing APIs.
Definition error.hpp:99
Public context shared by conflicting statements in one slashable slot.