14 std::filesystem::create_directories(path);
16 auto g1_path = path /
"grumpkin_g1.flat.dat";
17 auto lock_path = path /
"crs.lock";
23 if (g1_downloaded_points >= num_points) {
24 vinfo(
"using cached grumpkin crs with num points ", g1_downloaded_points,
" at: ", g1_path);
27 for (uint32_t i = 0; i < num_points; ++i) {
30 if (points[0].on_curve()) {
35 if (!allow_download && g1_downloaded_points == 0) {
36 throw_or_abort(
"grumpkin g1 data not found and generation not allowed in this context");
37 }
else if (!allow_download) {
42 " were requested but generation not allowed in this context"));
45 vinfo(
"generating grumpkin crs...");
typename Group::affine_element AffineElement
std::string format(Args... args)
const std::vector< FF > data
std::vector< grumpkin::g1::affine_element > generate_grumpkin_srs(size_t num_points)
Generates a monomial basis Grumpkin SRS on-the-fly.
Entry point for Barretenberg command-line interface.
std::vector< curve::Grumpkin::AffineElement > get_grumpkin_g1_data(const std::filesystem::path &path, size_t num_points, bool allow_download)
std::vector< uint8_t > read_file(const std::string &filename, size_t bytes=0)
void write_file(const std::string &filename, std::vector< uint8_t > const &data)
size_t get_file_size(std::string const &filename)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
std::vector< uint8_t > to_buffer(T const &value)
void throw_or_abort(std::string const &err)