purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
construction_leaf_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 <array>
8#include <cstddef>
9#include <utility>
10
13
14namespace purify::accountable {
15
18
26
29public:
32 const PreparedConstructionLeaf&) = delete;
35 PreparedConstructionLeaf&&) noexcept = default;
36
38 [[nodiscard]] const bppp::ScalarBytes& circuit_precommitment()
39 const noexcept {
40 return circuit_precommitment_;
41 }
42
44 const noexcept {
45 return norm_;
46 }
47
48private:
52 : circuit_precommitment_(circuit_precommitment),
53 norm_(std::move(norm)) {}
54
55 bppp::ScalarBytes circuit_precommitment_{};
56 bppp::accumulation::AlgebraicPreparedNorm norm_;
57
59};
60
71public:
72 static constexpr std::size_t kNormVectorLength = 16384;
73
75 delete;
77 const ConstructionLeafAccumulator&) = delete;
79 default;
81 ConstructionLeafAccumulator&&) noexcept = default;
82
83 [[nodiscard]] static Result<ConstructionLeafAccumulator> create(
84 purify_secp_context* secp_context);
85
86 [[nodiscard]] const bppp::accumulation::Basis& basis() const noexcept {
87 return basis_;
88 }
89
99 const RecoveryBoundSigningRoster& roster,
100 const UInt512& advertised_anchor_root,
101 const AnchorPunishmentPublicKey& punishment_key,
102 const AnchorEscrowContextDigest& context_digest,
103 const AnchorEscrowCiphertext& ciphertext,
104 const bppp::ScalarBytes& circuit_precommitment,
105 purify_secp_context* secp_context) const;
106
116 const NonceHostBoundSigningRoster& roster,
117 const UInt512& recovery_root,
118 const UInt512& advertised_anchor_root,
119 const AnchorPunishmentPublicKey& punishment_key,
120 const AnchorEscrowContextDigest& context_digest,
121 const AnchorEscrowCiphertext& ciphertext,
122 const bppp::ScalarBytes& circuit_precommitment,
123 purify_secp_context* secp_context) const;
124
128 const NonceHostBoundSigningRoster& roster,
129 const CoalitionFormation& formation,
130 std::size_t member_index,
131 const RecoveryRootShare& share,
132 const bppp::ScalarBytes& circuit_precommitment,
133 purify_secp_context* secp_context) const;
134
136 const RecoveryBoundSigningRoster& roster,
137 const UInt512& advertised_anchor_root,
138 const AnchorPunishmentPublicKey& punishment_key,
139 const AnchorEscrowContextDigest& context_digest,
140 const AnchorEscrowRecord& record,
141 purify_secp_context* secp_context,
142 bppp::ExperimentalCircuitBackend* cache = nullptr) const;
143
145 const NonceHostBoundSigningRoster& roster,
146 const CoalitionFormation& formation,
147 std::size_t member_index,
148 const RecoveryRootContribution& contribution,
149 purify_secp_context* secp_context,
150 bppp::ExperimentalCircuitBackend* cache = nullptr) const;
151
152private:
154 : basis_(std::move(basis)) {}
155
157};
158
159} // namespace purify::accountable
Result< ConstructionLeafParentConstants > derive_parent_constants(const RecoveryBoundSigningRoster &roster, const UInt512 &advertised_anchor_root, const AnchorPunishmentPublicKey &punishment_key, const AnchorEscrowContextDigest &context_digest, const AnchorEscrowCiphertext &ciphertext, const bppp::ScalarBytes &circuit_precommitment, purify_secp_context *secp_context) const
static Result< ConstructionLeafAccumulator > create(purify_secp_context *secp_context)
ConstructionLeafAccumulator(ConstructionLeafAccumulator &&) noexcept=default
const bppp::accumulation::Basis & basis() const noexcept
Result< PreparedConstructionLeaf > prepare(const RecoveryBoundSigningRoster &roster, const UInt512 &advertised_anchor_root, const AnchorPunishmentPublicKey &punishment_key, const AnchorEscrowContextDigest &context_digest, const AnchorEscrowRecord &record, purify_secp_context *secp_context, bppp::ExperimentalCircuitBackend *cache=nullptr) const
ConstructionLeafAccumulator(const ConstructionLeafAccumulator &)=delete
Result< ConstructionLeafParentConstants > derive_pending_anchor_parent_constants(const NonceHostBoundSigningRoster &roster, const UInt512 &recovery_root, const UInt512 &advertised_anchor_root, const AnchorPunishmentPublicKey &punishment_key, const AnchorEscrowContextDigest &context_digest, const AnchorEscrowCiphertext &ciphertext, const bppp::ScalarBytes &circuit_precommitment, purify_secp_context *secp_context) const
ConstructionLeafAccumulator & operator=(const ConstructionLeafAccumulator &)=delete
An ordered signing roster bound to one core and nonce-host list.
PreparedConstructionLeaf(PreparedConstructionLeaf &&) noexcept=default
PreparedConstructionLeaf & operator=(const PreparedConstructionLeaf &)=delete
const bppp::accumulation::AlgebraicPreparedNorm & norm() const noexcept
const bppp::ScalarBytes & circuit_precommitment() const noexcept
PreparedConstructionLeaf(const PreparedConstructionLeaf &)=delete
A nonce-host-bound roster with an authorized recovery-root relation.
Common interface for reusable experimental BPPP backend state.
Definition bppp.hpp:129
std::array< unsigned char, 32 > AnchorEscrowContextDigest
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
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