Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
13#include "components_check.hpp"
14#include <iostream>
15
16int main(int argc, char* argv[])
17{
19
20 if (argc < 2) {
21 std::cerr << "Usage: acir_components_check <bytecode_path>\n";
22 return 1;
23 }
24
25 auto bytecode = get_bytecode(argv[1]);
26 auto parsed_program = acir_format::deserialize_msgpack_compact<Acir::ProgramWithoutBrillig>(
28 Acir::ProgramWithoutBrillig program_without_brillig;
29 try {
30 o.convert(program_without_brillig);
31 } catch (const msgpack::type_error&) {
32 std::cerr << o << std::endl;
33 bb::assert_failure("acir_components_check: failed to convert msgpack data to ProgramWithoutBrillig");
34 }
35 return program_without_brillig;
36 });
38 parsed_program.functions.size(), 1U, "acir_components_check: expected single function in ACIR program");
39
40 const auto& circuit = parsed_program.functions[0];
42
43 acir_format::AcirProgram program{ .constraints = constraints, .witness = {} };
44 auto builder = acir_format::create_circuit<CircuitBuilder>(program);
45
47 auto errors = checker.check();
48
49 for (const auto& err : errors) {
50 std::cerr << err.message << "\n";
51 }
52
53 return errors.empty() ? 0 : 1;
54}
#define BB_ASSERT_EQ(actual, expected,...)
Definition assert.hpp:83
Structural comparison between ACIR-level and circuit-level connected components.
std::vector< Error > check()
Run the full check. Returns list of errors (empty = pass).
TranslatorCircuitBuilder creates a circuit that evaluates the correctness of the evaluation of EccOpQ...
AluTraceBuilder builder
Definition alu.test.cpp:124
std::vector< uint8_t > bytecode
std::vector< uint8_t > get_bytecode(const std::string &bytecodePath)
AcirFormat circuit_serde_to_acir_format(Acir::Circuit const &circuit, bool is_mega)
Convert an Acir::Circuit into an AcirFormat by processing all the opcodes.
void assert_failure(std::string const &err)
Definition assert.cpp:11
UltraCircuitBuilder_< UltraExecutionTraceBlocks > UltraCircuitBuilder
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Struct containing both the constraints to be added to the circuit and the witness vector.