Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
translator_circuit_checker.hpp
Go to the documentation of this file.
1#pragma once
3namespace bb {
5 using Fr = bb::fr;
6 using Fq = bb::fq;
9
10 // Number of limbs used to decompose a 254-bit value for modular arithmetic
12
13 static constexpr size_t RESULT_ROW = Builder::RESULT_ROW;
14
15 public:
24
29 static Fq get_computation_result(const Builder& circuit)
30 {
32 return Fq(
33 circuit.get_variable(circuit.wires[WireIds::ACCUMULATORS_BINARY_LIMBS_0][RESULT_ROW]) +
34 circuit.get_variable(circuit.wires[WireIds::ACCUMULATORS_BINARY_LIMBS_1][RESULT_ROW]) * Builder::SHIFT_1 +
35 circuit.get_variable(circuit.wires[WireIds::ACCUMULATORS_BINARY_LIMBS_2][RESULT_ROW]) * Builder::SHIFT_2 +
36 circuit.get_variable(circuit.wires[WireIds::ACCUMULATORS_BINARY_LIMBS_3][RESULT_ROW]) * Builder::SHIFT_3);
37 }
38
47 static RelationInputs compute_relation_inputs_limbs(const Fq& batching_challenge_v, const Fq& evaluation_input_x);
48
58 static bool check(const Builder& circuit);
59};
60} // namespace bb
#define BB_ASSERT_GT(left, right,...)
Definition assert.hpp:113
FF get_variable(const uint32_t index) const
Get the value of the variable v_{index}.
TranslatorCircuitBuilder creates a circuit that evaluates the correctness of the evaluation of EccOpQ...
WireIds
There are so many wires that naming them has no sense, it is easier to access them with enums.
std::array< std::vector< uint32_t >, NUM_WIRES > wires
static RelationInputs compute_relation_inputs_limbs(const Fq &batching_challenge_v, const Fq &evaluation_input_x)
Create limb representations of x and powers of v that are needed to compute the witness or check circ...
static Fq get_computation_result(const Builder &circuit)
Get the result of accumulation, stored as 4 binary limbs in the first row of the circuit.
static bool check(const Builder &circuit)
Check the witness satisifies the circuit.
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
field< Bn254FqParams > fq
Definition fq.hpp:153
field< Bn254FrParams > fr
Definition fr.hpp:155
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13