Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: sync with bb namespace changes #40

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions bberg/src/circuit_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn get_params() -> &'static str {
r#"
const FF gamma = FF::random_element();
const FF beta = FF::random_element();
proof_system::RelationParameters<typename Flavor::FF> params{
bb::RelationParameters<typename Flavor::FF> params{
.eta = 0,
.beta = beta,
.gamma = gamma,
Expand Down Expand Up @@ -117,15 +117,15 @@ impl CircuitBuilder for BBFiles {
let circuit_hpp = format!("
{includes}

using namespace barretenberg;
using namespace bb;

namespace proof_system {{
namespace bb {{

{row_with_all_included};

class {name}CircuitBuilder {{
public:
using Flavor = proof_system::honk::flavor::{name}Flavor;
using Flavor = bb::honk::flavor::{name}Flavor;
using FF = Flavor::FF;
using Row = {name}FullRow<FF>;

Expand Down Expand Up @@ -204,7 +204,7 @@ fn get_lookup_check_closure() -> String {
const auto evaluate_logderivative = [&]<typename LogDerivativeSettings>(const std::string& lookup_name) {

// Check the logderivative relation
proof_system::honk::logderivative_library::compute_logderivative_inverse<
bb::honk::logderivative_library::compute_logderivative_inverse<
Flavor,
LogDerivativeSettings>(
polys, params, num_rows);
Expand Down
12 changes: 6 additions & 6 deletions bberg/src/composer_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl ComposerBuilder for BBFiles {
"
{include_str}

namespace proof_system::honk {{
namespace bb::honk {{

using Flavor = honk::flavor::{name}Flavor;
void {name}Composer::compute_witness(CircuitConstructor& circuit)
Expand Down Expand Up @@ -109,7 +109,7 @@ std::shared_ptr<Flavor::VerificationKey> {name}Composer::compute_verification_ke
"
{include_str}

namespace proof_system::honk {{
namespace bb::honk {{
class {name}Composer {{
public:
using Flavor = honk::flavor::{name}Flavor;
Expand All @@ -129,7 +129,7 @@ class {name}Composer {{
std::shared_ptr<VerificationKey> verification_key;

// The crs_factory holds the path to the srs and exposes methods to extract the srs elements
std::shared_ptr<barretenberg::srs::factories::CrsFactory<Flavor::Curve>> crs_factory_;
std::shared_ptr<bb::srs::factories::CrsFactory<Flavor::Curve>> crs_factory_;

// The commitment key is passed to the prover but also used herein to compute the verfication key commitments
std::shared_ptr<CommitmentKey> commitment_key;
Expand All @@ -140,7 +140,7 @@ class {name}Composer {{

{name}Composer()
{{
crs_factory_ = barretenberg::srs::get_crs_factory();
crs_factory_ = bb::srs::get_crs_factory();
}}

{name}Composer(std::shared_ptr<ProvingKey> p_key, std::shared_ptr<VerificationKey> v_key)
Expand All @@ -162,15 +162,15 @@ class {name}Composer {{
{name}Prover create_prover(CircuitConstructor& circuit_constructor);
{name}Verifier create_verifier(CircuitConstructor& circuit_constructor);

void add_table_column_selector_poly_to_proving_key(barretenberg::polynomial& small, const std::string& tag);
void add_table_column_selector_poly_to_proving_key(bb::polynomial& small, const std::string& tag);

void compute_commitment_key(size_t circuit_size)
{{
commitment_key = std::make_shared<CommitmentKey>(circuit_size, crs_factory_);
}};
}};

}} // namespace proof_system::honk
}} // namespace bb::honk
"
);

Expand Down
12 changes: 6 additions & 6 deletions bberg/src/flavor_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl FlavorBuilder for BBFiles {
"
{includes}

namespace proof_system::honk::flavor {{
namespace bb::honk::flavor {{

class {name}Flavor {{
public:
Expand Down Expand Up @@ -101,7 +101,7 @@ class {name}Flavor {{
{transcript}
}};

}} // namespace proof_system::honk
}} // namespace bb::honk


"
Expand Down Expand Up @@ -165,7 +165,7 @@ fn create_class_aliases() -> &'static str {
using PCS = pcs::kzg::KZG<Curve>;

using FF = G1::subgroup_field;
using Polynomial = barretenberg::Polynomial<FF>;
using Polynomial = bb::Polynomial<FF>;
using PolynomialHandle = std::span<FF>;
using GroupElement = G1::element;
using Commitment = G1::affine_element;
Expand Down Expand Up @@ -408,7 +408,7 @@ fn create_polynomial_views(first_poly: &String) -> String {
* @details During folding and sumcheck, the prover evaluates the relations on these univariates.
*/
template <size_t LENGTH>
using ProverUnivariates = AllEntities<barretenberg::Univariate<FF, LENGTH>>;
using ProverUnivariates = AllEntities<bb::Univariate<FF, LENGTH>>;

/**
* @brief A container for univariates produced during the hot loop in sumcheck.
Expand Down Expand Up @@ -507,7 +507,7 @@ fn generate_transcript(witness: &[String]) -> String {

{declarations}

std::vector<barretenberg::Univariate<FF, BATCHED_RELATION_PARTIAL_LENGTH>> sumcheck_univariates;
std::vector<bb::Univariate<FF, BATCHED_RELATION_PARTIAL_LENGTH>> sumcheck_univariates;
std::array<FF, NUM_ALL_ENTITIES> sumcheck_evaluations;
std::vector<Commitment> zm_cq_comms;
Commitment zm_cq_comm;
Expand All @@ -529,7 +529,7 @@ fn generate_transcript(witness: &[String]) -> String {

for (size_t i = 0; i < log_n; ++i) {{
sumcheck_univariates.emplace_back(
deserialize_from_buffer<barretenberg::Univariate<FF, BATCHED_RELATION_PARTIAL_LENGTH>>(
deserialize_from_buffer<bb::Univariate<FF, BATCHED_RELATION_PARTIAL_LENGTH>>(
Transcript::proof_data, num_bytes_read));
}}
sumcheck_evaluations = deserialize_from_buffer<std::array<FF, NUM_ALL_ENTITIES>>(
Expand Down
2 changes: 1 addition & 1 deletion bberg/src/lookup_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ fn create_lookup_settings_file(lookup: &Lookup) -> String {
"
{lookup_settings_includes}

namespace proof_system::honk::sumcheck {{
namespace bb::honk::sumcheck {{

/**
* @brief This class contains an example of how to set LookupSettings classes used by the
Expand Down
2 changes: 1 addition & 1 deletion bberg/src/permutation_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ fn create_permutation_settings_file(permutation: &Permutation) -> String {
"
{permutation_settings_includes}

namespace proof_system::honk::sumcheck {{
namespace bb::honk::sumcheck {{

class {permutation_name}_permutation_settings {{
public:
Expand Down
18 changes: 9 additions & 9 deletions bberg/src/prover_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ impl ProverBuilder for BBFiles {
let include_str = includes_hpp(name);
let prover_hpp = format!("
{include_str}
namespace proof_system::honk {{
namespace bb::honk {{

class {name}Prover {{

Expand Down Expand Up @@ -41,7 +41,7 @@ impl ProverBuilder for BBFiles {

std::vector<FF> public_inputs;

proof_system::RelationParameters<FF> relation_parameters;
bb::RelationParameters<FF> relation_parameters;

std::shared_ptr<ProvingKey> key;

Expand All @@ -62,7 +62,7 @@ impl ProverBuilder for BBFiles {
plonk::proof proof;
}};

}} // namespace proof_system::honk
}} // namespace bb::honk

");
self.write_file(&self.prover, &format!("{}_prover.hpp", name), &prover_hpp);
Expand All @@ -74,7 +74,7 @@ impl ProverBuilder for BBFiles {
let prover_cpp = format!("
{include_str}

namespace proof_system::honk {{
namespace bb::honk {{

using Flavor = honk::flavor::{name}Flavor;

Expand All @@ -92,13 +92,13 @@ impl ProverBuilder for BBFiles {
, commitment_key(commitment_key)
{{
for (auto [prover_poly, key_poly] : zip_view(prover_polynomials.get_unshifted(), key->get_all())) {{
ASSERT(proof_system::flavor_get_label(prover_polynomials, prover_poly) ==
proof_system::flavor_get_label(*key, key_poly));
ASSERT(bb::flavor_get_label(prover_polynomials, prover_poly) ==
bb::flavor_get_label(*key, key_poly));
prover_poly = key_poly.share();
}}
for (auto [prover_poly, key_poly] : zip_view(prover_polynomials.get_shifted(), key->get_to_be_shifted())) {{
ASSERT(proof_system::flavor_get_label(prover_polynomials, prover_poly) ==
proof_system::flavor_get_label(*key, key_poly) + \"_shift\");
ASSERT(bb::flavor_get_label(prover_polynomials, prover_poly) ==
bb::flavor_get_label(*key, key_poly) + \"_shift\");
prover_poly = key_poly.shifted();
}}
}}
Expand Down Expand Up @@ -201,7 +201,7 @@ impl ProverBuilder for BBFiles {
return export_proof();
}}

}} // namespace proof_system::honk
}} // namespace bb::honk


");
Expand Down
2 changes: 1 addition & 1 deletion bberg/src/relation_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl RelationBuilder for BBFiles {

let relations = format!(
"{includes}
namespace proof_system::{root_name}_vm {{
namespace bb::{root_name}_vm {{

{row_type};

Expand Down
12 changes: 6 additions & 6 deletions bberg/src/verifier_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ impl VerifierBuilder for BBFiles {
let ver_cpp = format!("
{include_str}

using namespace barretenberg;
using namespace proof_system::honk::sumcheck;
using namespace bb;
using namespace bb::honk::sumcheck;

namespace proof_system::honk {{
namespace bb::honk {{
{name}Verifier::{name}Verifier(std::shared_ptr<Flavor::VerificationKey> verifier_key)
: key(verifier_key)
{{}}
Expand Down Expand Up @@ -106,7 +106,7 @@ impl VerifierBuilder for BBFiles {
}}


}} // namespace proof_system::honk
}} // namespace bb::honk


");
Expand All @@ -120,7 +120,7 @@ impl VerifierBuilder for BBFiles {
"
{include_str}

namespace proof_system::honk {{
namespace bb::honk {{
class {name}Verifier {{
using Flavor = honk::flavor::{name}Flavor;
using FF = Flavor::FF;
Expand All @@ -145,7 +145,7 @@ impl VerifierBuilder for BBFiles {
std::shared_ptr<Transcript> transcript;
}};

}} // namespace proof_system::honk
}} // namespace bb::honk


"
Expand Down
Loading