2#include "./mock/mock_circuit.hpp"
3#include "barretenberg/ecc/curves/bn254/fq12.hpp"
4#include "barretenberg/ecc/curves/bn254/pairing.hpp"
5#include "barretenberg/stdlib/recursion/aggregation_state/aggregation_state.hpp"
6#include "barretenberg/stdlib/recursion/verifier/verifier.hpp"
8namespace join_split_example {
13 : logic_verified(
false)
19 std::vector<fr> public_inputs;
22 std::vector<uint8_t> proof_data;
24 std::shared_ptr<plonk::verification_key> verification_key;
25 size_t number_of_gates;
28template <
typename Composer>
30 std::shared_ptr<barretenberg::srs::factories::VerifierCrs>
const& srs)
38 barretenberg::pairing::reduced_ate_pairing_batch_precomputed(P, srs->get_precomputed_g2_lines(), 2);
39 return inner_proof_result == barretenberg::fq12::one();
42template <
typename Builder,
typename Tx,
typename CircuitData,
typename F>
43auto verify_logic_internal(
Builder& builder, Tx& tx, CircuitData
const& cd,
char const* name, F
const& build_circuit)
45 info(name,
": Building circuit...");
47 auto result = build_circuit(builder, tx, cd);
48 info(name,
": Circuit built in ", timer.
toString(),
"s");
50 if (builder.failed()) {
51 info(name,
": Circuit logic failed: " + builder.err());
52 result.err = builder.err();
57 info(name,
": Srs not provided.");
61 if (!pairing_check(result.aggregation_state, cd.srs->get_verifier_crs())) {
62 info(name,
": Native pairing check failed.");
66 result.public_inputs = builder.get_public_inputs();
67 result.logic_verified =
true;
Get the execution between a block of code.
Definition: timer.hpp:12
std::string toString() const
Return the number of seconds elapsed since the start of the timer as a string.
Definition: timer.hpp:80
Definition: field12.hpp:5
Definition: affine_element.hpp:11
Definition: ultra_circuit_builder.hpp:31
size_t get_num_gates() const override
Get the final number of gates in a circuit, which consists of the sum of: 1) Current number number of...
Definition: ultra_circuit_builder.hpp:888
Definition: verify.hpp:11
Definition: aggregation_state.hpp:15