Skip to content

Commit

Permalink
hacky fix
Browse files Browse the repository at this point in the history
  • Loading branch information
codygunton committed Sep 11, 2024
1 parent 90d28b3 commit 6998193
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions barretenberg/cpp/src/barretenberg/bb/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,15 @@ std::string getHomeDir()
}

std::string CRS_PATH = getHomeDir() + "/.bb-crs";

const std::filesystem::path current_path = std::filesystem::current_path();
const auto current_dir = current_path.filename().string();

static constexpr size_t CRS_MINIMUM_SIZE = 128;
size_t size_or_min(const size_t in)
{
return in > CRS_MINIMUM_SIZE ? in : CRS_MINIMUM_SIZE;
}

/**
* @brief Initialize the global crs_factory for bn254 based on a known dyadic circuit size
*
Expand Down Expand Up @@ -195,7 +200,7 @@ bool proveAndVerifyHonkAcirFormat(acir_format::AcirFormat constraint_system, aci

auto num_extra_gates = builder.get_num_gates_added_to_ensure_nonzero_polynomials();
size_t srs_size = builder.get_circuit_subgroup_size(builder.get_total_circuit_size() + num_extra_gates);
init_bn254_crs(srs_size);
init_bn254_crs(size_or_min(srs_size));

// Construct Honk proof
Prover prover{ builder };
Expand Down Expand Up @@ -1059,7 +1064,7 @@ UltraProver_<Flavor> compute_valid_prover(const std::string& bytecodePath, const

auto num_extra_gates = builder.get_num_gates_added_to_ensure_nonzero_polynomials();
size_t srs_size = builder.get_circuit_subgroup_size(builder.get_total_circuit_size() + num_extra_gates);
init_bn254_crs(srs_size);
init_bn254_crs(size_or_min(srs_size));

Prover prover{ builder };
return prover;
Expand Down Expand Up @@ -1296,7 +1301,7 @@ void prove_honk_output_all(const std::string& bytecodePath,

auto num_extra_gates = builder.get_num_gates_added_to_ensure_nonzero_polynomials();
size_t srs_size = builder.get_circuit_subgroup_size(builder.get_total_circuit_size() + num_extra_gates);
init_bn254_crs(srs_size);
init_bn254_crs(size_or_min(srs_size));

// Construct Honk proof
Prover prover{ builder };
Expand Down

0 comments on commit 6998193

Please sign in to comment.