Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
merge_prover.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7#pragma once
8
15
16namespace bb {
17
28 using PCS = KZG<Curve>;
32
33 public:
34 using MergeProof = std::vector<FF>;
35
38 const CommitmentKey& commitment_key = CommitmentKey(),
39 const std::shared_ptr<Transcript>& transcript = std::make_shared<Transcript>());
40
42
45 std::shared_ptr<Transcript> transcript;
47
48 // Number of columns that jointly constitute the op_queue, should be the same as the number of wires in the
49 // MegaCircuitBuilder
51
52 private:
53 std::vector<std::string> labels_degree_check = { "LEFT_TABLE_DEGREE_CHECK_0",
54 "LEFT_TABLE_DEGREE_CHECK_1",
55 "LEFT_TABLE_DEGREE_CHECK_2",
56 "LEFT_TABLE_DEGREE_CHECK_3" };
57
58 std::vector<std::string> labels_shplonk_batching_challenges = {
59 "SHPLONK_MERGE_BATCHING_CHALLENGE_0", "SHPLONK_MERGE_BATCHING_CHALLENGE_1",
60 "SHPLONK_MERGE_BATCHING_CHALLENGE_2", "SHPLONK_MERGE_BATCHING_CHALLENGE_3",
61 "SHPLONK_MERGE_BATCHING_CHALLENGE_4", "SHPLONK_MERGE_BATCHING_CHALLENGE_5",
62 "SHPLONK_MERGE_BATCHING_CHALLENGE_6", "SHPLONK_MERGE_BATCHING_CHALLENGE_7",
63 "SHPLONK_MERGE_BATCHING_CHALLENGE_8", "SHPLONK_MERGE_BATCHING_CHALLENGE_9",
64 "SHPLONK_MERGE_BATCHING_CHALLENGE_10", "SHPLONK_MERGE_BATCHING_CHALLENGE_11",
65 "SHPLONK_MERGE_BATCHING_CHALLENGE_12"
66 };
67
81 const std::vector<FF>& degree_check_challenges);
82
95 const std::array<Polynomial, NUM_WIRES>& right_table,
96 const std::array<Polynomial, NUM_WIRES>& merged_table,
97 const std::vector<FF>& shplonk_batching_challenges,
98 const FF& kappa,
99 const FF& kappa_inv,
100 const Polynomial& reversed_batched_left_tables,
101 const std::vector<FF>& evals);
102
115 static OpeningClaim compute_shplonk_opening_claim(Polynomial& shplonk_batched_quotient,
116 const FF& shplonk_opening_challenge,
117 const std::array<Polynomial, NUM_WIRES>& left_table,
118 const std::array<Polynomial, NUM_WIRES>& right_table,
119 const std::array<Polynomial, NUM_WIRES>& merged_table,
120 const std::vector<FF>& shplonk_batching_challenges,
121 const FF& kappa,
122 const FF& kappa_inv,
123 Polynomial& reversed_batched_left_tables,
124 const std::vector<FF>& evals);
125};
126
127} // namespace bb
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
CommitmentKey object over a pairing group 𝔾₁.
static constexpr size_t NUM_WIRES
Defines the circuit block types for the Mega arithmetization.
Prover class for the Goblin ECC op queue transcript merge protocol.
static constexpr size_t NUM_WIRES
Curve::AffineElement Commitment
std::shared_ptr< ECCOpQueue > op_queue
std::vector< FF > MergeProof
MergeSettings settings
BB_PROFILE MergeProof construct_proof()
Prove proper construction of the aggregate Goblin ECC op queue polynomials T_j.
std::vector< std::string > labels_degree_check
static OpeningClaim compute_shplonk_opening_claim(Polynomial &shplonk_batched_quotient, const FF &shplonk_opening_challenge, const std::array< Polynomial, NUM_WIRES > &left_table, const std::array< Polynomial, NUM_WIRES > &right_table, const std::array< Polynomial, NUM_WIRES > &merged_table, const std::vector< FF > &shplonk_batching_challenges, const FF &kappa, const FF &kappa_inv, Polynomial &reversed_batched_left_tables, const std::vector< FF > &evals)
Compute the partially evaluated Shplonk batched quotient and the resulting opening claim.
std::vector< std::string > labels_shplonk_batching_challenges
std::shared_ptr< Transcript > transcript
CommitmentKey pcs_commitment_key
static Polynomial compute_shplonk_batched_quotient(const std::array< Polynomial, NUM_WIRES > &left_table, const std::array< Polynomial, NUM_WIRES > &right_table, const std::array< Polynomial, NUM_WIRES > &merged_table, const std::vector< FF > &shplonk_batching_challenges, const FF &kappa, const FF &kappa_inv, const Polynomial &reversed_batched_left_tables, const std::vector< FF > &evals)
Compute the batched Shplonk quotient polynomial.
static Polynomial compute_degree_check_polynomial(const std::array< Polynomial, NUM_WIRES > &left_table, const std::vector< FF > &degree_check_challenges)
Compute the batched polynomial for the degree check.
bb::CommitmentKey< Curve > CommitmentKey
Unverified claim (C,r,v) for some witness polynomial p(X) such that.
Definition claim.hpp:53
Opening pair (r,v) for some witness polynomial p(X) such that p(r) = v.
Definition claim.hpp:19
Polynomial p and an opening pair (r,v) such that p(r) = v.
Definition claim.hpp:34
typename Group::affine_element AffineElement
Definition bn254.hpp:22
bb::fr ScalarField
Definition bn254.hpp:18
#define BB_PROFILE
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
MergeSettings
The MergeSettings define whether an current subtable will be added at the beginning (PREPEND) or at t...
BaseTranscript< FrCodec, bb::crypto::Poseidon2< bb::crypto::Poseidon2Bn254ScalarFieldParams > > NativeTranscript
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13