33 static constexpr size_t comm_frs = FrCodec::calc_num_fields<Commitment>();
34 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) {
106 RecursiveCommitment::from_witness(outer_builder, merge_commitments.
t_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();
117 return { goblin_proof,
120 recursive_merge_commitments };
130 auto [proof, verifier_input, merge_commitments, _] = create_goblin_prover_output();
145 auto [proof, verifier_input, merge_commitments, recursive_merge_commitments] =
146 create_goblin_prover_output(&
builder);
155 info(
"Recursive Verifier: num gates = ",
builder.num_gates());
164 auto verification_key =
166 OuterProver prover(prover_instance, verification_key);
167 OuterVerifier verifier(verification_key);
168 auto proof = prover.construct_proof();
169 bool verified = verifier.template verify_proof<bb::DefaultIO>(proof).result;
171 ASSERT_TRUE(verified);
179 auto get_blocks = [](
size_t inner_size)
183 auto [proof, verifier_input, merge_commitments, recursive_merge_commitments] =
184 create_goblin_prover_output(&
builder, inner_size);
194 info(
"Recursive Verifier: num gates = ",
builder.num_gates());
198 auto outer_verification_key =
200 OuterProver prover(prover_instance, outer_verification_key);
201 OuterVerifier outer_verifier(outer_verification_key);
202 return {
builder.blocks, outer_verification_key };
205 auto [blocks_5, verification_key_5] = get_blocks(5);
206 auto [blocks_6, verification_key_6] = get_blocks(6);
208 compare_ultra_blocks_and_verification_keys<OuterFlavor>({ blocks_5, blocks_6 },
209 { verification_key_5, verification_key_6 });
221 auto [proof, verifier_input, merge_commitments, recursive_merge_commitments] =
222 create_goblin_prover_output(&
builder);
225 for (
auto& val : proof.eccvm_proof) {
244 EXPECT_FALSE(native_result);
253 auto [proof, verifier_input, merge_commitments, _] = create_goblin_prover_output();
257 MergeCommitments tampered_merge_commitments = merge_commitments;
258 tamper_with_op_commitment(tampered_merge_commitments);
261 RecursiveMergeCommitments recursive_merge_commitments;
263 recursive_merge_commitments.t_commitments[idx] =
264 RecursiveCommitment::from_witness(&
builder, tampered_merge_commitments.t_commitments[idx]);
265 recursive_merge_commitments.T_prev_commitments[idx] =
266 RecursiveCommitment::from_witness(&
builder, tampered_merge_commitments.T_prev_commitments[idx]);
267 recursive_merge_commitments.t_commitments[idx].fix_witness();
268 recursive_merge_commitments.T_prev_commitments[idx].fix_witness();
279 goblin_rec_verifier_output.points_accumulator.P0.get_value(),
280 goblin_rec_verifier_output.points_accumulator.P1.get_value());
281 bool pairing_result = native_pairing_points.
check();
282 EXPECT_FALSE(pairing_result);
286 auto tampered_proof = proof;
287 tamper_with_libra_eval(tampered_proof.translator_proof);
291 RecursiveMergeCommitments recursive_merge_commitments;
293 recursive_merge_commitments.t_commitments[idx] =
294 RecursiveCommitment::from_witness(&
builder, merge_commitments.t_commitments[idx]);
295 recursive_merge_commitments.T_prev_commitments[idx] =
296 RecursiveCommitment::from_witness(&
builder, merge_commitments.T_prev_commitments[idx]);
297 recursive_merge_commitments.t_commitments[idx].fix_witness();
298 recursive_merge_commitments.T_prev_commitments[idx].fix_witness();
302 [[maybe_unused]]
auto goblin_rec_verifier_output =
316 auto [proof, verifier_input, merge_commitments, recursive_merge_commitments] =
317 create_goblin_prover_output(&
builder);
320 tamper_with_eccvm_op_eval(proof.eccvm_proof);
323 [[maybe_unused]]
auto goblin_rec_verifier_output =
340 auto [proof, verifier_input, merge_commitments, recursive_merge_commitments] =
341 create_goblin_prover_output(&
builder);
349 MergeCommitments tampered_merge_commitments = merge_commitments;
350 tamper_with_op_commitment(tampered_merge_commitments);
354 RecursiveMergeCommitments tampered_recursive_merge_commitments;
356 tampered_recursive_merge_commitments.t_commitments[idx] =
357 RecursiveCommitment::from_witness(&
builder, tampered_merge_commitments.t_commitments[idx]);
358 tampered_recursive_merge_commitments.T_prev_commitments[idx] =
359 RecursiveCommitment::from_witness(&
builder, tampered_merge_commitments.T_prev_commitments[idx]);
360 tampered_recursive_merge_commitments.t_commitments[idx].fix_witness();
361 tampered_recursive_merge_commitments.T_prev_commitments[idx].fix_witness();
365 auto goblin_rec_verifier_output =
373 goblin_rec_verifier_output.points_accumulator.P0.get_value(),
374 goblin_rec_verifier_output.points_accumulator.P1.get_value());
375 bool pairing_result = native_pairing_points.
check();
376 EXPECT_FALSE(pairing_result);
#define BB_DISABLE_ASSERTS()
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 bool verify(const GoblinProof &proof, const MergeCommitments &merge_commitments, const std::shared_ptr< Transcript > &transcript, const MergeSettings merge_settings=MergeSettings::PREPEND)
Verify a full Goblin proof (ECCVM, Translator, merge)
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)
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.
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
UltraCircuitBuilder Builder
GoblinRecursiveVerifierOutput verify(const GoblinProof &, const MergeCommitments &merge_commitments, const MergeSettings merge_settings=MergeSettings::PREPEND)
Creates a circuit that executes the ECCVM, Translator and Merge verifiers.
GoblinRecursiveVerifier::MergeVerifier::Commitment RecursiveCommitment
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.
static constexpr size_t eval_frs
MergeVerifier::Commitment Commitment
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
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
uint32_t set_public()
Set the witness indices for the limbs of the pairing points to public.
OpeningClaim< Curve > opening_claim
stdlib::Proof< Builder > ipa_proof
PairingAccumulator points_accumulator
Goblin::VerificationKey verifier_input
MergeCommitments merge_commitments
RecursiveMergeCommitments recursive_merge_commitments