@@ -212,6 +212,14 @@ void build_constraints(Builder& builder,
212
212
gate_counter.track_diff (constraint_system.gates_per_opcode ,
213
213
constraint_system.original_opcode_indices .bigint_to_le_bytes_constraints .at (i));
214
214
}
215
+ // assert equals
216
+ for (size_t i = 0 ; i < constraint_system.assert_equalities .size (); ++i) {
217
+ const auto & constraint = constraint_system.assert_equalities .at (i);
218
+
219
+ builder.assert_equal (constraint.a , constraint.b );
220
+ gate_counter.track_diff (constraint_system.gates_per_opcode ,
221
+ constraint_system.original_opcode_indices .assert_equalities .at (i));
222
+ }
215
223
216
224
// RecursionConstraints
217
225
// TODO(https://github.com/AztecProtocol/barretenberg/issues/817): disable these for MegaHonk for now since we're
@@ -227,10 +235,11 @@ void build_constraints(Builder& builder,
227
235
process_plonk_recursion_constraints (builder, constraint_system, has_valid_witness_assignments, gate_counter);
228
236
process_honk_recursion_constraints (builder, constraint_system, has_valid_witness_assignments, gate_counter);
229
237
230
- // If the circuit does not itself contain honk recursion constraints but is going to be proven with honk then
231
- // recursively verified, add a default aggregation object
238
+ // If the circuit does not itself contain honk recursion constraints but is going to be
239
+ // proven with honk then recursively verified, add a default aggregation object
232
240
if (constraint_system.honk_recursion_constraints .empty () && honk_recursion &&
233
- builder.is_recursive_circuit ) { // Set a default aggregation object if we don't have one.
241
+ builder.is_recursive_circuit ) { // Set a default aggregation object if we don't have
242
+ // one.
234
243
AggregationObjectIndices current_aggregation_object =
235
244
stdlib::recursion::init_default_agg_obj_indices<Builder>(builder);
236
245
// Make sure the verification key records the public input indices of the
@@ -265,31 +274,34 @@ void process_plonk_recursion_constraints(Builder& builder,
265
274
for (size_t constraint_idx = 0 ; constraint_idx < constraint_system.recursion_constraints .size (); ++constraint_idx) {
266
275
auto constraint = constraint_system.recursion_constraints [constraint_idx];
267
276
268
- // A proof passed into the constraint should be stripped of its public inputs, except in the case where a
269
- // proof contains an aggregation object itself. We refer to this as the `nested_aggregation_object`. The
270
- // verifier circuit requires that the indices to a nested proof aggregation state are a circuit constant.
271
- // The user tells us they how they want these constants set by keeping the nested aggregation object
272
- // attached to the proof as public inputs. As this is the only object that can prepended to the proof if the
273
- // proof is above the expected size (with public inputs stripped)
277
+ // A proof passed into the constraint should be stripped of its public inputs, except in
278
+ // the case where a proof contains an aggregation object itself. We refer to this as the
279
+ // `nested_aggregation_object`. The verifier circuit requires that the indices to a
280
+ // nested proof aggregation state are a circuit constant. The user tells us they how
281
+ // they want these constants set by keeping the nested aggregation object attached to
282
+ // the proof as public inputs. As this is the only object that can prepended to the
283
+ // proof if the proof is above the expected size (with public inputs stripped)
274
284
AggregationObjectPubInputIndices nested_aggregation_object = {};
275
- // If the proof has public inputs attached to it, we should handle setting the nested aggregation object
285
+ // If the proof has public inputs attached to it, we should handle setting the nested
286
+ // aggregation object
276
287
if (constraint.proof .size () > proof_size_no_pub_inputs) {
277
288
// The public inputs attached to a proof should match the aggregation object in size
278
289
if (constraint.proof .size () - proof_size_no_pub_inputs != bb::AGGREGATION_OBJECT_SIZE) {
279
- auto error_string = format (
280
- " Public inputs are always stripped from proofs unless we have a recursive proof.\n "
281
- " Thus, public inputs attached to a proof must match the recursive aggregation object in size "
282
- " which is " ,
283
- bb::AGGREGATION_OBJECT_SIZE);
290
+ auto error_string = format (" Public inputs are always stripped from proofs "
291
+ " unless we have a recursive proof.\n "
292
+ " Thus, public inputs attached to a proof must match "
293
+ " the recursive aggregation object in size "
294
+ " which is " ,
295
+ bb::AGGREGATION_OBJECT_SIZE);
284
296
throw_or_abort (error_string);
285
297
}
286
298
for (size_t i = 0 ; i < bb::AGGREGATION_OBJECT_SIZE; ++i) {
287
- // Set the nested aggregation object indices to the current size of the public inputs
288
- // This way we know that the nested aggregation object indices will always be the last
289
- // indices of the public inputs
299
+ // Set the nested aggregation object indices to the current size of the public
300
+ // inputs This way we know that the nested aggregation object indices will
301
+ // always be the last indices of the public inputs
290
302
nested_aggregation_object[i] = static_cast <uint32_t >(constraint.public_inputs .size ());
291
- // Attach the nested aggregation object to the end of the public inputs to fill in
292
- // the slot where the nested aggregation object index will point into
303
+ // Attach the nested aggregation object to the end of the public inputs to fill
304
+ // in the slot where the nested aggregation object index will point into
293
305
constraint.public_inputs .emplace_back (constraint.proof [i]);
294
306
}
295
307
// Remove the aggregation object so that they can be handled as normal public inputs
0 commit comments