Skip to content

Commit

Permalink
construct a merge verifier directly
Browse files Browse the repository at this point in the history
  • Loading branch information
ledwards2225 committed Dec 7, 2023
1 parent 94da6b4 commit 07bd3f3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions barretenberg/cpp/src/barretenberg/goblin/goblin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Goblin {
using TranslatorComposer = proof_system::honk::GoblinTranslatorComposer;
using RecursiveMergeVerifier =
proof_system::plonk::stdlib::recursion::goblin::MergeRecursiveVerifier_<GoblinUltraCircuitBuilder>;
using MergeVerifier = proof_system::honk::MergeVerifier_<proof_system::honk::flavor::GoblinUltra>;

std::shared_ptr<OpQueue> op_queue = std::make_shared<OpQueue>();

Expand Down Expand Up @@ -108,13 +109,13 @@ class Goblin {
translator_composer = std::make_unique<TranslatorComposer>();
auto translator_prover = translator_composer->create_prover(*translator_builder, eccvm_prover.transcript);
proof.translator_proof = translator_prover.construct_proof();

return proof;
};

bool verify(const Proof& proof)
{
GoblinUltraComposer composer;
auto merge_verifier = composer.create_merge_verifier();
MergeVerifier merge_verifier;
bool merge_verified = merge_verifier.verify_proof(proof.merge_proof);

auto eccvm_verifier = eccvm_composer->create_verifier(*eccvm_builder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ MergeVerifier_<Flavor>::MergeVerifier_(std::unique_ptr<VerifierCommitmentKey> ve
: transcript(transcript)
, pcs_verification_key(std::move(verification_key)){};

template <typename Flavor>
MergeVerifier_<Flavor>::MergeVerifier_()
: transcript(std::make_shared<Transcript>())
, pcs_verification_key(std::make_unique<VerifierCommitmentKey>(0, barretenberg::srs::get_crs_factory())){};

/**
* @brief Verify proper construction of the aggregate Goblin ECC op queue polynomials T_i^(j), j = 1,2,3,4.
* @details Let T_i^(j) be the jth column of the aggregate op queue after incorporating the contribution from the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "barretenberg/flavor/ultra.hpp"
#include "barretenberg/plonk/proof_system/types/proof.hpp"
#include "barretenberg/proof_system/op_queue/ecc_op_queue.hpp"
#include "barretenberg/srs/global_crs.hpp"
#include "barretenberg/transcript/transcript.hpp"

namespace proof_system::honk {
Expand Down Expand Up @@ -33,6 +34,7 @@ template <typename Flavor> class MergeVerifier_ {

explicit MergeVerifier_(std::unique_ptr<VerifierCommitmentKey> verification_key,
const std::shared_ptr<Transcript>& transcript);
explicit MergeVerifier_();
bool verify_proof(const plonk::proof& proof);
};

Expand Down

0 comments on commit 07bd3f3

Please sign in to comment.