58 const std::vector<Commitment>& table_commitments,
60 const FF& shplonk_opening_challenge,
61 const std::vector<FF>& shplonk_batching_challenges,
64 const std::vector<FF>& evals)
const
72 for (
auto& commitment : table_commitments) {
75 if constexpr (IsRecursive) {
76 batch_opening_claim.
commitments.emplace_back(Commitment::one(kappa.get_context()));
78 batch_opening_claim.
commitments.emplace_back(Commitment::one());
82 batch_opening_claim.
scalars = { -(shplonk_opening_challenge - kappa) };
83 for (
auto& scalar : shplonk_batching_challenges) {
86 batch_opening_claim.
scalars.back() *=
87 (shplonk_opening_challenge - kappa) * (shplonk_opening_challenge - kappa_inv).invert();
89 batch_opening_claim.
scalars.emplace_back(
FF(0));
90 for (
size_t idx = 0; idx < evals.size(); idx++) {
91 if (idx < evals.size() - 1) {
92 batch_opening_claim.
scalars.back() -= evals[idx] * shplonk_batching_challenges[idx];
94 batch_opening_claim.
scalars.back() -= shplonk_batching_challenges.back() * evals.back() *
95 (shplonk_opening_challenge - kappa) *
96 (shplonk_opening_challenge - kappa_inv).invert();
102 return batch_opening_claim;
121 transcript->load_proof(proof);
126 const FF shift_size = transcript->template receive_from_prover<FF>(
"shift_size");
133 std::vector<Commitment> table_commitments;
134 table_commitments.reserve((3 * NUM_WIRES) + 1);
135 table_commitments.insert(table_commitments.end(),
138 table_commitments.insert(
140 for (
size_t idx = 0; idx < NUM_WIRES; ++idx) {
141 table_commitments.emplace_back(
142 transcript->template receive_from_prover<Commitment>(
"MERGED_TABLE_" +
std::to_string(idx)));
143 merged_table_commitments[idx] = table_commitments.back();
147 std::vector<FF> degree_check_challenges = transcript->template get_challenges<FF>(labels_degree_check);
150 table_commitments.emplace_back(
151 transcript->template receive_from_prover<Commitment>(
"REVERSED_BATCHED_LEFT_TABLES"));
154 std::vector<FF> shplonk_batching_challenges =
155 transcript->template get_challenges<FF>(labels_shplonk_batching_challenges);
158 const FF kappa = transcript->template get_challenge<FF>(
"kappa");
159 const FF kappa_inv = kappa.invert();
160 const FF pow_kappa = kappa.pow(shift_size);
161 const FF pow_kappa_minus_one = pow_kappa * kappa_inv;
164 std::vector<FF> evals;
165 evals.reserve((3 * NUM_WIRES) + 1);
166 for (
size_t idx = 0; idx < NUM_WIRES; ++idx) {
167 evals.emplace_back(transcript->template receive_from_prover<FF>(
"LEFT_TABLE_EVAL_" +
std::to_string(idx)));
169 for (
size_t idx = 0; idx < NUM_WIRES; ++idx) {
170 evals.emplace_back(transcript->template receive_from_prover<FF>(
"RIGHT_TABLE_EVAL_" +
std::to_string(idx)));
172 for (
size_t idx = 0; idx < NUM_WIRES; ++idx) {
173 evals.emplace_back(transcript->template receive_from_prover<FF>(
"MERGED_TABLE_EVAL_" +
std::to_string(idx)));
177 evals.emplace_back(transcript->template receive_from_prover<FF>(
"REVERSED_BATCHED_LEFT_TABLES_EVAL"));
182 if constexpr (IsRecursive) {
183 for (
auto& eval : evals) {
184 eval.set_origin_tag(kappa.get_origin_tag());
186 evals.back().set_origin_tag(degree_check_challenges.back().get_origin_tag());
190 bool concatenation_verified = check_concatenation_identities(evals, pow_kappa);
193 bool degree_check_verified = check_degree_identity(evals, pow_kappa_minus_one, degree_check_challenges);
197 transcript->template receive_from_prover<Commitment>(
"SHPLONK_BATCHED_QUOTIENT");
200 FF shplonk_opening_challenge = transcript->template get_challenge<FF>(
"shplonk_opening_challenge");
204 shplonk_batched_quotient,
205 shplonk_opening_challenge,
206 shplonk_batching_challenges,
215 PairingPoints pairing_points = PCS::reduce_verify_batch_opening_claim(
std::move(batch_opening_claim), transcript);
217 vinfo(
"Merge Verifier: degree check passed: ", degree_check_verified ?
"true" :
"false");
218 vinfo(
"Merge Verifier: concatenation check passed: ", concatenation_verified ?
"true" :
"false");
220 return { pairing_points, merged_table_commitments, degree_check_verified && concatenation_verified };
BatchOpeningClaim< Curve > compute_shplonk_opening_claim(const std::vector< Commitment > &table_commitments, const Commitment &shplonk_batched_quotient, const FF &shplonk_opening_challenge, const std::vector< FF > &shplonk_batching_challenges, const FF &kappa, const FF &kappa_inv, const std::vector< FF > &evals) const