Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bool.test.cpp
Go to the documentation of this file.
1#include "bool.hpp"
6#include <gtest/gtest.h>
7#include <tuple>
8
9using namespace bb;
10
11#pragma GCC diagnostic ignored "-Wunused-const-variable"
12
13namespace {
15}
17template <class Builder_> class BoolTest : public ::testing::Test {
18 public:
19 using Builder = Builder_;
22
23 // These tree boolean flags cover all possible combinations for a valid input.
24 struct BoolInput {
25 bool is_const; // witness_index = IS_CONSTANT
26 bool value; // w_a
27 bool is_inverted; // i_a
28 };
29
30 // A helper to produce all possible inputs for a given operand.
33 size_t idx = 0;
34 for (bool is_const : { false, true }) {
35 for (bool value : { false, true }) {
36 for (bool is_inverted : { false, true }) {
37 inputs[idx++] = BoolInput{ is_const, value, is_inverted };
38 }
39 }
40 }
41 return inputs;
42 }();
43 // A helper to create a bool_t element from the given flags
45 {
47 return in.is_inverted ? !b : b;
48 };
49
50 void test_binary_op(std::string const& op_name,
51 const std::function<bool_ct(const bool_ct&, const bool_ct&)>& op,
52 const std::function<bool(bool, bool)>& expected_op)
53 {
55
56 for (auto& lhs : all_inputs) {
57 for (auto& rhs : all_inputs) {
60
61 size_t num_gates_start = builder.get_num_finalized_gates_inefficient();
62
63 if (!a.is_constant() && !b.is_constant()) {
64 a.set_origin_tag(submitted_value_origin_tag);
65 b.set_origin_tag(challenge_origin_tag);
66 }
67 bool_ct c = op(a, b);
68
69 bool expected = expected_op(lhs.value ^ lhs.is_inverted, rhs.value ^ rhs.is_inverted);
70
71 EXPECT_EQ(c.get_value(), expected)
72 << "Failed on " << op_name << " with inputs: lhs = {const=" << lhs.is_const << ", val=" << lhs.value
73 << ", inv=" << lhs.is_inverted << "}, rhs = {const=" << rhs.is_const << ", val=" << rhs.value
74 << ", inv=" << rhs.is_inverted << "}";
75
76 if (a.is_constant() && b.is_constant()) {
77 EXPECT_TRUE(c.is_constant());
78 }
79
80 if (!a.is_constant() && !b.is_constant()) {
81 // The result of a binary op on two witnesses must be a witness
82 EXPECT_TRUE(!c.is_constant());
83 // Check that the tags are propagated
84 EXPECT_EQ(c.get_origin_tag(), first_two_merged_tag);
85 }
86
87 size_t diff = builder.get_num_finalized_gates_inefficient() - num_gates_start;
88 // An extra gate is created iff both operands are witnesses
89 EXPECT_EQ(diff, static_cast<size_t>(!a.is_constant() && !b.is_constant()));
90 }
91 }
92
93 EXPECT_TRUE(CircuitChecker::check(builder));
94 };
95
97 {
99 size_t num_gates_start = builder.get_num_finalized_gates_inefficient();
100 bool_ct a_true(true);
101 bool_ct a_false(false);
102 EXPECT_TRUE(a_true.get_value());
103 EXPECT_FALSE(a_false.get_value());
104 EXPECT_TRUE(a_true.is_constant() && a_false.is_constant());
105 EXPECT_TRUE(!a_true.is_inverted() && !a_false.is_inverted());
106 // No gates have been added
107 EXPECT_TRUE(num_gates_start == builder.get_num_finalized_gates_inefficient());
108 }
109
111 {
113 size_t num_gates_start = builder.get_num_finalized_gates_inefficient();
114 const size_t witness_idx_zero = builder.add_variable(bb::fr(0));
115 const size_t witness_idx_one = builder.add_variable(bb::fr(1));
116 const size_t non_bool_witness_idx = builder.add_variable(bb::fr(15));
117
118 bool_ct bool_witness = bool_ct::from_witness_index_unsafe(&builder, witness_idx_zero);
119 EXPECT_EQ(bool_witness.get_value(), false);
120
121 bool_witness = bool_ct::from_witness_index_unsafe(&builder, witness_idx_one);
122 EXPECT_EQ(bool_witness.get_value(), true);
123 // No gates are added.
124 EXPECT_EQ(builder.get_num_finalized_gates_inefficient() - num_gates_start, 0);
125
126 // Out-of-circuit failure when witness points to a non-bool value.
127 EXPECT_THROW_OR_ABORT(bool_witness = bool_ct::from_witness_index_unsafe(&builder, non_bool_witness_idx),
128 "bool_t: creating a witness bool from a non-boolean value");
129 }
131 {
133 size_t num_gates_start = builder.get_num_finalized_gates_inefficient();
134
135 bool_ct a_true = witness_ct(&builder, 1);
136 bool_ct a_false = witness_ct(&builder, 0);
137 EXPECT_TRUE(a_true.get_value());
138 EXPECT_FALSE(a_false.get_value());
139 EXPECT_TRUE(!a_true.is_constant() && !a_false.is_constant());
140 EXPECT_TRUE(!a_true.is_inverted() && !a_false.is_inverted());
141 // Each witness bool must be constrained => expect 2 gates being added
142 EXPECT_TRUE(builder.get_num_finalized_gates_inefficient() - num_gates_start == 2);
143 EXPECT_TRUE(CircuitChecker::check(builder));
144
145 // Test failure
146 bool_ct a_incorrect;
147 uint256_t random_value(engine.get_random_uint256());
148
149 if (random_value * random_value - random_value != 0) {
150 EXPECT_THROW_OR_ABORT(a_incorrect = witness_ct(&builder, random_value),
151 "((other.witness == bb::fr::one()) || (other.witness == bb::fr::zero()))");
152 };
153 }
154
156 {
157 const bool use_range_constraint = true;
158
159 for (size_t num_inputs = 1; num_inputs < 50; num_inputs++) {
161 size_t num_gates_start = builder.get_num_finalized_gates_inefficient();
162
163 std::vector<uint32_t> indices;
164 for (size_t idx = 0; idx < num_inputs; idx++) {
165 indices.push_back(bool_ct(witness_ct(&builder, idx % 2), use_range_constraint).get_witness_index());
166 }
167
168 // Note: +2 comes from entries added in create_range_list for target_range == 1
169 size_t sorted_list_size = num_inputs + 2;
170 // sorted list is padded to minimum size of 8
171 sorted_list_size = std::max(sorted_list_size, 8UL);
172 // +4 for combination of unconstrained gates and add gates for fixing endpoints
173 size_t fixed_additional_gates = 4;
174 // Delta-range mechanism packs 4 values per gate
175 size_t expected = numeric::ceil_div(sorted_list_size, 4UL) + fixed_additional_gates;
176
177 size_t actual = builder.get_num_finalized_gates_inefficient() - num_gates_start;
178
179 EXPECT_EQ(actual, expected);
180
181 builder.create_unconstrained_gates(indices);
182
183 EXPECT_TRUE(CircuitChecker::check(builder));
184 }
185
186 // Failure test
188 EXPECT_THROW_OR_ABORT(auto new_bool = bool_ct(witness_ct(&builder, 2), use_range_constraint),
189 "bool_t: witness value is not 0 or 1");
190 }
191 void test_AND()
192 {
194 "AND", [](const bool_ct& a, const bool_ct& b) { return a & b; }, [](bool a, bool b) { return a && b; });
195 }
196
197 void test_xor()
198 {
200 "XOR", [](const bool_ct& a, const bool_ct& b) { return a ^ b; }, [](bool a, bool b) { return a ^ b; });
201 }
202
203 void test_OR()
204 {
206 "OR", [](const bool_ct& a, const bool_ct& b) { return a || b; }, [](bool a, bool b) { return a || b; });
207 }
208
209 void test_EQ()
210 {
212 "==", [](const bool_ct& a, const bool_ct& b) { return a == b; }, [](bool a, bool b) { return a == b; });
213 }
214
215 void test_NEQ()
216 {
218 "!=", [](const bool_ct& a, const bool_ct& b) { return a != b; }, [](bool a, bool b) { return a != b; });
219 }
220
222 {
224 "=>",
225 [](const bool_ct& a, const bool_ct& b) { return a.implies(b); },
226 [](bool a, bool b) { return !a || b; });
227 }
228
230 {
232 "<=>",
233 [](const bool_ct& a, const bool_ct& b) { return a.implies_both_ways(b); },
234 [](bool a, bool b) { return !(a ^ b); });
235 }
236
238 {
239
240 for (auto& lhs : all_inputs) {
241 for (auto& rhs : all_inputs) {
243
246
247 if (a.is_constant() && b.is_constant() && !(!a.get_value() || b.get_value())) {
248 EXPECT_THROW_OR_ABORT(a.must_imply(b), R"(\‍(lhs\.get_value\‍(\) == rhs\.get_value\‍(\)\))");
249 } else {
250 bool result_is_constant = (!a || b).is_constant();
251
252 size_t num_gates_start = builder.get_num_finalized_gates_inefficient();
253
254 if (!a.is_constant() && !b.is_constant()) {
255 a.set_origin_tag(submitted_value_origin_tag);
256 b.set_origin_tag(challenge_origin_tag);
257 }
258 a.must_imply(b);
259 // !a || b
260 // b = 1 =>
261 bool expected = !(lhs.value ^ lhs.is_inverted) || rhs.value ^ rhs.is_inverted;
262
263 size_t diff = builder.get_num_finalized_gates_inefficient() - num_gates_start;
264
265 if (!a.is_constant() && !b.is_constant()) {
266 EXPECT_EQ(diff, 1);
267 }
268 // Due to optimizations, the result of a => b can be a constant, in this case, the the assert_equal
269 // reduces to an out-of-circuit ASSERT
270 if (result_is_constant) {
271 EXPECT_EQ(diff, 0);
272 }
273
274 // No gates are added when one operand is constant
275 if (!result_is_constant && a.is_constant() && !b.is_constant()) {
276 EXPECT_EQ(diff, 0);
277 }
278
279 if (!result_is_constant && !a.is_constant() && b.is_constant()) {
280 EXPECT_EQ(diff, 0);
281 }
282 EXPECT_EQ(CircuitChecker::check(builder), expected);
283 }
284 }
285 }
286 }
287
288 // Helper to compute expected gate count for conditional_assign
290 const bool_ct& condition, const bool_ct& a, const bool_ct& b, const BoolInput& lhs, const BoolInput& rhs)
291 {
292 if (condition.is_constant()) {
293 // Branch 1: Constant predicate - select lhs or rhs, then normalize
294 // Adds 1 gate only if selected value is inverted
295 bool_ct selected = condition.get_value() ? a : b;
296 return (selected.is_inverted()) ? 1 : 0;
297 }
298
299 // Check for Branch 2: same witness (both constants with same value)
300 if (a.is_constant() && b.is_constant() && a.get_value() == b.get_value()) {
301 // Branch 2: Same witness - return lhs.normalize()
302 // Adds 1 gate only if lhs is inverted
303 return (a.is_inverted()) ? 1 : 0;
304 }
305
306 // Branch 3: (predicate && lhs) || (!predicate && rhs), then normalize
307 // Key insight: OR of two witnesses creates a NEW normalized witness (no normalization gate needed)
308 // But OR of witness and constant may return the witness directly (may need normalization)
309
310 if (!a.is_constant() && !b.is_constant()) {
311 // All witnesses: AND + AND + OR = 3 gates
312 // OR creates new normalized witness, so normalize() is no-op
313 return 3;
314 } else if (!a.is_constant()) {
315 // lhs witness, rhs constant
316 // predicate && lhs: 1 gate (creates new witness)
317 // !predicate && rhs:
318 // - if rhs true: returns !predicate (inverted witness if pred was inverted)
319 // - if rhs false: returns false (constant)
320 // OR:
321 // - if rhs false: OR(new_witness, const_false) returns new_witness (no gate, already norm)
322 // - if rhs true: OR(new_witness, inverted_witness) adds 1 gate, creates new normalized witness
323 return b.get_value() ? 2 : 1;
324 } else if (!b.is_constant()) {
325 // lhs constant, rhs witness
326 // !predicate && rhs: 1 gate (creates new witness)
327 // predicate && lhs:
328 // - if lhs true: returns predicate (inverted witness if pred was inverted)
329 // - if lhs false: returns false (constant)
330 // OR:
331 // - if lhs false: OR(const_false, new_witness) returns new_witness (no gate, already norm)
332 // - if lhs true: OR(inverted_witness, new_witness) adds 1 gate, creates new normalized witness
333 return a.get_value() ? 2 : 1;
334 } else {
335 // Both constants: fully optimized
336 // Result is predicate, !predicate, or constant - may need normalization
337 if (lhs.value == rhs.value) {
338 // conditional_assign(pred, T, T) = T or conditional_assign(pred, F, F) = F (constant)
339 return 0;
340 } else if (lhs.value) {
341 // conditional_assign(pred, T, F) = pred
342 // Result is predicate (inverted if pred is inverted)
343 // Normalize adds 1 gate if predicate is inverted
344 return condition.is_inverted() ? 1 : 0;
345 } else {
346 // conditional_assign(pred, F, T) = !pred
347 // Result is !predicate (inverted if pred is NOT inverted)
348 // Normalize adds 1 gate if predicate is NOT inverted
349 return condition.is_inverted() ? 0 : 1;
350 }
351 }
352 }
353
355 {
356 for (auto lhs : all_inputs) {
357 for (auto rhs : all_inputs) {
358 for (auto predicate : all_inputs) {
360
363 bool_ct condition = create_bool_ct(predicate, &builder);
364
365 size_t num_gates_start = builder.get_num_finalized_gates_inefficient();
366 if (!a.is_constant() && !b.is_constant()) {
367 condition.set_origin_tag(submitted_value_origin_tag);
368 a.set_origin_tag(challenge_origin_tag);
369 b.set_origin_tag(next_challenge_tag);
370 }
371
372 bool_ct result = bool_ct::conditional_assign(condition, a, b);
373 size_t diff = builder.get_num_finalized_gates_inefficient() - num_gates_start;
374 if (!a.is_constant() && !b.is_constant()) {
375 EXPECT_EQ(result.get_origin_tag(), first_second_third_merged_tag);
376 }
377
378 // Verify correctness
379 bool expected = (condition.get_value()) ? a.get_value() : b.get_value();
380 EXPECT_EQ(result.get_value(), expected);
381
382 // Verify result is always normalized
383 EXPECT_FALSE(result.is_inverted());
384
385 // Pin down gate count for simple cases we can predict
386 if (condition.is_constant() ||
387 (a.is_constant() && b.is_constant() && a.get_value() == b.get_value())) {
388 // Branches 1 & 2: Predictable gate counts
389 size_t expected_gates = compute_conditional_assign_gates(condition, a, b, lhs, rhs);
390 EXPECT_EQ(diff, expected_gates);
391 } else if (!a.is_constant() && !b.is_constant()) {
392 // Branch 3, all witnesses: Always 3 gates (AND + AND + OR)
393 EXPECT_EQ(diff, 3UL);
394 }
395 // For mixed witness/constant cases in branch 3, gate count depends on complex
396 // boolean operator optimizations - we verify normalization instead
397
398 EXPECT_TRUE(CircuitChecker::check(builder));
399 }
400 }
401 }
402 }
403
405 {
406 for (auto a_raw : all_inputs) {
407 auto builder = Builder();
408
409 bool_ct a = create_bool_ct(a_raw, &builder);
410
411 size_t num_gates_start = builder.get_num_finalized_gates_inefficient();
412 if (!a.is_constant()) {
413 a.set_origin_tag(submitted_value_origin_tag);
414 }
415 bool_ct c = a.normalize();
416 EXPECT_EQ(c.get_value(), a.get_value());
417 if (!a.is_constant()) {
418 EXPECT_EQ(c.get_origin_tag(), submitted_value_origin_tag);
419 }
420 EXPECT_EQ(c.is_inverted(), false);
421 size_t diff = builder.get_num_finalized_gates_inefficient() - num_gates_start;
422 // Note that although `normalize()` returns value, it flips the `is_inverted()` flag of `a` if it was
423 // `true`.
424 EXPECT_EQ(diff, static_cast<size_t>(!a.is_constant() && a_raw.is_inverted));
425 EXPECT_TRUE(CircuitChecker::check(builder));
426 }
427 }
428
430 {
431
432 for (auto lhs : all_inputs) {
433 for (auto rhs : all_inputs) {
434
436
439
440 bool failed = a.get_value() != b.get_value();
441
442 if (!a.is_constant() && !b.is_constant()) {
443 a.assert_equal(b);
444 // CircuitChecker is not verifying the permutation relation
445 EXPECT_EQ(builder.failed(), failed);
446 } else if (!a.is_constant() || !b.is_constant()) {
447 a.assert_equal(b);
448 EXPECT_EQ(CircuitChecker::check(builder), !failed);
449 } else {
450 if (failed) {
451 EXPECT_THROW_OR_ABORT(a.assert_equal(b), R"(\‍(lhs\.get_value\‍(\) == rhs\.get_value\‍(\)\))");
452 }
453 }
454 }
455 }
456 }
457
459 {
460 auto builder = Builder();
461
462 auto gates_before = builder.get_num_finalized_gates_inefficient();
463
466
467 a.set_origin_tag(submitted_value_origin_tag);
468 b.set_origin_tag(challenge_origin_tag);
469
470 a = a ^ b; // a = 1
471 EXPECT_EQ(a.get_value(), 1);
472
473 // Tags are merged on XOR
474 EXPECT_EQ(a.get_origin_tag(), first_two_merged_tag);
475
476 b = !b; // b = 1 (witness 0)
477 EXPECT_EQ(b.get_value(), 1);
478
479 // Tag is preserved on NOT
480 EXPECT_EQ(b.get_origin_tag(), challenge_origin_tag);
481
482 a.set_origin_tag(submitted_value_origin_tag);
483
484 bool_ct d = (a == b); //
485 EXPECT_EQ(d.get_value(), 1);
486
487 // Tags are merged on ==
488 EXPECT_EQ(d.get_origin_tag(), first_two_merged_tag);
489
490 d = false; // d = 0
491 d.set_origin_tag(challenge_origin_tag);
492 EXPECT_EQ(d.get_value(), 0);
493
494 bool_ct e = a | d; // e = 1 = a
495 EXPECT_EQ(e.get_value(), 1);
496
497 // Tags are merged on OR
498 EXPECT_EQ(e.get_origin_tag(), first_two_merged_tag);
499
500 bool_ct f = e ^ b; // f = 0
501 EXPECT_EQ(f.get_value(), 0);
502
503 f.set_origin_tag(challenge_origin_tag);
504 d = (!f) & a; // d = 1
505 EXPECT_EQ(d.get_value(), 1);
506
507 // Tags are merged on AND
508 EXPECT_EQ(d.get_origin_tag(), first_two_merged_tag);
509
510 bool result = CircuitChecker::check(builder);
511 EXPECT_EQ(result, true);
512
513 auto gates_after = builder.get_num_finalized_gates_inefficient();
514 EXPECT_EQ(gates_after - gates_before, 6UL);
515 }
516
517 // Check that (a && (b || c)) ^ (d => f) <=> ((a && b) || (a && c)) ^ (!d || f)) for all inputs.
519 {
520 for (const auto& a_input : all_inputs) {
521 for (const auto& b_input : all_inputs) {
522 for (const auto& c_input : all_inputs) {
523 for (const auto& d_input : all_inputs) {
524 for (const auto& f_input : all_inputs) {
526
527 // Construct bool_cts from inputs
528 bool_ct a = create_bool_ct(a_input, &builder);
529 bool_ct b = create_bool_ct(b_input, &builder);
530 bool_ct c = create_bool_ct(c_input, &builder);
531 bool_ct d = create_bool_ct(d_input, &builder);
532 bool_ct f = create_bool_ct(f_input, &builder);
533
534 // === Formula 1 ===
535 bool_ct lhs = (a && (b || c)) ^ (d.implies(f));
536 bool_ct rhs = ((a && b) || (a && c)) ^ (!d || f);
537
538 // Equivalence check
539 bool_ct equivalent = lhs.implies_both_ways(rhs);
540 if (!equivalent.get_value()) {
541 info("FAIL:");
542 info("a: ", a.get_value(), " b: ", b.get_value(), " c: ", c.get_value());
543 info("d: ", d.get_value(), " f: ", f.get_value());
544 }
545
546 EXPECT_EQ(equivalent.get_value(), true);
547 EXPECT_TRUE(CircuitChecker::check(builder));
548 }
549 }
550 }
551 }
552 }
553 }
554};
555
556using CircuitTypes = ::testing::Types<bb::UltraCircuitBuilder>;
557
559TYPED_TEST(BoolTest, ConstructFromConstBool)
560{
561 TestFixture::test_construct_from_const_bool();
562}
563
564TYPED_TEST(BoolTest, ConstructFromWitness)
565{
566 TestFixture::test_construct_from_witness();
567}
568TYPED_TEST(BoolTest, ConstructFromWitnessRangeConstraint)
569{
570 TestFixture::test_construct_from_witness_range_constraint();
571}
572
573TYPED_TEST(BoolTest, Normalization)
574{
575 TestFixture::test_normalize();
576}
578{
579 TestFixture::test_xor();
580}
581
583{
584 TestFixture::test_AND();
585}
586
588{
589 TestFixture::test_OR();
590}
591
593{
594 TestFixture::test_EQ();
595}
596
598{
599 TestFixture::test_NEQ();
600}
601
603{
604 TestFixture::test_implies();
605}
606
607TYPED_TEST(BoolTest, ImpliesBothWays)
608{
609 TestFixture::test_implies_both_ways();
610}
611
613{
614 TestFixture::test_must_imply();
615}
616
617TYPED_TEST(BoolTest, ConditionalAssign)
618{
619 TestFixture::test_conditional_assign();
620}
621
622TYPED_TEST(BoolTest, TestBasicOperationsTags)
623{
624 TestFixture::test_basic_operations_tags();
625}
626
627TYPED_TEST(BoolTest, TestSimpleProof)
628{
629 TestFixture::test_simple_proof();
630}
631TYPED_TEST(BoolTest, AssertEqual)
632{
633 TestFixture::test_assert_equal();
634}
#define EXPECT_THROW_OR_ABORT(statement, matcher)
Definition assert.hpp:174
void test_xor()
void test_construct_from_witness_index()
void test_implies_both_ways()
void test_normalize()
void test_implies()
void test_NEQ()
void test_conditional_assign()
void test_binary_op(std::string const &op_name, const std::function< bool_ct(const bool_ct &, const bool_ct &)> &op, const std::function< bool(bool, bool)> &expected_op)
Definition bool.test.cpp:50
void test_OR()
void test_AND()
void test_must_imply()
Builder_ Builder
Definition bool.test.cpp:19
void test_basic_operations_tags()
void test_simple_proof()
void test_construct_from_const_bool()
Definition bool.test.cpp:96
static size_t compute_conditional_assign_gates(const bool_ct &condition, const bool_ct &a, const bool_ct &b, const BoolInput &lhs, const BoolInput &rhs)
std::array< BoolInput, 8 > all_inputs
Definition bool.test.cpp:31
void test_EQ()
void test_construct_from_witness_range_constraint()
stdlib::witness_t< Builder > witness_ct
Definition bool.test.cpp:20
void test_construct_from_witness()
static bool_ct create_bool_ct(const BoolInput &in, Builder *builder)
Definition bool.test.cpp:44
void test_assert_equal()
stdlib::bool_t< Builder > bool_ct
Definition bool.test.cpp:21
static bool check(const Builder &circuit)
Check the witness satisifies the circuit.
virtual uint256_t get_random_uint256()=0
Implements boolean logic in-circuit.
Definition bool.hpp:59
bool get_value() const
Definition bool.hpp:124
bool is_constant() const
Definition bool.hpp:126
void set_origin_tag(const OriginTag &new_tag) const
Definition bool.hpp:153
bool_t implies(const bool_t &other) const
Implements implication operator in circuit.
Definition bool.cpp:489
bool is_inverted() const
Definition bool.hpp:127
static bool_t conditional_assign(const bool_t< Builder > &predicate, const bool_t &lhs, const bool_t &rhs)
Conditionally assign lhs or rhs based on predicate, always returns normalized result.
Definition bool.cpp:465
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.
Definition bool.cpp:97
bool_t implies_both_ways(const bool_t &other) const
Implements a "double-implication" (<=>), a.k.a "iff", a.k.a. "biconditional".
Definition bool.cpp:506
OriginTag get_origin_tag() const
Definition bool.hpp:154
void info(Args... args)
Definition log.hpp:75
AluTraceBuilder builder
Definition alu.test.cpp:124
FF a
FF b
numeric::RNG & engine
AvmProvingInputs inputs
constexpr T ceil_div(const T &numerator, const T &denominator)
Computes the ceiling of the division of two integral types.
Definition general.hpp:23
RNG & get_debug_randomness(bool reset, std::uint_fast64_t seed)
Definition engine.cpp:190
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
TYPED_TEST_SUITE(ShpleminiTest, TestSettings)
TYPED_TEST(ShpleminiTest, CorrectnessOfMultivariateClaimBatching)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
This file contains part of the logic for the Origin Tag mechanism that tracks the use of in-circuit p...
#define STANDARD_TESTING_TAGS
testing::Types< bb::MegaCircuitBuilder, bb::UltraCircuitBuilder > CircuitTypes
static constexpr field one()
static constexpr field zero()