Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
protogalaxy_recursive_verifier.test.cpp
Go to the documentation of this file.
18
20
22class ProtogalaxyRecursiveTests : public testing::Test {
23 public:
24 // Recursive types: used to construct the circuit that performs folding verification
33 // Native types: used to construct the circuit whose instance will be folded and whose folding will be recursively
34 // verified
51
56
57 enum class AccumulatorTamperingMode : uint8_t {
58 None,
59 Wires,
60 Alphas,
64 };
65
66 enum class InstanceTamperingMode : uint8_t {
67 None,
68 Wires,
69 };
70
71 enum class ProofTamperingMode : uint8_t {
72 None,
75 };
76
77 static constexpr size_t INDEX_FIRST_PERTURBATOR_COEFF = 624;
78 static constexpr size_t INDEX_FIRST_COMBINER_QUOTIENT_COEFF = 644;
79
85 const size_t& log_num_gates = 9,
86 const size_t& log_num_gates_with_public_inputs = 9)
87 {
88 using FrNative = typename NativeCurve::ScalarFieldNative;
89 using Fr = typename NativeCurve::ScalarField;
91
92 ProtogalaxyTestUtils::create_function_circuit(builder, log_num_gates, log_num_gates_with_public_inputs);
93
94 // Pedersen hash
95 Fr a = Fr::from_witness(&builder, FrNative::random_element(&engine));
96 Fr b = Fr::from_witness(&builder, FrNative::random_element(&engine));
97 [[maybe_unused]] auto ped_hash = pedersen_hash<NativeBuilder>::hash({ a, b });
98
99 // Blake hash
100 byte_array_ct to_hash(&builder, "nonsense test data");
101 [[maybe_unused]] auto blake_hash = stdlib::Blake3s<NativeBuilder>::hash(to_hash);
102 };
103
108 const NativeVerifierInstances& verifier_instances)
109 {
110 RecursiveFoldingData recursive_folding_data;
111 // Turn first verifier instance into recursive instance
112 recursive_folding_data.verifier_inst =
114 recursive_folding_data.verifier_inst->is_complete = true;
115 // The first instance is always an accumulator, we need to populate witness commitments, target
116 // sum, gate challenge, relation parameters, and batching challenges
117 for (auto [native_comm, rec_comm] :
118 zip_view(verifier_instances[0]->witness_commitments.get_all(),
119 recursive_folding_data.verifier_inst->witness_commitments.get_all())) {
120 rec_comm = RecursiveCommitment::from_witness(&builder, native_comm);
121 }
122
123 recursive_folding_data.verifier_inst->target_sum =
124 RecursiveFF::from_witness(&builder, verifier_instances[0]->target_sum);
125
126 for (auto [native_relation_parameters, rec_relation_parameters] :
127 zip_view(verifier_instances[0]->relation_parameters.get_to_fold(),
128 recursive_folding_data.verifier_inst->relation_parameters.get_to_fold())) {
129 rec_relation_parameters = RecursiveFF::from_witness(&builder, native_relation_parameters);
130 }
131
132 for (auto [native_alpha, rec_alphas] :
133 zip_view(verifier_instances[0]->alphas, recursive_folding_data.verifier_inst->alphas)) {
134 rec_alphas = RecursiveFF::from_witness(&builder, native_alpha);
135 }
136
137 for (auto [native_gate_challenge, rec_gate_challenge] :
138 zip_view(verifier_instances[0]->gate_challenges, recursive_folding_data.verifier_inst->gate_challenges)) {
139 rec_gate_challenge = RecursiveFF::from_witness(&builder, native_gate_challenge);
140 }
141 recursive_folding_data.verifier_inst->target_sum =
142 RecursiveFF::from_witness(&builder, verifier_instances[0]->target_sum);
143 recursive_folding_data.vk_and_hash = std::make_shared<RecursiveVKAndHash>(builder, verifier_instances[1]->vk);
144
145 return recursive_folding_data;
146 }
147
157 const NativeVerifierInstances& verifier_instances,
158 const HonkProof& folding_proof)
159 {
160 // Instantiate recursive verifier instances
161 auto recursive_folding_data = create_recursive_folding_data(builder, verifier_instances);
162
163 stdlib::Proof<RecursiveBuilder> recursive_folding_proof(builder, folding_proof);
164
166 recursive_transcript->enable_manifest();
167 // We need to add the accumulator verifier instance to the transcript to ensure its origin is
168 // properly tracked, otherwise in the protocol the recursive folding verifier interacts with values that it
169 // has never seen before (because Oink is not run on an accumulator)
170 auto accumulator_hash =
171 recursive_folding_data.verifier_inst->hash_through_transcript("-", *recursive_transcript);
172 recursive_transcript->add_to_hash_buffer("accumulator_hash", accumulator_hash);
173
174 RecursiveFoldingVerifier recursive_folding_verifier(
175 &builder, recursive_folding_data.verifier_inst, recursive_folding_data.vk_and_hash, recursive_transcript);
176
177 auto folded_verifier_instance = recursive_folding_verifier.verify_folding_proof(recursive_folding_proof);
178
179 return { std::make_shared<NativeVerifierInstance>(folded_verifier_instance->get_value()),
180 recursive_transcript };
181 }
182
187 static void tamper_with_accumulator(const NativeFoldingData& accumulator,
188 const AccumulatorTamperingMode& mode,
189 bool expected)
190 {
191 bool is_valid = true;
192 auto prover_inst = get<0>(accumulator);
193 auto verifier_inst = get<1>(accumulator);
194
195 prover_inst->commitment_key = CommitmentKey(prover_inst->get_precomputed().metadata.dyadic_size);
196
197 switch (mode) {
199 // No tampering
200 is_valid = check_accumulator_target_sum_manual(prover_inst);
201 break;
203 prover_inst->polynomials.w_l.at(2) += NativeFF(1);
204 verifier_inst->witness_commitments.get_wires()[0] =
205 prover_inst->commitment_key.commit(prover_inst->polynomials.w_l);
206 is_valid = check_accumulator_target_sum_manual(prover_inst);
207 break;
209 prover_inst->alphas[1] +=
210 NativeFF(150); // Second subrelation is zero for the mock circuits constructed here
211 verifier_inst->alphas[1] = prover_inst->alphas[1];
212 is_valid = check_accumulator_target_sum_manual(prover_inst);
213 break;
215 prover_inst->gate_challenges[0] += NativeFF(42);
216 verifier_inst->gate_challenges[0] = prover_inst->gate_challenges[0];
217 is_valid = check_accumulator_target_sum_manual(prover_inst);
218 break;
220 prover_inst->relation_parameters.get_to_fold()[0] += NativeFF(3009);
221 verifier_inst->relation_parameters.get_to_fold()[0] = prover_inst->relation_parameters.get_to_fold()[0];
222 is_valid = check_accumulator_target_sum_manual(prover_inst);
223 break;
225 prover_inst->target_sum += NativeFF(2025);
226 verifier_inst->target_sum = prover_inst->target_sum;
227 is_valid = check_accumulator_target_sum_manual(prover_inst);
228 break;
229 }
230
231 EXPECT_EQ(is_valid, expected);
232 }
233
241 static void tamper_with_folding_proof(HonkProof& folding_proof, const ProofTamperingMode& mode)
242 {
243 switch (mode) {
245 break;
247 folding_proof[INDEX_FIRST_PERTURBATOR_COEFF] += NativeFF(10);
248 break;
250 folding_proof[INDEX_FIRST_COMBINER_QUOTIENT_COEFF] += NativeFF(100);
251 break;
252 }
253 }
254
258 static void tamper_with_instance(const NativeFoldingData& instance, const InstanceTamperingMode& mode)
259 {
260 auto prover_inst = get<0>(instance);
261
262 auto run_oink = [&prover_inst]() {
263 OinkProver<NativeFlavor> oink_prover(
264 prover_inst, std::make_shared<NativeVerificationKey>(prover_inst->get_precomputed()));
265 oink_prover.prove();
266 };
267
268 bool is_valid = true;
269
270 switch (mode) {
272 // No tampering
273 break;
275 prover_inst->polynomials.w_l.at(1) += NativeFF(1);
276 run_oink();
277 is_valid = check_accumulator_target_sum_manual(prover_inst);
278 // Reset so that PG runs Oink on this instance
279 prover_inst->is_complete = false;
280 break;
281 }
282
283 bool expected = mode == InstanceTamperingMode::None;
284 EXPECT_EQ(is_valid, expected);
285 }
286
319 static void protogalaxy_testing(const AccumulatorTamperingMode& accumulator_mode,
320 const InstanceTamperingMode& instance_mode,
321 const AccumulatorTamperingMode& folded_accumulator_mode,
322 const ProofTamperingMode& proof_mode)
323 {
324 bool is_accumulator_tampering_mode = (accumulator_mode != AccumulatorTamperingMode::None);
325 bool is_instance_tampering_mode = (instance_mode != InstanceTamperingMode::None);
326 bool is_proof_tampering_mode = (proof_mode != ProofTamperingMode::None);
327 bool is_folded_accumulator_tampering_mode = (folded_accumulator_mode != AccumulatorTamperingMode::None);
328 bool is_no_tampering_mode = !(is_accumulator_tampering_mode || is_instance_tampering_mode ||
329 is_folded_accumulator_tampering_mode || is_proof_tampering_mode);
330
331 // 1. Build test data
332 TupleOfKeys keys;
334
335 NativeBuilder native_builder;
336 create_function_circuit(native_builder, 10, 10);
338 keys, native_builder, 1, TraceSettings{ SMALL_TEST_STRUCTURE });
339
340 // 2. Tampering
342 ProtogalaxyTestUtils::get_folding_data(keys, 0), accumulator_mode, !is_accumulator_tampering_mode);
344
345 // 3 .Fold
346 auto [folded_accumulator, folding_proof] =
347 ProtogalaxyTestUtils::fold(get<0>(keys), get<1>(keys), /*hash_accumulator=*/true);
348
349 // 4. Tampering
350 tamper_with_folding_proof(folding_proof, proof_mode);
351
352 // 5. Construct the circuit that verifies the folding proof
354 auto [folded_verifier_accumulator, recursive_transcript] =
355 create_folding_circuit(builder, get<1>(keys), folding_proof);
356
357 // Check circuit: not that it never fails as it simply performs a computation
358 EXPECT_TRUE(CircuitChecker::check(builder)) << "Builder check failed. Error: " << builder.err();
359
360 // 6. Native folding = Recursive folding
361 auto [native_folded_verifier_accumulator, native_transcript] =
362 ProtogalaxyTestUtils::verify_folding_proof(get<1>(keys), folding_proof, /*hash_accumulator=*/true);
363 auto [compare_verifiers, msg_verifiers] =
364 ProtogalaxyTestUtils::compare_accumulators(folded_verifier_accumulator, native_folded_verifier_accumulator);
365 EXPECT_TRUE(compare_verifiers) << msg_verifiers;
366
367 // 7. Verify that native and recursive transcripts match
368 auto native_manifest = native_transcript->get_manifest();
369 auto recursive_manifest = recursive_transcript->get_manifest();
370 EXPECT_EQ(native_manifest.size(), recursive_manifest.size());
371 BB_ASSERT_GT(native_manifest.size(), 0UL);
372 for (size_t idx = 0; idx < native_manifest.size(); idx++) {
373 EXPECT_EQ(recursive_manifest[idx], native_manifest[idx])
374 << "Recursive Verifier/Verifier manifest discrepency in round " << idx;
375 }
376
377 // 8. Check that prover and verifier hold the same data if nothing has been tampered with
378 // Note that as our PG prover folds assuming that the incoming instance is valid, at this point Prover and
379 // Verifier still hold the same data. However, the decider will spot that the Prover has folded an invalid
380 // instance while claiming it was valid.
381 auto [compare_prover_verifier, msg_prover_verifier] =
382 ProtogalaxyTestUtils::compare_accumulators(folded_accumulator, native_folded_verifier_accumulator);
383 EXPECT_EQ(compare_prover_verifier, !(is_accumulator_tampering_mode || is_proof_tampering_mode))
384 << msg_prover_verifier;
385
386 // 9. Tamper with the accumulator
387 // Note that checking whether the target sum of the accumulator is equal to the sum of the relation
388 // contributions across the rows returns false if and only either the incoming instance was invalid, or if the
389 // accumulator itself has been tampered with. This is because a PG prover always returns an accumulator for
390 // which the target sum is equal to the sum of the relation contributions across the rows unless the incoming
391 // instance is invalid (meaning the sum of the relation contributions across the rows is not zero).
392 tamper_with_accumulator(NativeFoldingData{ folded_accumulator, native_folded_verifier_accumulator },
393 folded_accumulator_mode,
394 !(is_instance_tampering_mode || is_folded_accumulator_tampering_mode));
395
396 // 10. Run the decider. We use the native folded instance because we have already checked that the native and
397 // in-circuit computed one agree
398 bool is_folded_accumulator_valid =
399 ProtogalaxyTestUtils::run_decider(folded_accumulator, native_folded_verifier_accumulator);
400 EXPECT_EQ(is_folded_accumulator_valid, is_no_tampering_mode);
401 }
402};
403
405{
406 protogalaxy_testing(AccumulatorTamperingMode::None,
407 InstanceTamperingMode::None,
408 AccumulatorTamperingMode::None,
409 ProofTamperingMode::None);
410}
411
412TEST_F(ProtogalaxyRecursiveTests, WiresIncomingAccumulator)
413{
414 BB_DISABLE_ASSERTS(); // Disable assert in PG prover
415 protogalaxy_testing(AccumulatorTamperingMode::Wires,
416 InstanceTamperingMode::None,
417 AccumulatorTamperingMode::None,
418 ProofTamperingMode::None);
419}
420
421TEST_F(ProtogalaxyRecursiveTests, AlphasIncomingAccumulator)
422{
423 BB_DISABLE_ASSERTS(); // Disable assert in PG prover
424 protogalaxy_testing(AccumulatorTamperingMode::Alphas,
425 InstanceTamperingMode::None,
426 AccumulatorTamperingMode::None,
427 ProofTamperingMode::None);
428}
429
430TEST_F(ProtogalaxyRecursiveTests, GateChallengesIncomingAccumulator)
431{
432 BB_DISABLE_ASSERTS(); // Disable assert in PG prover
433 protogalaxy_testing(AccumulatorTamperingMode::GateChallenges,
434 InstanceTamperingMode::None,
435 AccumulatorTamperingMode::None,
436 ProofTamperingMode::None);
437}
438
439TEST_F(ProtogalaxyRecursiveTests, RelationParametersIncomingAccumulator)
440{
441 BB_DISABLE_ASSERTS(); // Disable assert in PG prover
442 protogalaxy_testing(AccumulatorTamperingMode::RelationParameters,
443 InstanceTamperingMode::None,
444 AccumulatorTamperingMode::None,
445 ProofTamperingMode::None);
446}
447
448TEST_F(ProtogalaxyRecursiveTests, TargetSumIncomingAccumulator)
449{
450 BB_DISABLE_ASSERTS(); // Disable assert in PG prover
451 protogalaxy_testing(AccumulatorTamperingMode::TargetSum,
452 InstanceTamperingMode::None,
453 AccumulatorTamperingMode::None,
454 ProofTamperingMode::None);
455}
456
457TEST_F(ProtogalaxyRecursiveTests, WiresIncomingInstance)
458{
459 protogalaxy_testing(AccumulatorTamperingMode::None,
460 InstanceTamperingMode::Wires,
461 AccumulatorTamperingMode::None,
462 ProofTamperingMode::None);
463}
464
465TEST_F(ProtogalaxyRecursiveTests, WiresFoldedAccumulator)
466{
467 protogalaxy_testing(AccumulatorTamperingMode::None,
468 InstanceTamperingMode::None,
469 AccumulatorTamperingMode::Wires,
470 ProofTamperingMode::None);
471}
472
473TEST_F(ProtogalaxyRecursiveTests, AlphasFoldedAccumulator)
474{
475 protogalaxy_testing(AccumulatorTamperingMode::None,
476 InstanceTamperingMode::None,
477 AccumulatorTamperingMode::Alphas,
478 ProofTamperingMode::None);
479}
480
481TEST_F(ProtogalaxyRecursiveTests, GateChallengesFoldedAccumulator)
482{
483 protogalaxy_testing(AccumulatorTamperingMode::None,
484 InstanceTamperingMode::None,
485 AccumulatorTamperingMode::GateChallenges,
486 ProofTamperingMode::None);
487}
488
489TEST_F(ProtogalaxyRecursiveTests, RelationParametersFoldedAccumulator)
490{
491 protogalaxy_testing(AccumulatorTamperingMode::None,
492 InstanceTamperingMode::None,
493 AccumulatorTamperingMode::RelationParameters,
494 ProofTamperingMode::None);
495}
496
497TEST_F(ProtogalaxyRecursiveTests, TargetSumFoldedAccumulator)
498{
499 protogalaxy_testing(AccumulatorTamperingMode::None,
500 InstanceTamperingMode::None,
501 AccumulatorTamperingMode::TargetSum,
502 ProofTamperingMode::None);
503}
504
505TEST_F(ProtogalaxyRecursiveTests, PerturbatorCoefficient)
506{
507 protogalaxy_testing(AccumulatorTamperingMode::None,
508 InstanceTamperingMode::None,
509 AccumulatorTamperingMode::None,
510 ProofTamperingMode::Perturbator);
511}
512
513TEST_F(ProtogalaxyRecursiveTests, CombinerQuotientCoefficient)
514{
515 protogalaxy_testing(AccumulatorTamperingMode::None,
516 InstanceTamperingMode::None,
517 AccumulatorTamperingMode::None,
518 ProofTamperingMode::CombinerQuotient);
519}
520
522{
524
525 auto compute_circuit_size = [](const size_t log_num_gates) -> std::pair<size_t, NativeBuilder> {
526 TupleOfKeys keys;
527
528 // First instance
529 TupleOfKeys keys_to_be_accumulated;
530
531 NativeBuilder native_builder_1;
532 create_function_circuit(native_builder_1, log_num_gates, log_num_gates);
533 ProtogalaxyTestUtils::construct_instances_and_add_to_tuple(
534 keys_to_be_accumulated, native_builder_1, 0, TraceSettings{ SMALL_TEST_STRUCTURE });
535
536 NativeBuilder native_builder_2;
537 create_function_circuit(native_builder_2, log_num_gates, log_num_gates);
538 ProtogalaxyTestUtils::construct_instances_and_add_to_tuple(
539 keys_to_be_accumulated, native_builder_2, 1, TraceSettings{ SMALL_TEST_STRUCTURE });
540
541 auto [prover_instance, verifier_instance] =
542 ProtogalaxyTestUtils::fold_and_verify(get<0>(keys_to_be_accumulated), get<1>(keys_to_be_accumulated));
543
544 get<0>(keys)[0] = prover_instance;
545 get<1>(keys)[0] = verifier_instance;
546
547 // Second instance
548 NativeBuilder native_builder_3;
549 create_function_circuit(native_builder_3); // This circuit must be fixed, otherwise the circuit depends on the
550 // size of the Oink proofs
551 ProtogalaxyTestUtils::construct_instances_and_add_to_tuple(
552 keys, native_builder_3, 1, TraceSettings{ SMALL_TEST_STRUCTURE });
553
554 auto [folded_accumulator, folding_proof] =
555 ProtogalaxyTestUtils::fold(get<0>(keys), get<1>(keys), /*hash_accumulator=*/true);
556
557 RecursiveBuilder builder;
558 [[maybe_unused]] auto _ = create_folding_circuit(builder, get<1>(keys), folding_proof);
559
560 EXPECT_TRUE(CircuitChecker::check(builder));
561
562 return { folding_proof.size(), builder };
563 };
564
565 auto [proof_size_1, circuit_1] = compute_circuit_size(11);
566 auto [proof_size_2, circuit_2] = compute_circuit_size(12);
567
568 EXPECT_EQ(proof_size_1, proof_size_2);
569 EXPECT_EQ(circuit_1.get_estimated_num_finalized_gates(), circuit_2.get_estimated_num_finalized_gates());
570 EXPECT_EQ(circuit_1.blocks, circuit_2.blocks);
571}
572
573} // namespace bb::stdlib::recursion::honk
#define BB_ASSERT_GT(left, right,...)
Definition assert.hpp:118
#define BB_DISABLE_ASSERTS()
Definition assert.hpp:32
CommitmentKey object over a pairing group 𝔾₁.
Curve::ScalarField FF
bb::CommitmentKey< Curve > CommitmentKey
Curve::AffineElement Commitment
The recursive counterpart to the "native" Mega flavor.
typename Curve::Element Commitment
typename Curve::ScalarField FF
Class for all the oink rounds, which are shared between the folding prover and ultra prover.
void prove()
Oink Prover function that runs all the rounds of the verifier.
std::array< std::shared_ptr< VerifierInstance >, NUM_INSTANCES > VerifierInstances
typename Flavor::VerificationKey VerificationKey
static void create_function_circuit(Builder &builder, const size_t &log_num_gates=9, const size_t &log_num_gates_with_public_inputs=9)
Create a circuit with the specified number of arithmetic gates and arithmetic gates with public input...
static FoldingVerificationResult verify_folding_proof(const VerifierInstances &verification_keys, const HonkProof &folding_proof, bool hash_accumulator=false)
Verify a folding proof. Return the folded accumulator and the verifier transcript.
std::tuple< std::shared_ptr< ProverInstance >, std::shared_ptr< VerifierInstance > > FoldingData
static FoldingResult< Flavor > fold(const ProverInstances &prover_instances, const VerifierInstances &verification_keys, bool hash_accumulator=false, ExecutionTraceUsageTracker trace_usage_tracker=ExecutionTraceUsageTracker{})
Fold two prover instances. Return folded accumulator and folding proof.
ProtogalaxyVerifier_< VerifierInstance > FoldingVerifier
ProtogalaxyProver_< Flavor > FoldingProver
std::array< std::shared_ptr< ProverInstance >, NUM_INSTANCES > ProverInstances
std::tuple< ProverInstances, VerifierInstances > TupleOfKeys
static bool run_decider(const std::shared_ptr< ProverInstance > &prover_accumulator, const std::shared_ptr< VerifierInstance > &verifier_accumulator)
Run the decider on the given accumulator.
static void construct_instances_and_add_to_tuple(TupleOfKeys &keys, Builder &builder, size_t idx=0, TraceSettings trace_settings=TraceSettings{})
Construct Prover and Verifier instances for a provided circuit and add to tuple.
static FoldingData get_folding_data(const TupleOfKeys &keys, size_t idx)
Get folding data at index idx in the tuple of keys.
VerifierInstance_< Flavor > VerifierInstance
static std::pair< bool, std::string > compare_accumulators(const std::shared_ptr< VerifierInstance > &lhs, const std::shared_ptr< VerifierInstance > &rhs)
Compare two accumulators. Return the result of the comparison and error message.
static void construct_accumulator_and_add_to_tuple(TupleOfKeys &keys, size_t idx=0, TraceSettings trace_settings=TraceSettings{})
Construct Prover and Verifier accumulators and add to tuple.
ProverInstance_< Flavor > ProverInstance
A ProverInstance is normally constructed from a finalized circuit and it contains all the information...
static bool check(const Builder &circuit)
Check the witness satisifies the circuit.
The VerifierInstance encapsulates all the necessary information for a Mega Honk Verifier to verify a ...
static byte_array_ct hash(const byte_array_ct &input)
Definition blake3s.cpp:183
A simple wrapper around a vector of stdlib field elements representing a proof.
Definition proof.hpp:19
Represents a dynamic array of bytes in-circuit.
static field_ct hash(const std::vector< field_ct > &in, GeneratorContext context={})
Computes a pedersen hash of the provided inputs.
Definition pedersen.cpp:29
static void tamper_with_accumulator(const NativeFoldingData &accumulator, const AccumulatorTamperingMode &mode, bool expected)
Tamper with an accumulator by changing one of its values: wires, alphas, gate challenge,...
static RecursiveFoldingData create_recursive_folding_data(RecursiveBuilder &builder, const NativeVerifierInstances &verifier_instances)
Create a recursive verifier instances from native ones.
static void tamper_with_folding_proof(HonkProof &folding_proof, const ProofTamperingMode &mode)
Tamper with folding proof by changing either the first coefficient of the perturbator,...
static std::pair< std::shared_ptr< NativeVerifierInstance >, std::shared_ptr< RecursiveFoldingVerifier::Transcript > > create_folding_circuit(RecursiveBuilder &builder, const NativeVerifierInstances &verifier_instances, const HonkProof &folding_proof)
Create the circuit that verifies the folding proof. Return folded verifier accumulator and the verifi...
static void tamper_with_instance(const NativeFoldingData &instance, const InstanceTamperingMode &mode)
Tamper with an instance by changing its wire values.
static void create_function_circuit(NativeBuilder &builder, const size_t &log_num_gates=9, const size_t &log_num_gates_with_public_inputs=9)
Create a non-trivial arbitrary inner circuit, the proof of which will be recursively verified.
std::shared_ptr< VerifierInstance > verify_folding_proof(const stdlib::Proof< Builder > &)
Run the folding protocol on the verifier side to establish whether the public data of the new accumu...
The stdlib counterpart of VerifierInstance, used in recursive folding verification.
AluTraceBuilder builder
Definition alu.test.cpp:123
FF a
FF b
RNG & get_debug_randomness(bool reset, std::uint_fast64_t seed)
Definition engine.cpp:190
std::filesystem::path bb_crs_path()
void init_file_crs_factory(const std::filesystem::path &path)
TEST_F(BoomerangGoblinRecursiveVerifierTests, graph_description_basic)
Construct and check a goblin recursive verification circuit.
std::vector< fr > HonkProof
Definition proof.hpp:15
VerifierCommitmentKey< Curve > vk
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
field_t< CircuitBuilder > ScalarField
Definition bn254.hpp:33
byte_array< CircuitBuilder > byte_array_ct
Definition bn254.hpp:43
curve::BN254::ScalarField ScalarFieldNative
Definition bn254.hpp:24