Skip to content

Commit

Permalink
removed template param from honk::proof
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasxia01 committed Jan 13, 2024
1 parent 99bd01d commit 029350c
Show file tree
Hide file tree
Showing 28 changed files with 44 additions and 43 deletions.
4 changes: 2 additions & 2 deletions barretenberg/cpp/src/barretenberg/eccvm/eccvm_prover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,13 @@ template <ECCVMFlavor Flavor> void ECCVMProver_<Flavor>::execute_transcript_cons
translation_batching_challenge_v = transcript->get_challenge("Translation:batching_challenge");
}

template <ECCVMFlavor Flavor> honk::proof<typename Flavor::FF>& ECCVMProver_<Flavor>::export_proof()
template <ECCVMFlavor Flavor> honk::proof& ECCVMProver_<Flavor>::export_proof()
{
proof = transcript->export_proof();
return proof;
}

template <ECCVMFlavor Flavor> honk::proof<typename Flavor::FF>& ECCVMProver_<Flavor>::construct_proof()
template <ECCVMFlavor Flavor> honk::proof& ECCVMProver_<Flavor>::construct_proof()
{
execute_preamble_round();

Expand Down
6 changes: 3 additions & 3 deletions barretenberg/cpp/src/barretenberg/eccvm/eccvm_prover.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ template <ECCVMFlavor Flavor> class ECCVMProver_ {
BBERG_PROFILE void execute_final_pcs_round();
BBERG_PROFILE void execute_transcript_consistency_univariate_opening_round();

honk::proof<FF>& export_proof();
honk::proof<FF>& construct_proof();
honk::proof& export_proof();
honk::proof& construct_proof();

std::shared_ptr<Transcript> transcript;

Expand Down Expand Up @@ -80,7 +80,7 @@ template <ECCVMFlavor Flavor> class ECCVMProver_ {
using Shplonk = pcs::shplonk::ShplonkProver_<Curve>;

private:
honk::proof<FF> proof;
honk::proof proof;
};

extern template class ECCVMProver_<honk::flavor::ECCVM>;
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/src/barretenberg/eccvm/eccvm_verifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ template <typename Flavor> ECCVMVerifier_<Flavor>& ECCVMVerifier_<Flavor>::opera
* @brief This function verifies an ECCVM Honk proof for given program settings.
*
*/
template <typename Flavor> bool ECCVMVerifier_<Flavor>::verify_proof(const honk::proof<FF>& proof)
template <typename Flavor> bool ECCVMVerifier_<Flavor>::verify_proof(const honk::proof& proof)
{
using FF = typename Flavor::FF;
using GroupElement = typename Flavor::GroupElement;
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/src/barretenberg/eccvm/eccvm_verifier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ template <typename Flavor> class ECCVMVerifier_ {
ECCVMVerifier_& operator=(ECCVMVerifier_&& other) noexcept;
~ECCVMVerifier_() = default;

bool verify_proof(const honk::proof<FF>& proof);
bool verify_proof(const honk::proof& proof);

std::shared_ptr<VerificationKey> key;
std::map<std::string, Commitment> commitments;
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/src/barretenberg/flavor/ecc_vm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ template <typename CycleGroup_T, typename Curve_T, typename PCS_T> class ECCVMBa

Transcript() = default;

Transcript(const honk::proof<FF>& proof)
Transcript(const honk::proof& proof)
: BaseTranscript(proof)
{}

Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/src/barretenberg/flavor/goblin_ultra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ class GoblinUltra {

Transcript_() = default;

Transcript_(const honk::proof<FF>& proof)
Transcript_(const honk::proof& proof)
: BaseTranscript(proof)
{}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#pragma once
#include "barretenberg/ecc/curves/bn254/fr.hpp"
#include <vector>

namespace proof_system::honk {

template <typename FF> using proof = std::vector<FF>;
using proof = std::vector<barretenberg::fr>;

} // namespace proof_system::honk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MergeRecursiveVerifier_<CircuitBuilder>::MergeRecursiveVerifier_(CircuitBuilder*
*/
template <typename CircuitBuilder>
std::array<typename bn254<CircuitBuilder>::Element, 2> MergeRecursiveVerifier_<CircuitBuilder>::verify_proof(
const proof_system::honk::proof<NativeFF>& proof)
const proof_system::honk::proof& proof)
{
transcript = std::make_shared<Transcript>(builder, proof);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ template <typename CircuitBuilder> class MergeRecursiveVerifier_ {

explicit MergeRecursiveVerifier_(CircuitBuilder* builder);

PairingPoints verify_proof(const proof_system::honk::proof<NativeFF>& proof);
PairingPoints verify_proof(const proof_system::honk::proof& proof);
};

extern template class MergeRecursiveVerifier_<GoblinUltraCircuitBuilder>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ UltraRecursiveVerifier_<Flavor>::UltraRecursiveVerifier_(
*/
template <typename Flavor>
std::array<typename Flavor::GroupElement, 2> UltraRecursiveVerifier_<Flavor>::verify_proof(
const proof_system::honk::proof<NativeFF>& proof)
const proof_system::honk::proof& proof)
{
using Sumcheck = ::proof_system::honk::sumcheck::SumcheckVerifier<Flavor>;
using Curve = typename Flavor::Curve;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ template <typename Flavor> class UltraRecursiveVerifier_ {

// TODO(luke): Eventually this will return something like aggregation_state but I'm simplifying for now until we
// determine the exact interface. Simply returns the two pairing points.
PairingPoints verify_proof(const proof_system::honk::proof<NativeFF>& proof);
PairingPoints verify_proof(const proof_system::honk::proof& proof);

std::shared_ptr<VerificationKey> key;
std::map<std::string, Commitment> commitments;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class GoblinTranslatorComposer {
using CommitmentKey = typename Flavor::CommitmentKey;
using VerifierCommitmentKey = typename Flavor::VerifierCommitmentKey;
using Polynomial = typename Flavor::Polynomial;
using Transcript = BaseTranscript<Flavor::FF>;
using Transcript = BaseTranscript;
static constexpr size_t MINI_CIRCUIT_SIZE = Flavor::MINI_CIRCUIT_SIZE;

static constexpr std::string_view NAME_STRING = "GoblinTranslator";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ void GoblinTranslatorProver::execute_zeromorph_rounds()
prover_polynomials.get_concatenation_groups());
}

honk::proof<GoblinTranslatorProver::FF>& GoblinTranslatorProver::export_proof()
honk::proof& GoblinTranslatorProver::export_proof()
{
proof = transcript->export_proof();
return proof;
}

honk::proof<GoblinTranslatorProver::FF>& GoblinTranslatorProver::construct_proof()
honk::proof& GoblinTranslatorProver::construct_proof()
{
// Add circuit size public input size and public inputs to transcript.
execute_preamble_round();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class GoblinTranslatorProver {
BBERG_PROFILE void execute_grand_product_computation_round();
BBERG_PROFILE void execute_relation_check_rounds();
BBERG_PROFILE void execute_zeromorph_rounds();
honk::proof<FF>& export_proof();
honk::proof<FF>& construct_proof();
honk::proof& export_proof();
honk::proof& construct_proof();

std::shared_ptr<Transcript> transcript = std::make_shared<Transcript>();

Expand All @@ -54,7 +54,7 @@ class GoblinTranslatorProver {
sumcheck::SumcheckOutput<Flavor> sumcheck_output;

private:
honk::proof<FF> proof;
honk::proof proof;
};

} // namespace proof_system::honk
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void GoblinTranslatorVerifier::put_translation_data_in_relation_parameters(const
/**
* @brief This function verifies an GoblinTranslator Honk proof for given program settings.
*/
bool GoblinTranslatorVerifier::verify_proof(const honk::proof<FF>& proof)
bool GoblinTranslatorVerifier::verify_proof(const honk::proof& proof)
{
// batching_challenge_v = transcript->get_challenge("Translation:batching_challenge");
batching_challenge_v = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class GoblinTranslatorVerifier {
void put_translation_data_in_relation_parameters(const uint256_t& evaluation_input_x,
const BF& batching_challenge_v,
const uint256_t& accumulated_result);
bool verify_proof(const honk::proof<FF>& proof);
bool verify_proof(const honk::proof& proof);
bool verify_translation(const TranslationEvaluations& translation_evaluations);
};
} // namespace proof_system::honk
4 changes: 2 additions & 2 deletions barretenberg/cpp/src/barretenberg/ultra_honk/merge_prover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ MergeProver_<Flavor>::MergeProver_(const std::shared_ptr<CommitmentKey>& commitm
* for details (https://github.com/AztecProtocol/barretenberg/issues/746).
*
* @tparam Flavor
* @return honk::proof<FF>&
* @return honk::proof&
*/
template <typename Flavor> honk::proof<typename Flavor::FF>& MergeProver_<Flavor>::construct_proof()
template <typename Flavor> honk::proof& MergeProver_<Flavor>::construct_proof()
{
size_t N = op_queue->get_current_size();

Expand Down
4 changes: 2 additions & 2 deletions barretenberg/cpp/src/barretenberg/ultra_honk/merge_prover.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ template <typename Flavor> class MergeProver_ {
explicit MergeProver_(const std::shared_ptr<CommitmentKey>&,
const std::shared_ptr<ECCOpQueue>&,
const std::shared_ptr<Transcript>& transcript = std::make_shared<Transcript>());
BBERG_PROFILE honk::proof<FF>& construct_proof();
BBERG_PROFILE honk::proof& construct_proof();

private:
honk::proof<FF> proof;
honk::proof proof;
};

extern template class MergeProver_<honk::flavor::Ultra>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ MergeVerifier_<Flavor>::MergeVerifier_()
* queue has been constructed correctly via a simple Schwartz-Zippel check. Evaluations are checked via batched KZG.
*
* @tparam Flavor
* @return honk::proof<FF>&
* @return honk::proof&
*/
template <typename Flavor> bool MergeVerifier_<Flavor>::verify_proof(const honk::proof<FF>& proof)
template <typename Flavor> bool MergeVerifier_<Flavor>::verify_proof(const honk::proof& proof)
{
transcript = std::make_shared<Transcript>(proof);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ template <typename Flavor> class MergeVerifier_ {
std::shared_ptr<VerifierCommitmentKey> pcs_verification_key;

explicit MergeVerifier_();
bool verify_proof(const honk::proof<FF>& proof);
bool verify_proof(const honk::proof& proof);
};

extern template class MergeVerifier_<honk::flavor::Ultra>;
Expand Down
4 changes: 2 additions & 2 deletions barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ template <UltraFlavor Flavor> void UltraProver_<Flavor>::execute_zeromorph_round
transcript);
}

template <UltraFlavor Flavor> honk::proof<typename Flavor::FF>& UltraProver_<Flavor>::export_proof()
template <UltraFlavor Flavor> honk::proof& UltraProver_<Flavor>::export_proof()
{
proof = transcript->proof_data;
return proof;
}

template <UltraFlavor Flavor> honk::proof<typename Flavor::FF>& UltraProver_<Flavor>::construct_proof()
template <UltraFlavor Flavor> honk::proof& UltraProver_<Flavor>::construct_proof()
{
// Add circuit size public input size and public inputs to transcript->
execute_preamble_round();
Expand Down
6 changes: 3 additions & 3 deletions barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ template <UltraFlavor Flavor> class UltraProver_ {
BBERG_PROFILE void execute_relation_check_rounds();
BBERG_PROFILE void execute_zeromorph_rounds();

honk::proof<FF>& export_proof();
honk::proof<FF>& construct_proof();
honk::proof& export_proof();
honk::proof& construct_proof();

std::shared_ptr<Instance> instance;

Expand All @@ -55,7 +55,7 @@ template <UltraFlavor Flavor> class UltraProver_ {
using ZeroMorph = pcs::zeromorph::ZeroMorphProver_<Curve>;

private:
honk::proof<FF> proof;
honk::proof proof;
};

extern template class UltraProver_<honk::flavor::Ultra>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ template <typename Flavor> UltraVerifier_<Flavor>& UltraVerifier_<Flavor>::opera
* @brief This function verifies an Ultra Honk proof for a given Flavor.
*
*/
template <typename Flavor> bool UltraVerifier_<Flavor>::verify_proof(const honk::proof<FF>& proof)
template <typename Flavor> bool UltraVerifier_<Flavor>::verify_proof(const honk::proof& proof)
{
using FF = typename Flavor::FF;
using Commitment = typename Flavor::Commitment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ template <typename Flavor> class UltraVerifier_ {
UltraVerifier_& operator=(const UltraVerifier_& other) = delete;
UltraVerifier_& operator=(UltraVerifier_&& other);

bool verify_proof(const honk::proof<FF>& proof);
bool verify_proof(const honk::proof& proof);

std::shared_ptr<VerificationKey> key;
std::map<std::string, Commitment> commitments;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ void AvmMiniProver::execute_zeromorph_rounds()
transcript);
}

honk::proof<FF>& AvmMiniProver::export_proof()
honk::proof& AvmMiniProver::export_proof()
{
proof = transcript->proof_data;
return proof;
}

proof_system::honk::proof<FF>& AvmMiniProver::construct_proof()
proof_system::honk::proof& AvmMiniProver::construct_proof()
{
// Add circuit size public input size and public inputs to transcript.
execute_preamble_round();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class AvmMiniProver {
void execute_relation_check_rounds();
void execute_zeromorph_rounds();

honk::proof<FF>& export_proof();
honk::proof<FF>& construct_proof();
honk::proof& export_proof();
honk::proof& construct_proof();

std::shared_ptr<Transcript> transcript = std::make_shared<Transcript>();

Expand All @@ -56,7 +56,7 @@ class AvmMiniProver {
using ZeroMorph = pcs::zeromorph::ZeroMorphProver_<Curve>;

private:
honk::proof<FF> proof;
honk::proof proof;
};

} // namespace proof_system::honk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ AvmMiniVerifier& AvmMiniVerifier::operator=(AvmMiniVerifier&& other) noexcept
* @brief This function verifies an AvmMini Honk proof for given program settings.
*
*/
bool AvmMiniVerifier::verify_proof(const honk::proof<FF>& proof)
bool AvmMiniVerifier::verify_proof(const honk::proof& proof)
{
using Flavor = honk::flavor::AvmMiniFlavor;
using FF = Flavor::FF;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AvmMiniVerifier {
AvmMiniVerifier& operator=(const AvmMiniVerifier& other) = delete;
AvmMiniVerifier& operator=(AvmMiniVerifier&& other) noexcept;

bool verify_proof(const honk::proof<FF>& proof);
bool verify_proof(const honk::proof& proof);

std::shared_ptr<VerificationKey> key;
std::map<std::string, Commitment> commitments;
Expand Down

0 comments on commit 029350c

Please sign in to comment.