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: Complete, auditors: [Sergei], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
8
16
17namespace bb {
18
32 using PCS = KZG<Curve>;
36
37 public:
38 using MergeProof = std::vector<FF>;
40
41 explicit MergeProver(const std::shared_ptr<ECCOpQueue>& op_queue, std::shared_ptr<Transcript> transcript);
42
44
46
48
49 private:
50 std::shared_ptr<Transcript> transcript;
53
54 std::vector<std::string> labels_degree_check = { "LEFT_TABLE_DEGREE_CHECK_0",
55 "LEFT_TABLE_DEGREE_CHECK_1",
56 "LEFT_TABLE_DEGREE_CHECK_2",
57 "LEFT_TABLE_DEGREE_CHECK_3" };
58
59 std::vector<std::string> labels_shplonk_batching_challenges = {
60 "SHPLONK_MERGE_BATCHING_CHALLENGE_0", "SHPLONK_MERGE_BATCHING_CHALLENGE_1",
61 "SHPLONK_MERGE_BATCHING_CHALLENGE_2", "SHPLONK_MERGE_BATCHING_CHALLENGE_3",
62 "SHPLONK_MERGE_BATCHING_CHALLENGE_4", "SHPLONK_MERGE_BATCHING_CHALLENGE_5",
63 "SHPLONK_MERGE_BATCHING_CHALLENGE_6", "SHPLONK_MERGE_BATCHING_CHALLENGE_7",
64 "SHPLONK_MERGE_BATCHING_CHALLENGE_8", "SHPLONK_MERGE_BATCHING_CHALLENGE_9",
65 "SHPLONK_MERGE_BATCHING_CHALLENGE_10", "SHPLONK_MERGE_BATCHING_CHALLENGE_11",
66 "SHPLONK_MERGE_BATCHING_CHALLENGE_12"
67 };
68
82 const std::vector<FF>& degree_check_challenges) const;
83
96 const std::array<Polynomial, NUM_WIRES>& right_table,
97 const std::array<Polynomial, NUM_WIRES>& merged_table,
98 const std::vector<FF>& shplonk_batching_challenges,
99 const FF& kappa,
100 const FF& kappa_inv,
101 const Polynomial& reversed_batched_left_tables,
102 const std::vector<FF>& evals);
103
116 static OpeningClaim compute_shplonk_opening_claim(Polynomial& shplonk_batched_quotient,
117 const FF& shplonk_opening_challenge,
118 const std::array<Polynomial, NUM_WIRES>& left_table,
119 const std::array<Polynomial, NUM_WIRES>& right_table,
120 const std::array<Polynomial, NUM_WIRES>& merged_table,
121 const std::vector<FF>& shplonk_batching_challenges,
122 const FF& kappa,
123 const FF& kappa_inv,
124 Polynomial& reversed_batched_left_tables,
125 const std::vector<FF>& evals);
126};
127
128} // 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 𝔾₁.
Prover for the single-step Goblin ECC op queue merge protocol.
static constexpr size_t NUM_WIRES
Curve::AffineElement Commitment
std::shared_ptr< ECCOpQueue > op_queue
std::vector< FF > MergeProof
std::array< Polynomial, NUM_WIRES > Table
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
Polynomial compute_degree_check_polynomial(const std::array< Polynomial, NUM_WIRES > &left_table, const std::vector< FF > &degree_check_challenges) const
Compute the batched polynomial for the 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.
size_t fixed_append_shift_size
Unverified claim (C,r,v) for some witness polynomial p(X) such that.
Definition claim.hpp:55
Opening pair (r,v) for some witness polynomial p(X) such that p(r) = v.
Definition claim.hpp:21
Polynomial p and an opening pair (r,v) such that p(r) = v.
Definition claim.hpp:36
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
BaseTranscript< FrCodec, bb::crypto::Poseidon2< bb::crypto::Poseidon2Bn254ScalarFieldParams > > NativeTranscript
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13