28template <
typename Flavor,
typename IO>
31 requires(IsRecursiveFlavor<Flavor> && IsUltraHonk<typename Flavor::NativeFlavor>)
37 using RecursiveVKAndHash = Flavor::VKAndHash;
39 using NativeFlavor = Flavor::NativeFlavor;
40 using NativeVerificationKey = NativeFlavor::VerificationKey;
44 "create_honk_recursion_constraints: Only HONK, HONK_ZK, ROLLUP_HONK, ROOT_ROLLUP_HONK proof types are "
48 "create_honk_recursion_constraints: ROLLUP_HONK and ROOT_ROLLUP_HONK must be recursively verified "
49 "using an IO type with HasIPA=true.");
66 const auto [honk_proof_to_be_set,
68 if (
builder.is_write_vk_mode()) {
70 create_mock_honk_proof<NativeFlavor, StdlibIO>(input.public_inputs.size()),
71 create_mock_honk_vk<NativeFlavor, StdlibIO>(
72 1 << NativeFlavor::VIRTUAL_LOG_N,
73 input.public_inputs.size()));
76 return construct_arbitrary_valid_honk_proof_and_vk<NativeFlavor, StdlibIO>(
77 input.public_inputs.size());
81 if (
builder.is_write_vk_mode()) {
90 if (!predicate.is_constant()) {
98 for (
auto [vk_witness, vk_element] :
zip_view(vk_fields, honk_vk_to_be_set->to_field_elements())) {
104 for (
auto [proof_witness, proof_element] :
zip_view(proof_fields, honk_proof_to_be_set)) {
118 RecursiveVerifier verifier(vk_and_hash);
122 native_verification_debug<Flavor, IO>(vkey, vk_hash.
get_value(), proof_fields);
125 return verifier_output;
132template <
typename Flavor,
typename IO>
143 const bool vkey_and_hash_match = native_vkey->hash() == vkey_hash;
147 bool is_valid_proof = native_verifier.
verify_proof(native_proof).result;
149 info(
"===== HONK RECURSION CONSTRAINT DEBUG INFO =====");
151 if constexpr (IO::HasIPA) {
152 flavor =
"Ultra Flavor with IPA (Rollup)";
154 flavor =
"Ultra ZK Flavor";
156 flavor =
"Ultra Flavor";
158 info(
"Flavor used: ", flavor);
159 info(
"Honk recursion constraint: native vk hash matches witness vk hash: ", vkey_and_hash_match ?
"true" :
"false");
160 info(
"Honk recursion constraint: input proof verifies natively: ", is_valid_proof ?
"true" :
"false");
161 info(
"===== END OF HONK RECURSION CONSTRAINT DEBUG INFO =====");
165#define INSTANTIATE_HONK_RECURSION_CONSTRAINT(Flavor, IO) \
166 template HonkRecursionConstraintOutput<typename Flavor::CircuitBuilder> \
167 create_honk_recursion_constraints<Flavor, IO>(typename Flavor::CircuitBuilder & builder, \
168 const RecursionConstraint& input);
180#undef INSTANTIATE_HONK_RECURSION_CONSTRAINT
183#define INSTANTIATE_NATIVE_VERIFICATION_DEBUG(Flavor, IO) \
184 template void native_verification_debug<Flavor, IO>(const std::shared_ptr<typename Flavor::VerificationKey>, \
185 const typename Flavor::NativeFlavor::FF vkey_hash, \
186 const bb::stdlib::Proof<typename Flavor::CircuitBuilder>&);
198#undef INSTANTIATE_NATIVE_VERIFICATION_DEBUG
#define BB_ASSERT(expression,...)
#define BB_ASSERT_EQ(actual, expected,...)
Manages the data that is propagated on the public inputs of an application/function circuit.
ECCVMCircuitBuilder CircuitBuilder
The recursive counterpart to the "native" Ultra flavor.
Output verify_proof(const Proof &proof)
Perform ultra verification.
The recursive counterpart to UltraZKFlavor.
FixedVKAndHash_< PrecomputedEntities< Commitment >, FF, typename constraining::AvmHardCodedVKAndHash > VerificationKey
Verification key of the AVM. It is fixed and reconstructed from precomputed values.
static constexpr bool HasZK
A simple wrapper around a vector of stdlib field elements representing a proof.
HonkProof get_value() const
Implements boolean logic in-circuit.
static field_t from_witness_index(Builder *ctx, uint32_t witness_index)
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)
static field_t conditional_assign(const bool_t< Builder > &predicate, const field_t &lhs, const field_t &rhs)
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 shared across Honk flavors.
Entry point for Barretenberg command-line interface.
std::vector< fr > HonkProof
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Output type for recursive ultra verification.