Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
eccvm.test.cpp
Go to the documentation of this file.
1#include <cstddef>
2#include <cstdint>
3#include <gtest/gtest.h>
4#include <vector>
5
20
21using namespace bb;
28
29// Test helper: Create a VK by committing to proving key polynomials (for comparing with fixed VK)
31{
33 // Overwrite fixed commitments with computed commitments from the proving key
34 for (auto [polynomial, commitment] : zip_view(proving_key->polynomials.get_precomputed(), vk.get_all())) {
35 commitment = proving_key->commitment_key.commit(polynomial);
36 }
37 return vk;
38}
39
40// Compute VK hash from fixed commitments (for test verification that vk_hash() is correct)
42{
44 // Serialize commitments using the Codec
45 for (const auto& commitment : ECCVMHardcodedVKAndHash::get_all()) {
46 auto frs = ECCVMFlavor::Codec::serialize_to_fields(commitment);
47 for (const auto& fr : frs) {
48 elements.push_back(fr);
49 }
50 }
51 return ECCVMFlavor::HashFunction::hash(elements);
52}
53
54class ECCVMTests : public ::testing::Test {
55 protected:
57};
58namespace {
60} // namespace
61
69{
70 using Curve = curve::BN254;
71 using G1 = Curve::Element;
72 using Fr = Curve::ScalarField;
73
75 G1 a = G1::random_element(engine);
76 G1 b = G1::random_element(engine);
77 G1 c = G1::random_element(engine);
80
81 op_queue->add_accumulate(a);
82 op_queue->mul_accumulate(a, x);
83 op_queue->mul_accumulate(b, x);
84 op_queue->mul_accumulate(b, y);
85 op_queue->add_accumulate(a);
86 op_queue->mul_accumulate(b, x);
87 op_queue->eq_and_reset();
88 op_queue->add_accumulate(c);
89 op_queue->mul_accumulate(a, x);
90 op_queue->mul_accumulate(b, x);
91 op_queue->eq_and_reset();
92 op_queue->mul_accumulate(a, x);
93 op_queue->mul_accumulate(b, x);
94 op_queue->mul_accumulate(c, x);
95 op_queue->merge();
96 add_hiding_op_for_test(op_queue);
97 ECCVMCircuitBuilder builder{ op_queue };
98 return builder;
99}
100
101// returns a CircuitBuilder consisting of mul_add ops of the following form: either 0*g, for a group element, or
102// x * e, where x is a scalar and e is the identity element of the group.
103ECCVMCircuitBuilder generate_zero_circuit([[maybe_unused]] numeric::RNG* engine = nullptr, bool zero_scalars = 1)
104{
105 using Curve = curve::BN254;
106 using G1 = Curve::Element;
107 using Fr = Curve::ScalarField;
108
110
111 if (!zero_scalars) {
112 for (auto i = 0; i < 8; i++) {
114 op_queue->mul_accumulate(Curve::Group::affine_point_at_infinity, x);
115 }
116 } else {
117 for (auto i = 0; i < 8; i++) {
118 G1 g = G1::random_element(engine);
119 op_queue->mul_accumulate(g, 0);
120 }
121 }
122 op_queue->merge();
123 add_hiding_op_for_test(op_queue);
124
125 ECCVMCircuitBuilder builder{ op_queue };
126 return builder;
127}
128
131 std::vector<FF>& gate_challenges)
132{
133 // Prepare the inputs for the sumcheck prover:
134 // Compute and add beta to relation parameters
135 const FF beta = FF::random_element();
136 const FF gamma = FF::random_element();
137 const FF beta_sqr = beta * beta;
138 const FF beta_quartic = beta_sqr * beta_sqr;
139 relation_parameters.gamma = gamma;
140 relation_parameters.beta = beta;
141 relation_parameters.beta_sqr = beta_sqr;
142 relation_parameters.beta_cube = beta_sqr * beta;
143 relation_parameters.beta_quartic = beta_quartic;
144 auto first_term_tag = beta_quartic; // FIRST_TERM_TAG (= 1) * beta_quartic
145 relation_parameters.eccvm_set_permutation_delta = (gamma + first_term_tag) * (gamma + beta_sqr + first_term_tag) *
146 (gamma + beta_sqr + beta_sqr + first_term_tag) *
147 (gamma + beta_sqr + beta_sqr + beta_sqr + first_term_tag);
148 relation_parameters.eccvm_set_permutation_delta = relation_parameters.eccvm_set_permutation_delta.invert();
149
150 // Compute z_perm and inverse polynomial for our logarithmic-derivative lookup method
151 // Skip the disabled head region to preserve masking values
152 compute_logderivative_inverse<FF, ECCVMFlavor::LookupRelation, ECCVMFlavor::ProverPolynomials, true>(
153 pk->polynomials, relation_parameters, ECCVMFlavor::TRACE_OFFSET);
154 compute_grand_products<ECCVMFlavor>(pk->polynomials, relation_parameters);
155
156 // Generate gate challenges
157 for (size_t idx = 0; idx < CONST_ECCVM_LOG_N; idx++) {
158 gate_challenges[idx] = FF::random_element();
159 }
160}
161TEST_F(ECCVMTests, ZeroesCoefficients)
162{
164
165 std::shared_ptr<Transcript> prover_transcript = std::make_shared<Transcript>();
166 ECCVMProver prover(builder, prover_transcript);
167 auto [proof, opening_claim] = prover.construct_proof();
168
169 // Compute IPA proof
170 auto ipa_transcript = std::make_shared<Transcript>();
171 PCS::compute_opening_proof(prover.key->commitment_key, opening_claim, ipa_transcript);
172
173 std::shared_ptr<Transcript> verifier_transcript = std::make_shared<Transcript>();
174 ECCVMVerifier verifier(verifier_transcript, proof);
175 auto eccvm_result = verifier.reduce_to_ipa_opening();
176
177 // Verify IPA
178 auto ipa_verifier_transcript = std::make_shared<Transcript>(ipa_transcript->export_proof());
180 bool ipa_verified = IPA<curve::Grumpkin>::reduce_verify(ipa_vk, eccvm_result.ipa_claim, ipa_verifier_transcript);
181
182 ASSERT_TRUE(ipa_verified && eccvm_result.reduction_succeeded);
183}
184// Calling get_eccvm_ops without a hiding op should throw
185TEST_F(ECCVMTests, MissingHidingOpThrows)
186{
188 // get_eccvm_ops() requires a hiding op to have been set; throws "Hiding op must be set before calling
189 // get_eccvm_ops()"
190 EXPECT_THROW(op_queue->get_eccvm_ops(), std::runtime_error);
191}
192
193// Note that `NullOpQueue` is somewhat misleading, as we add a hiding operation.
194TEST_F(ECCVMTests, NullOpQUeue)
195{
197 add_hiding_op_for_test(op_queue);
198 ECCVMCircuitBuilder builder{ op_queue };
199 std::shared_ptr<Transcript> prover_transcript = std::make_shared<Transcript>();
200 ECCVMProver prover(builder, prover_transcript);
201 auto [proof, opening_claim] = prover.construct_proof();
202
203 // Compute IPA proof
204 auto ipa_transcript = std::make_shared<Transcript>();
205 PCS::compute_opening_proof(prover.key->commitment_key, opening_claim, ipa_transcript);
206
207 std::shared_ptr<Transcript> verifier_transcript = std::make_shared<Transcript>();
208 ECCVMVerifier verifier(verifier_transcript, proof);
209 auto eccvm_result = verifier.reduce_to_ipa_opening();
210
211 // Verify IPA
212 auto ipa_verifier_transcript = std::make_shared<Transcript>(ipa_transcript->export_proof());
214 bool ipa_verified = IPA<curve::Grumpkin>::reduce_verify(ipa_vk, eccvm_result.ipa_claim, ipa_verifier_transcript);
215
216 ASSERT_TRUE(ipa_verified && eccvm_result.reduction_succeeded);
217}
218
219TEST_F(ECCVMTests, PointAtInfinity)
220{
222
223 std::shared_ptr<Transcript> prover_transcript = std::make_shared<Transcript>();
224 ECCVMProver prover(builder, prover_transcript);
225 auto [proof, opening_claim] = prover.construct_proof();
226
227 auto ipa_transcript = std::make_shared<Transcript>();
228 PCS::compute_opening_proof(prover.key->commitment_key, opening_claim, ipa_transcript);
229
230 std::shared_ptr<Transcript> verifier_transcript = std::make_shared<Transcript>();
231 ECCVMVerifier verifier(verifier_transcript, proof);
232 auto eccvm_result = verifier.reduce_to_ipa_opening();
233
234 auto ipa_verifier_transcript = std::make_shared<Transcript>(ipa_transcript->export_proof());
236 bool ipa_verified = IPA<curve::Grumpkin>::reduce_verify(ipa_vk, eccvm_result.ipa_claim, ipa_verifier_transcript);
237
238 ASSERT_TRUE(ipa_verified && eccvm_result.reduction_succeeded);
239}
240TEST_F(ECCVMTests, ScalarEdgeCase)
241{
242 using Curve = curve::BN254;
243 using G1 = Curve::Element;
244 using Fr = Curve::ScalarField;
245
247 G1 a = G1::one();
248
249 op_queue->mul_accumulate(a, Fr(uint256_t(1) << 128));
250 op_queue->eq_and_reset();
251 op_queue->merge();
252 add_hiding_op_for_test(op_queue);
253 ECCVMCircuitBuilder builder{ op_queue };
254
255 std::shared_ptr<Transcript> prover_transcript = std::make_shared<Transcript>();
256 ECCVMProver prover(builder, prover_transcript);
257 auto [proof, opening_claim] = prover.construct_proof();
258
259 auto ipa_transcript = std::make_shared<Transcript>();
260 PCS::compute_opening_proof(prover.key->commitment_key, opening_claim, ipa_transcript);
261
262 std::shared_ptr<Transcript> verifier_transcript = std::make_shared<Transcript>();
263 ECCVMVerifier verifier(verifier_transcript, proof);
264 auto eccvm_result = verifier.reduce_to_ipa_opening();
265
266 auto ipa_verifier_transcript = std::make_shared<Transcript>(ipa_transcript->export_proof());
268 bool ipa_verified = IPA<curve::Grumpkin>::reduce_verify(ipa_vk, eccvm_result.ipa_claim, ipa_verifier_transcript);
269
270 ASSERT_TRUE(ipa_verified && eccvm_result.reduction_succeeded);
271}
279TEST_F(ECCVMTests, ProofLengthCheck)
280{
282
283 std::shared_ptr<Transcript> prover_transcript = std::make_shared<Transcript>();
284 ECCVMProver prover(builder, prover_transcript);
285 auto [proof, opening_claim] = prover.construct_proof();
286 EXPECT_EQ(proof.size(), ECCVMFlavor::PROOF_LENGTH);
287}
288
289TEST_F(ECCVMTests, BaseCaseFixedSize)
290{
291 std::shared_ptr<Transcript> prover_transcript = std::make_shared<Transcript>();
292 ECCVMProver prover = [&]() {
294 return ECCVMProver(builder, prover_transcript);
295 }();
296
297 auto [proof, opening_claim] = prover.construct_proof();
298
299 auto ipa_transcript = std::make_shared<Transcript>();
300 PCS::compute_opening_proof(prover.key->commitment_key, opening_claim, ipa_transcript);
301
302 std::shared_ptr<Transcript> verifier_transcript = std::make_shared<Transcript>();
303 ECCVMVerifier verifier(verifier_transcript, proof);
304 auto eccvm_result = verifier.reduce_to_ipa_opening();
305
306 auto ipa_verifier_transcript = std::make_shared<Transcript>(ipa_transcript->export_proof());
308 bool ipa_verified = IPA<curve::Grumpkin>::reduce_verify(ipa_vk, eccvm_result.ipa_claim, ipa_verifier_transcript);
309
310 ASSERT_TRUE(ipa_verified && eccvm_result.reduction_succeeded);
311}
312
313TEST_F(ECCVMTests, EqFailsFixedSize)
314{
316 // Tamper with the eq op such that the expected value is incorect
317 builder.op_queue->add_erroneous_equality_op_for_testing();
318 builder.op_queue->merge();
319
320 std::shared_ptr<Transcript> prover_transcript = std::make_shared<Transcript>();
321 ECCVMProver prover(builder, prover_transcript);
322
323 auto [proof, opening_claim] = prover.construct_proof();
324
325 auto ipa_transcript = std::make_shared<Transcript>();
326 PCS::compute_opening_proof(prover.key->commitment_key, opening_claim, ipa_transcript);
327
328 std::shared_ptr<Transcript> verifier_transcript = std::make_shared<Transcript>();
329 ECCVMVerifier verifier(verifier_transcript, proof);
330 auto eccvm_result = verifier.reduce_to_ipa_opening();
331
332 auto ipa_verifier_transcript = std::make_shared<Transcript>(ipa_transcript->export_proof());
334 bool ipa_verified = IPA<curve::Grumpkin>::reduce_verify(ipa_vk, eccvm_result.ipa_claim, ipa_verifier_transcript);
335
336 ASSERT_FALSE(ipa_verified && eccvm_result.reduction_succeeded);
337}
338
339TEST_F(ECCVMTests, CommittedSumcheck)
340{
341 using Flavor = ECCVMFlavor;
342 using ProvingKey = ECCVMFlavor::ProvingKey;
343 using FF = ECCVMFlavor::FF;
345 using ZKData = ZKSumcheckData<Flavor>;
346
347 bb::RelationParameters<FF> relation_parameters;
348 std::vector<FF> gate_challenges(CONST_ECCVM_LOG_N);
349
351 std::shared_ptr<Transcript> prover_transcript = std::make_shared<Transcript>();
352 ECCVMProver prover(builder, prover_transcript);
354
355 // Prepare the inputs for the sumcheck prover:
356 // Compute and add beta to relation parameters
357 const FF alpha = FF::random_element();
358 complete_proving_key_for_test(relation_parameters, pk, gate_challenges);
359
360 // Clear the transcript
361 prover_transcript = std::make_shared<Transcript>();
362
363 // Run Sumcheck on the ECCVM Prover polynomials
365 SumcheckProver sumcheck_prover(pk->circuit_size,
366 pk->polynomials,
367 prover_transcript,
368 alpha,
369 gate_challenges,
370 relation_parameters,
371 CONST_ECCVM_LOG_N);
372
373 ZKData zk_sumcheck_data = ZKData(CONST_ECCVM_LOG_N, prover_transcript);
374 auto prover_output = sumcheck_prover.prove(zk_sumcheck_data);
375
376 std::shared_ptr<Transcript> verifier_transcript = std::make_shared<Transcript>(prover_transcript->export_proof());
377
378 // Execute Sumcheck Verifier
379 SumcheckVerifier<Flavor> sumcheck_verifier(verifier_transcript, alpha, CONST_ECCVM_LOG_N);
380 SumcheckOutput<ECCVMFlavor> verifier_output = sumcheck_verifier.verify(relation_parameters, gate_challenges);
381
382 // Evaluate prover's round univariates at corresponding challenges and compare them with the claimed evaluations
383 // computed by the verifier
384 for (size_t idx = 0; idx < CONST_ECCVM_LOG_N; idx++) {
385 FF true_eval_at_the_challenge = prover_output.round_univariates[idx].evaluate(prover_output.challenge[idx]);
386 FF verifier_eval_at_the_challenge = verifier_output.round_univariate_evaluations[idx][2];
387 EXPECT_TRUE(true_eval_at_the_challenge == verifier_eval_at_the_challenge);
388 }
389
390 // Check that the first sumcheck univariate is consistent with the claimed ZK Sumchek Sum
391 FF prover_target_sum = zk_sumcheck_data.libra_challenge * zk_sumcheck_data.libra_total_sum;
392
393 EXPECT_TRUE(prover_target_sum == verifier_output.round_univariate_evaluations[0][0] +
394 verifier_output.round_univariate_evaluations[0][1]);
395
396 EXPECT_TRUE(verifier_output.verified);
397}
398
414TEST_F(ECCVMTests, BaseInfinityForgedCoordinatesRejected)
415{
416 using Curve = curve::BN254;
417 using G1 = Curve::Element;
418 using Fr = Curve::ScalarField;
419
420 auto generators = Curve::Group::derive_generators("base_infinity_regression", 2);
421 G1 a = generators[0];
422 G1 b = generators[1]; // the point the attacker tries to smuggle in
425
426 // Honest vs forged results
427 G1 honest_result = a * x + b * y;
428 G1 forged_result = a * x;
429 ASSERT_NE(honest_result, forged_result) << "Need b*y != 0 for a meaningful attack";
430
431 // Build the circuit: mul(a, x), mul(infinity, y), eq_and_reset()
432 // The op queue honestly computes a*x + infinity*y = a*x. Eq point = a*x.
433 // The builder sets base_infinity=1 at the second mul row.
435 op_queue->mul_accumulate(a, x);
436 op_queue->mul_accumulate(Curve::Group::affine_point_at_infinity, y);
437 op_queue->eq_and_reset();
438 op_queue->merge();
439 add_hiding_op_for_test(op_queue);
440
441 ECCVMCircuitBuilder builder{ op_queue };
442
443 // Create prover (polynomials are built in the constructor)
444 std::shared_ptr<Transcript> prover_transcript = std::make_shared<Transcript>();
445 ECCVMProver prover(builder, prover_transcript);
446
447 // Find the mul row with base_infinity=1
448 auto& polys = prover.key->polynomials;
449 const size_t num_rows = polys.get_polynomial_size();
450 size_t forged_row = 0;
451 for (size_t i = 0; i < num_rows; i++) {
452 if (polys.transcript_op[i] == FF(4) && polys.transcript_base_infinity[i] == FF(1)) {
453 forged_row = i;
454 break;
455 }
456 }
457 ASSERT_GT(forged_row, size_t(0)) << "Could not find infinity mul row";
458
459 // Replace transcript_Px/Py with valid on-curve point b.
460 // After this, the committed transcript says: mul(a,x), mul(b,y), eq(a*x)
461 // Honest result = a*x + b*y, but the proof will claim a*x.
462 auto b_affine = Curve::Group::affine_element(b);
463 polys.transcript_Px.at(forged_row) = b_affine.x;
464 polys.transcript_Py.at(forged_row) = b_affine.y;
465
466 // Generate proof from modified polynomials
467 auto [proof, opening_claim] = prover.construct_proof();
468
469 // Compute IPA opening proof
470 auto ipa_transcript = std::make_shared<Transcript>();
471 PCS::compute_opening_proof(prover.key->commitment_key, opening_claim, ipa_transcript);
472
473 // Verify the ECCVM proof
474 std::shared_ptr<Transcript> verifier_transcript = std::make_shared<Transcript>();
475 ECCVMVerifier verifier(verifier_transcript, proof);
476 auto eccvm_result = verifier.reduce_to_ipa_opening();
477
478 // Verify the IPA proof
479 auto ipa_verifier_transcript = std::make_shared<Transcript>(ipa_transcript->export_proof());
481 bool ipa_verified = IPA<curve::Grumpkin>::reduce_verify(ipa_vk, eccvm_result.ipa_claim, ipa_verifier_transcript);
482
483 bool proof_verified = ipa_verified && eccvm_result.reduction_succeeded;
484
485 EXPECT_FALSE(proof_verified)
486 << "REGRESSION: Forged ECCVM proof must NOT verify after base_infinity coordinate constraints";
487}
488
496{
497 // Generate a circuit and its verification key (computed at runtime from the proving key)
499 std::shared_ptr<Transcript> prover_transcript = std::make_shared<Transcript>();
500 ECCVMProver prover(builder, prover_transcript);
501 auto [proof, opening_claim] = prover.construct_proof();
502
503 std::shared_ptr<Transcript> verifier_transcript = std::make_shared<Transcript>();
504 ECCVMVerifier verifier(verifier_transcript, proof);
505
506 // Generate the default fixed VK
508 // Generate a VK from PK
509 ECCVMFlavor::VerificationKey vk_computed_by_prover = create_vk_from_proving_key(prover.key);
510
511 const auto& labels = bb::ECCVMFlavor::VerificationKey::get_labels();
512 size_t index = 0;
513 for (auto [vk_commitment, fixed_commitment] : zip_view(vk_computed_by_prover.get_all(), fixed_vk.get_all())) {
514 EXPECT_EQ(vk_commitment, fixed_commitment)
515 << "Mismatch between vk_commitment and fixed_commitment at label: " << labels[index];
516 ++index;
517 }
518
519 // Check that the fixed VK is equal to the generated VK
520 EXPECT_EQ(fixed_vk, vk_computed_by_prover);
521
522 // Verify that the hardcoded VK hash matches the computed hash
523 auto computed_hash = compute_eccvm_vk_hash();
524 auto hardcoded_hash = ECCVMHardcodedVKAndHash::vk_hash();
525 if (computed_hash != hardcoded_hash) {
526 info("VK hash mismatch! Update ECCVMHardcodedVKAndHash::vk_hash() with:");
527 info("0x", computed_hash);
528 }
529 EXPECT_EQ(computed_hash, hardcoded_hash) << "Hardcoded VK hash does not match computed hash";
530}
531
537TEST_F(ECCVMTests, WitnessPolynomialsMasked)
538{
541
542 // Every witness polynomial should have at least one non-zero masking value
543 auto check_masked = [](const auto& poly, const std::string& label) {
544 bool has_masking = false;
545 for (size_t j = 0; j < NUM_MASKED_ROWS; j++) {
546 has_masking |= !poly[NUM_ZERO_ROWS + j].is_zero();
547 }
548 EXPECT_TRUE(has_masking) << label << " should be masked but has all zeros in masking region";
549 };
550
552 for (auto [poly, label] : zip_view(polynomials.get_wires(), labels.get_wires())) {
553 check_masked(poly, label);
554 }
555 check_masked(polynomials.z_perm, "z_perm");
556 check_masked(polynomials.lookup_inverses, "lookup_inverses");
557}
558
566TEST_F(ECCVMTests, RepeatedCommitmentsIndicesCorrect)
567{
569 auto pk = std::make_shared<PK>(builder);
570 pk->commitment_key = ECCVMFlavor::CommitmentKey(pk->circuit_size);
571
572 auto unshifted = pk->polynomials.get_unshifted();
573 auto to_be_shifted = pk->polynomials.get_to_be_shifted();
574
575 constexpr auto repeated = ECCVMFlavor::REPEATED_COMMITMENTS;
576 ASSERT_EQ(to_be_shifted.size(), repeated.first.count);
577
578 // Build the commitment vector exactly as Shplemini does: [Q, unshifted..., to_be_shifted...]
579 const auto& ck = pk->commitment_key;
581 commitments.push_back(ECCVMFlavor::Commitment::one()); // dummy Q
582 for (auto& poly : unshifted) {
583 commitments.push_back(ck.commit(poly));
584 }
585 for (auto& poly : to_be_shifted) {
586 commitments.push_back(ck.commit(poly));
587 }
588
589 // Same offset logic as remove_repeated_commitments
590 constexpr size_t offset = ECCVMFlavor::HasZK ? 2 : 1;
591 for (size_t i = 0; i < repeated.first.count; i++) {
592 EXPECT_EQ(commitments[repeated.first.original_start + offset + i],
593 commitments[repeated.first.duplicate_start + offset + i])
594 << "REPEATED_COMMITMENTS commitment mismatch at index " << i;
595 }
596}
void SetUp() override
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
A container for commitment labels.
A container for the prover polynomials.
The proving key is responsible for storing the polynomials used by the prover.
static constexpr size_t ECCVM_FIXED_SIZE
static constexpr bool HasZK
typename Curve::ScalarField FF
typename Curve::BaseField BF
static constexpr size_t PROOF_LENGTH
bb::CommitmentKey< Curve > CommitmentKey
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
BaseTranscript< Codec, HashFunction > Transcript
static constexpr size_t TRACE_OFFSET
static std::vector< Commitment > get_all()
std::pair< Proof, OpeningClaim > construct_proof()
std::shared_ptr< ProvingKey > key
Unified ECCVM verifier class for both native and recursive verification.
ReductionResult reduce_to_ipa_opening()
Reduce the ECCVM proof to an IPA opening claim.
Simple verification key class for fixed-size circuits (ECCVM, Translator, AVM).
Definition flavor.hpp:101
static std::vector< fr > serialize_to_fields(const T &val)
Conversion from transcript values to bb::frs.
IPA (inner product argument) commitment scheme class.
Definition ipa.hpp:86
The implementation of the sumcheck Prover for statements of the form for multilinear polynomials .
Definition sumcheck.hpp:294
SumcheckOutput< Flavor > prove()
Non-ZK version: Compute round univariate, place it in transcript, compute challenge,...
Definition sumcheck.hpp:392
Implementation of the sumcheck Verifier for statements of the form for multilinear polynomials .
Definition sumcheck.hpp:804
SumcheckOutput< Flavor > verify(const bb::RelationParameters< FF > &relation_parameters, const std::vector< FF > &gate_challenges)
The Sumcheck verification method. First it extracts round univariate, checks sum (the sumcheck univar...
Definition sumcheck.hpp:859
Representation of the Grumpkin Verifier Commitment Key inside a bn254 circuit.
static FF hash(const std::vector< FF > &input)
Hashes a vector of field elements.
typename Group::element Element
Definition grumpkin.hpp:63
#define info(...)
Definition log.hpp:93
AluTraceBuilder builder
Definition alu.test.cpp:124
FF a
FF b
void complete_proving_key_for_test(bb::RelationParameters< FF > &relation_parameters, std::shared_ptr< PK > &pk, std::vector< FF > &gate_challenges)
ECCVMFlavor::VerificationKey create_vk_from_proving_key(const std::shared_ptr< PK > &proving_key)
ECCVMFlavor::BF compute_eccvm_vk_hash()
ECCVMCircuitBuilder generate_zero_circuit(numeric::RNG *engine=nullptr, bool zero_scalars=1)
ECCVMCircuitBuilder generate_circuit(numeric::RNG *engine=nullptr)
Adds operations in BN254 to the op_queue and then constructs and ECCVM circuit from the op_queue.
numeric::RNG & engine
ssize_t offset
Definition engine.cpp:62
void add_hiding_op_for_test(const std::shared_ptr< ECCOpQueue > &op_queue)
Set a hiding op on the op_queue for testing.
RNG & get_debug_randomness(bool reset, std::uint_fast64_t seed)
Definition engine.cpp:245
std::filesystem::path bb_crs_path()
void init_file_crs_factory(const std::filesystem::path &path)
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
TEST_F(IPATest, ChallengesAreZero)
Definition ipa.test.cpp:155
CommitmentKey< Curve > ck
VerifierCommitmentKey< Curve > vk
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Curve::ScalarField Fr
Curve::AffineElement G1
Container for parameters used by the grand product (permutation, lookup) Honk relations.
Contains the evaluations of multilinear polynomials at the challenge point . These are computed by S...
std::vector< std::array< FF, 3 > > round_univariate_evaluations
This structure is created to contain various polynomials and constants required by ZK Sumcheck.
static field random_element(numeric::RNG *engine=nullptr) noexcept