34 static constexpr size_t comm_frs = FrCodec::calc_num_fields<Commitment>();
35 static constexpr size_t eval_frs = FrCodec::calc_num_fields<FF>();
59 const size_t idx = translator_proof.size() - tail_size;
62 translator_proof[idx] = translator_proof[idx] + translator_proof[idx];
72 static constexpr size_t evals_after_op = 3;
73 const size_t op_eval_idx = eccvm_proof.size() - evals_after_op;
76 eccvm_proof[op_eval_idx] +=
FF(1);
94 auto t_current = goblin.
op_queue->construct_current_ultra_ops_subtable_columns();
95 auto T_prev = goblin.
op_queue->construct_previous_ultra_ops_table_columns();
103 if (outer_builder !=
nullptr) {
105 recursive_merge_commitments.t_commitments[idx] =
106 RecursiveCommitment::from_witness(outer_builder, merge_commitments.
t_commitments[idx]);
107 recursive_merge_commitments.T_prev_commitments[idx] =
108 RecursiveCommitment::from_witness(outer_builder, merge_commitments.
T_prev_commitments[idx]);
111 recursive_merge_commitments.t_commitments[idx].unset_free_witness_tag();
112 recursive_merge_commitments.T_prev_commitments[idx].unset_free_witness_tag();
117 return { goblin_proof, merge_commitments, recursive_merge_commitments };
127 auto [proof, merge_commitments, _] = create_goblin_prover_output();
135 bool pairing_verified = result.translator_pairing_points.check();
142 EXPECT_TRUE(pairing_verified && ipa_verified);
153 auto [proof, merge_commitments, recursive_merge_commitments] = create_goblin_prover_output(&
builder);
160 auto output = verifier.reduce_to_pairing_check_and_ipa_opening();
163 output.translator_pairing_points.aggregate(output.merge_pairing_points);
169 info(
"Recursive Verifier: num gates = ",
builder.num_gates());
178 auto verification_key =
181 OuterProver prover(prover_instance, verification_key);
182 OuterVerifier verifier(vk_and_hash);
183 auto proof = prover.construct_proof();
184 bool verified = verifier.verify_proof(proof).result;
186 ASSERT_TRUE(verified);
194 auto get_blocks = [](
size_t inner_size)
198 auto [proof, merge_commitments, recursive_merge_commitments] =
199 create_goblin_prover_output(&
builder, inner_size);
206 auto output = verifier.reduce_to_pairing_check_and_ipa_opening();
209 output.translator_pairing_points.aggregate(output.merge_pairing_points);
215 info(
"Recursive Verifier: num gates = ",
builder.num_gates());
219 auto outer_verification_key =
222 OuterProver prover(prover_instance, outer_verification_key);
223 OuterVerifier outer_verifier(vk_and_hash);
224 return {
builder.blocks, outer_verification_key };
227 auto [blocks_5, verification_key_5] = get_blocks(5);
228 auto [blocks_6, verification_key_6] = get_blocks(6);
230 compare_ultra_blocks_and_verification_keys<OuterFlavor>({ blocks_5, blocks_6 },
231 { verification_key_5, verification_key_6 });
243 auto [proof, merge_commitments, recursive_merge_commitments] = create_goblin_prover_output(&
builder);
246 for (
auto& val : proof.eccvm_proof) {
258 auto goblin_rec_verifier_output = verifier.reduce_to_pairing_check_and_ipa_opening();
269 EXPECT_FALSE(native_result);
278 auto [proof, merge_commitments, _] = create_goblin_prover_output();
282 MergeCommitments tampered_merge_commitments = merge_commitments;
283 tamper_with_op_commitment(tampered_merge_commitments);
286 RecursiveMergeCommitments recursive_merge_commitments;
288 recursive_merge_commitments.t_commitments[idx] =
289 RecursiveCommitment::from_witness(&
builder, tampered_merge_commitments.t_commitments[idx]);
290 recursive_merge_commitments.T_prev_commitments[idx] =
291 RecursiveCommitment::from_witness(&
builder, tampered_merge_commitments.T_prev_commitments[idx]);
292 recursive_merge_commitments.t_commitments[idx].fix_witness();
293 recursive_merge_commitments.T_prev_commitments[idx].fix_witness();
301 auto goblin_rec_verifier_output = verifier.reduce_to_pairing_check_and_ipa_opening();
304 goblin_rec_verifier_output.translator_pairing_points.aggregate(goblin_rec_verifier_output.merge_pairing_points);
311 goblin_rec_verifier_output.translator_pairing_points.P0.get_value(),
312 goblin_rec_verifier_output.translator_pairing_points.P1.get_value());
313 bool pairing_result = native_pairing_points.
check();
314 EXPECT_FALSE(pairing_result);
318 auto tampered_proof = proof;
319 tamper_with_libra_eval(tampered_proof.translator_proof);
323 RecursiveMergeCommitments recursive_merge_commitments;
325 recursive_merge_commitments.t_commitments[idx] =
326 RecursiveCommitment::from_witness(&
builder, merge_commitments.t_commitments[idx]);
327 recursive_merge_commitments.T_prev_commitments[idx] =
328 RecursiveCommitment::from_witness(&
builder, merge_commitments.T_prev_commitments[idx]);
329 recursive_merge_commitments.t_commitments[idx].fix_witness();
330 recursive_merge_commitments.T_prev_commitments[idx].fix_witness();
338 [[maybe_unused]]
auto goblin_rec_verifier_output = verifier.reduce_to_pairing_check_and_ipa_opening();
351 auto [proof, merge_commitments, recursive_merge_commitments] = create_goblin_prover_output(&
builder);
354 tamper_with_eccvm_op_eval(proof.eccvm_proof);
361 [[maybe_unused]]
auto goblin_rec_verifier_output = verifier.reduce_to_pairing_check_and_ipa_opening();
377 auto [proof, merge_commitments, recursive_merge_commitments] = create_goblin_prover_output(&
builder);
385 bool pairing_verified = native_result.translator_pairing_points.check();
389 EXPECT_TRUE(pairing_verified && ipa_verified);
392 MergeCommitments tampered_merge_commitments = merge_commitments;
393 tamper_with_op_commitment(tampered_merge_commitments);
397 RecursiveMergeCommitments tampered_recursive_merge_commitments;
399 tampered_recursive_merge_commitments.t_commitments[idx] =
400 RecursiveCommitment::from_witness(&
builder, tampered_merge_commitments.t_commitments[idx]);
401 tampered_recursive_merge_commitments.T_prev_commitments[idx] =
402 RecursiveCommitment::from_witness(&
builder, tampered_merge_commitments.T_prev_commitments[idx]);
403 tampered_recursive_merge_commitments.t_commitments[idx].fix_witness();
404 tampered_recursive_merge_commitments.T_prev_commitments[idx].fix_witness();
412 auto goblin_rec_verifier_output = verifier.reduce_to_pairing_check_and_ipa_opening();
415 goblin_rec_verifier_output.translator_pairing_points.aggregate(goblin_rec_verifier_output.merge_pairing_points);
422 goblin_rec_verifier_output.translator_pairing_points.P0.get_value(),
423 goblin_rec_verifier_output.translator_pairing_points.P1.get_value());
424 bool pairing_result = native_pairing_points.
check();
425 EXPECT_FALSE(pairing_result);
#define BB_DISABLE_ASSERTS()
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
CommitmentKey object over a pairing group 𝔾₁.
Commitment commit(PolynomialSpan< const Fr > polynomial) const
Uses the ProverSRS to create a commitment to p(X)
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
static constexpr size_t ECCVM_FIXED_SIZE
TranslatorFlavor::VerificationKey TranslatorVerificationKey
std::shared_ptr< OpQueue > op_queue
GoblinProof prove(const MergeSettings merge_settings=MergeSettings::PREPEND)
Constuct a full Goblin proof (ECCVM, Translator, merge)
ECCVMFlavor::VerificationKey ECCVMVerificationKey
static void construct_and_merge_mock_circuits(Goblin &goblin, const size_t num_circuits=3)
Unified Goblin verifier for both native and recursive verification.
ReductionResult reduce_to_pairing_check_and_ipa_opening()
Reduce Goblin proof to pairing check and IPA opening claim.
IPA (inner product argument) commitment scheme class.
static constexpr size_t NUM_WIRES
typename Curve::AffineElement Commitment
Unverified claim (C,r,v) for some witness polynomial p(X) such that.
auto get_native_opening_claim() const
An object storing two EC points that represent the inputs to a pairing check.
bool check() const
Perform the pairing check.
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 verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
Representation of the Grumpkin Verifier Commitment Key inside a bn254 circuit.
Manages the data that is propagated on the public inputs of an application/function circuit.
PairingInputs pairing_inputs
static ProverOutput create_goblin_prover_output(Builder *outer_builder=nullptr, const size_t num_circuits=5)
Create a goblin proof and the VM verification keys needed by the goblin recursive verifier.
bb::GoblinRecursiveVerifier::MergeVerifier::InputCommitments RecursiveMergeCommitments
static constexpr size_t eval_frs
MergeVerifier::Commitment Commitment
bb::GoblinRecursiveVerifier::MergeVerifier::Commitment RecursiveCommitment
static void SetUpTestSuite()
static constexpr size_t comm_frs
static void tamper_with_op_commitment(MergeCommitments &merge_commitments)
static void tamper_with_eccvm_op_eval(HonkProof &eccvm_proof)
static void tamper_with_libra_eval(HonkProof &translator_proof)
std::filesystem::path bb_crs_path()
void init_file_crs_factory(const std::filesystem::path &path)
std::shared_ptr< factories::CrsFactory< curve::Grumpkin > > get_grumpkin_crs_factory()
TEST_F(BoomerangGoblinRecursiveVerifierTests, graph_description_basic)
Construct and check a goblin recursive verification circuit.
std::vector< fr > HonkProof
BaseTranscript< stdlib::StdlibCodec< stdlib::field_t< UltraCircuitBuilder > >, stdlib::poseidon2< UltraCircuitBuilder > > UltraStdlibTranscript
UltraCircuitBuilder_< UltraExecutionTraceBlocks > UltraCircuitBuilder
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
PairingPoints translator_pairing_points
uint32_t set_public()
Set the witness indices for the limbs of the pairing points to public.
MergeCommitments merge_commitments
RecursiveMergeCommitments recursive_merge_commitments