48template <
typename Flavor>
51 size_t public_inputs_size,
54 requires IsRecursiveFlavor<Flavor>
57 using NativeFlavor =
typename Flavor::NativeFlavor;
63 BB_ASSERT_EQ(proof_size, NativeFlavor::PROOF_LENGTH_WITHOUT_PUB_INPUTS());
65 size_t num_inner_public_inputs = public_inputs_size - IO::PUBLIC_INPUTS_SIZE;
66 uint32_t pub_inputs_offset = NativeFlavor::has_zero_row ? 1 : 0;
69 auto honk_vk = create_mock_honk_vk<typename Flavor::NativeFlavor, IO>(
75 for (
auto& vk_element : honk_vk->to_field_elements()) {
76 builder.set_variable(key_fields[
offset].witness_index, vk_element);
81 bb::HonkProof honk_proof = create_mock_honk_proof<typename Flavor::NativeFlavor, IO>(num_inner_public_inputs);
85 for (
auto& proof_element : honk_proof) {
86 builder.set_variable(proof_fields[
offset].witness_index, proof_element);
106template <
typename Flavor>
108 std::vector<fr>& place_holder_vk_fields,
111 bool has_valid_witness_assignments,
113 size_t public_inputs_size,
121 if (!has_valid_witness_assignments) {
124 size_t size_of_proof_with_no_pub_inputs = proof_size - IO::PUBLIC_INPUTS_SIZE;
125 size_t total_num_public_inputs = public_inputs_size + IO::PUBLIC_INPUTS_SIZE;
127 create_dummy_vkey_and_proof<Flavor>(
128 builder, size_of_proof_with_no_pub_inputs, total_num_public_inputs, vk_fields, proof_fields);
134 auto honk_vk = create_mock_honk_vk<typename Flavor::NativeFlavor, IO>(
136 place_holder_vk_fields = honk_vk->to_field_elements();
137 place_holder_proof = create_mock_honk_proof<typename Flavor::NativeFlavor, IO>(public_inputs_size);
138 place_holder_vk_hash = honk_vk->hash();
142 auto [place_holder_honk_proof, place_holder_vk] =
143 construct_honk_proof_for_simple_circuit<typename Flavor::NativeFlavor>(public_inputs_size);
144 place_holder_proof = place_holder_honk_proof;
145 place_holder_vk_fields = place_holder_vk->to_field_elements();
146 place_holder_vk_hash = place_holder_vk->hash();
161template <
typename Flavor>
164 requires(IsRecursiveFlavor<Flavor> && IsUltraHonk<typename Flavor::NativeFlavor>)
169 using RecursiveVKAndHash = Flavor::VKAndHash;
175 ASSERT(input.proof_type ==
HONK || input.proof_type ==
HONK_ZK || HasIPAAccumulator<Flavor>);
187 std::vector<uint32_t> proof_indices =
195 std::vector<fr> place_holder_vk_fields;
200 place_holder_proof_and_vk<Flavor>(
builder,
201 place_holder_vk_fields,
203 place_holder_vk_hash,
204 has_valid_witness_assignments,
206 input.public_inputs.size(),
210 if (!input.predicate.is_constant) {
214 result_proof.reserve(proof_fields.size());
215 result_vk.reserve(vk_fields.size());
217 for (uint32_t i = 0; i < proof_fields.size(); ++i) {
229 result_proof.push_back(valid_proof);
233 for (uint32_t i = 0; i < vk_fields.size(); ++i) {
240 result_vk.push_back(valid_vk);
244 proof_fields = result_proof;
245 vk_fields = result_vk;
251 RecursiveVerifier verifier(&
builder, vk_and_hash);
255 return verifier_output;
261 bool has_valid_witness_assignments);
266 bool has_valid_witness_assignments);
271 bool has_valid_witness_assignments);
276 bool has_valid_witness_assignments);
281 bool has_valid_witness_assignments);
#define BB_ASSERT_EQ(actual, expected,...)
#define ASSERT(expression,...)
The verification key is responsible for storing the commitments to the precomputed (non-witness) poly...
MegaCircuitBuilder CircuitBuilder
static constexpr size_t VIRTUAL_LOG_N
static constexpr bool has_zero_row
An object storing two bn254 points that represent the inputs to a pairing check.
The recursive counterpart to the "native" Ultra flavor.
The recursive counterpart to the "native" UltraRollupFlavor.
The recursive counterpart to the Ultra flavor with ZK.
A simple wrapper around a vector of stdlib field elements representing a proof.
Implements boolean logic in-circuit.
static bool_t from_witness_index_unsafe(Builder *ctx, uint32_t witness_index)
Create a bool_t from a witness index that is known to contain a constrained bool value.
static field_t from_witness_index(Builder *ctx, uint32_t witness_index)
static field_t conditional_assign(const bool_t< Builder > &predicate, const field_t &lhs, const field_t &rhs)
If predicate == true then return lhs, else return rhs.
void unset_free_witness_tag() const
Unset the free witness flag for the field element's tag.
bb::fr get_value() const
Given a := *this, compute its value given by a.v * a.mul + a.add.
static field_t from_witness(Builder *ctx, const bb::fr &input)
Manages the data that is propagated on the public inputs of an application/function circuit.
The data that is propagated on the public inputs of a rollup circuit.
Base class templates for structures that contain data parameterized by the fundamental polynomials of...
Entry point for Barretenberg command-line interface.
std::vector< fr > HonkProof
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
An object storing two EC points that represent the inputs to a pairing check.