74 size_t total_num_msm_rows =
builder->op_queue->get_num_rows();
76 BB_ASSERT_LTE(total_num_msm_rows, 1UL << CONST_ECCVM_LOG_N,
"ECCVM/Goblin: Too many ops in ecc op queue");
80 const size_t num_non_trivial_scalars_gemini_and_shplonk =
84 const size_t num_msm_rows_unshifted = 33 * ((num_polys - 1 + 3) / 4) + 31;
85 const size_t num_msm_rows_shifted = 33 * ((num_shifted + 3) / 4) + 31;
87 EXPECT_EQ(total_num_msm_rows - num_msm_rows_shifted - num_msm_rows_unshifted,
88 33 * ((num_non_trivial_scalars_gemini_and_shplonk + 1) / 2) + 33);
90 const size_t num_non_trivial_scalars_gemini_and_shplonk =
94 EXPECT_EQ(33 * ((num_polys + num_shifted + num_non_trivial_scalars_gemini_and_shplonk + 1) / 2) + 33,
122 std::vector<std::string> unshifted_batching_challenge_labels;
123 std::vector<std::string> shifted_batching_challenge_labels;
125 for (
size_t idx = 0; idx < num_polys - 1; idx++) {
126 unshifted_batching_challenge_labels.push_back(
"rho_" +
std::to_string(idx));
128 for (
size_t idx = 0; idx < num_shifted; idx++) {
129 shifted_batching_challenge_labels.push_back(
"rho_" +
std::to_string(num_polys - 1 + idx));
134 auto unshifted_challenges =
135 prover_transcript->template get_challenges<NativeFr>(unshifted_batching_challenge_labels);
136 auto shifted_challenges =
137 prover_transcript->template get_challenges<NativeFr>(shifted_batching_challenge_labels);
140 for (
size_t i = 0; i < unshifted_challenges.size(); ++i) {
144 for (
size_t i = 0; i < shifted_challenges.size(); ++i) {
146 shifted_challenges[i]);
153 auto prover_opening_claims =
161 [[maybe_unused]]
auto _ = stdlib_verifier_transcript->template receive_from_prover<Fr>(
"Init");
164 auto stdlib_unshifted_commitments =
166 auto stdlib_shifted_commitments =
169 auto stdlib_unshifted_evaluations =
171 auto stdlib_shifted_evaluations =
176 for (
auto& comm : stdlib_unshifted_commitments) {
177 comm.unset_free_witness_tag();
179 for (
auto& comm : stdlib_shifted_commitments) {
180 comm.unset_free_witness_tag();
182 for (
auto& eval : stdlib_unshifted_evaluations) {
183 eval.unset_free_witness_tag();
185 for (
auto& eval : stdlib_shifted_evaluations) {
186 eval.unset_free_witness_tag();
192 for (
auto& challenge : u_challenge_in_circuit) {
193 challenge.unset_free_witness_tag();
207 std::vector<Fr> unshifted_challenges(num_polys);
210 unshifted_challenges[0] =
Fr(1);
212 auto tail = stdlib_verifier_transcript->template get_challenges<Fr>(unshifted_labels);
213 std::copy(tail.begin(), tail.end(), unshifted_challenges.begin() + 1);
216 auto shifted_challenges = stdlib_verifier_transcript->template get_challenges<Fr>(shifted_labels);
221 auto [unshifted_challenges, shifted_challenges] =
222 get_batching_challenges(unshifted_batching_challenge_labels, shifted_batching_challenge_labels);
225 Commitment::batch_mul(claim_batcher.get_unshifted().commitments, unshifted_challenges, 128);
228 Commitment::batch_mul(claim_batcher.get_shifted().commitments, shifted_challenges, 128);
232 unshifted_challenges.end(),
233 claim_batcher.get_unshifted().evaluations.begin(),
236 shifted_challenges.end(),
237 claim_batcher.get_shifted().evaluations.begin(),
256 EXPECT_TRUE(pairing_points.
check());
265 using clock = std::chrono::steady_clock;
266 auto start_total = clock::now();
270 auto start_builder = clock::now();
273 ECCVMProver prover(eccvm_builder, eccvm_transcript);
275 auto end_builder = clock::now();
277 info(
"ECCVM prover construction took ",
278 std::chrono::duration_cast<std::chrono::milliseconds>(end_builder - start_builder).count(),
281 auto start_prove = clock::now();
283 auto end_prove = clock::now();
285 info(
"ECCVM proof construction took ",
286 std::chrono::duration_cast<std::chrono::milliseconds>(end_prove - start_prove).count(),
289 auto end_total = clock::now();
290 info(
"ECCVM total (builder + proof) time: ",
291 std::chrono::duration_cast<std::chrono::milliseconds>(end_total - start_total).count(),
295 info(
"builder num gates ",
builder.get_num_finalized_gates_inefficient());