Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
api_chonk.hpp
Go to the documentation of this file.
1#pragma once
3#include <filesystem>
4#include <stdexcept>
5#include <string>
6#include <vector>
7
8namespace bb {
9
10class ChonkAPI : public API {
11
12 public:
13 void prove(const Flags& flags, const std::filesystem::path& input_path, const std::filesystem::path& output_dir);
14
15 bool verify(const Flags& flags,
16 const std::filesystem::path& public_inputs_path,
17 const std::filesystem::path& proof_path,
18 const std::filesystem::path& vk_path) override;
19
20 bool prove_and_verify(const std::filesystem::path& input_path);
21
22 void gates(const Flags& flags, const std::filesystem::path& bytecode_path) override;
23
24 void write_solidity_verifier(const Flags& flags,
25 const std::filesystem::path& output_path,
26 const std::filesystem::path& vk_path) override;
27
28 // Two modes:
29 // - write a vk for a standalone circuit
30 // - write the vk of the Hiding kernel which requires the last circuit input (e.g. a private-tail in Aztec) to be
31 // passed. This is used just to parameterize the Hiding kernel with the last circuit public inputs amount.
32 void write_vk(const Flags& flags,
33 const std::filesystem::path& bytecode_path,
34 const std::filesystem::path& output_path) override;
35
36 bool check_precomputed_vks(const Flags& flags, const std::filesystem::path& input_path);
37 bool check(const Flags& flags,
38 const std::filesystem::path& bytecode_path,
39 const std::filesystem::path& witness_path) override;
40};
41
42void chonk_gate_count(const std::string& bytecode_path, bool include_gates_per_opcode);
43
44std::vector<uint8_t> decompress(const void* bytes, size_t size);
45
46} // namespace bb
Definition api.hpp:7
bool prove_and_verify(const std::filesystem::path &input_path)
bool verify(const Flags &flags, const std::filesystem::path &public_inputs_path, const std::filesystem::path &proof_path, const std::filesystem::path &vk_path) override
void write_vk(const Flags &flags, const std::filesystem::path &bytecode_path, const std::filesystem::path &output_path) override
void prove(const Flags &flags, const std::filesystem::path &input_path, const std::filesystem::path &output_dir)
Definition api_chonk.cpp:58
bool check(const Flags &flags, const std::filesystem::path &bytecode_path, const std::filesystem::path &witness_path) override
void gates(const Flags &flags, const std::filesystem::path &bytecode_path) override
bool check_precomputed_vks(const Flags &flags, const std::filesystem::path &input_path)
void write_solidity_verifier(const Flags &flags, const std::filesystem::path &output_path, const std::filesystem::path &vk_path) override
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
void chonk_gate_count(const std::string &bytecode_path, bool include_gates_per_opcode)
std::vector< uint8_t > decompress(const void *bytes, size_t size)