Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
acir.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7#pragma once
8
10#include "bincode.hpp"
11#include "serde.hpp"
12
13namespace Acir {
14struct Helpers {
15 static std::map<std::string, msgpack::object const*> make_kvmap(msgpack::object const& o, std::string const& name)
16 {
17 if (o.type != msgpack::type::MAP) {
18 std::cerr << o << std::endl;
19 throw_or_abort("expected MAP for " + name);
20 }
22 for (uint32_t i = 0; i < o.via.map.size; ++i) {
23 if (o.via.map.ptr[i].key.type != msgpack::type::STR) {
24 std::cerr << o << std::endl;
25 throw_or_abort("expected STR for keys of " + name);
26 }
27 kvmap.emplace(std::string(o.via.map.ptr[i].key.via.str.ptr, o.via.map.ptr[i].key.via.str.size),
28 &o.via.map.ptr[i].val);
29 }
30 return kvmap;
31 }
32 template <typename T>
34 std::string const& struct_name,
35 std::string const& field_name,
36 T& field,
37 bool is_optional)
38 {
39 auto it = kvmap.find(field_name);
40 if (it != kvmap.end()) {
41 try {
42 it->second->convert(field);
43 } catch (const msgpack::type_error&) {
44 std::cerr << *it->second << std::endl;
45 throw_or_abort("error converting into field " + struct_name + "::" + field_name);
46 }
47 } else if (!is_optional) {
48 throw_or_abort("missing field: " + struct_name + "::" + field_name);
49 }
50 }
51};
52} // namespace Acir
53
54namespace Acir {
55
57
58 struct Add {
59 friend bool operator==(const Add&, const Add&);
60 std::vector<uint8_t> bincodeSerialize() const;
61 static Add bincodeDeserialize(std::vector<uint8_t>);
62
63 void msgpack_pack(auto& packer) const {}
64 void msgpack_unpack(msgpack::object const& o) {}
65 };
66
67 struct Sub {
68 friend bool operator==(const Sub&, const Sub&);
69 std::vector<uint8_t> bincodeSerialize() const;
70 static Sub bincodeDeserialize(std::vector<uint8_t>);
71
72 void msgpack_pack(auto& packer) const {}
73 void msgpack_unpack(msgpack::object const& o) {}
74 };
75
76 struct Mul {
77 friend bool operator==(const Mul&, const Mul&);
78 std::vector<uint8_t> bincodeSerialize() const;
79 static Mul bincodeDeserialize(std::vector<uint8_t>);
80
81 void msgpack_pack(auto& packer) const {}
82 void msgpack_unpack(msgpack::object const& o) {}
83 };
84
85 struct Div {
86 friend bool operator==(const Div&, const Div&);
87 std::vector<uint8_t> bincodeSerialize() const;
88 static Div bincodeDeserialize(std::vector<uint8_t>);
89
90 void msgpack_pack(auto& packer) const {}
91 void msgpack_unpack(msgpack::object const& o) {}
92 };
93
94 struct IntegerDiv {
95 friend bool operator==(const IntegerDiv&, const IntegerDiv&);
96 std::vector<uint8_t> bincodeSerialize() const;
97 static IntegerDiv bincodeDeserialize(std::vector<uint8_t>);
98
99 void msgpack_pack(auto& packer) const {}
100 void msgpack_unpack(msgpack::object const& o) {}
101 };
102
103 struct Equals {
104 friend bool operator==(const Equals&, const Equals&);
105 std::vector<uint8_t> bincodeSerialize() const;
106 static Equals bincodeDeserialize(std::vector<uint8_t>);
107
108 void msgpack_pack(auto& packer) const {}
109 void msgpack_unpack(msgpack::object const& o) {}
110 };
111
112 struct LessThan {
113 friend bool operator==(const LessThan&, const LessThan&);
114 std::vector<uint8_t> bincodeSerialize() const;
115 static LessThan bincodeDeserialize(std::vector<uint8_t>);
116
117 void msgpack_pack(auto& packer) const {}
118 void msgpack_unpack(msgpack::object const& o) {}
119 };
120
122 friend bool operator==(const LessThanEquals&, const LessThanEquals&);
123 std::vector<uint8_t> bincodeSerialize() const;
124 static LessThanEquals bincodeDeserialize(std::vector<uint8_t>);
125
126 void msgpack_pack(auto& packer) const {}
127 void msgpack_unpack(msgpack::object const& o) {}
128 };
129
131
132 friend bool operator==(const BinaryFieldOp&, const BinaryFieldOp&);
133 std::vector<uint8_t> bincodeSerialize() const;
134 static BinaryFieldOp bincodeDeserialize(std::vector<uint8_t>);
135
136 void msgpack_pack(auto& packer) const
137 {
138 std::string tag;
139 bool is_unit;
140 switch (value.index()) {
141
142 case 0:
143 tag = "Add";
144 is_unit = true;
145 break;
146 case 1:
147 tag = "Sub";
148 is_unit = true;
149 break;
150 case 2:
151 tag = "Mul";
152 is_unit = true;
153 break;
154 case 3:
155 tag = "Div";
156 is_unit = true;
157 break;
158 case 4:
159 tag = "IntegerDiv";
160 is_unit = true;
161 break;
162 case 5:
163 tag = "Equals";
164 is_unit = true;
165 break;
166 case 6:
167 tag = "LessThan";
168 is_unit = true;
169 break;
170 case 7:
171 tag = "LessThanEquals";
172 is_unit = true;
173 break;
174 default:
175 throw_or_abort("unknown enum 'BinaryFieldOp' variant index: " + std::to_string(value.index()));
176 }
177 if (is_unit) {
178 packer.pack(tag);
179 } else {
180 std::visit(
181 [&packer, tag](const auto& arg) {
183 data[tag] = msgpack::object(arg);
184 packer.pack(data);
185 },
186 value);
187 }
188 }
189
190 void msgpack_unpack(msgpack::object const& o)
191 {
192
193 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
194 std::cerr << o << std::endl;
195 throw_or_abort("expected MAP or STR for enum 'BinaryFieldOp'; got type " + std::to_string(o.type));
196 }
197 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
198 throw_or_abort("expected 1 entry for enum 'BinaryFieldOp'; got " + std::to_string(o.via.map.size));
199 }
200 std::string tag;
201 try {
202 if (o.type == msgpack::type::object_type::MAP) {
203 o.via.map.ptr[0].key.convert(tag);
204 } else {
205 o.convert(tag);
206 }
207 } catch (const msgpack::type_error&) {
208 std::cerr << o << std::endl;
209 throw_or_abort("error converting tag to string for enum 'BinaryFieldOp'");
210 }
211 if (tag == "Add") {
212 Add v;
213 value = v;
214 } else if (tag == "Sub") {
215 Sub v;
216 value = v;
217 } else if (tag == "Mul") {
218 Mul v;
219 value = v;
220 } else if (tag == "Div") {
221 Div v;
222 value = v;
223 } else if (tag == "IntegerDiv") {
224 IntegerDiv v;
225 value = v;
226 } else if (tag == "Equals") {
227 Equals v;
228 value = v;
229 } else if (tag == "LessThan") {
230 LessThan v;
231 value = v;
232 } else if (tag == "LessThanEquals") {
234 value = v;
235 } else {
236 std::cerr << o << std::endl;
237 throw_or_abort("unknown 'BinaryFieldOp' enum variant: " + tag);
238 }
239 }
240};
241
243
244 struct Add {
245 friend bool operator==(const Add&, const Add&);
246 std::vector<uint8_t> bincodeSerialize() const;
247 static Add bincodeDeserialize(std::vector<uint8_t>);
248
249 void msgpack_pack(auto& packer) const {}
250 void msgpack_unpack(msgpack::object const& o) {}
251 };
252
253 struct Sub {
254 friend bool operator==(const Sub&, const Sub&);
255 std::vector<uint8_t> bincodeSerialize() const;
256 static Sub bincodeDeserialize(std::vector<uint8_t>);
257
258 void msgpack_pack(auto& packer) const {}
259 void msgpack_unpack(msgpack::object const& o) {}
260 };
261
262 struct Mul {
263 friend bool operator==(const Mul&, const Mul&);
264 std::vector<uint8_t> bincodeSerialize() const;
265 static Mul bincodeDeserialize(std::vector<uint8_t>);
266
267 void msgpack_pack(auto& packer) const {}
268 void msgpack_unpack(msgpack::object const& o) {}
269 };
270
271 struct Div {
272 friend bool operator==(const Div&, const Div&);
273 std::vector<uint8_t> bincodeSerialize() const;
274 static Div bincodeDeserialize(std::vector<uint8_t>);
275
276 void msgpack_pack(auto& packer) const {}
277 void msgpack_unpack(msgpack::object const& o) {}
278 };
279
280 struct Equals {
281 friend bool operator==(const Equals&, const Equals&);
282 std::vector<uint8_t> bincodeSerialize() const;
283 static Equals bincodeDeserialize(std::vector<uint8_t>);
284
285 void msgpack_pack(auto& packer) const {}
286 void msgpack_unpack(msgpack::object const& o) {}
287 };
288
289 struct LessThan {
290 friend bool operator==(const LessThan&, const LessThan&);
291 std::vector<uint8_t> bincodeSerialize() const;
292 static LessThan bincodeDeserialize(std::vector<uint8_t>);
293
294 void msgpack_pack(auto& packer) const {}
295 void msgpack_unpack(msgpack::object const& o) {}
296 };
297
299 friend bool operator==(const LessThanEquals&, const LessThanEquals&);
300 std::vector<uint8_t> bincodeSerialize() const;
301 static LessThanEquals bincodeDeserialize(std::vector<uint8_t>);
302
303 void msgpack_pack(auto& packer) const {}
304 void msgpack_unpack(msgpack::object const& o) {}
305 };
306
307 struct And {
308 friend bool operator==(const And&, const And&);
309 std::vector<uint8_t> bincodeSerialize() const;
310 static And bincodeDeserialize(std::vector<uint8_t>);
311
312 void msgpack_pack(auto& packer) const {}
313 void msgpack_unpack(msgpack::object const& o) {}
314 };
315
316 struct Or {
317 friend bool operator==(const Or&, const Or&);
318 std::vector<uint8_t> bincodeSerialize() const;
319 static Or bincodeDeserialize(std::vector<uint8_t>);
320
321 void msgpack_pack(auto& packer) const {}
322 void msgpack_unpack(msgpack::object const& o) {}
323 };
324
325 struct Xor {
326 friend bool operator==(const Xor&, const Xor&);
327 std::vector<uint8_t> bincodeSerialize() const;
328 static Xor bincodeDeserialize(std::vector<uint8_t>);
329
330 void msgpack_pack(auto& packer) const {}
331 void msgpack_unpack(msgpack::object const& o) {}
332 };
333
334 struct Shl {
335 friend bool operator==(const Shl&, const Shl&);
336 std::vector<uint8_t> bincodeSerialize() const;
337 static Shl bincodeDeserialize(std::vector<uint8_t>);
338
339 void msgpack_pack(auto& packer) const {}
340 void msgpack_unpack(msgpack::object const& o) {}
341 };
342
343 struct Shr {
344 friend bool operator==(const Shr&, const Shr&);
345 std::vector<uint8_t> bincodeSerialize() const;
346 static Shr bincodeDeserialize(std::vector<uint8_t>);
347
348 void msgpack_pack(auto& packer) const {}
349 void msgpack_unpack(msgpack::object const& o) {}
350 };
351
353
354 friend bool operator==(const BinaryIntOp&, const BinaryIntOp&);
355 std::vector<uint8_t> bincodeSerialize() const;
356 static BinaryIntOp bincodeDeserialize(std::vector<uint8_t>);
357
358 void msgpack_pack(auto& packer) const
359 {
360 std::string tag;
361 bool is_unit;
362 switch (value.index()) {
363
364 case 0:
365 tag = "Add";
366 is_unit = true;
367 break;
368 case 1:
369 tag = "Sub";
370 is_unit = true;
371 break;
372 case 2:
373 tag = "Mul";
374 is_unit = true;
375 break;
376 case 3:
377 tag = "Div";
378 is_unit = true;
379 break;
380 case 4:
381 tag = "Equals";
382 is_unit = true;
383 break;
384 case 5:
385 tag = "LessThan";
386 is_unit = true;
387 break;
388 case 6:
389 tag = "LessThanEquals";
390 is_unit = true;
391 break;
392 case 7:
393 tag = "And";
394 is_unit = true;
395 break;
396 case 8:
397 tag = "Or";
398 is_unit = true;
399 break;
400 case 9:
401 tag = "Xor";
402 is_unit = true;
403 break;
404 case 10:
405 tag = "Shl";
406 is_unit = true;
407 break;
408 case 11:
409 tag = "Shr";
410 is_unit = true;
411 break;
412 default:
413 throw_or_abort("unknown enum 'BinaryIntOp' variant index: " + std::to_string(value.index()));
414 }
415 if (is_unit) {
416 packer.pack(tag);
417 } else {
418 std::visit(
419 [&packer, tag](const auto& arg) {
421 data[tag] = msgpack::object(arg);
422 packer.pack(data);
423 },
424 value);
425 }
426 }
427
428 void msgpack_unpack(msgpack::object const& o)
429 {
430
431 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
432 std::cerr << o << std::endl;
433 throw_or_abort("expected MAP or STR for enum 'BinaryIntOp'; got type " + std::to_string(o.type));
434 }
435 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
436 throw_or_abort("expected 1 entry for enum 'BinaryIntOp'; got " + std::to_string(o.via.map.size));
437 }
438 std::string tag;
439 try {
440 if (o.type == msgpack::type::object_type::MAP) {
441 o.via.map.ptr[0].key.convert(tag);
442 } else {
443 o.convert(tag);
444 }
445 } catch (const msgpack::type_error&) {
446 std::cerr << o << std::endl;
447 throw_or_abort("error converting tag to string for enum 'BinaryIntOp'");
448 }
449 if (tag == "Add") {
450 Add v;
451 value = v;
452 } else if (tag == "Sub") {
453 Sub v;
454 value = v;
455 } else if (tag == "Mul") {
456 Mul v;
457 value = v;
458 } else if (tag == "Div") {
459 Div v;
460 value = v;
461 } else if (tag == "Equals") {
462 Equals v;
463 value = v;
464 } else if (tag == "LessThan") {
465 LessThan v;
466 value = v;
467 } else if (tag == "LessThanEquals") {
469 value = v;
470 } else if (tag == "And") {
471 And v;
472 value = v;
473 } else if (tag == "Or") {
474 Or v;
475 value = v;
476 } else if (tag == "Xor") {
477 Xor v;
478 value = v;
479 } else if (tag == "Shl") {
480 Shl v;
481 value = v;
482 } else if (tag == "Shr") {
483 Shr v;
484 value = v;
485 } else {
486 std::cerr << o << std::endl;
487 throw_or_abort("unknown 'BinaryIntOp' enum variant: " + tag);
488 }
489 }
490};
491
493
494 struct U1 {
495 friend bool operator==(const U1&, const U1&);
496 std::vector<uint8_t> bincodeSerialize() const;
497 static U1 bincodeDeserialize(std::vector<uint8_t>);
498
499 void msgpack_pack(auto& packer) const {}
500 void msgpack_unpack(msgpack::object const& o) {}
501 };
502
503 struct U8 {
504 friend bool operator==(const U8&, const U8&);
505 std::vector<uint8_t> bincodeSerialize() const;
506 static U8 bincodeDeserialize(std::vector<uint8_t>);
507
508 void msgpack_pack(auto& packer) const {}
509 void msgpack_unpack(msgpack::object const& o) {}
510 };
511
512 struct U16 {
513 friend bool operator==(const U16&, const U16&);
514 std::vector<uint8_t> bincodeSerialize() const;
515 static U16 bincodeDeserialize(std::vector<uint8_t>);
516
517 void msgpack_pack(auto& packer) const {}
518 void msgpack_unpack(msgpack::object const& o) {}
519 };
520
521 struct U32 {
522 friend bool operator==(const U32&, const U32&);
523 std::vector<uint8_t> bincodeSerialize() const;
524 static U32 bincodeDeserialize(std::vector<uint8_t>);
525
526 void msgpack_pack(auto& packer) const {}
527 void msgpack_unpack(msgpack::object const& o) {}
528 };
529
530 struct U64 {
531 friend bool operator==(const U64&, const U64&);
532 std::vector<uint8_t> bincodeSerialize() const;
533 static U64 bincodeDeserialize(std::vector<uint8_t>);
534
535 void msgpack_pack(auto& packer) const {}
536 void msgpack_unpack(msgpack::object const& o) {}
537 };
538
539 struct U128 {
540 friend bool operator==(const U128&, const U128&);
541 std::vector<uint8_t> bincodeSerialize() const;
542 static U128 bincodeDeserialize(std::vector<uint8_t>);
543
544 void msgpack_pack(auto& packer) const {}
545 void msgpack_unpack(msgpack::object const& o) {}
546 };
547
549
550 friend bool operator==(const IntegerBitSize&, const IntegerBitSize&);
551 std::vector<uint8_t> bincodeSerialize() const;
552 static IntegerBitSize bincodeDeserialize(std::vector<uint8_t>);
553
554 void msgpack_pack(auto& packer) const
555 {
556 std::string tag;
557 bool is_unit;
558 switch (value.index()) {
559
560 case 0:
561 tag = "U1";
562 is_unit = true;
563 break;
564 case 1:
565 tag = "U8";
566 is_unit = true;
567 break;
568 case 2:
569 tag = "U16";
570 is_unit = true;
571 break;
572 case 3:
573 tag = "U32";
574 is_unit = true;
575 break;
576 case 4:
577 tag = "U64";
578 is_unit = true;
579 break;
580 case 5:
581 tag = "U128";
582 is_unit = true;
583 break;
584 default:
585 throw_or_abort("unknown enum 'IntegerBitSize' variant index: " + std::to_string(value.index()));
586 }
587 if (is_unit) {
588 packer.pack(tag);
589 } else {
590 std::visit(
591 [&packer, tag](const auto& arg) {
593 data[tag] = msgpack::object(arg);
594 packer.pack(data);
595 },
596 value);
597 }
598 }
599
600 void msgpack_unpack(msgpack::object const& o)
601 {
602
603 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
604 std::cerr << o << std::endl;
605 throw_or_abort("expected MAP or STR for enum 'IntegerBitSize'; got type " + std::to_string(o.type));
606 }
607 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
608 throw_or_abort("expected 1 entry for enum 'IntegerBitSize'; got " + std::to_string(o.via.map.size));
609 }
610 std::string tag;
611 try {
612 if (o.type == msgpack::type::object_type::MAP) {
613 o.via.map.ptr[0].key.convert(tag);
614 } else {
615 o.convert(tag);
616 }
617 } catch (const msgpack::type_error&) {
618 std::cerr << o << std::endl;
619 throw_or_abort("error converting tag to string for enum 'IntegerBitSize'");
620 }
621 if (tag == "U1") {
622 U1 v;
623 value = v;
624 } else if (tag == "U8") {
625 U8 v;
626 value = v;
627 } else if (tag == "U16") {
628 U16 v;
629 value = v;
630 } else if (tag == "U32") {
631 U32 v;
632 value = v;
633 } else if (tag == "U64") {
634 U64 v;
635 value = v;
636 } else if (tag == "U128") {
637 U128 v;
638 value = v;
639 } else {
640 std::cerr << o << std::endl;
641 throw_or_abort("unknown 'IntegerBitSize' enum variant: " + tag);
642 }
643 }
644};
645
646struct BitSize {
647
648 struct Field {
649 friend bool operator==(const Field&, const Field&);
650 std::vector<uint8_t> bincodeSerialize() const;
651 static Field bincodeDeserialize(std::vector<uint8_t>);
652
653 void msgpack_pack(auto& packer) const {}
654 void msgpack_unpack(msgpack::object const& o) {}
655 };
656
657 struct Integer {
659
660 friend bool operator==(const Integer&, const Integer&);
661 std::vector<uint8_t> bincodeSerialize() const;
662 static Integer bincodeDeserialize(std::vector<uint8_t>);
663
664 void msgpack_pack(auto& packer) const { packer.pack(value); }
665
666 void msgpack_unpack(msgpack::object const& o)
667 {
668 try {
669 o.convert(value);
670 } catch (const msgpack::type_error&) {
671 std::cerr << o << std::endl;
672 throw_or_abort("error converting into newtype 'Integer'");
673 }
674 }
675 };
676
678
679 friend bool operator==(const BitSize&, const BitSize&);
680 std::vector<uint8_t> bincodeSerialize() const;
681 static BitSize bincodeDeserialize(std::vector<uint8_t>);
682
683 void msgpack_pack(auto& packer) const
684 {
685 std::string tag;
686 bool is_unit;
687 switch (value.index()) {
688
689 case 0:
690 tag = "Field";
691 is_unit = true;
692 break;
693 case 1:
694 tag = "Integer";
695 is_unit = false;
696 break;
697 default:
698 throw_or_abort("unknown enum 'BitSize' variant index: " + std::to_string(value.index()));
699 }
700 if (is_unit) {
701 packer.pack(tag);
702 } else {
703 std::visit(
704 [&packer, tag](const auto& arg) {
706 data[tag] = msgpack::object(arg);
707 packer.pack(data);
708 },
709 value);
710 }
711 }
712
713 void msgpack_unpack(msgpack::object const& o)
714 {
715
716 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
717 std::cerr << o << std::endl;
718 throw_or_abort("expected MAP or STR for enum 'BitSize'; got type " + std::to_string(o.type));
719 }
720 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
721 throw_or_abort("expected 1 entry for enum 'BitSize'; got " + std::to_string(o.via.map.size));
722 }
723 std::string tag;
724 try {
725 if (o.type == msgpack::type::object_type::MAP) {
726 o.via.map.ptr[0].key.convert(tag);
727 } else {
728 o.convert(tag);
729 }
730 } catch (const msgpack::type_error&) {
731 std::cerr << o << std::endl;
732 throw_or_abort("error converting tag to string for enum 'BitSize'");
733 }
734 if (tag == "Field") {
735 Field v;
736 value = v;
737 } else if (tag == "Integer") {
738 Integer v;
739 try {
740 o.via.map.ptr[0].val.convert(v);
741 } catch (const msgpack::type_error&) {
742 std::cerr << o << std::endl;
743 throw_or_abort("error converting into enum variant 'BitSize::Integer'");
744 }
745
746 value = v;
747 } else {
748 std::cerr << o << std::endl;
749 throw_or_abort("unknown 'BitSize' enum variant: " + tag);
750 }
751 }
752};
753
755
756 struct Direct {
757 uint64_t value;
758
759 friend bool operator==(const Direct&, const Direct&);
760 std::vector<uint8_t> bincodeSerialize() const;
761 static Direct bincodeDeserialize(std::vector<uint8_t>);
762
763 void msgpack_pack(auto& packer) const { packer.pack(value); }
764
765 void msgpack_unpack(msgpack::object const& o)
766 {
767 try {
768 o.convert(value);
769 } catch (const msgpack::type_error&) {
770 std::cerr << o << std::endl;
771 throw_or_abort("error converting into newtype 'Direct'");
772 }
773 }
774 };
775
776 struct Relative {
777 uint64_t value;
778
779 friend bool operator==(const Relative&, const Relative&);
780 std::vector<uint8_t> bincodeSerialize() const;
781 static Relative bincodeDeserialize(std::vector<uint8_t>);
782
783 void msgpack_pack(auto& packer) const { packer.pack(value); }
784
785 void msgpack_unpack(msgpack::object const& o)
786 {
787 try {
788 o.convert(value);
789 } catch (const msgpack::type_error&) {
790 std::cerr << o << std::endl;
791 throw_or_abort("error converting into newtype 'Relative'");
792 }
793 }
794 };
795
797
798 friend bool operator==(const MemoryAddress&, const MemoryAddress&);
799 std::vector<uint8_t> bincodeSerialize() const;
800 static MemoryAddress bincodeDeserialize(std::vector<uint8_t>);
801
802 void msgpack_pack(auto& packer) const
803 {
804 std::string tag;
805 bool is_unit;
806 switch (value.index()) {
807
808 case 0:
809 tag = "Direct";
810 is_unit = false;
811 break;
812 case 1:
813 tag = "Relative";
814 is_unit = false;
815 break;
816 default:
817 throw_or_abort("unknown enum 'MemoryAddress' variant index: " + std::to_string(value.index()));
818 }
819 if (is_unit) {
820 packer.pack(tag);
821 } else {
822 std::visit(
823 [&packer, tag](const auto& arg) {
825 data[tag] = msgpack::object(arg);
826 packer.pack(data);
827 },
828 value);
829 }
830 }
831
832 void msgpack_unpack(msgpack::object const& o)
833 {
834
835 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
836 std::cerr << o << std::endl;
837 throw_or_abort("expected MAP or STR for enum 'MemoryAddress'; got type " + std::to_string(o.type));
838 }
839 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
840 throw_or_abort("expected 1 entry for enum 'MemoryAddress'; got " + std::to_string(o.via.map.size));
841 }
842 std::string tag;
843 try {
844 if (o.type == msgpack::type::object_type::MAP) {
845 o.via.map.ptr[0].key.convert(tag);
846 } else {
847 o.convert(tag);
848 }
849 } catch (const msgpack::type_error&) {
850 std::cerr << o << std::endl;
851 throw_or_abort("error converting tag to string for enum 'MemoryAddress'");
852 }
853 if (tag == "Direct") {
854 Direct v;
855 try {
856 o.via.map.ptr[0].val.convert(v);
857 } catch (const msgpack::type_error&) {
858 std::cerr << o << std::endl;
859 throw_or_abort("error converting into enum variant 'MemoryAddress::Direct'");
860 }
861
862 value = v;
863 } else if (tag == "Relative") {
864 Relative v;
865 try {
866 o.via.map.ptr[0].val.convert(v);
867 } catch (const msgpack::type_error&) {
868 std::cerr << o << std::endl;
869 throw_or_abort("error converting into enum variant 'MemoryAddress::Relative'");
870 }
871
872 value = v;
873 } else {
874 std::cerr << o << std::endl;
875 throw_or_abort("unknown 'MemoryAddress' enum variant: " + tag);
876 }
877 }
878};
879
880struct HeapArray {
882 uint64_t size;
883
884 friend bool operator==(const HeapArray&, const HeapArray&);
885 std::vector<uint8_t> bincodeSerialize() const;
886 static HeapArray bincodeDeserialize(std::vector<uint8_t>);
887
888 void msgpack_pack(auto& packer) const
889 {
890 packer.pack_map(2);
891 packer.pack(std::make_pair("pointer", pointer));
892 packer.pack(std::make_pair("size", size));
893 }
894
895 void msgpack_unpack(msgpack::object const& o)
896 {
897 auto name = "HeapArray";
898 auto kvmap = Helpers::make_kvmap(o, name);
899 Helpers::conv_fld_from_kvmap(kvmap, name, "pointer", pointer, false);
900 Helpers::conv_fld_from_kvmap(kvmap, name, "size", size, false);
901 }
902};
903
907
908 friend bool operator==(const HeapVector&, const HeapVector&);
909 std::vector<uint8_t> bincodeSerialize() const;
910 static HeapVector bincodeDeserialize(std::vector<uint8_t>);
911
912 void msgpack_pack(auto& packer) const
913 {
914 packer.pack_map(2);
915 packer.pack(std::make_pair("pointer", pointer));
916 packer.pack(std::make_pair("size", size));
917 }
918
919 void msgpack_unpack(msgpack::object const& o)
920 {
921 auto name = "HeapVector";
922 auto kvmap = Helpers::make_kvmap(o, name);
923 Helpers::conv_fld_from_kvmap(kvmap, name, "pointer", pointer, false);
924 Helpers::conv_fld_from_kvmap(kvmap, name, "size", size, false);
925 }
926};
927
929
935
936 friend bool operator==(const AES128Encrypt&, const AES128Encrypt&);
937 std::vector<uint8_t> bincodeSerialize() const;
938 static AES128Encrypt bincodeDeserialize(std::vector<uint8_t>);
939
940 void msgpack_pack(auto& packer) const
941 {
942 packer.pack_map(4);
943 packer.pack(std::make_pair("inputs", inputs));
944 packer.pack(std::make_pair("iv", iv));
945 packer.pack(std::make_pair("key", key));
946 packer.pack(std::make_pair("outputs", outputs));
947 }
948
949 void msgpack_unpack(msgpack::object const& o)
950 {
951 auto name = "AES128Encrypt";
952 auto kvmap = Helpers::make_kvmap(o, name);
953 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
954 Helpers::conv_fld_from_kvmap(kvmap, name, "iv", iv, false);
955 Helpers::conv_fld_from_kvmap(kvmap, name, "key", key, false);
956 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
957 }
958 };
959
960 struct Blake2s {
963
964 friend bool operator==(const Blake2s&, const Blake2s&);
965 std::vector<uint8_t> bincodeSerialize() const;
966 static Blake2s bincodeDeserialize(std::vector<uint8_t>);
967
968 void msgpack_pack(auto& packer) const
969 {
970 packer.pack_map(2);
971 packer.pack(std::make_pair("message", message));
972 packer.pack(std::make_pair("output", output));
973 }
974
975 void msgpack_unpack(msgpack::object const& o)
976 {
977 auto name = "Blake2s";
978 auto kvmap = Helpers::make_kvmap(o, name);
979 Helpers::conv_fld_from_kvmap(kvmap, name, "message", message, false);
980 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
981 }
982 };
983
984 struct Blake3 {
987
988 friend bool operator==(const Blake3&, const Blake3&);
989 std::vector<uint8_t> bincodeSerialize() const;
990 static Blake3 bincodeDeserialize(std::vector<uint8_t>);
991
992 void msgpack_pack(auto& packer) const
993 {
994 packer.pack_map(2);
995 packer.pack(std::make_pair("message", message));
996 packer.pack(std::make_pair("output", output));
997 }
998
999 void msgpack_unpack(msgpack::object const& o)
1000 {
1001 auto name = "Blake3";
1002 auto kvmap = Helpers::make_kvmap(o, name);
1003 Helpers::conv_fld_from_kvmap(kvmap, name, "message", message, false);
1004 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
1005 }
1006 };
1007
1011
1012 friend bool operator==(const Keccakf1600&, const Keccakf1600&);
1013 std::vector<uint8_t> bincodeSerialize() const;
1014 static Keccakf1600 bincodeDeserialize(std::vector<uint8_t>);
1015
1016 void msgpack_pack(auto& packer) const
1017 {
1018 packer.pack_map(2);
1019 packer.pack(std::make_pair("input", input));
1020 packer.pack(std::make_pair("output", output));
1021 }
1022
1023 void msgpack_unpack(msgpack::object const& o)
1024 {
1025 auto name = "Keccakf1600";
1026 auto kvmap = Helpers::make_kvmap(o, name);
1027 Helpers::conv_fld_from_kvmap(kvmap, name, "input", input, false);
1028 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
1029 }
1030 };
1031
1038
1039 friend bool operator==(const EcdsaSecp256k1&, const EcdsaSecp256k1&);
1040 std::vector<uint8_t> bincodeSerialize() const;
1041 static EcdsaSecp256k1 bincodeDeserialize(std::vector<uint8_t>);
1042
1043 void msgpack_pack(auto& packer) const
1044 {
1045 packer.pack_map(5);
1046 packer.pack(std::make_pair("hashed_msg", hashed_msg));
1047 packer.pack(std::make_pair("public_key_x", public_key_x));
1048 packer.pack(std::make_pair("public_key_y", public_key_y));
1049 packer.pack(std::make_pair("signature", signature));
1050 packer.pack(std::make_pair("result", result));
1051 }
1052
1053 void msgpack_unpack(msgpack::object const& o)
1054 {
1055 auto name = "EcdsaSecp256k1";
1056 auto kvmap = Helpers::make_kvmap(o, name);
1057 Helpers::conv_fld_from_kvmap(kvmap, name, "hashed_msg", hashed_msg, false);
1058 Helpers::conv_fld_from_kvmap(kvmap, name, "public_key_x", public_key_x, false);
1059 Helpers::conv_fld_from_kvmap(kvmap, name, "public_key_y", public_key_y, false);
1060 Helpers::conv_fld_from_kvmap(kvmap, name, "signature", signature, false);
1061 Helpers::conv_fld_from_kvmap(kvmap, name, "result", result, false);
1062 }
1063 };
1064
1071
1072 friend bool operator==(const EcdsaSecp256r1&, const EcdsaSecp256r1&);
1073 std::vector<uint8_t> bincodeSerialize() const;
1074 static EcdsaSecp256r1 bincodeDeserialize(std::vector<uint8_t>);
1075
1076 void msgpack_pack(auto& packer) const
1077 {
1078 packer.pack_map(5);
1079 packer.pack(std::make_pair("hashed_msg", hashed_msg));
1080 packer.pack(std::make_pair("public_key_x", public_key_x));
1081 packer.pack(std::make_pair("public_key_y", public_key_y));
1082 packer.pack(std::make_pair("signature", signature));
1083 packer.pack(std::make_pair("result", result));
1084 }
1085
1086 void msgpack_unpack(msgpack::object const& o)
1087 {
1088 auto name = "EcdsaSecp256r1";
1089 auto kvmap = Helpers::make_kvmap(o, name);
1090 Helpers::conv_fld_from_kvmap(kvmap, name, "hashed_msg", hashed_msg, false);
1091 Helpers::conv_fld_from_kvmap(kvmap, name, "public_key_x", public_key_x, false);
1092 Helpers::conv_fld_from_kvmap(kvmap, name, "public_key_y", public_key_y, false);
1093 Helpers::conv_fld_from_kvmap(kvmap, name, "signature", signature, false);
1094 Helpers::conv_fld_from_kvmap(kvmap, name, "result", result, false);
1095 }
1096 };
1097
1102
1103 friend bool operator==(const MultiScalarMul&, const MultiScalarMul&);
1104 std::vector<uint8_t> bincodeSerialize() const;
1105 static MultiScalarMul bincodeDeserialize(std::vector<uint8_t>);
1106
1107 void msgpack_pack(auto& packer) const
1108 {
1109 packer.pack_map(3);
1110 packer.pack(std::make_pair("points", points));
1111 packer.pack(std::make_pair("scalars", scalars));
1112 packer.pack(std::make_pair("outputs", outputs));
1113 }
1114
1115 void msgpack_unpack(msgpack::object const& o)
1116 {
1117 auto name = "MultiScalarMul";
1118 auto kvmap = Helpers::make_kvmap(o, name);
1119 Helpers::conv_fld_from_kvmap(kvmap, name, "points", points, false);
1120 Helpers::conv_fld_from_kvmap(kvmap, name, "scalars", scalars, false);
1121 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
1122 }
1123 };
1124
1133
1134 friend bool operator==(const EmbeddedCurveAdd&, const EmbeddedCurveAdd&);
1135 std::vector<uint8_t> bincodeSerialize() const;
1136 static EmbeddedCurveAdd bincodeDeserialize(std::vector<uint8_t>);
1137
1138 void msgpack_pack(auto& packer) const
1139 {
1140 packer.pack_map(7);
1141 packer.pack(std::make_pair("input1_x", input1_x));
1142 packer.pack(std::make_pair("input1_y", input1_y));
1143 packer.pack(std::make_pair("input1_infinite", input1_infinite));
1144 packer.pack(std::make_pair("input2_x", input2_x));
1145 packer.pack(std::make_pair("input2_y", input2_y));
1146 packer.pack(std::make_pair("input2_infinite", input2_infinite));
1147 packer.pack(std::make_pair("result", result));
1148 }
1149
1150 void msgpack_unpack(msgpack::object const& o)
1151 {
1152 auto name = "EmbeddedCurveAdd";
1153 auto kvmap = Helpers::make_kvmap(o, name);
1154 Helpers::conv_fld_from_kvmap(kvmap, name, "input1_x", input1_x, false);
1155 Helpers::conv_fld_from_kvmap(kvmap, name, "input1_y", input1_y, false);
1156 Helpers::conv_fld_from_kvmap(kvmap, name, "input1_infinite", input1_infinite, false);
1157 Helpers::conv_fld_from_kvmap(kvmap, name, "input2_x", input2_x, false);
1158 Helpers::conv_fld_from_kvmap(kvmap, name, "input2_y", input2_y, false);
1159 Helpers::conv_fld_from_kvmap(kvmap, name, "input2_infinite", input2_infinite, false);
1160 Helpers::conv_fld_from_kvmap(kvmap, name, "result", result, false);
1161 }
1162 };
1163
1164 struct BigIntAdd {
1168
1169 friend bool operator==(const BigIntAdd&, const BigIntAdd&);
1170 std::vector<uint8_t> bincodeSerialize() const;
1171 static BigIntAdd bincodeDeserialize(std::vector<uint8_t>);
1172
1173 void msgpack_pack(auto& packer) const
1174 {
1175 packer.pack_map(3);
1176 packer.pack(std::make_pair("lhs", lhs));
1177 packer.pack(std::make_pair("rhs", rhs));
1178 packer.pack(std::make_pair("output", output));
1179 }
1180
1181 void msgpack_unpack(msgpack::object const& o)
1182 {
1183 auto name = "BigIntAdd";
1184 auto kvmap = Helpers::make_kvmap(o, name);
1185 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
1186 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
1187 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
1188 }
1189 };
1190
1191 struct BigIntSub {
1195
1196 friend bool operator==(const BigIntSub&, const BigIntSub&);
1197 std::vector<uint8_t> bincodeSerialize() const;
1198 static BigIntSub bincodeDeserialize(std::vector<uint8_t>);
1199
1200 void msgpack_pack(auto& packer) const
1201 {
1202 packer.pack_map(3);
1203 packer.pack(std::make_pair("lhs", lhs));
1204 packer.pack(std::make_pair("rhs", rhs));
1205 packer.pack(std::make_pair("output", output));
1206 }
1207
1208 void msgpack_unpack(msgpack::object const& o)
1209 {
1210 auto name = "BigIntSub";
1211 auto kvmap = Helpers::make_kvmap(o, name);
1212 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
1213 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
1214 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
1215 }
1216 };
1217
1218 struct BigIntMul {
1222
1223 friend bool operator==(const BigIntMul&, const BigIntMul&);
1224 std::vector<uint8_t> bincodeSerialize() const;
1225 static BigIntMul bincodeDeserialize(std::vector<uint8_t>);
1226
1227 void msgpack_pack(auto& packer) const
1228 {
1229 packer.pack_map(3);
1230 packer.pack(std::make_pair("lhs", lhs));
1231 packer.pack(std::make_pair("rhs", rhs));
1232 packer.pack(std::make_pair("output", output));
1233 }
1234
1235 void msgpack_unpack(msgpack::object const& o)
1236 {
1237 auto name = "BigIntMul";
1238 auto kvmap = Helpers::make_kvmap(o, name);
1239 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
1240 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
1241 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
1242 }
1243 };
1244
1245 struct BigIntDiv {
1249
1250 friend bool operator==(const BigIntDiv&, const BigIntDiv&);
1251 std::vector<uint8_t> bincodeSerialize() const;
1252 static BigIntDiv bincodeDeserialize(std::vector<uint8_t>);
1253
1254 void msgpack_pack(auto& packer) const
1255 {
1256 packer.pack_map(3);
1257 packer.pack(std::make_pair("lhs", lhs));
1258 packer.pack(std::make_pair("rhs", rhs));
1259 packer.pack(std::make_pair("output", output));
1260 }
1261
1262 void msgpack_unpack(msgpack::object const& o)
1263 {
1264 auto name = "BigIntDiv";
1265 auto kvmap = Helpers::make_kvmap(o, name);
1266 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
1267 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
1268 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
1269 }
1270 };
1271
1276
1277 friend bool operator==(const BigIntFromLeBytes&, const BigIntFromLeBytes&);
1278 std::vector<uint8_t> bincodeSerialize() const;
1279 static BigIntFromLeBytes bincodeDeserialize(std::vector<uint8_t>);
1280
1281 void msgpack_pack(auto& packer) const
1282 {
1283 packer.pack_map(3);
1284 packer.pack(std::make_pair("inputs", inputs));
1285 packer.pack(std::make_pair("modulus", modulus));
1286 packer.pack(std::make_pair("output", output));
1287 }
1288
1289 void msgpack_unpack(msgpack::object const& o)
1290 {
1291 auto name = "BigIntFromLeBytes";
1292 auto kvmap = Helpers::make_kvmap(o, name);
1293 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
1294 Helpers::conv_fld_from_kvmap(kvmap, name, "modulus", modulus, false);
1295 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
1296 }
1297 };
1298
1302
1303 friend bool operator==(const BigIntToLeBytes&, const BigIntToLeBytes&);
1304 std::vector<uint8_t> bincodeSerialize() const;
1305 static BigIntToLeBytes bincodeDeserialize(std::vector<uint8_t>);
1306
1307 void msgpack_pack(auto& packer) const
1308 {
1309 packer.pack_map(2);
1310 packer.pack(std::make_pair("input", input));
1311 packer.pack(std::make_pair("output", output));
1312 }
1313
1314 void msgpack_unpack(msgpack::object const& o)
1315 {
1316 auto name = "BigIntToLeBytes";
1317 auto kvmap = Helpers::make_kvmap(o, name);
1318 Helpers::conv_fld_from_kvmap(kvmap, name, "input", input, false);
1319 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
1320 }
1321 };
1322
1327
1328 friend bool operator==(const Poseidon2Permutation&, const Poseidon2Permutation&);
1329 std::vector<uint8_t> bincodeSerialize() const;
1330 static Poseidon2Permutation bincodeDeserialize(std::vector<uint8_t>);
1331
1332 void msgpack_pack(auto& packer) const
1333 {
1334 packer.pack_map(3);
1335 packer.pack(std::make_pair("message", message));
1336 packer.pack(std::make_pair("output", output));
1337 packer.pack(std::make_pair("len", len));
1338 }
1339
1340 void msgpack_unpack(msgpack::object const& o)
1341 {
1342 auto name = "Poseidon2Permutation";
1343 auto kvmap = Helpers::make_kvmap(o, name);
1344 Helpers::conv_fld_from_kvmap(kvmap, name, "message", message, false);
1345 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
1346 Helpers::conv_fld_from_kvmap(kvmap, name, "len", len, false);
1347 }
1348 };
1349
1354
1355 friend bool operator==(const Sha256Compression&, const Sha256Compression&);
1356 std::vector<uint8_t> bincodeSerialize() const;
1357 static Sha256Compression bincodeDeserialize(std::vector<uint8_t>);
1358
1359 void msgpack_pack(auto& packer) const
1360 {
1361 packer.pack_map(3);
1362 packer.pack(std::make_pair("input", input));
1363 packer.pack(std::make_pair("hash_values", hash_values));
1364 packer.pack(std::make_pair("output", output));
1365 }
1366
1367 void msgpack_unpack(msgpack::object const& o)
1368 {
1369 auto name = "Sha256Compression";
1370 auto kvmap = Helpers::make_kvmap(o, name);
1371 Helpers::conv_fld_from_kvmap(kvmap, name, "input", input, false);
1372 Helpers::conv_fld_from_kvmap(kvmap, name, "hash_values", hash_values, false);
1373 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
1374 }
1375 };
1376
1377 struct ToRadix {
1383
1384 friend bool operator==(const ToRadix&, const ToRadix&);
1385 std::vector<uint8_t> bincodeSerialize() const;
1386 static ToRadix bincodeDeserialize(std::vector<uint8_t>);
1387
1388 void msgpack_pack(auto& packer) const
1389 {
1390 packer.pack_map(5);
1391 packer.pack(std::make_pair("input", input));
1392 packer.pack(std::make_pair("radix", radix));
1393 packer.pack(std::make_pair("output_pointer", output_pointer));
1394 packer.pack(std::make_pair("num_limbs", num_limbs));
1395 packer.pack(std::make_pair("output_bits", output_bits));
1396 }
1397
1398 void msgpack_unpack(msgpack::object const& o)
1399 {
1400 auto name = "ToRadix";
1401 auto kvmap = Helpers::make_kvmap(o, name);
1402 Helpers::conv_fld_from_kvmap(kvmap, name, "input", input, false);
1403 Helpers::conv_fld_from_kvmap(kvmap, name, "radix", radix, false);
1404 Helpers::conv_fld_from_kvmap(kvmap, name, "output_pointer", output_pointer, false);
1405 Helpers::conv_fld_from_kvmap(kvmap, name, "num_limbs", num_limbs, false);
1406 Helpers::conv_fld_from_kvmap(kvmap, name, "output_bits", output_bits, false);
1407 }
1408 };
1409
1410 std::variant<AES128Encrypt,
1411 Blake2s,
1412 Blake3,
1413 Keccakf1600,
1414 EcdsaSecp256k1,
1415 EcdsaSecp256r1,
1416 MultiScalarMul,
1417 EmbeddedCurveAdd,
1418 BigIntAdd,
1419 BigIntSub,
1420 BigIntMul,
1421 BigIntDiv,
1422 BigIntFromLeBytes,
1423 BigIntToLeBytes,
1424 Poseidon2Permutation,
1425 Sha256Compression,
1426 ToRadix>
1428
1429 friend bool operator==(const BlackBoxOp&, const BlackBoxOp&);
1430 std::vector<uint8_t> bincodeSerialize() const;
1431 static BlackBoxOp bincodeDeserialize(std::vector<uint8_t>);
1432
1433 void msgpack_pack(auto& packer) const
1434 {
1435 std::string tag;
1436 bool is_unit;
1437 switch (value.index()) {
1438
1439 case 0:
1440 tag = "AES128Encrypt";
1441 is_unit = false;
1442 break;
1443 case 1:
1444 tag = "Blake2s";
1445 is_unit = false;
1446 break;
1447 case 2:
1448 tag = "Blake3";
1449 is_unit = false;
1450 break;
1451 case 3:
1452 tag = "Keccakf1600";
1453 is_unit = false;
1454 break;
1455 case 4:
1456 tag = "EcdsaSecp256k1";
1457 is_unit = false;
1458 break;
1459 case 5:
1460 tag = "EcdsaSecp256r1";
1461 is_unit = false;
1462 break;
1463 case 6:
1464 tag = "MultiScalarMul";
1465 is_unit = false;
1466 break;
1467 case 7:
1468 tag = "EmbeddedCurveAdd";
1469 is_unit = false;
1470 break;
1471 case 8:
1472 tag = "BigIntAdd";
1473 is_unit = false;
1474 break;
1475 case 9:
1476 tag = "BigIntSub";
1477 is_unit = false;
1478 break;
1479 case 10:
1480 tag = "BigIntMul";
1481 is_unit = false;
1482 break;
1483 case 11:
1484 tag = "BigIntDiv";
1485 is_unit = false;
1486 break;
1487 case 12:
1488 tag = "BigIntFromLeBytes";
1489 is_unit = false;
1490 break;
1491 case 13:
1492 tag = "BigIntToLeBytes";
1493 is_unit = false;
1494 break;
1495 case 14:
1496 tag = "Poseidon2Permutation";
1497 is_unit = false;
1498 break;
1499 case 15:
1500 tag = "Sha256Compression";
1501 is_unit = false;
1502 break;
1503 case 16:
1504 tag = "ToRadix";
1505 is_unit = false;
1506 break;
1507 default:
1508 throw_or_abort("unknown enum 'BlackBoxOp' variant index: " + std::to_string(value.index()));
1509 }
1510 if (is_unit) {
1511 packer.pack(tag);
1512 } else {
1513 std::visit(
1514 [&packer, tag](const auto& arg) {
1516 data[tag] = msgpack::object(arg);
1517 packer.pack(data);
1518 },
1519 value);
1520 }
1521 }
1522
1523 void msgpack_unpack(msgpack::object const& o)
1524 {
1525
1526 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
1527 std::cerr << o << std::endl;
1528 throw_or_abort("expected MAP or STR for enum 'BlackBoxOp'; got type " + std::to_string(o.type));
1529 }
1530 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
1531 throw_or_abort("expected 1 entry for enum 'BlackBoxOp'; got " + std::to_string(o.via.map.size));
1532 }
1533 std::string tag;
1534 try {
1535 if (o.type == msgpack::type::object_type::MAP) {
1536 o.via.map.ptr[0].key.convert(tag);
1537 } else {
1538 o.convert(tag);
1539 }
1540 } catch (const msgpack::type_error&) {
1541 std::cerr << o << std::endl;
1542 throw_or_abort("error converting tag to string for enum 'BlackBoxOp'");
1543 }
1544 if (tag == "AES128Encrypt") {
1545 AES128Encrypt v;
1546 try {
1547 o.via.map.ptr[0].val.convert(v);
1548 } catch (const msgpack::type_error&) {
1549 std::cerr << o << std::endl;
1550 throw_or_abort("error converting into enum variant 'BlackBoxOp::AES128Encrypt'");
1551 }
1552
1553 value = v;
1554 } else if (tag == "Blake2s") {
1555 Blake2s v;
1556 try {
1557 o.via.map.ptr[0].val.convert(v);
1558 } catch (const msgpack::type_error&) {
1559 std::cerr << o << std::endl;
1560 throw_or_abort("error converting into enum variant 'BlackBoxOp::Blake2s'");
1561 }
1562
1563 value = v;
1564 } else if (tag == "Blake3") {
1565 Blake3 v;
1566 try {
1567 o.via.map.ptr[0].val.convert(v);
1568 } catch (const msgpack::type_error&) {
1569 std::cerr << o << std::endl;
1570 throw_or_abort("error converting into enum variant 'BlackBoxOp::Blake3'");
1571 }
1572
1573 value = v;
1574 } else if (tag == "Keccakf1600") {
1575 Keccakf1600 v;
1576 try {
1577 o.via.map.ptr[0].val.convert(v);
1578 } catch (const msgpack::type_error&) {
1579 std::cerr << o << std::endl;
1580 throw_or_abort("error converting into enum variant 'BlackBoxOp::Keccakf1600'");
1581 }
1582
1583 value = v;
1584 } else if (tag == "EcdsaSecp256k1") {
1586 try {
1587 o.via.map.ptr[0].val.convert(v);
1588 } catch (const msgpack::type_error&) {
1589 std::cerr << o << std::endl;
1590 throw_or_abort("error converting into enum variant 'BlackBoxOp::EcdsaSecp256k1'");
1591 }
1592
1593 value = v;
1594 } else if (tag == "EcdsaSecp256r1") {
1596 try {
1597 o.via.map.ptr[0].val.convert(v);
1598 } catch (const msgpack::type_error&) {
1599 std::cerr << o << std::endl;
1600 throw_or_abort("error converting into enum variant 'BlackBoxOp::EcdsaSecp256r1'");
1601 }
1602
1603 value = v;
1604 } else if (tag == "MultiScalarMul") {
1606 try {
1607 o.via.map.ptr[0].val.convert(v);
1608 } catch (const msgpack::type_error&) {
1609 std::cerr << o << std::endl;
1610 throw_or_abort("error converting into enum variant 'BlackBoxOp::MultiScalarMul'");
1611 }
1612
1613 value = v;
1614 } else if (tag == "EmbeddedCurveAdd") {
1616 try {
1617 o.via.map.ptr[0].val.convert(v);
1618 } catch (const msgpack::type_error&) {
1619 std::cerr << o << std::endl;
1620 throw_or_abort("error converting into enum variant 'BlackBoxOp::EmbeddedCurveAdd'");
1621 }
1622
1623 value = v;
1624 } else if (tag == "BigIntAdd") {
1625 BigIntAdd v;
1626 try {
1627 o.via.map.ptr[0].val.convert(v);
1628 } catch (const msgpack::type_error&) {
1629 std::cerr << o << std::endl;
1630 throw_or_abort("error converting into enum variant 'BlackBoxOp::BigIntAdd'");
1631 }
1632
1633 value = v;
1634 } else if (tag == "BigIntSub") {
1635 BigIntSub v;
1636 try {
1637 o.via.map.ptr[0].val.convert(v);
1638 } catch (const msgpack::type_error&) {
1639 std::cerr << o << std::endl;
1640 throw_or_abort("error converting into enum variant 'BlackBoxOp::BigIntSub'");
1641 }
1642
1643 value = v;
1644 } else if (tag == "BigIntMul") {
1645 BigIntMul v;
1646 try {
1647 o.via.map.ptr[0].val.convert(v);
1648 } catch (const msgpack::type_error&) {
1649 std::cerr << o << std::endl;
1650 throw_or_abort("error converting into enum variant 'BlackBoxOp::BigIntMul'");
1651 }
1652
1653 value = v;
1654 } else if (tag == "BigIntDiv") {
1655 BigIntDiv v;
1656 try {
1657 o.via.map.ptr[0].val.convert(v);
1658 } catch (const msgpack::type_error&) {
1659 std::cerr << o << std::endl;
1660 throw_or_abort("error converting into enum variant 'BlackBoxOp::BigIntDiv'");
1661 }
1662
1663 value = v;
1664 } else if (tag == "BigIntFromLeBytes") {
1666 try {
1667 o.via.map.ptr[0].val.convert(v);
1668 } catch (const msgpack::type_error&) {
1669 std::cerr << o << std::endl;
1670 throw_or_abort("error converting into enum variant 'BlackBoxOp::BigIntFromLeBytes'");
1671 }
1672
1673 value = v;
1674 } else if (tag == "BigIntToLeBytes") {
1676 try {
1677 o.via.map.ptr[0].val.convert(v);
1678 } catch (const msgpack::type_error&) {
1679 std::cerr << o << std::endl;
1680 throw_or_abort("error converting into enum variant 'BlackBoxOp::BigIntToLeBytes'");
1681 }
1682
1683 value = v;
1684 } else if (tag == "Poseidon2Permutation") {
1686 try {
1687 o.via.map.ptr[0].val.convert(v);
1688 } catch (const msgpack::type_error&) {
1689 std::cerr << o << std::endl;
1690 throw_or_abort("error converting into enum variant 'BlackBoxOp::Poseidon2Permutation'");
1691 }
1692
1693 value = v;
1694 } else if (tag == "Sha256Compression") {
1696 try {
1697 o.via.map.ptr[0].val.convert(v);
1698 } catch (const msgpack::type_error&) {
1699 std::cerr << o << std::endl;
1700 throw_or_abort("error converting into enum variant 'BlackBoxOp::Sha256Compression'");
1701 }
1702
1703 value = v;
1704 } else if (tag == "ToRadix") {
1705 ToRadix v;
1706 try {
1707 o.via.map.ptr[0].val.convert(v);
1708 } catch (const msgpack::type_error&) {
1709 std::cerr << o << std::endl;
1710 throw_or_abort("error converting into enum variant 'BlackBoxOp::ToRadix'");
1711 }
1712
1713 value = v;
1714 } else {
1715 std::cerr << o << std::endl;
1716 throw_or_abort("unknown 'BlackBoxOp' enum variant: " + tag);
1717 }
1718 }
1719};
1720
1721struct HeapValueType;
1722
1724
1725 struct Simple {
1727
1728 friend bool operator==(const Simple&, const Simple&);
1729 std::vector<uint8_t> bincodeSerialize() const;
1730 static Simple bincodeDeserialize(std::vector<uint8_t>);
1731
1732 void msgpack_pack(auto& packer) const { packer.pack(value); }
1733
1734 void msgpack_unpack(msgpack::object const& o)
1735 {
1736 try {
1737 o.convert(value);
1738 } catch (const msgpack::type_error&) {
1739 std::cerr << o << std::endl;
1740 throw_or_abort("error converting into newtype 'Simple'");
1741 }
1742 }
1743 };
1744
1745 struct Array {
1746 std::vector<Acir::HeapValueType> value_types;
1747 uint64_t size;
1748
1749 friend bool operator==(const Array&, const Array&);
1750 std::vector<uint8_t> bincodeSerialize() const;
1751 static Array bincodeDeserialize(std::vector<uint8_t>);
1752
1753 void msgpack_pack(auto& packer) const
1754 {
1755 packer.pack_map(2);
1756 packer.pack(std::make_pair("value_types", value_types));
1757 packer.pack(std::make_pair("size", size));
1758 }
1759
1760 void msgpack_unpack(msgpack::object const& o)
1761 {
1762 auto name = "Array";
1763 auto kvmap = Helpers::make_kvmap(o, name);
1764 Helpers::conv_fld_from_kvmap(kvmap, name, "value_types", value_types, false);
1765 Helpers::conv_fld_from_kvmap(kvmap, name, "size", size, false);
1766 }
1767 };
1768
1769 struct Vector {
1770 std::vector<Acir::HeapValueType> value_types;
1771
1772 friend bool operator==(const Vector&, const Vector&);
1773 std::vector<uint8_t> bincodeSerialize() const;
1774 static Vector bincodeDeserialize(std::vector<uint8_t>);
1775
1776 void msgpack_pack(auto& packer) const
1777 {
1778 packer.pack_map(1);
1779 packer.pack(std::make_pair("value_types", value_types));
1780 }
1781
1782 void msgpack_unpack(msgpack::object const& o)
1783 {
1784 auto name = "Vector";
1785 auto kvmap = Helpers::make_kvmap(o, name);
1786 Helpers::conv_fld_from_kvmap(kvmap, name, "value_types", value_types, false);
1787 }
1788 };
1789
1791
1792 friend bool operator==(const HeapValueType&, const HeapValueType&);
1793 std::vector<uint8_t> bincodeSerialize() const;
1794 static HeapValueType bincodeDeserialize(std::vector<uint8_t>);
1795
1796 void msgpack_pack(auto& packer) const
1797 {
1798 std::string tag;
1799 bool is_unit;
1800 switch (value.index()) {
1801
1802 case 0:
1803 tag = "Simple";
1804 is_unit = false;
1805 break;
1806 case 1:
1807 tag = "Array";
1808 is_unit = false;
1809 break;
1810 case 2:
1811 tag = "Vector";
1812 is_unit = false;
1813 break;
1814 default:
1815 throw_or_abort("unknown enum 'HeapValueType' variant index: " + std::to_string(value.index()));
1816 }
1817 if (is_unit) {
1818 packer.pack(tag);
1819 } else {
1820 std::visit(
1821 [&packer, tag](const auto& arg) {
1823 data[tag] = msgpack::object(arg);
1824 packer.pack(data);
1825 },
1826 value);
1827 }
1828 }
1829
1830 void msgpack_unpack(msgpack::object const& o)
1831 {
1832
1833 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
1834 std::cerr << o << std::endl;
1835 throw_or_abort("expected MAP or STR for enum 'HeapValueType'; got type " + std::to_string(o.type));
1836 }
1837 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
1838 throw_or_abort("expected 1 entry for enum 'HeapValueType'; got " + std::to_string(o.via.map.size));
1839 }
1840 std::string tag;
1841 try {
1842 if (o.type == msgpack::type::object_type::MAP) {
1843 o.via.map.ptr[0].key.convert(tag);
1844 } else {
1845 o.convert(tag);
1846 }
1847 } catch (const msgpack::type_error&) {
1848 std::cerr << o << std::endl;
1849 throw_or_abort("error converting tag to string for enum 'HeapValueType'");
1850 }
1851 if (tag == "Simple") {
1852 Simple v;
1853 try {
1854 o.via.map.ptr[0].val.convert(v);
1855 } catch (const msgpack::type_error&) {
1856 std::cerr << o << std::endl;
1857 throw_or_abort("error converting into enum variant 'HeapValueType::Simple'");
1858 }
1859
1860 value = v;
1861 } else if (tag == "Array") {
1862 Array v;
1863 try {
1864 o.via.map.ptr[0].val.convert(v);
1865 } catch (const msgpack::type_error&) {
1866 std::cerr << o << std::endl;
1867 throw_or_abort("error converting into enum variant 'HeapValueType::Array'");
1868 }
1869
1870 value = v;
1871 } else if (tag == "Vector") {
1872 Vector v;
1873 try {
1874 o.via.map.ptr[0].val.convert(v);
1875 } catch (const msgpack::type_error&) {
1876 std::cerr << o << std::endl;
1877 throw_or_abort("error converting into enum variant 'HeapValueType::Vector'");
1878 }
1879
1880 value = v;
1881 } else {
1882 std::cerr << o << std::endl;
1883 throw_or_abort("unknown 'HeapValueType' enum variant: " + tag);
1884 }
1885 }
1886};
1887
1889
1892
1893 friend bool operator==(const MemoryAddress&, const MemoryAddress&);
1894 std::vector<uint8_t> bincodeSerialize() const;
1895 static MemoryAddress bincodeDeserialize(std::vector<uint8_t>);
1896
1897 void msgpack_pack(auto& packer) const { packer.pack(value); }
1898
1899 void msgpack_unpack(msgpack::object const& o)
1900 {
1901 try {
1902 o.convert(value);
1903 } catch (const msgpack::type_error&) {
1904 std::cerr << o << std::endl;
1905 throw_or_abort("error converting into newtype 'MemoryAddress'");
1906 }
1907 }
1908 };
1909
1910 struct HeapArray {
1912
1913 friend bool operator==(const HeapArray&, const HeapArray&);
1914 std::vector<uint8_t> bincodeSerialize() const;
1915 static HeapArray bincodeDeserialize(std::vector<uint8_t>);
1916
1917 void msgpack_pack(auto& packer) const { packer.pack(value); }
1918
1919 void msgpack_unpack(msgpack::object const& o)
1920 {
1921 try {
1922 o.convert(value);
1923 } catch (const msgpack::type_error&) {
1924 std::cerr << o << std::endl;
1925 throw_or_abort("error converting into newtype 'HeapArray'");
1926 }
1927 }
1928 };
1929
1930 struct HeapVector {
1932
1933 friend bool operator==(const HeapVector&, const HeapVector&);
1934 std::vector<uint8_t> bincodeSerialize() const;
1935 static HeapVector bincodeDeserialize(std::vector<uint8_t>);
1936
1937 void msgpack_pack(auto& packer) const { packer.pack(value); }
1938
1939 void msgpack_unpack(msgpack::object const& o)
1940 {
1941 try {
1942 o.convert(value);
1943 } catch (const msgpack::type_error&) {
1944 std::cerr << o << std::endl;
1945 throw_or_abort("error converting into newtype 'HeapVector'");
1946 }
1947 }
1948 };
1949
1951
1952 friend bool operator==(const ValueOrArray&, const ValueOrArray&);
1953 std::vector<uint8_t> bincodeSerialize() const;
1954 static ValueOrArray bincodeDeserialize(std::vector<uint8_t>);
1955
1956 void msgpack_pack(auto& packer) const
1957 {
1958 std::string tag;
1959 bool is_unit;
1960 switch (value.index()) {
1961
1962 case 0:
1963 tag = "MemoryAddress";
1964 is_unit = false;
1965 break;
1966 case 1:
1967 tag = "HeapArray";
1968 is_unit = false;
1969 break;
1970 case 2:
1971 tag = "HeapVector";
1972 is_unit = false;
1973 break;
1974 default:
1975 throw_or_abort("unknown enum 'ValueOrArray' variant index: " + std::to_string(value.index()));
1976 }
1977 if (is_unit) {
1978 packer.pack(tag);
1979 } else {
1980 std::visit(
1981 [&packer, tag](const auto& arg) {
1983 data[tag] = msgpack::object(arg);
1984 packer.pack(data);
1985 },
1986 value);
1987 }
1988 }
1989
1990 void msgpack_unpack(msgpack::object const& o)
1991 {
1992
1993 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
1994 std::cerr << o << std::endl;
1995 throw_or_abort("expected MAP or STR for enum 'ValueOrArray'; got type " + std::to_string(o.type));
1996 }
1997 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
1998 throw_or_abort("expected 1 entry for enum 'ValueOrArray'; got " + std::to_string(o.via.map.size));
1999 }
2000 std::string tag;
2001 try {
2002 if (o.type == msgpack::type::object_type::MAP) {
2003 o.via.map.ptr[0].key.convert(tag);
2004 } else {
2005 o.convert(tag);
2006 }
2007 } catch (const msgpack::type_error&) {
2008 std::cerr << o << std::endl;
2009 throw_or_abort("error converting tag to string for enum 'ValueOrArray'");
2010 }
2011 if (tag == "MemoryAddress") {
2012 MemoryAddress v;
2013 try {
2014 o.via.map.ptr[0].val.convert(v);
2015 } catch (const msgpack::type_error&) {
2016 std::cerr << o << std::endl;
2017 throw_or_abort("error converting into enum variant 'ValueOrArray::MemoryAddress'");
2018 }
2019
2020 value = v;
2021 } else if (tag == "HeapArray") {
2022 HeapArray v;
2023 try {
2024 o.via.map.ptr[0].val.convert(v);
2025 } catch (const msgpack::type_error&) {
2026 std::cerr << o << std::endl;
2027 throw_or_abort("error converting into enum variant 'ValueOrArray::HeapArray'");
2028 }
2029
2030 value = v;
2031 } else if (tag == "HeapVector") {
2032 HeapVector v;
2033 try {
2034 o.via.map.ptr[0].val.convert(v);
2035 } catch (const msgpack::type_error&) {
2036 std::cerr << o << std::endl;
2037 throw_or_abort("error converting into enum variant 'ValueOrArray::HeapVector'");
2038 }
2039
2040 value = v;
2041 } else {
2042 std::cerr << o << std::endl;
2043 throw_or_abort("unknown 'ValueOrArray' enum variant: " + tag);
2044 }
2045 }
2046};
2047
2049
2055
2056 friend bool operator==(const BinaryFieldOp&, const BinaryFieldOp&);
2057 std::vector<uint8_t> bincodeSerialize() const;
2058 static BinaryFieldOp bincodeDeserialize(std::vector<uint8_t>);
2059
2060 void msgpack_pack(auto& packer) const
2061 {
2062 packer.pack_map(4);
2063 packer.pack(std::make_pair("destination", destination));
2064 packer.pack(std::make_pair("op", op));
2065 packer.pack(std::make_pair("lhs", lhs));
2066 packer.pack(std::make_pair("rhs", rhs));
2067 }
2068
2069 void msgpack_unpack(msgpack::object const& o)
2070 {
2071 auto name = "BinaryFieldOp";
2072 auto kvmap = Helpers::make_kvmap(o, name);
2073 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
2074 Helpers::conv_fld_from_kvmap(kvmap, name, "op", op, false);
2075 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
2076 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
2077 }
2078 };
2079
2086
2087 friend bool operator==(const BinaryIntOp&, const BinaryIntOp&);
2088 std::vector<uint8_t> bincodeSerialize() const;
2089 static BinaryIntOp bincodeDeserialize(std::vector<uint8_t>);
2090
2091 void msgpack_pack(auto& packer) const
2092 {
2093 packer.pack_map(5);
2094 packer.pack(std::make_pair("destination", destination));
2095 packer.pack(std::make_pair("op", op));
2096 packer.pack(std::make_pair("bit_size", bit_size));
2097 packer.pack(std::make_pair("lhs", lhs));
2098 packer.pack(std::make_pair("rhs", rhs));
2099 }
2100
2101 void msgpack_unpack(msgpack::object const& o)
2102 {
2103 auto name = "BinaryIntOp";
2104 auto kvmap = Helpers::make_kvmap(o, name);
2105 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
2106 Helpers::conv_fld_from_kvmap(kvmap, name, "op", op, false);
2107 Helpers::conv_fld_from_kvmap(kvmap, name, "bit_size", bit_size, false);
2108 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
2109 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
2110 }
2111 };
2112
2113 struct Not {
2117
2118 friend bool operator==(const Not&, const Not&);
2119 std::vector<uint8_t> bincodeSerialize() const;
2120 static Not bincodeDeserialize(std::vector<uint8_t>);
2121
2122 void msgpack_pack(auto& packer) const
2123 {
2124 packer.pack_map(3);
2125 packer.pack(std::make_pair("destination", destination));
2126 packer.pack(std::make_pair("source", source));
2127 packer.pack(std::make_pair("bit_size", bit_size));
2128 }
2129
2130 void msgpack_unpack(msgpack::object const& o)
2131 {
2132 auto name = "Not";
2133 auto kvmap = Helpers::make_kvmap(o, name);
2134 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
2135 Helpers::conv_fld_from_kvmap(kvmap, name, "source", source, false);
2136 Helpers::conv_fld_from_kvmap(kvmap, name, "bit_size", bit_size, false);
2137 }
2138 };
2139
2140 struct Cast {
2144
2145 friend bool operator==(const Cast&, const Cast&);
2146 std::vector<uint8_t> bincodeSerialize() const;
2147 static Cast bincodeDeserialize(std::vector<uint8_t>);
2148
2149 void msgpack_pack(auto& packer) const
2150 {
2151 packer.pack_map(3);
2152 packer.pack(std::make_pair("destination", destination));
2153 packer.pack(std::make_pair("source", source));
2154 packer.pack(std::make_pair("bit_size", bit_size));
2155 }
2156
2157 void msgpack_unpack(msgpack::object const& o)
2158 {
2159 auto name = "Cast";
2160 auto kvmap = Helpers::make_kvmap(o, name);
2161 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
2162 Helpers::conv_fld_from_kvmap(kvmap, name, "source", source, false);
2163 Helpers::conv_fld_from_kvmap(kvmap, name, "bit_size", bit_size, false);
2164 }
2165 };
2166
2167 struct JumpIfNot {
2169 uint64_t location;
2170
2171 friend bool operator==(const JumpIfNot&, const JumpIfNot&);
2172 std::vector<uint8_t> bincodeSerialize() const;
2173 static JumpIfNot bincodeDeserialize(std::vector<uint8_t>);
2174
2175 void msgpack_pack(auto& packer) const
2176 {
2177 packer.pack_map(2);
2178 packer.pack(std::make_pair("condition", condition));
2179 packer.pack(std::make_pair("location", location));
2180 }
2181
2182 void msgpack_unpack(msgpack::object const& o)
2183 {
2184 auto name = "JumpIfNot";
2185 auto kvmap = Helpers::make_kvmap(o, name);
2186 Helpers::conv_fld_from_kvmap(kvmap, name, "condition", condition, false);
2187 Helpers::conv_fld_from_kvmap(kvmap, name, "location", location, false);
2188 }
2189 };
2190
2191 struct JumpIf {
2193 uint64_t location;
2194
2195 friend bool operator==(const JumpIf&, const JumpIf&);
2196 std::vector<uint8_t> bincodeSerialize() const;
2197 static JumpIf bincodeDeserialize(std::vector<uint8_t>);
2198
2199 void msgpack_pack(auto& packer) const
2200 {
2201 packer.pack_map(2);
2202 packer.pack(std::make_pair("condition", condition));
2203 packer.pack(std::make_pair("location", location));
2204 }
2205
2206 void msgpack_unpack(msgpack::object const& o)
2207 {
2208 auto name = "JumpIf";
2209 auto kvmap = Helpers::make_kvmap(o, name);
2210 Helpers::conv_fld_from_kvmap(kvmap, name, "condition", condition, false);
2211 Helpers::conv_fld_from_kvmap(kvmap, name, "location", location, false);
2212 }
2213 };
2214
2215 struct Jump {
2216 uint64_t location;
2217
2218 friend bool operator==(const Jump&, const Jump&);
2219 std::vector<uint8_t> bincodeSerialize() const;
2220 static Jump bincodeDeserialize(std::vector<uint8_t>);
2221
2222 void msgpack_pack(auto& packer) const
2223 {
2224 packer.pack_map(1);
2225 packer.pack(std::make_pair("location", location));
2226 }
2227
2228 void msgpack_unpack(msgpack::object const& o)
2229 {
2230 auto name = "Jump";
2231 auto kvmap = Helpers::make_kvmap(o, name);
2232 Helpers::conv_fld_from_kvmap(kvmap, name, "location", location, false);
2233 }
2234 };
2235
2240
2241 friend bool operator==(const CalldataCopy&, const CalldataCopy&);
2242 std::vector<uint8_t> bincodeSerialize() const;
2243 static CalldataCopy bincodeDeserialize(std::vector<uint8_t>);
2244
2245 void msgpack_pack(auto& packer) const
2246 {
2247 packer.pack_map(3);
2248 packer.pack(std::make_pair("destination_address", destination_address));
2249 packer.pack(std::make_pair("size_address", size_address));
2250 packer.pack(std::make_pair("offset_address", offset_address));
2251 }
2252
2253 void msgpack_unpack(msgpack::object const& o)
2254 {
2255 auto name = "CalldataCopy";
2256 auto kvmap = Helpers::make_kvmap(o, name);
2257 Helpers::conv_fld_from_kvmap(kvmap, name, "destination_address", destination_address, false);
2258 Helpers::conv_fld_from_kvmap(kvmap, name, "size_address", size_address, false);
2259 Helpers::conv_fld_from_kvmap(kvmap, name, "offset_address", offset_address, false);
2260 }
2261 };
2262
2263 struct Call {
2264 uint64_t location;
2265
2266 friend bool operator==(const Call&, const Call&);
2267 std::vector<uint8_t> bincodeSerialize() const;
2268 static Call bincodeDeserialize(std::vector<uint8_t>);
2269
2270 void msgpack_pack(auto& packer) const
2271 {
2272 packer.pack_map(1);
2273 packer.pack(std::make_pair("location", location));
2274 }
2275
2276 void msgpack_unpack(msgpack::object const& o)
2277 {
2278 auto name = "Call";
2279 auto kvmap = Helpers::make_kvmap(o, name);
2280 Helpers::conv_fld_from_kvmap(kvmap, name, "location", location, false);
2281 }
2282 };
2283
2284 struct Const {
2287 std::string value;
2288
2289 friend bool operator==(const Const&, const Const&);
2290 std::vector<uint8_t> bincodeSerialize() const;
2291 static Const bincodeDeserialize(std::vector<uint8_t>);
2292
2293 void msgpack_pack(auto& packer) const
2294 {
2295 packer.pack_map(3);
2296 packer.pack(std::make_pair("destination", destination));
2297 packer.pack(std::make_pair("bit_size", bit_size));
2298 packer.pack(std::make_pair("value", value));
2299 }
2300
2301 void msgpack_unpack(msgpack::object const& o)
2302 {
2303 auto name = "Const";
2304 auto kvmap = Helpers::make_kvmap(o, name);
2305 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
2306 Helpers::conv_fld_from_kvmap(kvmap, name, "bit_size", bit_size, false);
2307 Helpers::conv_fld_from_kvmap(kvmap, name, "value", value, false);
2308 }
2309 };
2310
2314 std::string value;
2315
2316 friend bool operator==(const IndirectConst&, const IndirectConst&);
2317 std::vector<uint8_t> bincodeSerialize() const;
2318 static IndirectConst bincodeDeserialize(std::vector<uint8_t>);
2319
2320 void msgpack_pack(auto& packer) const
2321 {
2322 packer.pack_map(3);
2323 packer.pack(std::make_pair("destination_pointer", destination_pointer));
2324 packer.pack(std::make_pair("bit_size", bit_size));
2325 packer.pack(std::make_pair("value", value));
2326 }
2327
2328 void msgpack_unpack(msgpack::object const& o)
2329 {
2330 auto name = "IndirectConst";
2331 auto kvmap = Helpers::make_kvmap(o, name);
2332 Helpers::conv_fld_from_kvmap(kvmap, name, "destination_pointer", destination_pointer, false);
2333 Helpers::conv_fld_from_kvmap(kvmap, name, "bit_size", bit_size, false);
2334 Helpers::conv_fld_from_kvmap(kvmap, name, "value", value, false);
2335 }
2336 };
2337
2338 struct Return {
2339 friend bool operator==(const Return&, const Return&);
2340 std::vector<uint8_t> bincodeSerialize() const;
2341 static Return bincodeDeserialize(std::vector<uint8_t>);
2342
2343 void msgpack_pack(auto& packer) const {}
2344 void msgpack_unpack(msgpack::object const& o) {}
2345 };
2346
2348 std::string function;
2349 std::vector<Acir::ValueOrArray> destinations;
2350 std::vector<Acir::HeapValueType> destination_value_types;
2351 std::vector<Acir::ValueOrArray> inputs;
2352 std::vector<Acir::HeapValueType> input_value_types;
2353
2354 friend bool operator==(const ForeignCall&, const ForeignCall&);
2355 std::vector<uint8_t> bincodeSerialize() const;
2356 static ForeignCall bincodeDeserialize(std::vector<uint8_t>);
2357
2358 void msgpack_pack(auto& packer) const
2359 {
2360 packer.pack_map(5);
2361 packer.pack(std::make_pair("function", function));
2362 packer.pack(std::make_pair("destinations", destinations));
2363 packer.pack(std::make_pair("destination_value_types", destination_value_types));
2364 packer.pack(std::make_pair("inputs", inputs));
2365 packer.pack(std::make_pair("input_value_types", input_value_types));
2366 }
2367
2368 void msgpack_unpack(msgpack::object const& o)
2369 {
2370 auto name = "ForeignCall";
2371 auto kvmap = Helpers::make_kvmap(o, name);
2372 Helpers::conv_fld_from_kvmap(kvmap, name, "function", function, false);
2373 Helpers::conv_fld_from_kvmap(kvmap, name, "destinations", destinations, false);
2374 Helpers::conv_fld_from_kvmap(kvmap, name, "destination_value_types", destination_value_types, false);
2375 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
2376 Helpers::conv_fld_from_kvmap(kvmap, name, "input_value_types", input_value_types, false);
2377 }
2378 };
2379
2380 struct Mov {
2383
2384 friend bool operator==(const Mov&, const Mov&);
2385 std::vector<uint8_t> bincodeSerialize() const;
2386 static Mov bincodeDeserialize(std::vector<uint8_t>);
2387
2388 void msgpack_pack(auto& packer) const
2389 {
2390 packer.pack_map(2);
2391 packer.pack(std::make_pair("destination", destination));
2392 packer.pack(std::make_pair("source", source));
2393 }
2394
2395 void msgpack_unpack(msgpack::object const& o)
2396 {
2397 auto name = "Mov";
2398 auto kvmap = Helpers::make_kvmap(o, name);
2399 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
2400 Helpers::conv_fld_from_kvmap(kvmap, name, "source", source, false);
2401 }
2402 };
2403
2409
2410 friend bool operator==(const ConditionalMov&, const ConditionalMov&);
2411 std::vector<uint8_t> bincodeSerialize() const;
2412 static ConditionalMov bincodeDeserialize(std::vector<uint8_t>);
2413
2414 void msgpack_pack(auto& packer) const
2415 {
2416 packer.pack_map(4);
2417 packer.pack(std::make_pair("destination", destination));
2418 packer.pack(std::make_pair("source_a", source_a));
2419 packer.pack(std::make_pair("source_b", source_b));
2420 packer.pack(std::make_pair("condition", condition));
2421 }
2422
2423 void msgpack_unpack(msgpack::object const& o)
2424 {
2425 auto name = "ConditionalMov";
2426 auto kvmap = Helpers::make_kvmap(o, name);
2427 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
2428 Helpers::conv_fld_from_kvmap(kvmap, name, "source_a", source_a, false);
2429 Helpers::conv_fld_from_kvmap(kvmap, name, "source_b", source_b, false);
2430 Helpers::conv_fld_from_kvmap(kvmap, name, "condition", condition, false);
2431 }
2432 };
2433
2434 struct Load {
2437
2438 friend bool operator==(const Load&, const Load&);
2439 std::vector<uint8_t> bincodeSerialize() const;
2440 static Load bincodeDeserialize(std::vector<uint8_t>);
2441
2442 void msgpack_pack(auto& packer) const
2443 {
2444 packer.pack_map(2);
2445 packer.pack(std::make_pair("destination", destination));
2446 packer.pack(std::make_pair("source_pointer", source_pointer));
2447 }
2448
2449 void msgpack_unpack(msgpack::object const& o)
2450 {
2451 auto name = "Load";
2452 auto kvmap = Helpers::make_kvmap(o, name);
2453 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
2454 Helpers::conv_fld_from_kvmap(kvmap, name, "source_pointer", source_pointer, false);
2455 }
2456 };
2457
2458 struct Store {
2461
2462 friend bool operator==(const Store&, const Store&);
2463 std::vector<uint8_t> bincodeSerialize() const;
2464 static Store bincodeDeserialize(std::vector<uint8_t>);
2465
2466 void msgpack_pack(auto& packer) const
2467 {
2468 packer.pack_map(2);
2469 packer.pack(std::make_pair("destination_pointer", destination_pointer));
2470 packer.pack(std::make_pair("source", source));
2471 }
2472
2473 void msgpack_unpack(msgpack::object const& o)
2474 {
2475 auto name = "Store";
2476 auto kvmap = Helpers::make_kvmap(o, name);
2477 Helpers::conv_fld_from_kvmap(kvmap, name, "destination_pointer", destination_pointer, false);
2478 Helpers::conv_fld_from_kvmap(kvmap, name, "source", source, false);
2479 }
2480 };
2481
2482 struct BlackBox {
2484
2485 friend bool operator==(const BlackBox&, const BlackBox&);
2486 std::vector<uint8_t> bincodeSerialize() const;
2487 static BlackBox bincodeDeserialize(std::vector<uint8_t>);
2488
2489 void msgpack_pack(auto& packer) const { packer.pack(value); }
2490
2491 void msgpack_unpack(msgpack::object const& o)
2492 {
2493 try {
2494 o.convert(value);
2495 } catch (const msgpack::type_error&) {
2496 std::cerr << o << std::endl;
2497 throw_or_abort("error converting into newtype 'BlackBox'");
2498 }
2499 }
2500 };
2501
2502 struct Trap {
2504
2505 friend bool operator==(const Trap&, const Trap&);
2506 std::vector<uint8_t> bincodeSerialize() const;
2507 static Trap bincodeDeserialize(std::vector<uint8_t>);
2508
2509 void msgpack_pack(auto& packer) const
2510 {
2511 packer.pack_map(1);
2512 packer.pack(std::make_pair("revert_data", revert_data));
2513 }
2514
2515 void msgpack_unpack(msgpack::object const& o)
2516 {
2517 auto name = "Trap";
2518 auto kvmap = Helpers::make_kvmap(o, name);
2519 Helpers::conv_fld_from_kvmap(kvmap, name, "revert_data", revert_data, false);
2520 }
2521 };
2522
2523 struct Stop {
2525
2526 friend bool operator==(const Stop&, const Stop&);
2527 std::vector<uint8_t> bincodeSerialize() const;
2528 static Stop bincodeDeserialize(std::vector<uint8_t>);
2529
2530 void msgpack_pack(auto& packer) const
2531 {
2532 packer.pack_map(1);
2533 packer.pack(std::make_pair("return_data", return_data));
2534 }
2535
2536 void msgpack_unpack(msgpack::object const& o)
2537 {
2538 auto name = "Stop";
2539 auto kvmap = Helpers::make_kvmap(o, name);
2540 Helpers::conv_fld_from_kvmap(kvmap, name, "return_data", return_data, false);
2541 }
2542 };
2543
2546 Not,
2547 Cast,
2548 JumpIfNot,
2549 JumpIf,
2550 Jump,
2551 CalldataCopy,
2552 Call,
2553 Const,
2554 IndirectConst,
2555 Return,
2556 ForeignCall,
2557 Mov,
2558 ConditionalMov,
2559 Load,
2560 Store,
2561 BlackBox,
2562 Trap,
2563 Stop>
2565
2566 friend bool operator==(const BrilligOpcode&, const BrilligOpcode&);
2567 std::vector<uint8_t> bincodeSerialize() const;
2568 static BrilligOpcode bincodeDeserialize(std::vector<uint8_t>);
2569
2570 void msgpack_pack(auto& packer) const
2571 {
2572 std::string tag;
2573 bool is_unit;
2574 switch (value.index()) {
2575
2576 case 0:
2577 tag = "BinaryFieldOp";
2578 is_unit = false;
2579 break;
2580 case 1:
2581 tag = "BinaryIntOp";
2582 is_unit = false;
2583 break;
2584 case 2:
2585 tag = "Not";
2586 is_unit = false;
2587 break;
2588 case 3:
2589 tag = "Cast";
2590 is_unit = false;
2591 break;
2592 case 4:
2593 tag = "JumpIfNot";
2594 is_unit = false;
2595 break;
2596 case 5:
2597 tag = "JumpIf";
2598 is_unit = false;
2599 break;
2600 case 6:
2601 tag = "Jump";
2602 is_unit = false;
2603 break;
2604 case 7:
2605 tag = "CalldataCopy";
2606 is_unit = false;
2607 break;
2608 case 8:
2609 tag = "Call";
2610 is_unit = false;
2611 break;
2612 case 9:
2613 tag = "Const";
2614 is_unit = false;
2615 break;
2616 case 10:
2617 tag = "IndirectConst";
2618 is_unit = false;
2619 break;
2620 case 11:
2621 tag = "Return";
2622 is_unit = true;
2623 break;
2624 case 12:
2625 tag = "ForeignCall";
2626 is_unit = false;
2627 break;
2628 case 13:
2629 tag = "Mov";
2630 is_unit = false;
2631 break;
2632 case 14:
2633 tag = "ConditionalMov";
2634 is_unit = false;
2635 break;
2636 case 15:
2637 tag = "Load";
2638 is_unit = false;
2639 break;
2640 case 16:
2641 tag = "Store";
2642 is_unit = false;
2643 break;
2644 case 17:
2645 tag = "BlackBox";
2646 is_unit = false;
2647 break;
2648 case 18:
2649 tag = "Trap";
2650 is_unit = false;
2651 break;
2652 case 19:
2653 tag = "Stop";
2654 is_unit = false;
2655 break;
2656 default:
2657 throw_or_abort("unknown enum 'BrilligOpcode' variant index: " + std::to_string(value.index()));
2658 }
2659 if (is_unit) {
2660 packer.pack(tag);
2661 } else {
2662 std::visit(
2663 [&packer, tag](const auto& arg) {
2665 data[tag] = msgpack::object(arg);
2666 packer.pack(data);
2667 },
2668 value);
2669 }
2670 }
2671
2672 void msgpack_unpack(msgpack::object const& o)
2673 {
2674
2675 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
2676 std::cerr << o << std::endl;
2677 throw_or_abort("expected MAP or STR for enum 'BrilligOpcode'; got type " + std::to_string(o.type));
2678 }
2679 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
2680 throw_or_abort("expected 1 entry for enum 'BrilligOpcode'; got " + std::to_string(o.via.map.size));
2681 }
2682 std::string tag;
2683 try {
2684 if (o.type == msgpack::type::object_type::MAP) {
2685 o.via.map.ptr[0].key.convert(tag);
2686 } else {
2687 o.convert(tag);
2688 }
2689 } catch (const msgpack::type_error&) {
2690 std::cerr << o << std::endl;
2691 throw_or_abort("error converting tag to string for enum 'BrilligOpcode'");
2692 }
2693 if (tag == "BinaryFieldOp") {
2694 BinaryFieldOp v;
2695 try {
2696 o.via.map.ptr[0].val.convert(v);
2697 } catch (const msgpack::type_error&) {
2698 std::cerr << o << std::endl;
2699 throw_or_abort("error converting into enum variant 'BrilligOpcode::BinaryFieldOp'");
2700 }
2701
2702 value = v;
2703 } else if (tag == "BinaryIntOp") {
2704 BinaryIntOp v;
2705 try {
2706 o.via.map.ptr[0].val.convert(v);
2707 } catch (const msgpack::type_error&) {
2708 std::cerr << o << std::endl;
2709 throw_or_abort("error converting into enum variant 'BrilligOpcode::BinaryIntOp'");
2710 }
2711
2712 value = v;
2713 } else if (tag == "Not") {
2714 Not v;
2715 try {
2716 o.via.map.ptr[0].val.convert(v);
2717 } catch (const msgpack::type_error&) {
2718 std::cerr << o << std::endl;
2719 throw_or_abort("error converting into enum variant 'BrilligOpcode::Not'");
2720 }
2721
2722 value = v;
2723 } else if (tag == "Cast") {
2724 Cast v;
2725 try {
2726 o.via.map.ptr[0].val.convert(v);
2727 } catch (const msgpack::type_error&) {
2728 std::cerr << o << std::endl;
2729 throw_or_abort("error converting into enum variant 'BrilligOpcode::Cast'");
2730 }
2731
2732 value = v;
2733 } else if (tag == "JumpIfNot") {
2734 JumpIfNot v;
2735 try {
2736 o.via.map.ptr[0].val.convert(v);
2737 } catch (const msgpack::type_error&) {
2738 std::cerr << o << std::endl;
2739 throw_or_abort("error converting into enum variant 'BrilligOpcode::JumpIfNot'");
2740 }
2741
2742 value = v;
2743 } else if (tag == "JumpIf") {
2744 JumpIf v;
2745 try {
2746 o.via.map.ptr[0].val.convert(v);
2747 } catch (const msgpack::type_error&) {
2748 std::cerr << o << std::endl;
2749 throw_or_abort("error converting into enum variant 'BrilligOpcode::JumpIf'");
2750 }
2751
2752 value = v;
2753 } else if (tag == "Jump") {
2754 Jump v;
2755 try {
2756 o.via.map.ptr[0].val.convert(v);
2757 } catch (const msgpack::type_error&) {
2758 std::cerr << o << std::endl;
2759 throw_or_abort("error converting into enum variant 'BrilligOpcode::Jump'");
2760 }
2761
2762 value = v;
2763 } else if (tag == "CalldataCopy") {
2764 CalldataCopy v;
2765 try {
2766 o.via.map.ptr[0].val.convert(v);
2767 } catch (const msgpack::type_error&) {
2768 std::cerr << o << std::endl;
2769 throw_or_abort("error converting into enum variant 'BrilligOpcode::CalldataCopy'");
2770 }
2771
2772 value = v;
2773 } else if (tag == "Call") {
2774 Call v;
2775 try {
2776 o.via.map.ptr[0].val.convert(v);
2777 } catch (const msgpack::type_error&) {
2778 std::cerr << o << std::endl;
2779 throw_or_abort("error converting into enum variant 'BrilligOpcode::Call'");
2780 }
2781
2782 value = v;
2783 } else if (tag == "Const") {
2784 Const v;
2785 try {
2786 o.via.map.ptr[0].val.convert(v);
2787 } catch (const msgpack::type_error&) {
2788 std::cerr << o << std::endl;
2789 throw_or_abort("error converting into enum variant 'BrilligOpcode::Const'");
2790 }
2791
2792 value = v;
2793 } else if (tag == "IndirectConst") {
2794 IndirectConst v;
2795 try {
2796 o.via.map.ptr[0].val.convert(v);
2797 } catch (const msgpack::type_error&) {
2798 std::cerr << o << std::endl;
2799 throw_or_abort("error converting into enum variant 'BrilligOpcode::IndirectConst'");
2800 }
2801
2802 value = v;
2803 } else if (tag == "Return") {
2804 Return v;
2805 value = v;
2806 } else if (tag == "ForeignCall") {
2807 ForeignCall v;
2808 try {
2809 o.via.map.ptr[0].val.convert(v);
2810 } catch (const msgpack::type_error&) {
2811 std::cerr << o << std::endl;
2812 throw_or_abort("error converting into enum variant 'BrilligOpcode::ForeignCall'");
2813 }
2814
2815 value = v;
2816 } else if (tag == "Mov") {
2817 Mov v;
2818 try {
2819 o.via.map.ptr[0].val.convert(v);
2820 } catch (const msgpack::type_error&) {
2821 std::cerr << o << std::endl;
2822 throw_or_abort("error converting into enum variant 'BrilligOpcode::Mov'");
2823 }
2824
2825 value = v;
2826 } else if (tag == "ConditionalMov") {
2828 try {
2829 o.via.map.ptr[0].val.convert(v);
2830 } catch (const msgpack::type_error&) {
2831 std::cerr << o << std::endl;
2832 throw_or_abort("error converting into enum variant 'BrilligOpcode::ConditionalMov'");
2833 }
2834
2835 value = v;
2836 } else if (tag == "Load") {
2837 Load v;
2838 try {
2839 o.via.map.ptr[0].val.convert(v);
2840 } catch (const msgpack::type_error&) {
2841 std::cerr << o << std::endl;
2842 throw_or_abort("error converting into enum variant 'BrilligOpcode::Load'");
2843 }
2844
2845 value = v;
2846 } else if (tag == "Store") {
2847 Store v;
2848 try {
2849 o.via.map.ptr[0].val.convert(v);
2850 } catch (const msgpack::type_error&) {
2851 std::cerr << o << std::endl;
2852 throw_or_abort("error converting into enum variant 'BrilligOpcode::Store'");
2853 }
2854
2855 value = v;
2856 } else if (tag == "BlackBox") {
2857 BlackBox v;
2858 try {
2859 o.via.map.ptr[0].val.convert(v);
2860 } catch (const msgpack::type_error&) {
2861 std::cerr << o << std::endl;
2862 throw_or_abort("error converting into enum variant 'BrilligOpcode::BlackBox'");
2863 }
2864
2865 value = v;
2866 } else if (tag == "Trap") {
2867 Trap v;
2868 try {
2869 o.via.map.ptr[0].val.convert(v);
2870 } catch (const msgpack::type_error&) {
2871 std::cerr << o << std::endl;
2872 throw_or_abort("error converting into enum variant 'BrilligOpcode::Trap'");
2873 }
2874
2875 value = v;
2876 } else if (tag == "Stop") {
2877 Stop v;
2878 try {
2879 o.via.map.ptr[0].val.convert(v);
2880 } catch (const msgpack::type_error&) {
2881 std::cerr << o << std::endl;
2882 throw_or_abort("error converting into enum variant 'BrilligOpcode::Stop'");
2883 }
2884
2885 value = v;
2886 } else {
2887 std::cerr << o << std::endl;
2888 throw_or_abort("unknown 'BrilligOpcode' enum variant: " + tag);
2889 }
2890 }
2891};
2892
2893struct Witness {
2894 uint32_t value;
2895
2896 friend bool operator==(const Witness&, const Witness&);
2897 std::vector<uint8_t> bincodeSerialize() const;
2898 static Witness bincodeDeserialize(std::vector<uint8_t>);
2899
2900 void msgpack_pack(auto& packer) const { packer.pack(value); }
2901
2902 void msgpack_unpack(msgpack::object const& o)
2903 {
2904 try {
2905 o.convert(value);
2906 } catch (const msgpack::type_error&) {
2907 std::cerr << o << std::endl;
2908 throw_or_abort("error converting into newtype 'Witness'");
2909 }
2910 }
2911};
2912
2914
2915 struct Constant {
2916 std::string value;
2917
2918 friend bool operator==(const Constant&, const Constant&);
2919 std::vector<uint8_t> bincodeSerialize() const;
2920 static Constant bincodeDeserialize(std::vector<uint8_t>);
2921
2922 void msgpack_pack(auto& packer) const { packer.pack(value); }
2923
2924 void msgpack_unpack(msgpack::object const& o)
2925 {
2926 try {
2927 o.convert(value);
2928 } catch (const msgpack::type_error&) {
2929 std::cerr << o << std::endl;
2930 throw_or_abort("error converting into newtype 'Constant'");
2931 }
2932 }
2933 };
2934
2935 struct Witness {
2937
2938 friend bool operator==(const Witness&, const Witness&);
2939 std::vector<uint8_t> bincodeSerialize() const;
2940 static Witness bincodeDeserialize(std::vector<uint8_t>);
2941
2942 void msgpack_pack(auto& packer) const { packer.pack(value); }
2943
2944 void msgpack_unpack(msgpack::object const& o)
2945 {
2946 try {
2947 o.convert(value);
2948 } catch (const msgpack::type_error&) {
2949 std::cerr << o << std::endl;
2950 throw_or_abort("error converting into newtype 'Witness'");
2951 }
2952 }
2953 };
2954
2956
2957 friend bool operator==(const ConstantOrWitnessEnum&, const ConstantOrWitnessEnum&);
2958 std::vector<uint8_t> bincodeSerialize() const;
2959 static ConstantOrWitnessEnum bincodeDeserialize(std::vector<uint8_t>);
2960
2961 void msgpack_pack(auto& packer) const
2962 {
2963 std::string tag;
2964 bool is_unit;
2965 switch (value.index()) {
2966
2967 case 0:
2968 tag = "Constant";
2969 is_unit = false;
2970 break;
2971 case 1:
2972 tag = "Witness";
2973 is_unit = false;
2974 break;
2975 default:
2976 throw_or_abort("unknown enum 'ConstantOrWitnessEnum' variant index: " + std::to_string(value.index()));
2977 }
2978 if (is_unit) {
2979 packer.pack(tag);
2980 } else {
2981 std::visit(
2982 [&packer, tag](const auto& arg) {
2984 data[tag] = msgpack::object(arg);
2985 packer.pack(data);
2986 },
2987 value);
2988 }
2989 }
2990
2991 void msgpack_unpack(msgpack::object const& o)
2992 {
2993
2994 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
2995 std::cerr << o << std::endl;
2996 throw_or_abort("expected MAP or STR for enum 'ConstantOrWitnessEnum'; got type " + std::to_string(o.type));
2997 }
2998 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
2999 throw_or_abort("expected 1 entry for enum 'ConstantOrWitnessEnum'; got " + std::to_string(o.via.map.size));
3000 }
3001 std::string tag;
3002 try {
3003 if (o.type == msgpack::type::object_type::MAP) {
3004 o.via.map.ptr[0].key.convert(tag);
3005 } else {
3006 o.convert(tag);
3007 }
3008 } catch (const msgpack::type_error&) {
3009 std::cerr << o << std::endl;
3010 throw_or_abort("error converting tag to string for enum 'ConstantOrWitnessEnum'");
3011 }
3012 if (tag == "Constant") {
3013 Constant v;
3014 try {
3015 o.via.map.ptr[0].val.convert(v);
3016 } catch (const msgpack::type_error&) {
3017 std::cerr << o << std::endl;
3018 throw_or_abort("error converting into enum variant 'ConstantOrWitnessEnum::Constant'");
3019 }
3020
3021 value = v;
3022 } else if (tag == "Witness") {
3023 Witness v;
3024 try {
3025 o.via.map.ptr[0].val.convert(v);
3026 } catch (const msgpack::type_error&) {
3027 std::cerr << o << std::endl;
3028 throw_or_abort("error converting into enum variant 'ConstantOrWitnessEnum::Witness'");
3029 }
3030
3031 value = v;
3032 } else {
3033 std::cerr << o << std::endl;
3034 throw_or_abort("unknown 'ConstantOrWitnessEnum' enum variant: " + tag);
3035 }
3036 }
3037};
3038
3041 uint32_t num_bits;
3042
3043 friend bool operator==(const FunctionInput&, const FunctionInput&);
3044 std::vector<uint8_t> bincodeSerialize() const;
3045 static FunctionInput bincodeDeserialize(std::vector<uint8_t>);
3046
3047 void msgpack_pack(auto& packer) const
3048 {
3049 packer.pack_map(2);
3050 packer.pack(std::make_pair("input", input));
3051 packer.pack(std::make_pair("num_bits", num_bits));
3052 }
3053
3054 void msgpack_unpack(msgpack::object const& o)
3055 {
3056 auto name = "FunctionInput";
3057 auto kvmap = Helpers::make_kvmap(o, name);
3058 Helpers::conv_fld_from_kvmap(kvmap, name, "input", input, false);
3059 Helpers::conv_fld_from_kvmap(kvmap, name, "num_bits", num_bits, false);
3060 }
3061};
3062
3064
3066 std::vector<Acir::FunctionInput> inputs;
3069 std::vector<Acir::Witness> outputs;
3070
3071 friend bool operator==(const AES128Encrypt&, const AES128Encrypt&);
3072 std::vector<uint8_t> bincodeSerialize() const;
3073 static AES128Encrypt bincodeDeserialize(std::vector<uint8_t>);
3074
3075 void msgpack_pack(auto& packer) const
3076 {
3077 packer.pack_map(4);
3078 packer.pack(std::make_pair("inputs", inputs));
3079 packer.pack(std::make_pair("iv", iv));
3080 packer.pack(std::make_pair("key", key));
3081 packer.pack(std::make_pair("outputs", outputs));
3082 }
3083
3084 void msgpack_unpack(msgpack::object const& o)
3085 {
3086 auto name = "AES128Encrypt";
3087 auto kvmap = Helpers::make_kvmap(o, name);
3088 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
3089 Helpers::conv_fld_from_kvmap(kvmap, name, "iv", iv, false);
3090 Helpers::conv_fld_from_kvmap(kvmap, name, "key", key, false);
3091 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
3092 }
3093 };
3094
3095 struct AND {
3099
3100 friend bool operator==(const AND&, const AND&);
3101 std::vector<uint8_t> bincodeSerialize() const;
3102 static AND bincodeDeserialize(std::vector<uint8_t>);
3103
3104 void msgpack_pack(auto& packer) const
3105 {
3106 packer.pack_map(3);
3107 packer.pack(std::make_pair("lhs", lhs));
3108 packer.pack(std::make_pair("rhs", rhs));
3109 packer.pack(std::make_pair("output", output));
3110 }
3111
3112 void msgpack_unpack(msgpack::object const& o)
3113 {
3114 auto name = "AND";
3115 auto kvmap = Helpers::make_kvmap(o, name);
3116 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
3117 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
3118 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
3119 }
3120 };
3121
3122 struct XOR {
3126
3127 friend bool operator==(const XOR&, const XOR&);
3128 std::vector<uint8_t> bincodeSerialize() const;
3129 static XOR bincodeDeserialize(std::vector<uint8_t>);
3130
3131 void msgpack_pack(auto& packer) const
3132 {
3133 packer.pack_map(3);
3134 packer.pack(std::make_pair("lhs", lhs));
3135 packer.pack(std::make_pair("rhs", rhs));
3136 packer.pack(std::make_pair("output", output));
3137 }
3138
3139 void msgpack_unpack(msgpack::object const& o)
3140 {
3141 auto name = "XOR";
3142 auto kvmap = Helpers::make_kvmap(o, name);
3143 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
3144 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
3145 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
3146 }
3147 };
3148
3149 struct RANGE {
3151
3152 friend bool operator==(const RANGE&, const RANGE&);
3153 std::vector<uint8_t> bincodeSerialize() const;
3154 static RANGE bincodeDeserialize(std::vector<uint8_t>);
3155
3156 void msgpack_pack(auto& packer) const
3157 {
3158 packer.pack_map(1);
3159 packer.pack(std::make_pair("input", input));
3160 }
3161
3162 void msgpack_unpack(msgpack::object const& o)
3163 {
3164 auto name = "RANGE";
3165 auto kvmap = Helpers::make_kvmap(o, name);
3166 Helpers::conv_fld_from_kvmap(kvmap, name, "input", input, false);
3167 }
3168 };
3169
3170 struct Blake2s {
3171 std::vector<Acir::FunctionInput> inputs;
3173
3174 friend bool operator==(const Blake2s&, const Blake2s&);
3175 std::vector<uint8_t> bincodeSerialize() const;
3176 static Blake2s bincodeDeserialize(std::vector<uint8_t>);
3177
3178 void msgpack_pack(auto& packer) const
3179 {
3180 packer.pack_map(2);
3181 packer.pack(std::make_pair("inputs", inputs));
3182 packer.pack(std::make_pair("outputs", outputs));
3183 }
3184
3185 void msgpack_unpack(msgpack::object const& o)
3186 {
3187 auto name = "Blake2s";
3188 auto kvmap = Helpers::make_kvmap(o, name);
3189 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
3190 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
3191 }
3192 };
3193
3194 struct Blake3 {
3195 std::vector<Acir::FunctionInput> inputs;
3197
3198 friend bool operator==(const Blake3&, const Blake3&);
3199 std::vector<uint8_t> bincodeSerialize() const;
3200 static Blake3 bincodeDeserialize(std::vector<uint8_t>);
3201
3202 void msgpack_pack(auto& packer) const
3203 {
3204 packer.pack_map(2);
3205 packer.pack(std::make_pair("inputs", inputs));
3206 packer.pack(std::make_pair("outputs", outputs));
3207 }
3208
3209 void msgpack_unpack(msgpack::object const& o)
3210 {
3211 auto name = "Blake3";
3212 auto kvmap = Helpers::make_kvmap(o, name);
3213 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
3214 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
3215 }
3216 };
3217
3224
3225 friend bool operator==(const EcdsaSecp256k1&, const EcdsaSecp256k1&);
3226 std::vector<uint8_t> bincodeSerialize() const;
3227 static EcdsaSecp256k1 bincodeDeserialize(std::vector<uint8_t>);
3228
3229 void msgpack_pack(auto& packer) const
3230 {
3231 packer.pack_map(5);
3232 packer.pack(std::make_pair("public_key_x", public_key_x));
3233 packer.pack(std::make_pair("public_key_y", public_key_y));
3234 packer.pack(std::make_pair("signature", signature));
3235 packer.pack(std::make_pair("hashed_message", hashed_message));
3236 packer.pack(std::make_pair("output", output));
3237 }
3238
3239 void msgpack_unpack(msgpack::object const& o)
3240 {
3241 auto name = "EcdsaSecp256k1";
3242 auto kvmap = Helpers::make_kvmap(o, name);
3243 Helpers::conv_fld_from_kvmap(kvmap, name, "public_key_x", public_key_x, false);
3244 Helpers::conv_fld_from_kvmap(kvmap, name, "public_key_y", public_key_y, false);
3245 Helpers::conv_fld_from_kvmap(kvmap, name, "signature", signature, false);
3246 Helpers::conv_fld_from_kvmap(kvmap, name, "hashed_message", hashed_message, false);
3247 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
3248 }
3249 };
3250
3257
3258 friend bool operator==(const EcdsaSecp256r1&, const EcdsaSecp256r1&);
3259 std::vector<uint8_t> bincodeSerialize() const;
3260 static EcdsaSecp256r1 bincodeDeserialize(std::vector<uint8_t>);
3261
3262 void msgpack_pack(auto& packer) const
3263 {
3264 packer.pack_map(5);
3265 packer.pack(std::make_pair("public_key_x", public_key_x));
3266 packer.pack(std::make_pair("public_key_y", public_key_y));
3267 packer.pack(std::make_pair("signature", signature));
3268 packer.pack(std::make_pair("hashed_message", hashed_message));
3269 packer.pack(std::make_pair("output", output));
3270 }
3271
3272 void msgpack_unpack(msgpack::object const& o)
3273 {
3274 auto name = "EcdsaSecp256r1";
3275 auto kvmap = Helpers::make_kvmap(o, name);
3276 Helpers::conv_fld_from_kvmap(kvmap, name, "public_key_x", public_key_x, false);
3277 Helpers::conv_fld_from_kvmap(kvmap, name, "public_key_y", public_key_y, false);
3278 Helpers::conv_fld_from_kvmap(kvmap, name, "signature", signature, false);
3279 Helpers::conv_fld_from_kvmap(kvmap, name, "hashed_message", hashed_message, false);
3280 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
3281 }
3282 };
3283
3285 std::vector<Acir::FunctionInput> points;
3286 std::vector<Acir::FunctionInput> scalars;
3288
3289 friend bool operator==(const MultiScalarMul&, const MultiScalarMul&);
3290 std::vector<uint8_t> bincodeSerialize() const;
3291 static MultiScalarMul bincodeDeserialize(std::vector<uint8_t>);
3292
3293 void msgpack_pack(auto& packer) const
3294 {
3295 packer.pack_map(3);
3296 packer.pack(std::make_pair("points", points));
3297 packer.pack(std::make_pair("scalars", scalars));
3298 packer.pack(std::make_pair("outputs", outputs));
3299 }
3300
3301 void msgpack_unpack(msgpack::object const& o)
3302 {
3303 auto name = "MultiScalarMul";
3304 auto kvmap = Helpers::make_kvmap(o, name);
3305 Helpers::conv_fld_from_kvmap(kvmap, name, "points", points, false);
3306 Helpers::conv_fld_from_kvmap(kvmap, name, "scalars", scalars, false);
3307 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
3308 }
3309 };
3310
3315
3316 friend bool operator==(const EmbeddedCurveAdd&, const EmbeddedCurveAdd&);
3317 std::vector<uint8_t> bincodeSerialize() const;
3318 static EmbeddedCurveAdd bincodeDeserialize(std::vector<uint8_t>);
3319
3320 void msgpack_pack(auto& packer) const
3321 {
3322 packer.pack_map(3);
3323 packer.pack(std::make_pair("input1", input1));
3324 packer.pack(std::make_pair("input2", input2));
3325 packer.pack(std::make_pair("outputs", outputs));
3326 }
3327
3328 void msgpack_unpack(msgpack::object const& o)
3329 {
3330 auto name = "EmbeddedCurveAdd";
3331 auto kvmap = Helpers::make_kvmap(o, name);
3332 Helpers::conv_fld_from_kvmap(kvmap, name, "input1", input1, false);
3333 Helpers::conv_fld_from_kvmap(kvmap, name, "input2", input2, false);
3334 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
3335 }
3336 };
3337
3341
3342 friend bool operator==(const Keccakf1600&, const Keccakf1600&);
3343 std::vector<uint8_t> bincodeSerialize() const;
3344 static Keccakf1600 bincodeDeserialize(std::vector<uint8_t>);
3345
3346 void msgpack_pack(auto& packer) const
3347 {
3348 packer.pack_map(2);
3349 packer.pack(std::make_pair("inputs", inputs));
3350 packer.pack(std::make_pair("outputs", outputs));
3351 }
3352
3353 void msgpack_unpack(msgpack::object const& o)
3354 {
3355 auto name = "Keccakf1600";
3356 auto kvmap = Helpers::make_kvmap(o, name);
3357 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
3358 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
3359 }
3360 };
3361
3363 std::vector<Acir::FunctionInput> verification_key;
3364 std::vector<Acir::FunctionInput> proof;
3365 std::vector<Acir::FunctionInput> public_inputs;
3367 uint32_t proof_type;
3368
3369 friend bool operator==(const RecursiveAggregation&, const RecursiveAggregation&);
3370 std::vector<uint8_t> bincodeSerialize() const;
3371 static RecursiveAggregation bincodeDeserialize(std::vector<uint8_t>);
3372
3373 void msgpack_pack(auto& packer) const
3374 {
3375 packer.pack_map(5);
3376 packer.pack(std::make_pair("verification_key", verification_key));
3377 packer.pack(std::make_pair("proof", proof));
3378 packer.pack(std::make_pair("public_inputs", public_inputs));
3379 packer.pack(std::make_pair("key_hash", key_hash));
3380 packer.pack(std::make_pair("proof_type", proof_type));
3381 }
3382
3383 void msgpack_unpack(msgpack::object const& o)
3384 {
3385 auto name = "RecursiveAggregation";
3386 auto kvmap = Helpers::make_kvmap(o, name);
3387 Helpers::conv_fld_from_kvmap(kvmap, name, "verification_key", verification_key, false);
3388 Helpers::conv_fld_from_kvmap(kvmap, name, "proof", proof, false);
3389 Helpers::conv_fld_from_kvmap(kvmap, name, "public_inputs", public_inputs, false);
3390 Helpers::conv_fld_from_kvmap(kvmap, name, "key_hash", key_hash, false);
3391 Helpers::conv_fld_from_kvmap(kvmap, name, "proof_type", proof_type, false);
3392 }
3393 };
3394
3395 struct BigIntAdd {
3396 uint32_t lhs;
3397 uint32_t rhs;
3398 uint32_t output;
3399
3400 friend bool operator==(const BigIntAdd&, const BigIntAdd&);
3401 std::vector<uint8_t> bincodeSerialize() const;
3402 static BigIntAdd bincodeDeserialize(std::vector<uint8_t>);
3403
3404 void msgpack_pack(auto& packer) const
3405 {
3406 packer.pack_map(3);
3407 packer.pack(std::make_pair("lhs", lhs));
3408 packer.pack(std::make_pair("rhs", rhs));
3409 packer.pack(std::make_pair("output", output));
3410 }
3411
3412 void msgpack_unpack(msgpack::object const& o)
3413 {
3414 auto name = "BigIntAdd";
3415 auto kvmap = Helpers::make_kvmap(o, name);
3416 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
3417 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
3418 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
3419 }
3420 };
3421
3422 struct BigIntSub {
3423 uint32_t lhs;
3424 uint32_t rhs;
3425 uint32_t output;
3426
3427 friend bool operator==(const BigIntSub&, const BigIntSub&);
3428 std::vector<uint8_t> bincodeSerialize() const;
3429 static BigIntSub bincodeDeserialize(std::vector<uint8_t>);
3430
3431 void msgpack_pack(auto& packer) const
3432 {
3433 packer.pack_map(3);
3434 packer.pack(std::make_pair("lhs", lhs));
3435 packer.pack(std::make_pair("rhs", rhs));
3436 packer.pack(std::make_pair("output", output));
3437 }
3438
3439 void msgpack_unpack(msgpack::object const& o)
3440 {
3441 auto name = "BigIntSub";
3442 auto kvmap = Helpers::make_kvmap(o, name);
3443 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
3444 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
3445 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
3446 }
3447 };
3448
3449 struct BigIntMul {
3450 uint32_t lhs;
3451 uint32_t rhs;
3452 uint32_t output;
3453
3454 friend bool operator==(const BigIntMul&, const BigIntMul&);
3455 std::vector<uint8_t> bincodeSerialize() const;
3456 static BigIntMul bincodeDeserialize(std::vector<uint8_t>);
3457
3458 void msgpack_pack(auto& packer) const
3459 {
3460 packer.pack_map(3);
3461 packer.pack(std::make_pair("lhs", lhs));
3462 packer.pack(std::make_pair("rhs", rhs));
3463 packer.pack(std::make_pair("output", output));
3464 }
3465
3466 void msgpack_unpack(msgpack::object const& o)
3467 {
3468 auto name = "BigIntMul";
3469 auto kvmap = Helpers::make_kvmap(o, name);
3470 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
3471 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
3472 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
3473 }
3474 };
3475
3476 struct BigIntDiv {
3477 uint32_t lhs;
3478 uint32_t rhs;
3479 uint32_t output;
3480
3481 friend bool operator==(const BigIntDiv&, const BigIntDiv&);
3482 std::vector<uint8_t> bincodeSerialize() const;
3483 static BigIntDiv bincodeDeserialize(std::vector<uint8_t>);
3484
3485 void msgpack_pack(auto& packer) const
3486 {
3487 packer.pack_map(3);
3488 packer.pack(std::make_pair("lhs", lhs));
3489 packer.pack(std::make_pair("rhs", rhs));
3490 packer.pack(std::make_pair("output", output));
3491 }
3492
3493 void msgpack_unpack(msgpack::object const& o)
3494 {
3495 auto name = "BigIntDiv";
3496 auto kvmap = Helpers::make_kvmap(o, name);
3497 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
3498 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
3499 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
3500 }
3501 };
3502
3504 std::vector<Acir::FunctionInput> inputs;
3505 std::vector<uint8_t> modulus;
3506 uint32_t output;
3507
3508 friend bool operator==(const BigIntFromLeBytes&, const BigIntFromLeBytes&);
3509 std::vector<uint8_t> bincodeSerialize() const;
3510 static BigIntFromLeBytes bincodeDeserialize(std::vector<uint8_t>);
3511
3512 void msgpack_pack(auto& packer) const
3513 {
3514 packer.pack_map(3);
3515 packer.pack(std::make_pair("inputs", inputs));
3516 packer.pack(std::make_pair("modulus", modulus));
3517 packer.pack(std::make_pair("output", output));
3518 }
3519
3520 void msgpack_unpack(msgpack::object const& o)
3521 {
3522 auto name = "BigIntFromLeBytes";
3523 auto kvmap = Helpers::make_kvmap(o, name);
3524 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
3525 Helpers::conv_fld_from_kvmap(kvmap, name, "modulus", modulus, false);
3526 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
3527 }
3528 };
3529
3531 uint32_t input;
3532 std::vector<Acir::Witness> outputs;
3533
3534 friend bool operator==(const BigIntToLeBytes&, const BigIntToLeBytes&);
3535 std::vector<uint8_t> bincodeSerialize() const;
3536 static BigIntToLeBytes bincodeDeserialize(std::vector<uint8_t>);
3537
3538 void msgpack_pack(auto& packer) const
3539 {
3540 packer.pack_map(2);
3541 packer.pack(std::make_pair("input", input));
3542 packer.pack(std::make_pair("outputs", outputs));
3543 }
3544
3545 void msgpack_unpack(msgpack::object const& o)
3546 {
3547 auto name = "BigIntToLeBytes";
3548 auto kvmap = Helpers::make_kvmap(o, name);
3549 Helpers::conv_fld_from_kvmap(kvmap, name, "input", input, false);
3550 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
3551 }
3552 };
3553
3555 std::vector<Acir::FunctionInput> inputs;
3556 std::vector<Acir::Witness> outputs;
3557 uint32_t len;
3558
3559 friend bool operator==(const Poseidon2Permutation&, const Poseidon2Permutation&);
3560 std::vector<uint8_t> bincodeSerialize() const;
3561 static Poseidon2Permutation bincodeDeserialize(std::vector<uint8_t>);
3562
3563 void msgpack_pack(auto& packer) const
3564 {
3565 packer.pack_map(3);
3566 packer.pack(std::make_pair("inputs", inputs));
3567 packer.pack(std::make_pair("outputs", outputs));
3568 packer.pack(std::make_pair("len", len));
3569 }
3570
3571 void msgpack_unpack(msgpack::object const& o)
3572 {
3573 auto name = "Poseidon2Permutation";
3574 auto kvmap = Helpers::make_kvmap(o, name);
3575 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
3576 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
3577 Helpers::conv_fld_from_kvmap(kvmap, name, "len", len, false);
3578 }
3579 };
3580
3585
3586 friend bool operator==(const Sha256Compression&, const Sha256Compression&);
3587 std::vector<uint8_t> bincodeSerialize() const;
3588 static Sha256Compression bincodeDeserialize(std::vector<uint8_t>);
3589
3590 void msgpack_pack(auto& packer) const
3591 {
3592 packer.pack_map(3);
3593 packer.pack(std::make_pair("inputs", inputs));
3594 packer.pack(std::make_pair("hash_values", hash_values));
3595 packer.pack(std::make_pair("outputs", outputs));
3596 }
3597
3598 void msgpack_unpack(msgpack::object const& o)
3599 {
3600 auto name = "Sha256Compression";
3601 auto kvmap = Helpers::make_kvmap(o, name);
3602 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
3603 Helpers::conv_fld_from_kvmap(kvmap, name, "hash_values", hash_values, false);
3604 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
3605 }
3606 };
3607
3608 std::variant<AES128Encrypt,
3609 AND,
3610 XOR,
3611 RANGE,
3612 Blake2s,
3613 Blake3,
3614 EcdsaSecp256k1,
3615 EcdsaSecp256r1,
3616 MultiScalarMul,
3617 EmbeddedCurveAdd,
3618 Keccakf1600,
3619 RecursiveAggregation,
3620 BigIntAdd,
3621 BigIntSub,
3622 BigIntMul,
3623 BigIntDiv,
3624 BigIntFromLeBytes,
3625 BigIntToLeBytes,
3626 Poseidon2Permutation,
3627 Sha256Compression>
3629
3630 friend bool operator==(const BlackBoxFuncCall&, const BlackBoxFuncCall&);
3631 std::vector<uint8_t> bincodeSerialize() const;
3632 static BlackBoxFuncCall bincodeDeserialize(std::vector<uint8_t>);
3633
3634 void msgpack_pack(auto& packer) const
3635 {
3636 std::string tag;
3637 bool is_unit;
3638 switch (value.index()) {
3639
3640 case 0:
3641 tag = "AES128Encrypt";
3642 is_unit = false;
3643 break;
3644 case 1:
3645 tag = "AND";
3646 is_unit = false;
3647 break;
3648 case 2:
3649 tag = "XOR";
3650 is_unit = false;
3651 break;
3652 case 3:
3653 tag = "RANGE";
3654 is_unit = false;
3655 break;
3656 case 4:
3657 tag = "Blake2s";
3658 is_unit = false;
3659 break;
3660 case 5:
3661 tag = "Blake3";
3662 is_unit = false;
3663 break;
3664 case 6:
3665 tag = "EcdsaSecp256k1";
3666 is_unit = false;
3667 break;
3668 case 7:
3669 tag = "EcdsaSecp256r1";
3670 is_unit = false;
3671 break;
3672 case 8:
3673 tag = "MultiScalarMul";
3674 is_unit = false;
3675 break;
3676 case 9:
3677 tag = "EmbeddedCurveAdd";
3678 is_unit = false;
3679 break;
3680 case 10:
3681 tag = "Keccakf1600";
3682 is_unit = false;
3683 break;
3684 case 11:
3685 tag = "RecursiveAggregation";
3686 is_unit = false;
3687 break;
3688 case 12:
3689 tag = "BigIntAdd";
3690 is_unit = false;
3691 break;
3692 case 13:
3693 tag = "BigIntSub";
3694 is_unit = false;
3695 break;
3696 case 14:
3697 tag = "BigIntMul";
3698 is_unit = false;
3699 break;
3700 case 15:
3701 tag = "BigIntDiv";
3702 is_unit = false;
3703 break;
3704 case 16:
3705 tag = "BigIntFromLeBytes";
3706 is_unit = false;
3707 break;
3708 case 17:
3709 tag = "BigIntToLeBytes";
3710 is_unit = false;
3711 break;
3712 case 18:
3713 tag = "Poseidon2Permutation";
3714 is_unit = false;
3715 break;
3716 case 19:
3717 tag = "Sha256Compression";
3718 is_unit = false;
3719 break;
3720 default:
3721 throw_or_abort("unknown enum 'BlackBoxFuncCall' variant index: " + std::to_string(value.index()));
3722 }
3723 if (is_unit) {
3724 packer.pack(tag);
3725 } else {
3726 std::visit(
3727 [&packer, tag](const auto& arg) {
3729 data[tag] = msgpack::object(arg);
3730 packer.pack(data);
3731 },
3732 value);
3733 }
3734 }
3735
3736 void msgpack_unpack(msgpack::object const& o)
3737 {
3738
3739 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
3740 std::cerr << o << std::endl;
3741 throw_or_abort("expected MAP or STR for enum 'BlackBoxFuncCall'; got type " + std::to_string(o.type));
3742 }
3743 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
3744 throw_or_abort("expected 1 entry for enum 'BlackBoxFuncCall'; got " + std::to_string(o.via.map.size));
3745 }
3746 std::string tag;
3747 try {
3748 if (o.type == msgpack::type::object_type::MAP) {
3749 o.via.map.ptr[0].key.convert(tag);
3750 } else {
3751 o.convert(tag);
3752 }
3753 } catch (const msgpack::type_error&) {
3754 std::cerr << o << std::endl;
3755 throw_or_abort("error converting tag to string for enum 'BlackBoxFuncCall'");
3756 }
3757 if (tag == "AES128Encrypt") {
3758 AES128Encrypt v;
3759 try {
3760 o.via.map.ptr[0].val.convert(v);
3761 } catch (const msgpack::type_error&) {
3762 std::cerr << o << std::endl;
3763 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::AES128Encrypt'");
3764 }
3765
3766 value = v;
3767 } else if (tag == "AND") {
3768 AND v;
3769 try {
3770 o.via.map.ptr[0].val.convert(v);
3771 } catch (const msgpack::type_error&) {
3772 std::cerr << o << std::endl;
3773 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::AND'");
3774 }
3775
3776 value = v;
3777 } else if (tag == "XOR") {
3778 XOR v;
3779 try {
3780 o.via.map.ptr[0].val.convert(v);
3781 } catch (const msgpack::type_error&) {
3782 std::cerr << o << std::endl;
3783 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::XOR'");
3784 }
3785
3786 value = v;
3787 } else if (tag == "RANGE") {
3788 RANGE v;
3789 try {
3790 o.via.map.ptr[0].val.convert(v);
3791 } catch (const msgpack::type_error&) {
3792 std::cerr << o << std::endl;
3793 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::RANGE'");
3794 }
3795
3796 value = v;
3797 } else if (tag == "Blake2s") {
3798 Blake2s v;
3799 try {
3800 o.via.map.ptr[0].val.convert(v);
3801 } catch (const msgpack::type_error&) {
3802 std::cerr << o << std::endl;
3803 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::Blake2s'");
3804 }
3805
3806 value = v;
3807 } else if (tag == "Blake3") {
3808 Blake3 v;
3809 try {
3810 o.via.map.ptr[0].val.convert(v);
3811 } catch (const msgpack::type_error&) {
3812 std::cerr << o << std::endl;
3813 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::Blake3'");
3814 }
3815
3816 value = v;
3817 } else if (tag == "EcdsaSecp256k1") {
3819 try {
3820 o.via.map.ptr[0].val.convert(v);
3821 } catch (const msgpack::type_error&) {
3822 std::cerr << o << std::endl;
3823 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::EcdsaSecp256k1'");
3824 }
3825
3826 value = v;
3827 } else if (tag == "EcdsaSecp256r1") {
3829 try {
3830 o.via.map.ptr[0].val.convert(v);
3831 } catch (const msgpack::type_error&) {
3832 std::cerr << o << std::endl;
3833 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::EcdsaSecp256r1'");
3834 }
3835
3836 value = v;
3837 } else if (tag == "MultiScalarMul") {
3839 try {
3840 o.via.map.ptr[0].val.convert(v);
3841 } catch (const msgpack::type_error&) {
3842 std::cerr << o << std::endl;
3843 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::MultiScalarMul'");
3844 }
3845
3846 value = v;
3847 } else if (tag == "EmbeddedCurveAdd") {
3849 try {
3850 o.via.map.ptr[0].val.convert(v);
3851 } catch (const msgpack::type_error&) {
3852 std::cerr << o << std::endl;
3853 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::EmbeddedCurveAdd'");
3854 }
3855
3856 value = v;
3857 } else if (tag == "Keccakf1600") {
3858 Keccakf1600 v;
3859 try {
3860 o.via.map.ptr[0].val.convert(v);
3861 } catch (const msgpack::type_error&) {
3862 std::cerr << o << std::endl;
3863 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::Keccakf1600'");
3864 }
3865
3866 value = v;
3867 } else if (tag == "RecursiveAggregation") {
3869 try {
3870 o.via.map.ptr[0].val.convert(v);
3871 } catch (const msgpack::type_error&) {
3872 std::cerr << o << std::endl;
3873 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::RecursiveAggregation'");
3874 }
3875
3876 value = v;
3877 } else if (tag == "BigIntAdd") {
3878 BigIntAdd v;
3879 try {
3880 o.via.map.ptr[0].val.convert(v);
3881 } catch (const msgpack::type_error&) {
3882 std::cerr << o << std::endl;
3883 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::BigIntAdd'");
3884 }
3885
3886 value = v;
3887 } else if (tag == "BigIntSub") {
3888 BigIntSub v;
3889 try {
3890 o.via.map.ptr[0].val.convert(v);
3891 } catch (const msgpack::type_error&) {
3892 std::cerr << o << std::endl;
3893 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::BigIntSub'");
3894 }
3895
3896 value = v;
3897 } else if (tag == "BigIntMul") {
3898 BigIntMul v;
3899 try {
3900 o.via.map.ptr[0].val.convert(v);
3901 } catch (const msgpack::type_error&) {
3902 std::cerr << o << std::endl;
3903 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::BigIntMul'");
3904 }
3905
3906 value = v;
3907 } else if (tag == "BigIntDiv") {
3908 BigIntDiv v;
3909 try {
3910 o.via.map.ptr[0].val.convert(v);
3911 } catch (const msgpack::type_error&) {
3912 std::cerr << o << std::endl;
3913 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::BigIntDiv'");
3914 }
3915
3916 value = v;
3917 } else if (tag == "BigIntFromLeBytes") {
3919 try {
3920 o.via.map.ptr[0].val.convert(v);
3921 } catch (const msgpack::type_error&) {
3922 std::cerr << o << std::endl;
3923 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::BigIntFromLeBytes'");
3924 }
3925
3926 value = v;
3927 } else if (tag == "BigIntToLeBytes") {
3929 try {
3930 o.via.map.ptr[0].val.convert(v);
3931 } catch (const msgpack::type_error&) {
3932 std::cerr << o << std::endl;
3933 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::BigIntToLeBytes'");
3934 }
3935
3936 value = v;
3937 } else if (tag == "Poseidon2Permutation") {
3939 try {
3940 o.via.map.ptr[0].val.convert(v);
3941 } catch (const msgpack::type_error&) {
3942 std::cerr << o << std::endl;
3943 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::Poseidon2Permutation'");
3944 }
3945
3946 value = v;
3947 } else if (tag == "Sha256Compression") {
3949 try {
3950 o.via.map.ptr[0].val.convert(v);
3951 } catch (const msgpack::type_error&) {
3952 std::cerr << o << std::endl;
3953 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::Sha256Compression'");
3954 }
3955
3956 value = v;
3957 } else {
3958 std::cerr << o << std::endl;
3959 throw_or_abort("unknown 'BlackBoxFuncCall' enum variant: " + tag);
3960 }
3961 }
3962};
3963
3964struct BlockId {
3965 uint32_t value;
3966
3967 friend bool operator==(const BlockId&, const BlockId&);
3968 std::vector<uint8_t> bincodeSerialize() const;
3969 static BlockId bincodeDeserialize(std::vector<uint8_t>);
3970
3971 void msgpack_pack(auto& packer) const { packer.pack(value); }
3972
3973 void msgpack_unpack(msgpack::object const& o)
3974 {
3975 try {
3976 o.convert(value);
3977 } catch (const msgpack::type_error&) {
3978 std::cerr << o << std::endl;
3979 throw_or_abort("error converting into newtype 'BlockId'");
3980 }
3981 }
3982};
3983
3985
3986 struct Memory {
3987 friend bool operator==(const Memory&, const Memory&);
3988 std::vector<uint8_t> bincodeSerialize() const;
3989 static Memory bincodeDeserialize(std::vector<uint8_t>);
3990
3991 void msgpack_pack(auto& packer) const {}
3992 void msgpack_unpack(msgpack::object const& o) {}
3993 };
3994
3995 struct CallData {
3996 uint32_t value;
3997
3998 friend bool operator==(const CallData&, const CallData&);
3999 std::vector<uint8_t> bincodeSerialize() const;
4000 static CallData bincodeDeserialize(std::vector<uint8_t>);
4001
4002 void msgpack_pack(auto& packer) const { packer.pack(value); }
4003
4004 void msgpack_unpack(msgpack::object const& o)
4005 {
4006 try {
4007 o.convert(value);
4008 } catch (const msgpack::type_error&) {
4009 std::cerr << o << std::endl;
4010 throw_or_abort("error converting into newtype 'CallData'");
4011 }
4012 }
4013 };
4014
4015 struct ReturnData {
4016 friend bool operator==(const ReturnData&, const ReturnData&);
4017 std::vector<uint8_t> bincodeSerialize() const;
4018 static ReturnData bincodeDeserialize(std::vector<uint8_t>);
4019
4020 void msgpack_pack(auto& packer) const {}
4021 void msgpack_unpack(msgpack::object const& o) {}
4022 };
4023
4025
4026 friend bool operator==(const BlockType&, const BlockType&);
4027 std::vector<uint8_t> bincodeSerialize() const;
4028 static BlockType bincodeDeserialize(std::vector<uint8_t>);
4029
4030 void msgpack_pack(auto& packer) const
4031 {
4032 std::string tag;
4033 bool is_unit;
4034 switch (value.index()) {
4035
4036 case 0:
4037 tag = "Memory";
4038 is_unit = true;
4039 break;
4040 case 1:
4041 tag = "CallData";
4042 is_unit = false;
4043 break;
4044 case 2:
4045 tag = "ReturnData";
4046 is_unit = true;
4047 break;
4048 default:
4049 throw_or_abort("unknown enum 'BlockType' variant index: " + std::to_string(value.index()));
4050 }
4051 if (is_unit) {
4052 packer.pack(tag);
4053 } else {
4054 std::visit(
4055 [&packer, tag](const auto& arg) {
4057 data[tag] = msgpack::object(arg);
4058 packer.pack(data);
4059 },
4060 value);
4061 }
4062 }
4063
4064 void msgpack_unpack(msgpack::object const& o)
4065 {
4066
4067 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
4068 std::cerr << o << std::endl;
4069 throw_or_abort("expected MAP or STR for enum 'BlockType'; got type " + std::to_string(o.type));
4070 }
4071 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
4072 throw_or_abort("expected 1 entry for enum 'BlockType'; got " + std::to_string(o.via.map.size));
4073 }
4074 std::string tag;
4075 try {
4076 if (o.type == msgpack::type::object_type::MAP) {
4077 o.via.map.ptr[0].key.convert(tag);
4078 } else {
4079 o.convert(tag);
4080 }
4081 } catch (const msgpack::type_error&) {
4082 std::cerr << o << std::endl;
4083 throw_or_abort("error converting tag to string for enum 'BlockType'");
4084 }
4085 if (tag == "Memory") {
4086 Memory v;
4087 value = v;
4088 } else if (tag == "CallData") {
4089 CallData v;
4090 try {
4091 o.via.map.ptr[0].val.convert(v);
4092 } catch (const msgpack::type_error&) {
4093 std::cerr << o << std::endl;
4094 throw_or_abort("error converting into enum variant 'BlockType::CallData'");
4095 }
4096
4097 value = v;
4098 } else if (tag == "ReturnData") {
4099 ReturnData v;
4100 value = v;
4101 } else {
4102 std::cerr << o << std::endl;
4103 throw_or_abort("unknown 'BlockType' enum variant: " + tag);
4104 }
4105 }
4106};
4107
4111 std::string q_c;
4112
4113 friend bool operator==(const Expression&, const Expression&);
4114 std::vector<uint8_t> bincodeSerialize() const;
4115 static Expression bincodeDeserialize(std::vector<uint8_t>);
4116
4117 void msgpack_pack(auto& packer) const
4118 {
4119 packer.pack_map(3);
4120 packer.pack(std::make_pair("mul_terms", mul_terms));
4121 packer.pack(std::make_pair("linear_combinations", linear_combinations));
4122 packer.pack(std::make_pair("q_c", q_c));
4123 }
4124
4125 void msgpack_unpack(msgpack::object const& o)
4126 {
4127 auto name = "Expression";
4128 auto kvmap = Helpers::make_kvmap(o, name);
4129 Helpers::conv_fld_from_kvmap(kvmap, name, "mul_terms", mul_terms, false);
4130 Helpers::conv_fld_from_kvmap(kvmap, name, "linear_combinations", linear_combinations, false);
4131 Helpers::conv_fld_from_kvmap(kvmap, name, "q_c", q_c, false);
4132 }
4133};
4134
4136
4137 struct Single {
4139
4140 friend bool operator==(const Single&, const Single&);
4141 std::vector<uint8_t> bincodeSerialize() const;
4142 static Single bincodeDeserialize(std::vector<uint8_t>);
4143
4144 void msgpack_pack(auto& packer) const { packer.pack(value); }
4145
4146 void msgpack_unpack(msgpack::object const& o)
4147 {
4148 try {
4149 o.convert(value);
4150 } catch (const msgpack::type_error&) {
4151 std::cerr << o << std::endl;
4152 throw_or_abort("error converting into newtype 'Single'");
4153 }
4154 }
4155 };
4156
4157 struct Array {
4158 std::vector<Acir::Expression> value;
4159
4160 friend bool operator==(const Array&, const Array&);
4161 std::vector<uint8_t> bincodeSerialize() const;
4162 static Array bincodeDeserialize(std::vector<uint8_t>);
4163
4164 void msgpack_pack(auto& packer) const { packer.pack(value); }
4165
4166 void msgpack_unpack(msgpack::object const& o)
4167 {
4168 try {
4169 o.convert(value);
4170 } catch (const msgpack::type_error&) {
4171 std::cerr << o << std::endl;
4172 throw_or_abort("error converting into newtype 'Array'");
4173 }
4174 }
4175 };
4176
4179
4180 friend bool operator==(const MemoryArray&, const MemoryArray&);
4181 std::vector<uint8_t> bincodeSerialize() const;
4182 static MemoryArray bincodeDeserialize(std::vector<uint8_t>);
4183
4184 void msgpack_pack(auto& packer) const { packer.pack(value); }
4185
4186 void msgpack_unpack(msgpack::object const& o)
4187 {
4188 try {
4189 o.convert(value);
4190 } catch (const msgpack::type_error&) {
4191 std::cerr << o << std::endl;
4192 throw_or_abort("error converting into newtype 'MemoryArray'");
4193 }
4194 }
4195 };
4196
4198
4199 friend bool operator==(const BrilligInputs&, const BrilligInputs&);
4200 std::vector<uint8_t> bincodeSerialize() const;
4201 static BrilligInputs bincodeDeserialize(std::vector<uint8_t>);
4202
4203 void msgpack_pack(auto& packer) const
4204 {
4205 std::string tag;
4206 bool is_unit;
4207 switch (value.index()) {
4208
4209 case 0:
4210 tag = "Single";
4211 is_unit = false;
4212 break;
4213 case 1:
4214 tag = "Array";
4215 is_unit = false;
4216 break;
4217 case 2:
4218 tag = "MemoryArray";
4219 is_unit = false;
4220 break;
4221 default:
4222 throw_or_abort("unknown enum 'BrilligInputs' variant index: " + std::to_string(value.index()));
4223 }
4224 if (is_unit) {
4225 packer.pack(tag);
4226 } else {
4227 std::visit(
4228 [&packer, tag](const auto& arg) {
4230 data[tag] = msgpack::object(arg);
4231 packer.pack(data);
4232 },
4233 value);
4234 }
4235 }
4236
4237 void msgpack_unpack(msgpack::object const& o)
4238 {
4239
4240 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
4241 std::cerr << o << std::endl;
4242 throw_or_abort("expected MAP or STR for enum 'BrilligInputs'; got type " + std::to_string(o.type));
4243 }
4244 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
4245 throw_or_abort("expected 1 entry for enum 'BrilligInputs'; got " + std::to_string(o.via.map.size));
4246 }
4247 std::string tag;
4248 try {
4249 if (o.type == msgpack::type::object_type::MAP) {
4250 o.via.map.ptr[0].key.convert(tag);
4251 } else {
4252 o.convert(tag);
4253 }
4254 } catch (const msgpack::type_error&) {
4255 std::cerr << o << std::endl;
4256 throw_or_abort("error converting tag to string for enum 'BrilligInputs'");
4257 }
4258 if (tag == "Single") {
4259 Single v;
4260 try {
4261 o.via.map.ptr[0].val.convert(v);
4262 } catch (const msgpack::type_error&) {
4263 std::cerr << o << std::endl;
4264 throw_or_abort("error converting into enum variant 'BrilligInputs::Single'");
4265 }
4266
4267 value = v;
4268 } else if (tag == "Array") {
4269 Array v;
4270 try {
4271 o.via.map.ptr[0].val.convert(v);
4272 } catch (const msgpack::type_error&) {
4273 std::cerr << o << std::endl;
4274 throw_or_abort("error converting into enum variant 'BrilligInputs::Array'");
4275 }
4276
4277 value = v;
4278 } else if (tag == "MemoryArray") {
4279 MemoryArray v;
4280 try {
4281 o.via.map.ptr[0].val.convert(v);
4282 } catch (const msgpack::type_error&) {
4283 std::cerr << o << std::endl;
4284 throw_or_abort("error converting into enum variant 'BrilligInputs::MemoryArray'");
4285 }
4286
4287 value = v;
4288 } else {
4289 std::cerr << o << std::endl;
4290 throw_or_abort("unknown 'BrilligInputs' enum variant: " + tag);
4291 }
4292 }
4293};
4294
4296
4297 struct Simple {
4299
4300 friend bool operator==(const Simple&, const Simple&);
4301 std::vector<uint8_t> bincodeSerialize() const;
4302 static Simple bincodeDeserialize(std::vector<uint8_t>);
4303
4304 void msgpack_pack(auto& packer) const { packer.pack(value); }
4305
4306 void msgpack_unpack(msgpack::object const& o)
4307 {
4308 try {
4309 o.convert(value);
4310 } catch (const msgpack::type_error&) {
4311 std::cerr << o << std::endl;
4312 throw_or_abort("error converting into newtype 'Simple'");
4313 }
4314 }
4315 };
4316
4317 struct Array {
4318 std::vector<Acir::Witness> value;
4319
4320 friend bool operator==(const Array&, const Array&);
4321 std::vector<uint8_t> bincodeSerialize() const;
4322 static Array bincodeDeserialize(std::vector<uint8_t>);
4323
4324 void msgpack_pack(auto& packer) const { packer.pack(value); }
4325
4326 void msgpack_unpack(msgpack::object const& o)
4327 {
4328 try {
4329 o.convert(value);
4330 } catch (const msgpack::type_error&) {
4331 std::cerr << o << std::endl;
4332 throw_or_abort("error converting into newtype 'Array'");
4333 }
4334 }
4335 };
4336
4338
4339 friend bool operator==(const BrilligOutputs&, const BrilligOutputs&);
4340 std::vector<uint8_t> bincodeSerialize() const;
4341 static BrilligOutputs bincodeDeserialize(std::vector<uint8_t>);
4342
4343 void msgpack_pack(auto& packer) const
4344 {
4345 std::string tag;
4346 bool is_unit;
4347 switch (value.index()) {
4348
4349 case 0:
4350 tag = "Simple";
4351 is_unit = false;
4352 break;
4353 case 1:
4354 tag = "Array";
4355 is_unit = false;
4356 break;
4357 default:
4358 throw_or_abort("unknown enum 'BrilligOutputs' variant index: " + std::to_string(value.index()));
4359 }
4360 if (is_unit) {
4361 packer.pack(tag);
4362 } else {
4363 std::visit(
4364 [&packer, tag](const auto& arg) {
4366 data[tag] = msgpack::object(arg);
4367 packer.pack(data);
4368 },
4369 value);
4370 }
4371 }
4372
4373 void msgpack_unpack(msgpack::object const& o)
4374 {
4375
4376 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
4377 std::cerr << o << std::endl;
4378 throw_or_abort("expected MAP or STR for enum 'BrilligOutputs'; got type " + std::to_string(o.type));
4379 }
4380 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
4381 throw_or_abort("expected 1 entry for enum 'BrilligOutputs'; got " + std::to_string(o.via.map.size));
4382 }
4383 std::string tag;
4384 try {
4385 if (o.type == msgpack::type::object_type::MAP) {
4386 o.via.map.ptr[0].key.convert(tag);
4387 } else {
4388 o.convert(tag);
4389 }
4390 } catch (const msgpack::type_error&) {
4391 std::cerr << o << std::endl;
4392 throw_or_abort("error converting tag to string for enum 'BrilligOutputs'");
4393 }
4394 if (tag == "Simple") {
4395 Simple v;
4396 try {
4397 o.via.map.ptr[0].val.convert(v);
4398 } catch (const msgpack::type_error&) {
4399 std::cerr << o << std::endl;
4400 throw_or_abort("error converting into enum variant 'BrilligOutputs::Simple'");
4401 }
4402
4403 value = v;
4404 } else if (tag == "Array") {
4405 Array v;
4406 try {
4407 o.via.map.ptr[0].val.convert(v);
4408 } catch (const msgpack::type_error&) {
4409 std::cerr << o << std::endl;
4410 throw_or_abort("error converting into enum variant 'BrilligOutputs::Array'");
4411 }
4412
4413 value = v;
4414 } else {
4415 std::cerr << o << std::endl;
4416 throw_or_abort("unknown 'BrilligOutputs' enum variant: " + tag);
4417 }
4418 }
4419};
4420
4421struct MemOp {
4425
4426 friend bool operator==(const MemOp&, const MemOp&);
4427 std::vector<uint8_t> bincodeSerialize() const;
4428 static MemOp bincodeDeserialize(std::vector<uint8_t>);
4429
4430 void msgpack_pack(auto& packer) const
4431 {
4432 packer.pack_map(3);
4433 packer.pack(std::make_pair("operation", operation));
4434 packer.pack(std::make_pair("index", index));
4435 packer.pack(std::make_pair("value", value));
4436 }
4437
4438 void msgpack_unpack(msgpack::object const& o)
4439 {
4440 auto name = "MemOp";
4441 auto kvmap = Helpers::make_kvmap(o, name);
4442 Helpers::conv_fld_from_kvmap(kvmap, name, "operation", operation, false);
4443 Helpers::conv_fld_from_kvmap(kvmap, name, "index", index, false);
4444 Helpers::conv_fld_from_kvmap(kvmap, name, "value", value, false);
4445 }
4446};
4447
4448struct Opcode {
4449
4450 struct AssertZero {
4452
4453 friend bool operator==(const AssertZero&, const AssertZero&);
4454 std::vector<uint8_t> bincodeSerialize() const;
4455 static AssertZero bincodeDeserialize(std::vector<uint8_t>);
4456
4457 void msgpack_pack(auto& packer) const { packer.pack(value); }
4458
4459 void msgpack_unpack(msgpack::object const& o)
4460 {
4461 try {
4462 o.convert(value);
4463 } catch (const msgpack::type_error&) {
4464 std::cerr << o << std::endl;
4465 throw_or_abort("error converting into newtype 'AssertZero'");
4466 }
4467 }
4468 };
4469
4472
4473 friend bool operator==(const BlackBoxFuncCall&, const BlackBoxFuncCall&);
4474 std::vector<uint8_t> bincodeSerialize() const;
4475 static BlackBoxFuncCall bincodeDeserialize(std::vector<uint8_t>);
4476
4477 void msgpack_pack(auto& packer) const { packer.pack(value); }
4478
4479 void msgpack_unpack(msgpack::object const& o)
4480 {
4481 try {
4482 o.convert(value);
4483 } catch (const msgpack::type_error&) {
4484 std::cerr << o << std::endl;
4485 throw_or_abort("error converting into newtype 'BlackBoxFuncCall'");
4486 }
4487 }
4488 };
4489
4490 struct MemoryOp {
4494
4495 friend bool operator==(const MemoryOp&, const MemoryOp&);
4496 std::vector<uint8_t> bincodeSerialize() const;
4497 static MemoryOp bincodeDeserialize(std::vector<uint8_t>);
4498
4499 void msgpack_pack(auto& packer) const
4500 {
4501 packer.pack_map(3);
4502 packer.pack(std::make_pair("block_id", block_id));
4503 packer.pack(std::make_pair("op", op));
4504 packer.pack(std::make_pair("predicate", predicate));
4505 }
4506
4507 void msgpack_unpack(msgpack::object const& o)
4508 {
4509 auto name = "MemoryOp";
4510 auto kvmap = Helpers::make_kvmap(o, name);
4511 Helpers::conv_fld_from_kvmap(kvmap, name, "block_id", block_id, false);
4512 Helpers::conv_fld_from_kvmap(kvmap, name, "op", op, false);
4513 Helpers::conv_fld_from_kvmap(kvmap, name, "predicate", predicate, true);
4514 }
4515 };
4516
4517 struct MemoryInit {
4519 std::vector<Acir::Witness> init;
4521
4522 friend bool operator==(const MemoryInit&, const MemoryInit&);
4523 std::vector<uint8_t> bincodeSerialize() const;
4524 static MemoryInit bincodeDeserialize(std::vector<uint8_t>);
4525
4526 void msgpack_pack(auto& packer) const
4527 {
4528 packer.pack_map(3);
4529 packer.pack(std::make_pair("block_id", block_id));
4530 packer.pack(std::make_pair("init", init));
4531 packer.pack(std::make_pair("block_type", block_type));
4532 }
4533
4534 void msgpack_unpack(msgpack::object const& o)
4535 {
4536 auto name = "MemoryInit";
4537 auto kvmap = Helpers::make_kvmap(o, name);
4538 Helpers::conv_fld_from_kvmap(kvmap, name, "block_id", block_id, false);
4539 Helpers::conv_fld_from_kvmap(kvmap, name, "init", init, false);
4540 Helpers::conv_fld_from_kvmap(kvmap, name, "block_type", block_type, false);
4541 }
4542 };
4543
4545 uint32_t id;
4546 std::vector<Acir::BrilligInputs> inputs;
4547 std::vector<Acir::BrilligOutputs> outputs;
4549
4550 friend bool operator==(const BrilligCall&, const BrilligCall&);
4551 std::vector<uint8_t> bincodeSerialize() const;
4552 static BrilligCall bincodeDeserialize(std::vector<uint8_t>);
4553
4554 void msgpack_pack(auto& packer) const
4555 {
4556 packer.pack_map(4);
4557 packer.pack(std::make_pair("id", id));
4558 packer.pack(std::make_pair("inputs", inputs));
4559 packer.pack(std::make_pair("outputs", outputs));
4560 packer.pack(std::make_pair("predicate", predicate));
4561 }
4562
4563 void msgpack_unpack(msgpack::object const& o)
4564 {
4565 auto name = "BrilligCall";
4566 auto kvmap = Helpers::make_kvmap(o, name);
4567 Helpers::conv_fld_from_kvmap(kvmap, name, "id", id, false);
4568 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
4569 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
4570 Helpers::conv_fld_from_kvmap(kvmap, name, "predicate", predicate, true);
4571 }
4572 };
4573
4574 struct Call {
4575 uint32_t id;
4576 std::vector<Acir::Witness> inputs;
4577 std::vector<Acir::Witness> outputs;
4579
4580 friend bool operator==(const Call&, const Call&);
4581 std::vector<uint8_t> bincodeSerialize() const;
4582 static Call bincodeDeserialize(std::vector<uint8_t>);
4583
4584 void msgpack_pack(auto& packer) const
4585 {
4586 packer.pack_map(4);
4587 packer.pack(std::make_pair("id", id));
4588 packer.pack(std::make_pair("inputs", inputs));
4589 packer.pack(std::make_pair("outputs", outputs));
4590 packer.pack(std::make_pair("predicate", predicate));
4591 }
4592
4593 void msgpack_unpack(msgpack::object const& o)
4594 {
4595 auto name = "Call";
4596 auto kvmap = Helpers::make_kvmap(o, name);
4597 Helpers::conv_fld_from_kvmap(kvmap, name, "id", id, false);
4598 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
4599 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
4600 Helpers::conv_fld_from_kvmap(kvmap, name, "predicate", predicate, true);
4601 }
4602 };
4603
4605
4606 friend bool operator==(const Opcode&, const Opcode&);
4607 std::vector<uint8_t> bincodeSerialize() const;
4608 static Opcode bincodeDeserialize(std::vector<uint8_t>);
4609
4610 void msgpack_pack(auto& packer) const
4611 {
4612 std::string tag;
4613 bool is_unit;
4614 switch (value.index()) {
4615
4616 case 0:
4617 tag = "AssertZero";
4618 is_unit = false;
4619 break;
4620 case 1:
4621 tag = "BlackBoxFuncCall";
4622 is_unit = false;
4623 break;
4624 case 2:
4625 tag = "MemoryOp";
4626 is_unit = false;
4627 break;
4628 case 3:
4629 tag = "MemoryInit";
4630 is_unit = false;
4631 break;
4632 case 4:
4633 tag = "BrilligCall";
4634 is_unit = false;
4635 break;
4636 case 5:
4637 tag = "Call";
4638 is_unit = false;
4639 break;
4640 default:
4641 throw_or_abort("unknown enum 'Opcode' variant index: " + std::to_string(value.index()));
4642 }
4643 if (is_unit) {
4644 packer.pack(tag);
4645 } else {
4646 std::visit(
4647 [&packer, tag](const auto& arg) {
4649 data[tag] = msgpack::object(arg);
4650 packer.pack(data);
4651 },
4652 value);
4653 }
4654 }
4655
4656 void msgpack_unpack(msgpack::object const& o)
4657 {
4658
4659 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
4660 std::cerr << o << std::endl;
4661 throw_or_abort("expected MAP or STR for enum 'Opcode'; got type " + std::to_string(o.type));
4662 }
4663 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
4664 throw_or_abort("expected 1 entry for enum 'Opcode'; got " + std::to_string(o.via.map.size));
4665 }
4666 std::string tag;
4667 try {
4668 if (o.type == msgpack::type::object_type::MAP) {
4669 o.via.map.ptr[0].key.convert(tag);
4670 } else {
4671 o.convert(tag);
4672 }
4673 } catch (const msgpack::type_error&) {
4674 std::cerr << o << std::endl;
4675 throw_or_abort("error converting tag to string for enum 'Opcode'");
4676 }
4677 if (tag == "AssertZero") {
4678 AssertZero v;
4679 try {
4680 o.via.map.ptr[0].val.convert(v);
4681 } catch (const msgpack::type_error&) {
4682 std::cerr << o << std::endl;
4683 throw_or_abort("error converting into enum variant 'Opcode::AssertZero'");
4684 }
4685
4686 value = v;
4687 } else if (tag == "BlackBoxFuncCall") {
4689 try {
4690 o.via.map.ptr[0].val.convert(v);
4691 } catch (const msgpack::type_error&) {
4692 std::cerr << o << std::endl;
4693 throw_or_abort("error converting into enum variant 'Opcode::BlackBoxFuncCall'");
4694 }
4695
4696 value = v;
4697 } else if (tag == "MemoryOp") {
4698 MemoryOp v;
4699 try {
4700 o.via.map.ptr[0].val.convert(v);
4701 } catch (const msgpack::type_error&) {
4702 std::cerr << o << std::endl;
4703 throw_or_abort("error converting into enum variant 'Opcode::MemoryOp'");
4704 }
4705
4706 value = v;
4707 } else if (tag == "MemoryInit") {
4708 MemoryInit v;
4709 try {
4710 o.via.map.ptr[0].val.convert(v);
4711 } catch (const msgpack::type_error&) {
4712 std::cerr << o << std::endl;
4713 throw_or_abort("error converting into enum variant 'Opcode::MemoryInit'");
4714 }
4715
4716 value = v;
4717 } else if (tag == "BrilligCall") {
4718 BrilligCall v;
4719 try {
4720 o.via.map.ptr[0].val.convert(v);
4721 } catch (const msgpack::type_error&) {
4722 std::cerr << o << std::endl;
4723 throw_or_abort("error converting into enum variant 'Opcode::BrilligCall'");
4724 }
4725
4726 value = v;
4727 } else if (tag == "Call") {
4728 Call v;
4729 try {
4730 o.via.map.ptr[0].val.convert(v);
4731 } catch (const msgpack::type_error&) {
4732 std::cerr << o << std::endl;
4733 throw_or_abort("error converting into enum variant 'Opcode::Call'");
4734 }
4735
4736 value = v;
4737 } else {
4738 std::cerr << o << std::endl;
4739 throw_or_abort("unknown 'Opcode' enum variant: " + tag);
4740 }
4741 }
4742};
4743
4745
4746 struct Expression {
4748
4749 friend bool operator==(const Expression&, const Expression&);
4750 std::vector<uint8_t> bincodeSerialize() const;
4751 static Expression bincodeDeserialize(std::vector<uint8_t>);
4752
4753 void msgpack_pack(auto& packer) const { packer.pack(value); }
4754
4755 void msgpack_unpack(msgpack::object const& o)
4756 {
4757 try {
4758 o.convert(value);
4759 } catch (const msgpack::type_error&) {
4760 std::cerr << o << std::endl;
4761 throw_or_abort("error converting into newtype 'Expression'");
4762 }
4763 }
4764 };
4765
4766 struct Memory {
4768
4769 friend bool operator==(const Memory&, const Memory&);
4770 std::vector<uint8_t> bincodeSerialize() const;
4771 static Memory bincodeDeserialize(std::vector<uint8_t>);
4772
4773 void msgpack_pack(auto& packer) const { packer.pack(value); }
4774
4775 void msgpack_unpack(msgpack::object const& o)
4776 {
4777 try {
4778 o.convert(value);
4779 } catch (const msgpack::type_error&) {
4780 std::cerr << o << std::endl;
4781 throw_or_abort("error converting into newtype 'Memory'");
4782 }
4783 }
4784 };
4785
4787
4788 friend bool operator==(const ExpressionOrMemory&, const ExpressionOrMemory&);
4789 std::vector<uint8_t> bincodeSerialize() const;
4790 static ExpressionOrMemory bincodeDeserialize(std::vector<uint8_t>);
4791
4792 void msgpack_pack(auto& packer) const
4793 {
4794 std::string tag;
4795 bool is_unit;
4796 switch (value.index()) {
4797
4798 case 0:
4799 tag = "Expression";
4800 is_unit = false;
4801 break;
4802 case 1:
4803 tag = "Memory";
4804 is_unit = false;
4805 break;
4806 default:
4807 throw_or_abort("unknown enum 'ExpressionOrMemory' variant index: " + std::to_string(value.index()));
4808 }
4809 if (is_unit) {
4810 packer.pack(tag);
4811 } else {
4812 std::visit(
4813 [&packer, tag](const auto& arg) {
4815 data[tag] = msgpack::object(arg);
4816 packer.pack(data);
4817 },
4818 value);
4819 }
4820 }
4821
4822 void msgpack_unpack(msgpack::object const& o)
4823 {
4824
4825 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
4826 std::cerr << o << std::endl;
4827 throw_or_abort("expected MAP or STR for enum 'ExpressionOrMemory'; got type " + std::to_string(o.type));
4828 }
4829 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
4830 throw_or_abort("expected 1 entry for enum 'ExpressionOrMemory'; got " + std::to_string(o.via.map.size));
4831 }
4832 std::string tag;
4833 try {
4834 if (o.type == msgpack::type::object_type::MAP) {
4835 o.via.map.ptr[0].key.convert(tag);
4836 } else {
4837 o.convert(tag);
4838 }
4839 } catch (const msgpack::type_error&) {
4840 std::cerr << o << std::endl;
4841 throw_or_abort("error converting tag to string for enum 'ExpressionOrMemory'");
4842 }
4843 if (tag == "Expression") {
4844 Expression v;
4845 try {
4846 o.via.map.ptr[0].val.convert(v);
4847 } catch (const msgpack::type_error&) {
4848 std::cerr << o << std::endl;
4849 throw_or_abort("error converting into enum variant 'ExpressionOrMemory::Expression'");
4850 }
4851
4852 value = v;
4853 } else if (tag == "Memory") {
4854 Memory v;
4855 try {
4856 o.via.map.ptr[0].val.convert(v);
4857 } catch (const msgpack::type_error&) {
4858 std::cerr << o << std::endl;
4859 throw_or_abort("error converting into enum variant 'ExpressionOrMemory::Memory'");
4860 }
4861
4862 value = v;
4863 } else {
4864 std::cerr << o << std::endl;
4865 throw_or_abort("unknown 'ExpressionOrMemory' enum variant: " + tag);
4866 }
4867 }
4868};
4869
4872 std::vector<Acir::ExpressionOrMemory> payload;
4873
4874 friend bool operator==(const AssertionPayload&, const AssertionPayload&);
4875 std::vector<uint8_t> bincodeSerialize() const;
4876 static AssertionPayload bincodeDeserialize(std::vector<uint8_t>);
4877
4878 void msgpack_pack(auto& packer) const
4879 {
4880 packer.pack_map(2);
4881 packer.pack(std::make_pair("error_selector", error_selector));
4882 packer.pack(std::make_pair("payload", payload));
4883 }
4884
4885 void msgpack_unpack(msgpack::object const& o)
4886 {
4887 auto name = "AssertionPayload";
4888 auto kvmap = Helpers::make_kvmap(o, name);
4889 Helpers::conv_fld_from_kvmap(kvmap, name, "error_selector", error_selector, false);
4890 Helpers::conv_fld_from_kvmap(kvmap, name, "payload", payload, false);
4891 }
4892};
4893
4895
4896 struct Unbounded {
4897 friend bool operator==(const Unbounded&, const Unbounded&);
4898 std::vector<uint8_t> bincodeSerialize() const;
4899 static Unbounded bincodeDeserialize(std::vector<uint8_t>);
4900
4901 void msgpack_pack(auto& packer) const {}
4902 void msgpack_unpack(msgpack::object const& o) {}
4903 };
4904
4905 struct Bounded {
4906 uint64_t width;
4907
4908 friend bool operator==(const Bounded&, const Bounded&);
4909 std::vector<uint8_t> bincodeSerialize() const;
4910 static Bounded bincodeDeserialize(std::vector<uint8_t>);
4911
4912 void msgpack_pack(auto& packer) const
4913 {
4914 packer.pack_map(1);
4915 packer.pack(std::make_pair("width", width));
4916 }
4917
4918 void msgpack_unpack(msgpack::object const& o)
4919 {
4920 auto name = "Bounded";
4921 auto kvmap = Helpers::make_kvmap(o, name);
4922 Helpers::conv_fld_from_kvmap(kvmap, name, "width", width, false);
4923 }
4924 };
4925
4927
4928 friend bool operator==(const ExpressionWidth&, const ExpressionWidth&);
4929 std::vector<uint8_t> bincodeSerialize() const;
4930 static ExpressionWidth bincodeDeserialize(std::vector<uint8_t>);
4931
4932 void msgpack_pack(auto& packer) const
4933 {
4934 std::string tag;
4935 bool is_unit;
4936 switch (value.index()) {
4937
4938 case 0:
4939 tag = "Unbounded";
4940 is_unit = true;
4941 break;
4942 case 1:
4943 tag = "Bounded";
4944 is_unit = false;
4945 break;
4946 default:
4947 throw_or_abort("unknown enum 'ExpressionWidth' variant index: " + std::to_string(value.index()));
4948 }
4949 if (is_unit) {
4950 packer.pack(tag);
4951 } else {
4952 std::visit(
4953 [&packer, tag](const auto& arg) {
4955 data[tag] = msgpack::object(arg);
4956 packer.pack(data);
4957 },
4958 value);
4959 }
4960 }
4961
4962 void msgpack_unpack(msgpack::object const& o)
4963 {
4964
4965 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
4966 std::cerr << o << std::endl;
4967 throw_or_abort("expected MAP or STR for enum 'ExpressionWidth'; got type " + std::to_string(o.type));
4968 }
4969 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
4970 throw_or_abort("expected 1 entry for enum 'ExpressionWidth'; got " + std::to_string(o.via.map.size));
4971 }
4972 std::string tag;
4973 try {
4974 if (o.type == msgpack::type::object_type::MAP) {
4975 o.via.map.ptr[0].key.convert(tag);
4976 } else {
4977 o.convert(tag);
4978 }
4979 } catch (const msgpack::type_error&) {
4980 std::cerr << o << std::endl;
4981 throw_or_abort("error converting tag to string for enum 'ExpressionWidth'");
4982 }
4983 if (tag == "Unbounded") {
4984 Unbounded v;
4985 value = v;
4986 } else if (tag == "Bounded") {
4987 Bounded v;
4988 try {
4989 o.via.map.ptr[0].val.convert(v);
4990 } catch (const msgpack::type_error&) {
4991 std::cerr << o << std::endl;
4992 throw_or_abort("error converting into enum variant 'ExpressionWidth::Bounded'");
4993 }
4994
4995 value = v;
4996 } else {
4997 std::cerr << o << std::endl;
4998 throw_or_abort("unknown 'ExpressionWidth' enum variant: " + tag);
4999 }
5000 }
5001};
5002
5004
5005 struct Acir {
5006 uint64_t value;
5007
5008 friend bool operator==(const Acir&, const Acir&);
5009 std::vector<uint8_t> bincodeSerialize() const;
5010 static Acir bincodeDeserialize(std::vector<uint8_t>);
5011
5012 void msgpack_pack(auto& packer) const { packer.pack(value); }
5013
5014 void msgpack_unpack(msgpack::object const& o)
5015 {
5016 try {
5017 o.convert(value);
5018 } catch (const msgpack::type_error&) {
5019 std::cerr << o << std::endl;
5020 throw_or_abort("error converting into newtype 'Acir'");
5021 }
5022 }
5023 };
5024
5025 struct Brillig {
5026 uint64_t acir_index;
5028
5029 friend bool operator==(const Brillig&, const Brillig&);
5030 std::vector<uint8_t> bincodeSerialize() const;
5031 static Brillig bincodeDeserialize(std::vector<uint8_t>);
5032
5033 void msgpack_pack(auto& packer) const
5034 {
5035 packer.pack_map(2);
5036 packer.pack(std::make_pair("acir_index", acir_index));
5037 packer.pack(std::make_pair("brillig_index", brillig_index));
5038 }
5039
5040 void msgpack_unpack(msgpack::object const& o)
5041 {
5042 auto name = "Brillig";
5043 auto kvmap = Helpers::make_kvmap(o, name);
5044 Helpers::conv_fld_from_kvmap(kvmap, name, "acir_index", acir_index, false);
5045 Helpers::conv_fld_from_kvmap(kvmap, name, "brillig_index", brillig_index, false);
5046 }
5047 };
5048
5050
5051 friend bool operator==(const OpcodeLocation&, const OpcodeLocation&);
5052 std::vector<uint8_t> bincodeSerialize() const;
5053 static OpcodeLocation bincodeDeserialize(std::vector<uint8_t>);
5054
5055 void msgpack_pack(auto& packer) const
5056 {
5057 std::string tag;
5058 bool is_unit;
5059 switch (value.index()) {
5060
5061 case 0:
5062 tag = "Acir";
5063 is_unit = false;
5064 break;
5065 case 1:
5066 tag = "Brillig";
5067 is_unit = false;
5068 break;
5069 default:
5070 throw_or_abort("unknown enum 'OpcodeLocation' variant index: " + std::to_string(value.index()));
5071 }
5072 if (is_unit) {
5073 packer.pack(tag);
5074 } else {
5075 std::visit(
5076 [&packer, tag](const auto& arg) {
5078 data[tag] = msgpack::object(arg);
5079 packer.pack(data);
5080 },
5081 value);
5082 }
5083 }
5084
5085 void msgpack_unpack(msgpack::object const& o)
5086 {
5087
5088 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
5089 std::cerr << o << std::endl;
5090 throw_or_abort("expected MAP or STR for enum 'OpcodeLocation'; got type " + std::to_string(o.type));
5091 }
5092 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
5093 throw_or_abort("expected 1 entry for enum 'OpcodeLocation'; got " + std::to_string(o.via.map.size));
5094 }
5095 std::string tag;
5096 try {
5097 if (o.type == msgpack::type::object_type::MAP) {
5098 o.via.map.ptr[0].key.convert(tag);
5099 } else {
5100 o.convert(tag);
5101 }
5102 } catch (const msgpack::type_error&) {
5103 std::cerr << o << std::endl;
5104 throw_or_abort("error converting tag to string for enum 'OpcodeLocation'");
5105 }
5106 if (tag == "Acir") {
5107 Acir v;
5108 try {
5109 o.via.map.ptr[0].val.convert(v);
5110 } catch (const msgpack::type_error&) {
5111 std::cerr << o << std::endl;
5112 throw_or_abort("error converting into enum variant 'OpcodeLocation::Acir'");
5113 }
5114
5115 value = v;
5116 } else if (tag == "Brillig") {
5117 Brillig v;
5118 try {
5119 o.via.map.ptr[0].val.convert(v);
5120 } catch (const msgpack::type_error&) {
5121 std::cerr << o << std::endl;
5122 throw_or_abort("error converting into enum variant 'OpcodeLocation::Brillig'");
5123 }
5124
5125 value = v;
5126 } else {
5127 std::cerr << o << std::endl;
5128 throw_or_abort("unknown 'OpcodeLocation' enum variant: " + tag);
5129 }
5130 }
5131};
5132
5134 std::vector<Acir::Witness> value;
5135
5136 friend bool operator==(const PublicInputs&, const PublicInputs&);
5137 std::vector<uint8_t> bincodeSerialize() const;
5138 static PublicInputs bincodeDeserialize(std::vector<uint8_t>);
5139
5140 void msgpack_pack(auto& packer) const { packer.pack(value); }
5141
5142 void msgpack_unpack(msgpack::object const& o)
5143 {
5144 try {
5145 o.convert(value);
5146 } catch (const msgpack::type_error&) {
5147 std::cerr << o << std::endl;
5148 throw_or_abort("error converting into newtype 'PublicInputs'");
5149 }
5150 }
5151};
5152
5153struct Circuit {
5155 std::vector<Acir::Opcode> opcodes;
5157 std::vector<Acir::Witness> private_parameters;
5161
5162 friend bool operator==(const Circuit&, const Circuit&);
5163 std::vector<uint8_t> bincodeSerialize() const;
5164 static Circuit bincodeDeserialize(std::vector<uint8_t>);
5165
5166 void msgpack_pack(auto& packer) const
5167 {
5168 packer.pack_map(7);
5169 packer.pack(std::make_pair("current_witness_index", current_witness_index));
5170 packer.pack(std::make_pair("opcodes", opcodes));
5171 packer.pack(std::make_pair("expression_width", expression_width));
5172 packer.pack(std::make_pair("private_parameters", private_parameters));
5173 packer.pack(std::make_pair("public_parameters", public_parameters));
5174 packer.pack(std::make_pair("return_values", return_values));
5175 packer.pack(std::make_pair("assert_messages", assert_messages));
5176 }
5177
5178 void msgpack_unpack(msgpack::object const& o)
5179 {
5180 auto name = "Circuit";
5181 auto kvmap = Helpers::make_kvmap(o, name);
5182 Helpers::conv_fld_from_kvmap(kvmap, name, "current_witness_index", current_witness_index, false);
5183 Helpers::conv_fld_from_kvmap(kvmap, name, "opcodes", opcodes, false);
5184 Helpers::conv_fld_from_kvmap(kvmap, name, "expression_width", expression_width, false);
5185 Helpers::conv_fld_from_kvmap(kvmap, name, "private_parameters", private_parameters, false);
5186 Helpers::conv_fld_from_kvmap(kvmap, name, "public_parameters", public_parameters, false);
5187 Helpers::conv_fld_from_kvmap(kvmap, name, "return_values", return_values, false);
5188 Helpers::conv_fld_from_kvmap(kvmap, name, "assert_messages", assert_messages, false);
5189 }
5190};
5191
5193 std::vector<Acir::BrilligOpcode> bytecode;
5194
5195 friend bool operator==(const BrilligBytecode&, const BrilligBytecode&);
5196 std::vector<uint8_t> bincodeSerialize() const;
5197 static BrilligBytecode bincodeDeserialize(std::vector<uint8_t>);
5198
5199 void msgpack_pack(auto& packer) const
5200 {
5201 packer.pack_map(1);
5202 packer.pack(std::make_pair("bytecode", bytecode));
5203 }
5204
5205 void msgpack_unpack(msgpack::object const& o)
5206 {
5207 auto name = "BrilligBytecode";
5208 auto kvmap = Helpers::make_kvmap(o, name);
5209 Helpers::conv_fld_from_kvmap(kvmap, name, "bytecode", bytecode, false);
5210 }
5211};
5212
5213struct Program {
5214 std::vector<Acir::Circuit> functions;
5215 std::vector<Acir::BrilligBytecode> unconstrained_functions;
5216
5217 friend bool operator==(const Program&, const Program&);
5218 std::vector<uint8_t> bincodeSerialize() const;
5219 static Program bincodeDeserialize(std::vector<uint8_t>);
5220
5221 void msgpack_pack(auto& packer) const
5222 {
5223 packer.pack_map(2);
5224 packer.pack(std::make_pair("functions", functions));
5225 packer.pack(std::make_pair("unconstrained_functions", unconstrained_functions));
5226 }
5227
5228 void msgpack_unpack(msgpack::object const& o)
5229 {
5230 auto name = "Program";
5231 auto kvmap = Helpers::make_kvmap(o, name);
5232 Helpers::conv_fld_from_kvmap(kvmap, name, "functions", functions, false);
5233 Helpers::conv_fld_from_kvmap(kvmap, name, "unconstrained_functions", unconstrained_functions, false);
5234 }
5235};
5236
5238 std::vector<Acir::Circuit> functions;
5239
5240 friend bool operator==(const ProgramWithoutBrillig&, const ProgramWithoutBrillig&);
5241 std::vector<uint8_t> bincodeSerialize() const;
5242 static ProgramWithoutBrillig bincodeDeserialize(std::vector<uint8_t>);
5243
5244 void msgpack_pack(auto& packer) const
5245 {
5246 packer.pack_map(1);
5247 packer.pack(std::make_pair("functions", functions));
5248 }
5249
5250 void msgpack_unpack(msgpack::object const& o)
5251 {
5252 auto name = "ProgramWithoutBrillig";
5253 auto kvmap = Helpers::make_kvmap(o, name);
5254 Helpers::conv_fld_from_kvmap(kvmap, name, "functions", functions, false);
5255 }
5256};
5257
5258} // end of namespace Acir
5259
5260namespace Acir {
5261
5262inline bool operator==(const AssertionPayload& lhs, const AssertionPayload& rhs)
5263{
5264 if (!(lhs.error_selector == rhs.error_selector)) {
5265 return false;
5266 }
5267 if (!(lhs.payload == rhs.payload)) {
5268 return false;
5269 }
5270 return true;
5271}
5272
5273inline std::vector<uint8_t> AssertionPayload::bincodeSerialize() const
5274{
5275 auto serializer = serde::BincodeSerializer();
5277 return std::move(serializer).bytes();
5278}
5279
5281{
5282 const size_t input_size = input.size();
5283 auto deserializer = serde::BincodeDeserializer(input);
5285 if (deserializer.get_buffer_offset() < input_size) {
5286 throw_or_abort("Some input bytes were not read");
5287 }
5288 return value;
5289}
5290
5291} // end of namespace Acir
5292
5293template <>
5294template <typename Serializer>
5296{
5297 serializer.increase_container_depth();
5298 serde::Serializable<decltype(obj.error_selector)>::serialize(obj.error_selector, serializer);
5299 serde::Serializable<decltype(obj.payload)>::serialize(obj.payload, serializer);
5300 serializer.decrease_container_depth();
5301}
5302
5303template <>
5304template <typename Deserializer>
5306{
5307 deserializer.increase_container_depth();
5309 obj.error_selector = serde::Deserializable<decltype(obj.error_selector)>::deserialize(deserializer);
5310 obj.payload = serde::Deserializable<decltype(obj.payload)>::deserialize(deserializer);
5311 deserializer.decrease_container_depth();
5312 return obj;
5313}
5314
5315namespace Acir {
5316
5317inline bool operator==(const BinaryFieldOp& lhs, const BinaryFieldOp& rhs)
5318{
5319 if (!(lhs.value == rhs.value)) {
5320 return false;
5321 }
5322 return true;
5323}
5324
5325inline std::vector<uint8_t> BinaryFieldOp::bincodeSerialize() const
5326{
5327 auto serializer = serde::BincodeSerializer();
5329 return std::move(serializer).bytes();
5330}
5331
5332inline BinaryFieldOp BinaryFieldOp::bincodeDeserialize(std::vector<uint8_t> input)
5333{
5334 auto deserializer = serde::BincodeDeserializer(input);
5336 if (deserializer.get_buffer_offset() < input.size()) {
5337 throw_or_abort("Some input bytes were not read");
5338 }
5339 return value;
5340}
5341
5342} // end of namespace Acir
5343
5344template <>
5345template <typename Serializer>
5347{
5348 serializer.increase_container_depth();
5349 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
5350 serializer.decrease_container_depth();
5351}
5352
5353template <>
5354template <typename Deserializer>
5356{
5357 deserializer.increase_container_depth();
5359 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
5360 deserializer.decrease_container_depth();
5361 return obj;
5362}
5363
5364namespace Acir {
5365
5366inline bool operator==(const BinaryFieldOp::Add& lhs, const BinaryFieldOp::Add& rhs)
5367{
5368 return true;
5369}
5370
5371inline std::vector<uint8_t> BinaryFieldOp::Add::bincodeSerialize() const
5372{
5373 auto serializer = serde::BincodeSerializer();
5375 return std::move(serializer).bytes();
5376}
5377
5379{
5380 auto deserializer = serde::BincodeDeserializer(input);
5382 if (deserializer.get_buffer_offset() < input.size()) {
5383 throw_or_abort("Some input bytes were not read");
5384 }
5385 return value;
5386}
5387
5388} // end of namespace Acir
5389
5390template <>
5391template <typename Serializer>
5395
5396template <>
5397template <typename Deserializer>
5403
5404namespace Acir {
5405
5406inline bool operator==(const BinaryFieldOp::Sub& lhs, const BinaryFieldOp::Sub& rhs)
5407{
5408 return true;
5409}
5410
5411inline std::vector<uint8_t> BinaryFieldOp::Sub::bincodeSerialize() const
5412{
5413 auto serializer = serde::BincodeSerializer();
5415 return std::move(serializer).bytes();
5416}
5417
5419{
5420 auto deserializer = serde::BincodeDeserializer(input);
5422 if (deserializer.get_buffer_offset() < input.size()) {
5423 throw_or_abort("Some input bytes were not read");
5424 }
5425 return value;
5426}
5427
5428} // end of namespace Acir
5429
5430template <>
5431template <typename Serializer>
5435
5436template <>
5437template <typename Deserializer>
5443
5444namespace Acir {
5445
5446inline bool operator==(const BinaryFieldOp::Mul& lhs, const BinaryFieldOp::Mul& rhs)
5447{
5448 return true;
5449}
5450
5451inline std::vector<uint8_t> BinaryFieldOp::Mul::bincodeSerialize() const
5452{
5453 auto serializer = serde::BincodeSerializer();
5455 return std::move(serializer).bytes();
5456}
5457
5459{
5460 auto deserializer = serde::BincodeDeserializer(input);
5462 if (deserializer.get_buffer_offset() < input.size()) {
5463 throw_or_abort("Some input bytes were not read");
5464 }
5465 return value;
5466}
5467
5468} // end of namespace Acir
5469
5470template <>
5471template <typename Serializer>
5475
5476template <>
5477template <typename Deserializer>
5483
5484namespace Acir {
5485
5486inline bool operator==(const BinaryFieldOp::Div& lhs, const BinaryFieldOp::Div& rhs)
5487{
5488 return true;
5489}
5490
5491inline std::vector<uint8_t> BinaryFieldOp::Div::bincodeSerialize() const
5492{
5493 auto serializer = serde::BincodeSerializer();
5495 return std::move(serializer).bytes();
5496}
5497
5499{
5500 auto deserializer = serde::BincodeDeserializer(input);
5502 if (deserializer.get_buffer_offset() < input.size()) {
5503 throw_or_abort("Some input bytes were not read");
5504 }
5505 return value;
5506}
5507
5508} // end of namespace Acir
5509
5510template <>
5511template <typename Serializer>
5515
5516template <>
5517template <typename Deserializer>
5523
5524namespace Acir {
5525
5527{
5528 return true;
5529}
5530
5531inline std::vector<uint8_t> BinaryFieldOp::IntegerDiv::bincodeSerialize() const
5532{
5533 auto serializer = serde::BincodeSerializer();
5535 return std::move(serializer).bytes();
5536}
5537
5539{
5540 auto deserializer = serde::BincodeDeserializer(input);
5542 if (deserializer.get_buffer_offset() < input.size()) {
5543 throw_or_abort("Some input bytes were not read");
5544 }
5545 return value;
5546}
5547
5548} // end of namespace Acir
5549
5550template <>
5551template <typename Serializer>
5555
5556template <>
5557template <typename Deserializer>
5564
5565namespace Acir {
5566
5567inline bool operator==(const BinaryFieldOp::Equals& lhs, const BinaryFieldOp::Equals& rhs)
5568{
5569 return true;
5570}
5571
5572inline std::vector<uint8_t> BinaryFieldOp::Equals::bincodeSerialize() const
5573{
5574 auto serializer = serde::BincodeSerializer();
5576 return std::move(serializer).bytes();
5577}
5578
5580{
5581 auto deserializer = serde::BincodeDeserializer(input);
5583 if (deserializer.get_buffer_offset() < input.size()) {
5584 throw_or_abort("Some input bytes were not read");
5585 }
5586 return value;
5587}
5588
5589} // end of namespace Acir
5590
5591template <>
5592template <typename Serializer>
5596
5597template <>
5598template <typename Deserializer>
5604
5605namespace Acir {
5606
5608{
5609 return true;
5610}
5611
5612inline std::vector<uint8_t> BinaryFieldOp::LessThan::bincodeSerialize() const
5613{
5614 auto serializer = serde::BincodeSerializer();
5616 return std::move(serializer).bytes();
5617}
5618
5620{
5621 auto deserializer = serde::BincodeDeserializer(input);
5623 if (deserializer.get_buffer_offset() < input.size()) {
5624 throw_or_abort("Some input bytes were not read");
5625 }
5626 return value;
5627}
5628
5629} // end of namespace Acir
5630
5631template <>
5632template <typename Serializer>
5636
5637template <>
5638template <typename Deserializer>
5645
5646namespace Acir {
5647
5649{
5650 return true;
5651}
5652
5653inline std::vector<uint8_t> BinaryFieldOp::LessThanEquals::bincodeSerialize() const
5654{
5655 auto serializer = serde::BincodeSerializer();
5657 return std::move(serializer).bytes();
5658}
5659
5661{
5662 auto deserializer = serde::BincodeDeserializer(input);
5664 if (deserializer.get_buffer_offset() < input.size()) {
5665 throw_or_abort("Some input bytes were not read");
5666 }
5667 return value;
5668}
5669
5670} // end of namespace Acir
5671
5672template <>
5673template <typename Serializer>
5677
5678template <>
5679template <typename Deserializer>
5686
5687namespace Acir {
5688
5689inline bool operator==(const BinaryIntOp& lhs, const BinaryIntOp& rhs)
5690{
5691 if (!(lhs.value == rhs.value)) {
5692 return false;
5693 }
5694 return true;
5695}
5696
5697inline std::vector<uint8_t> BinaryIntOp::bincodeSerialize() const
5698{
5699 auto serializer = serde::BincodeSerializer();
5701 return std::move(serializer).bytes();
5702}
5703
5704inline BinaryIntOp BinaryIntOp::bincodeDeserialize(std::vector<uint8_t> input)
5705{
5706 auto deserializer = serde::BincodeDeserializer(input);
5708 if (deserializer.get_buffer_offset() < input.size()) {
5709 throw_or_abort("Some input bytes were not read");
5710 }
5711 return value;
5712}
5713
5714} // end of namespace Acir
5715
5716template <>
5717template <typename Serializer>
5719{
5720 serializer.increase_container_depth();
5721 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
5722 serializer.decrease_container_depth();
5723}
5724
5725template <>
5726template <typename Deserializer>
5728{
5729 deserializer.increase_container_depth();
5731 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
5732 deserializer.decrease_container_depth();
5733 return obj;
5734}
5735
5736namespace Acir {
5737
5738inline bool operator==(const BinaryIntOp::Add& lhs, const BinaryIntOp::Add& rhs)
5739{
5740 return true;
5741}
5742
5743inline std::vector<uint8_t> BinaryIntOp::Add::bincodeSerialize() const
5744{
5745 auto serializer = serde::BincodeSerializer();
5747 return std::move(serializer).bytes();
5748}
5749
5751{
5752 auto deserializer = serde::BincodeDeserializer(input);
5754 if (deserializer.get_buffer_offset() < input.size()) {
5755 throw_or_abort("Some input bytes were not read");
5756 }
5757 return value;
5758}
5759
5760} // end of namespace Acir
5761
5762template <>
5763template <typename Serializer>
5766
5767template <>
5768template <typename Deserializer>
5774
5775namespace Acir {
5776
5777inline bool operator==(const BinaryIntOp::Sub& lhs, const BinaryIntOp::Sub& rhs)
5778{
5779 return true;
5780}
5781
5782inline std::vector<uint8_t> BinaryIntOp::Sub::bincodeSerialize() const
5783{
5784 auto serializer = serde::BincodeSerializer();
5786 return std::move(serializer).bytes();
5787}
5788
5790{
5791 auto deserializer = serde::BincodeDeserializer(input);
5793 if (deserializer.get_buffer_offset() < input.size()) {
5794 throw_or_abort("Some input bytes were not read");
5795 }
5796 return value;
5797}
5798
5799} // end of namespace Acir
5800
5801template <>
5802template <typename Serializer>
5805
5806template <>
5807template <typename Deserializer>
5813
5814namespace Acir {
5815
5816inline bool operator==(const BinaryIntOp::Mul& lhs, const BinaryIntOp::Mul& rhs)
5817{
5818 return true;
5819}
5820
5821inline std::vector<uint8_t> BinaryIntOp::Mul::bincodeSerialize() const
5822{
5823 auto serializer = serde::BincodeSerializer();
5825 return std::move(serializer).bytes();
5826}
5827
5829{
5830 auto deserializer = serde::BincodeDeserializer(input);
5832 if (deserializer.get_buffer_offset() < input.size()) {
5833 throw_or_abort("Some input bytes were not read");
5834 }
5835 return value;
5836}
5837
5838} // end of namespace Acir
5839
5840template <>
5841template <typename Serializer>
5844
5845template <>
5846template <typename Deserializer>
5852
5853namespace Acir {
5854
5855inline bool operator==(const BinaryIntOp::Div& lhs, const BinaryIntOp::Div& rhs)
5856{
5857 return true;
5858}
5859
5860inline std::vector<uint8_t> BinaryIntOp::Div::bincodeSerialize() const
5861{
5862 auto serializer = serde::BincodeSerializer();
5864 return std::move(serializer).bytes();
5865}
5866
5868{
5869 auto deserializer = serde::BincodeDeserializer(input);
5871 if (deserializer.get_buffer_offset() < input.size()) {
5872 throw_or_abort("Some input bytes were not read");
5873 }
5874 return value;
5875}
5876
5877} // end of namespace Acir
5878
5879template <>
5880template <typename Serializer>
5883
5884template <>
5885template <typename Deserializer>
5891
5892namespace Acir {
5893
5894inline bool operator==(const BinaryIntOp::Equals& lhs, const BinaryIntOp::Equals& rhs)
5895{
5896 return true;
5897}
5898
5899inline std::vector<uint8_t> BinaryIntOp::Equals::bincodeSerialize() const
5900{
5901 auto serializer = serde::BincodeSerializer();
5903 return std::move(serializer).bytes();
5904}
5905
5907{
5908 auto deserializer = serde::BincodeDeserializer(input);
5910 if (deserializer.get_buffer_offset() < input.size()) {
5911 throw_or_abort("Some input bytes were not read");
5912 }
5913 return value;
5914}
5915
5916} // end of namespace Acir
5917
5918template <>
5919template <typename Serializer>
5923
5924template <>
5925template <typename Deserializer>
5931
5932namespace Acir {
5933
5934inline bool operator==(const BinaryIntOp::LessThan& lhs, const BinaryIntOp::LessThan& rhs)
5935{
5936 return true;
5937}
5938
5939inline std::vector<uint8_t> BinaryIntOp::LessThan::bincodeSerialize() const
5940{
5941 auto serializer = serde::BincodeSerializer();
5943 return std::move(serializer).bytes();
5944}
5945
5947{
5948 auto deserializer = serde::BincodeDeserializer(input);
5950 if (deserializer.get_buffer_offset() < input.size()) {
5951 throw_or_abort("Some input bytes were not read");
5952 }
5953 return value;
5954}
5955
5956} // end of namespace Acir
5957
5958template <>
5959template <typename Serializer>
5963
5964template <>
5965template <typename Deserializer>
5971
5972namespace Acir {
5973
5975{
5976 return true;
5977}
5978
5979inline std::vector<uint8_t> BinaryIntOp::LessThanEquals::bincodeSerialize() const
5980{
5981 auto serializer = serde::BincodeSerializer();
5983 return std::move(serializer).bytes();
5984}
5985
5987{
5988 auto deserializer = serde::BincodeDeserializer(input);
5990 if (deserializer.get_buffer_offset() < input.size()) {
5991 throw_or_abort("Some input bytes were not read");
5992 }
5993 return value;
5994}
5995
5996} // end of namespace Acir
5997
5998template <>
5999template <typename Serializer>
6003
6004template <>
6005template <typename Deserializer>
6012
6013namespace Acir {
6014
6015inline bool operator==(const BinaryIntOp::And& lhs, const BinaryIntOp::And& rhs)
6016{
6017 return true;
6018}
6019
6020inline std::vector<uint8_t> BinaryIntOp::And::bincodeSerialize() const
6021{
6022 auto serializer = serde::BincodeSerializer();
6024 return std::move(serializer).bytes();
6025}
6026
6028{
6029 auto deserializer = serde::BincodeDeserializer(input);
6031 if (deserializer.get_buffer_offset() < input.size()) {
6032 throw_or_abort("Some input bytes were not read");
6033 }
6034 return value;
6035}
6036
6037} // end of namespace Acir
6038
6039template <>
6040template <typename Serializer>
6043
6044template <>
6045template <typename Deserializer>
6051
6052namespace Acir {
6053
6054inline bool operator==(const BinaryIntOp::Or& lhs, const BinaryIntOp::Or& rhs)
6055{
6056 return true;
6057}
6058
6059inline std::vector<uint8_t> BinaryIntOp::Or::bincodeSerialize() const
6060{
6061 auto serializer = serde::BincodeSerializer();
6063 return std::move(serializer).bytes();
6064}
6065
6067{
6068 auto deserializer = serde::BincodeDeserializer(input);
6070 if (deserializer.get_buffer_offset() < input.size()) {
6071 throw_or_abort("Some input bytes were not read");
6072 }
6073 return value;
6074}
6075
6076} // end of namespace Acir
6077
6078template <>
6079template <typename Serializer>
6082
6083template <>
6084template <typename Deserializer>
6086{
6088 return obj;
6089}
6090
6091namespace Acir {
6092
6093inline bool operator==(const BinaryIntOp::Xor& lhs, const BinaryIntOp::Xor& rhs)
6094{
6095 return true;
6096}
6097
6098inline std::vector<uint8_t> BinaryIntOp::Xor::bincodeSerialize() const
6099{
6100 auto serializer = serde::BincodeSerializer();
6102 return std::move(serializer).bytes();
6103}
6104
6106{
6107 auto deserializer = serde::BincodeDeserializer(input);
6109 if (deserializer.get_buffer_offset() < input.size()) {
6110 throw_or_abort("Some input bytes were not read");
6111 }
6112 return value;
6113}
6114
6115} // end of namespace Acir
6116
6117template <>
6118template <typename Serializer>
6121
6122template <>
6123template <typename Deserializer>
6129
6130namespace Acir {
6131
6132inline bool operator==(const BinaryIntOp::Shl& lhs, const BinaryIntOp::Shl& rhs)
6133{
6134 return true;
6135}
6136
6137inline std::vector<uint8_t> BinaryIntOp::Shl::bincodeSerialize() const
6138{
6139 auto serializer = serde::BincodeSerializer();
6141 return std::move(serializer).bytes();
6142}
6143
6145{
6146 auto deserializer = serde::BincodeDeserializer(input);
6148 if (deserializer.get_buffer_offset() < input.size()) {
6149 throw_or_abort("Some input bytes were not read");
6150 }
6151 return value;
6152}
6153
6154} // end of namespace Acir
6155
6156template <>
6157template <typename Serializer>
6160
6161template <>
6162template <typename Deserializer>
6168
6169namespace Acir {
6170
6171inline bool operator==(const BinaryIntOp::Shr& lhs, const BinaryIntOp::Shr& rhs)
6172{
6173 return true;
6174}
6175
6176inline std::vector<uint8_t> BinaryIntOp::Shr::bincodeSerialize() const
6177{
6178 auto serializer = serde::BincodeSerializer();
6180 return std::move(serializer).bytes();
6181}
6182
6184{
6185 auto deserializer = serde::BincodeDeserializer(input);
6187 if (deserializer.get_buffer_offset() < input.size()) {
6188 throw_or_abort("Some input bytes were not read");
6189 }
6190 return value;
6191}
6192
6193} // end of namespace Acir
6194
6195template <>
6196template <typename Serializer>
6199
6200template <>
6201template <typename Deserializer>
6207
6208namespace Acir {
6209
6210inline bool operator==(const BitSize& lhs, const BitSize& rhs)
6211{
6212 if (!(lhs.value == rhs.value)) {
6213 return false;
6214 }
6215 return true;
6216}
6217
6218inline std::vector<uint8_t> BitSize::bincodeSerialize() const
6219{
6220 auto serializer = serde::BincodeSerializer();
6221 serde::Serializable<BitSize>::serialize(*this, serializer);
6222 return std::move(serializer).bytes();
6223}
6224
6225inline BitSize BitSize::bincodeDeserialize(std::vector<uint8_t> input)
6226{
6227 auto deserializer = serde::BincodeDeserializer(input);
6229 if (deserializer.get_buffer_offset() < input.size()) {
6230 throw_or_abort("Some input bytes were not read");
6231 }
6232 return value;
6233}
6234
6235} // end of namespace Acir
6236
6237template <>
6238template <typename Serializer>
6239void serde::Serializable<Acir::BitSize>::serialize(const Acir::BitSize& obj, Serializer& serializer)
6240{
6241 serializer.increase_container_depth();
6242 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
6243 serializer.decrease_container_depth();
6244}
6245
6246template <>
6247template <typename Deserializer>
6249{
6250 deserializer.increase_container_depth();
6251 Acir::BitSize obj;
6252 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
6253 deserializer.decrease_container_depth();
6254 return obj;
6255}
6256
6257namespace Acir {
6258
6259inline bool operator==(const BitSize::Field& lhs, const BitSize::Field& rhs)
6260{
6261 return true;
6262}
6263
6264inline std::vector<uint8_t> BitSize::Field::bincodeSerialize() const
6265{
6266 auto serializer = serde::BincodeSerializer();
6268 return std::move(serializer).bytes();
6269}
6270
6271inline BitSize::Field BitSize::Field::bincodeDeserialize(std::vector<uint8_t> input)
6272{
6273 auto deserializer = serde::BincodeDeserializer(input);
6275 if (deserializer.get_buffer_offset() < input.size()) {
6276 throw_or_abort("Some input bytes were not read");
6277 }
6278 return value;
6279}
6280
6281} // end of namespace Acir
6282
6283template <>
6284template <typename Serializer>
6287
6288template <>
6289template <typename Deserializer>
6291{
6293 return obj;
6294}
6295
6296namespace Acir {
6297
6298inline bool operator==(const BitSize::Integer& lhs, const BitSize::Integer& rhs)
6299{
6300 if (!(lhs.value == rhs.value)) {
6301 return false;
6302 }
6303 return true;
6304}
6305
6306inline std::vector<uint8_t> BitSize::Integer::bincodeSerialize() const
6307{
6308 auto serializer = serde::BincodeSerializer();
6310 return std::move(serializer).bytes();
6311}
6312
6314{
6315 auto deserializer = serde::BincodeDeserializer(input);
6317 if (deserializer.get_buffer_offset() < input.size()) {
6318 throw_or_abort("Some input bytes were not read");
6319 }
6320 return value;
6321}
6322
6323} // end of namespace Acir
6324
6325template <>
6326template <typename Serializer>
6328{
6329 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
6330}
6331
6332template <>
6333template <typename Deserializer>
6335{
6337 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
6338 return obj;
6339}
6340
6341namespace Acir {
6342
6343inline bool operator==(const BlackBoxFuncCall& lhs, const BlackBoxFuncCall& rhs)
6344{
6345 if (!(lhs.value == rhs.value)) {
6346 return false;
6347 }
6348 return true;
6349}
6350
6351inline std::vector<uint8_t> BlackBoxFuncCall::bincodeSerialize() const
6352{
6353 auto serializer = serde::BincodeSerializer();
6355 return std::move(serializer).bytes();
6356}
6357
6359{
6360 auto deserializer = serde::BincodeDeserializer(input);
6362 if (deserializer.get_buffer_offset() < input.size()) {
6363 throw_or_abort("Some input bytes were not read");
6364 }
6365 return value;
6366}
6367
6368} // end of namespace Acir
6369
6370template <>
6371template <typename Serializer>
6373{
6374 serializer.increase_container_depth();
6375 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
6376 serializer.decrease_container_depth();
6377}
6378
6379template <>
6380template <typename Deserializer>
6382{
6383 deserializer.increase_container_depth();
6385 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
6386 deserializer.decrease_container_depth();
6387 return obj;
6388}
6389
6390namespace Acir {
6391
6393{
6394 if (!(lhs.inputs == rhs.inputs)) {
6395 return false;
6396 }
6397 if (!(lhs.iv == rhs.iv)) {
6398 return false;
6399 }
6400 if (!(lhs.key == rhs.key)) {
6401 return false;
6402 }
6403 if (!(lhs.outputs == rhs.outputs)) {
6404 return false;
6405 }
6406 return true;
6407}
6408
6409inline std::vector<uint8_t> BlackBoxFuncCall::AES128Encrypt::bincodeSerialize() const
6410{
6411 auto serializer = serde::BincodeSerializer();
6413 return std::move(serializer).bytes();
6414}
6415
6417{
6418 auto deserializer = serde::BincodeDeserializer(input);
6420 if (deserializer.get_buffer_offset() < input.size()) {
6421 throw_or_abort("Some input bytes were not read");
6422 }
6423 return value;
6424}
6425
6426} // end of namespace Acir
6427
6428template <>
6429template <typename Serializer>
6431 const Acir::BlackBoxFuncCall::AES128Encrypt& obj, Serializer& serializer)
6432{
6433 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
6434 serde::Serializable<decltype(obj.iv)>::serialize(obj.iv, serializer);
6435 serde::Serializable<decltype(obj.key)>::serialize(obj.key, serializer);
6436 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
6437}
6438
6439template <>
6440template <typename Deserializer>
6442 Deserializer& deserializer)
6443{
6445 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
6446 obj.iv = serde::Deserializable<decltype(obj.iv)>::deserialize(deserializer);
6447 obj.key = serde::Deserializable<decltype(obj.key)>::deserialize(deserializer);
6448 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
6449 return obj;
6450}
6451
6452namespace Acir {
6453
6454inline bool operator==(const BlackBoxFuncCall::AND& lhs, const BlackBoxFuncCall::AND& rhs)
6455{
6456 if (!(lhs.lhs == rhs.lhs)) {
6457 return false;
6458 }
6459 if (!(lhs.rhs == rhs.rhs)) {
6460 return false;
6461 }
6462 if (!(lhs.output == rhs.output)) {
6463 return false;
6464 }
6465 return true;
6466}
6467
6468inline std::vector<uint8_t> BlackBoxFuncCall::AND::bincodeSerialize() const
6469{
6470 auto serializer = serde::BincodeSerializer();
6472 return std::move(serializer).bytes();
6473}
6474
6476{
6477 auto deserializer = serde::BincodeDeserializer(input);
6479 if (deserializer.get_buffer_offset() < input.size()) {
6480 throw_or_abort("Some input bytes were not read");
6481 }
6482 return value;
6483}
6484
6485} // end of namespace Acir
6486
6487template <>
6488template <typename Serializer>
6490 Serializer& serializer)
6491{
6492 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
6493 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
6494 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
6495}
6496
6497template <>
6498template <typename Deserializer>
6500{
6502 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
6503 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
6504 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
6505 return obj;
6506}
6507
6508namespace Acir {
6509
6510inline bool operator==(const BlackBoxFuncCall::XOR& lhs, const BlackBoxFuncCall::XOR& rhs)
6511{
6512 if (!(lhs.lhs == rhs.lhs)) {
6513 return false;
6514 }
6515 if (!(lhs.rhs == rhs.rhs)) {
6516 return false;
6517 }
6518 if (!(lhs.output == rhs.output)) {
6519 return false;
6520 }
6521 return true;
6522}
6523
6524inline std::vector<uint8_t> BlackBoxFuncCall::XOR::bincodeSerialize() const
6525{
6526 auto serializer = serde::BincodeSerializer();
6528 return std::move(serializer).bytes();
6529}
6530
6532{
6533 auto deserializer = serde::BincodeDeserializer(input);
6535 if (deserializer.get_buffer_offset() < input.size()) {
6536 throw_or_abort("Some input bytes were not read");
6537 }
6538 return value;
6539}
6540
6541} // end of namespace Acir
6542
6543template <>
6544template <typename Serializer>
6546 Serializer& serializer)
6547{
6548 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
6549 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
6550 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
6551}
6552
6553template <>
6554template <typename Deserializer>
6556{
6558 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
6559 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
6560 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
6561 return obj;
6562}
6563
6564namespace Acir {
6565
6567{
6568 if (!(lhs.input == rhs.input)) {
6569 return false;
6570 }
6571 return true;
6572}
6573
6574inline std::vector<uint8_t> BlackBoxFuncCall::RANGE::bincodeSerialize() const
6575{
6576 auto serializer = serde::BincodeSerializer();
6578 return std::move(serializer).bytes();
6579}
6580
6582{
6583 auto deserializer = serde::BincodeDeserializer(input);
6585 if (deserializer.get_buffer_offset() < input.size()) {
6586 throw_or_abort("Some input bytes were not read");
6587 }
6588 return value;
6589}
6590
6591} // end of namespace Acir
6592
6593template <>
6594template <typename Serializer>
6596 Serializer& serializer)
6597{
6598 serde::Serializable<decltype(obj.input)>::serialize(obj.input, serializer);
6599}
6600
6601template <>
6602template <typename Deserializer>
6604 Deserializer& deserializer)
6605{
6607 obj.input = serde::Deserializable<decltype(obj.input)>::deserialize(deserializer);
6608 return obj;
6609}
6610
6611namespace Acir {
6612
6614{
6615 if (!(lhs.inputs == rhs.inputs)) {
6616 return false;
6617 }
6618 if (!(lhs.outputs == rhs.outputs)) {
6619 return false;
6620 }
6621 return true;
6622}
6623
6624inline std::vector<uint8_t> BlackBoxFuncCall::Blake2s::bincodeSerialize() const
6625{
6626 auto serializer = serde::BincodeSerializer();
6628 return std::move(serializer).bytes();
6629}
6630
6632{
6633 auto deserializer = serde::BincodeDeserializer(input);
6635 if (deserializer.get_buffer_offset() < input.size()) {
6636 throw_or_abort("Some input bytes were not read");
6637 }
6638 return value;
6639}
6640
6641} // end of namespace Acir
6642
6643template <>
6644template <typename Serializer>
6646 Serializer& serializer)
6647{
6648 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
6649 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
6650}
6651
6652template <>
6653template <typename Deserializer>
6655 Deserializer& deserializer)
6656{
6658 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
6659 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
6660 return obj;
6661}
6662
6663namespace Acir {
6664
6666{
6667 if (!(lhs.inputs == rhs.inputs)) {
6668 return false;
6669 }
6670 if (!(lhs.outputs == rhs.outputs)) {
6671 return false;
6672 }
6673 return true;
6674}
6675
6676inline std::vector<uint8_t> BlackBoxFuncCall::Blake3::bincodeSerialize() const
6677{
6678 auto serializer = serde::BincodeSerializer();
6680 return std::move(serializer).bytes();
6681}
6682
6684{
6685 auto deserializer = serde::BincodeDeserializer(input);
6687 if (deserializer.get_buffer_offset() < input.size()) {
6688 throw_or_abort("Some input bytes were not read");
6689 }
6690 return value;
6691}
6692
6693} // end of namespace Acir
6694
6695template <>
6696template <typename Serializer>
6698 Serializer& serializer)
6699{
6700 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
6701 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
6702}
6703
6704template <>
6705template <typename Deserializer>
6707 Deserializer& deserializer)
6708{
6710 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
6711 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
6712 return obj;
6713}
6714
6715namespace Acir {
6716
6718{
6719 if (!(lhs.public_key_x == rhs.public_key_x)) {
6720 return false;
6721 }
6722 if (!(lhs.public_key_y == rhs.public_key_y)) {
6723 return false;
6724 }
6725 if (!(lhs.signature == rhs.signature)) {
6726 return false;
6727 }
6728 if (!(lhs.hashed_message == rhs.hashed_message)) {
6729 return false;
6730 }
6731 if (!(lhs.output == rhs.output)) {
6732 return false;
6733 }
6734 return true;
6735}
6736
6738{
6739 auto serializer = serde::BincodeSerializer();
6741 return std::move(serializer).bytes();
6742}
6743
6745{
6746 auto deserializer = serde::BincodeDeserializer(input);
6748 if (deserializer.get_buffer_offset() < input.size()) {
6749 throw_or_abort("Some input bytes were not read");
6750 }
6751 return value;
6752}
6753
6754} // end of namespace Acir
6755
6756template <>
6757template <typename Serializer>
6759 const Acir::BlackBoxFuncCall::EcdsaSecp256k1& obj, Serializer& serializer)
6760{
6761 serde::Serializable<decltype(obj.public_key_x)>::serialize(obj.public_key_x, serializer);
6762 serde::Serializable<decltype(obj.public_key_y)>::serialize(obj.public_key_y, serializer);
6763 serde::Serializable<decltype(obj.signature)>::serialize(obj.signature, serializer);
6764 serde::Serializable<decltype(obj.hashed_message)>::serialize(obj.hashed_message, serializer);
6765 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
6766}
6767
6768template <>
6769template <typename Deserializer>
6771 Deserializer& deserializer)
6772{
6774 obj.public_key_x = serde::Deserializable<decltype(obj.public_key_x)>::deserialize(deserializer);
6775 obj.public_key_y = serde::Deserializable<decltype(obj.public_key_y)>::deserialize(deserializer);
6776 obj.signature = serde::Deserializable<decltype(obj.signature)>::deserialize(deserializer);
6777 obj.hashed_message = serde::Deserializable<decltype(obj.hashed_message)>::deserialize(deserializer);
6778 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
6779 return obj;
6780}
6781
6782namespace Acir {
6783
6785{
6786 if (!(lhs.public_key_x == rhs.public_key_x)) {
6787 return false;
6788 }
6789 if (!(lhs.public_key_y == rhs.public_key_y)) {
6790 return false;
6791 }
6792 if (!(lhs.signature == rhs.signature)) {
6793 return false;
6794 }
6795 if (!(lhs.hashed_message == rhs.hashed_message)) {
6796 return false;
6797 }
6798 if (!(lhs.output == rhs.output)) {
6799 return false;
6800 }
6801 return true;
6802}
6803
6805{
6806 auto serializer = serde::BincodeSerializer();
6808 return std::move(serializer).bytes();
6809}
6810
6812{
6813 auto deserializer = serde::BincodeDeserializer(input);
6815 if (deserializer.get_buffer_offset() < input.size()) {
6816 throw_or_abort("Some input bytes were not read");
6817 }
6818 return value;
6819}
6820
6821} // end of namespace Acir
6822
6823template <>
6824template <typename Serializer>
6826 const Acir::BlackBoxFuncCall::EcdsaSecp256r1& obj, Serializer& serializer)
6827{
6828 serde::Serializable<decltype(obj.public_key_x)>::serialize(obj.public_key_x, serializer);
6829 serde::Serializable<decltype(obj.public_key_y)>::serialize(obj.public_key_y, serializer);
6830 serde::Serializable<decltype(obj.signature)>::serialize(obj.signature, serializer);
6831 serde::Serializable<decltype(obj.hashed_message)>::serialize(obj.hashed_message, serializer);
6832 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
6833}
6834
6835template <>
6836template <typename Deserializer>
6838 Deserializer& deserializer)
6839{
6841 obj.public_key_x = serde::Deserializable<decltype(obj.public_key_x)>::deserialize(deserializer);
6842 obj.public_key_y = serde::Deserializable<decltype(obj.public_key_y)>::deserialize(deserializer);
6843 obj.signature = serde::Deserializable<decltype(obj.signature)>::deserialize(deserializer);
6844 obj.hashed_message = serde::Deserializable<decltype(obj.hashed_message)>::deserialize(deserializer);
6845 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
6846 return obj;
6847}
6848
6849namespace Acir {
6850
6852{
6853 if (!(lhs.points == rhs.points)) {
6854 return false;
6855 }
6856 if (!(lhs.scalars == rhs.scalars)) {
6857 return false;
6858 }
6859 if (!(lhs.outputs == rhs.outputs)) {
6860 return false;
6861 }
6862 return true;
6863}
6864
6866{
6867 auto serializer = serde::BincodeSerializer();
6869 return std::move(serializer).bytes();
6870}
6871
6873{
6874 auto deserializer = serde::BincodeDeserializer(input);
6876 if (deserializer.get_buffer_offset() < input.size()) {
6877 throw_or_abort("Some input bytes were not read");
6878 }
6879 return value;
6880}
6881
6882} // end of namespace Acir
6883
6884template <>
6885template <typename Serializer>
6887 const Acir::BlackBoxFuncCall::MultiScalarMul& obj, Serializer& serializer)
6888{
6889 serde::Serializable<decltype(obj.points)>::serialize(obj.points, serializer);
6890 serde::Serializable<decltype(obj.scalars)>::serialize(obj.scalars, serializer);
6891 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
6892}
6893
6894template <>
6895template <typename Deserializer>
6897 Deserializer& deserializer)
6898{
6900 obj.points = serde::Deserializable<decltype(obj.points)>::deserialize(deserializer);
6901 obj.scalars = serde::Deserializable<decltype(obj.scalars)>::deserialize(deserializer);
6902 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
6903 return obj;
6904}
6905
6906namespace Acir {
6907
6909{
6910 if (!(lhs.input1 == rhs.input1)) {
6911 return false;
6912 }
6913 if (!(lhs.input2 == rhs.input2)) {
6914 return false;
6915 }
6916 if (!(lhs.outputs == rhs.outputs)) {
6917 return false;
6918 }
6919 return true;
6920}
6921
6923{
6924 auto serializer = serde::BincodeSerializer();
6926 return std::move(serializer).bytes();
6927}
6928
6930 std::vector<uint8_t> input)
6931{
6932 auto deserializer = serde::BincodeDeserializer(input);
6934 if (deserializer.get_buffer_offset() < input.size()) {
6935 throw_or_abort("Some input bytes were not read");
6936 }
6937 return value;
6938}
6939
6940} // end of namespace Acir
6941
6942template <>
6943template <typename Serializer>
6945 const Acir::BlackBoxFuncCall::EmbeddedCurveAdd& obj, Serializer& serializer)
6946{
6947 serde::Serializable<decltype(obj.input1)>::serialize(obj.input1, serializer);
6948 serde::Serializable<decltype(obj.input2)>::serialize(obj.input2, serializer);
6949 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
6950}
6951
6952template <>
6953template <typename Deserializer>
6955 Deserializer& deserializer)
6956{
6958 obj.input1 = serde::Deserializable<decltype(obj.input1)>::deserialize(deserializer);
6959 obj.input2 = serde::Deserializable<decltype(obj.input2)>::deserialize(deserializer);
6960 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
6961 return obj;
6962}
6963
6964namespace Acir {
6965
6967{
6968 if (!(lhs.inputs == rhs.inputs)) {
6969 return false;
6970 }
6971 if (!(lhs.outputs == rhs.outputs)) {
6972 return false;
6973 }
6974 return true;
6975}
6976
6977inline std::vector<uint8_t> BlackBoxFuncCall::Keccakf1600::bincodeSerialize() const
6978{
6979 auto serializer = serde::BincodeSerializer();
6981 return std::move(serializer).bytes();
6982}
6983
6985{
6986 auto deserializer = serde::BincodeDeserializer(input);
6988 if (deserializer.get_buffer_offset() < input.size()) {
6989 throw_or_abort("Some input bytes were not read");
6990 }
6991 return value;
6992}
6993
6994} // end of namespace Acir
6995
6996template <>
6997template <typename Serializer>
6999 Serializer& serializer)
7000{
7001 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
7002 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
7003}
7004
7005template <>
7006template <typename Deserializer>
7008 Deserializer& deserializer)
7009{
7011 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
7012 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
7013 return obj;
7014}
7015
7016namespace Acir {
7017
7020{
7021 if (!(lhs.verification_key == rhs.verification_key)) {
7022 return false;
7023 }
7024 if (!(lhs.proof == rhs.proof)) {
7025 return false;
7026 }
7027 if (!(lhs.public_inputs == rhs.public_inputs)) {
7028 return false;
7029 }
7030 if (!(lhs.key_hash == rhs.key_hash)) {
7031 return false;
7032 }
7033 if (!(lhs.proof_type == rhs.proof_type)) {
7034 return false;
7035 }
7036 return true;
7037}
7038
7040{
7041 auto serializer = serde::BincodeSerializer();
7043 return std::move(serializer).bytes();
7044}
7045
7047 std::vector<uint8_t> input)
7048{
7049 auto deserializer = serde::BincodeDeserializer(input);
7051 if (deserializer.get_buffer_offset() < input.size()) {
7052 throw_or_abort("Some input bytes were not read");
7053 }
7054 return value;
7055}
7056
7057} // end of namespace Acir
7058
7059template <>
7060template <typename Serializer>
7062 const Acir::BlackBoxFuncCall::RecursiveAggregation& obj, Serializer& serializer)
7063{
7064 serde::Serializable<decltype(obj.verification_key)>::serialize(obj.verification_key, serializer);
7065 serde::Serializable<decltype(obj.proof)>::serialize(obj.proof, serializer);
7066 serde::Serializable<decltype(obj.public_inputs)>::serialize(obj.public_inputs, serializer);
7067 serde::Serializable<decltype(obj.key_hash)>::serialize(obj.key_hash, serializer);
7068 serde::Serializable<decltype(obj.proof_type)>::serialize(obj.proof_type, serializer);
7069}
7070
7071template <>
7072template <typename Deserializer>
7074 Acir::BlackBoxFuncCall::RecursiveAggregation>::deserialize(Deserializer& deserializer)
7075{
7077 obj.verification_key = serde::Deserializable<decltype(obj.verification_key)>::deserialize(deserializer);
7078 obj.proof = serde::Deserializable<decltype(obj.proof)>::deserialize(deserializer);
7079 obj.public_inputs = serde::Deserializable<decltype(obj.public_inputs)>::deserialize(deserializer);
7080 obj.key_hash = serde::Deserializable<decltype(obj.key_hash)>::deserialize(deserializer);
7081 obj.proof_type = serde::Deserializable<decltype(obj.proof_type)>::deserialize(deserializer);
7082 return obj;
7083}
7084
7085namespace Acir {
7086
7088{
7089 if (!(lhs.lhs == rhs.lhs)) {
7090 return false;
7091 }
7092 if (!(lhs.rhs == rhs.rhs)) {
7093 return false;
7094 }
7095 if (!(lhs.output == rhs.output)) {
7096 return false;
7097 }
7098 return true;
7099}
7100
7101inline std::vector<uint8_t> BlackBoxFuncCall::BigIntAdd::bincodeSerialize() const
7102{
7103 auto serializer = serde::BincodeSerializer();
7105 return std::move(serializer).bytes();
7106}
7107
7109{
7110 auto deserializer = serde::BincodeDeserializer(input);
7112 if (deserializer.get_buffer_offset() < input.size()) {
7113 throw_or_abort("Some input bytes were not read");
7114 }
7115 return value;
7116}
7117
7118} // end of namespace Acir
7119
7120template <>
7121template <typename Serializer>
7123 Serializer& serializer)
7124{
7125 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
7126 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
7127 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
7128}
7129
7130template <>
7131template <typename Deserializer>
7133 Deserializer& deserializer)
7134{
7136 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
7137 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
7138 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
7139 return obj;
7140}
7141
7142namespace Acir {
7143
7145{
7146 if (!(lhs.lhs == rhs.lhs)) {
7147 return false;
7148 }
7149 if (!(lhs.rhs == rhs.rhs)) {
7150 return false;
7151 }
7152 if (!(lhs.output == rhs.output)) {
7153 return false;
7154 }
7155 return true;
7156}
7157
7158inline std::vector<uint8_t> BlackBoxFuncCall::BigIntSub::bincodeSerialize() const
7159{
7160 auto serializer = serde::BincodeSerializer();
7162 return std::move(serializer).bytes();
7163}
7164
7166{
7167 auto deserializer = serde::BincodeDeserializer(input);
7169 if (deserializer.get_buffer_offset() < input.size()) {
7170 throw_or_abort("Some input bytes were not read");
7171 }
7172 return value;
7173}
7174
7175} // end of namespace Acir
7176
7177template <>
7178template <typename Serializer>
7180 Serializer& serializer)
7181{
7182 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
7183 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
7184 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
7185}
7186
7187template <>
7188template <typename Deserializer>
7190 Deserializer& deserializer)
7191{
7193 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
7194 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
7195 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
7196 return obj;
7197}
7198
7199namespace Acir {
7200
7202{
7203 if (!(lhs.lhs == rhs.lhs)) {
7204 return false;
7205 }
7206 if (!(lhs.rhs == rhs.rhs)) {
7207 return false;
7208 }
7209 if (!(lhs.output == rhs.output)) {
7210 return false;
7211 }
7212 return true;
7213}
7214
7215inline std::vector<uint8_t> BlackBoxFuncCall::BigIntMul::bincodeSerialize() const
7216{
7217 auto serializer = serde::BincodeSerializer();
7219 return std::move(serializer).bytes();
7220}
7221
7223{
7224 auto deserializer = serde::BincodeDeserializer(input);
7226 if (deserializer.get_buffer_offset() < input.size()) {
7227 throw_or_abort("Some input bytes were not read");
7228 }
7229 return value;
7230}
7231
7232} // end of namespace Acir
7233
7234template <>
7235template <typename Serializer>
7237 Serializer& serializer)
7238{
7239 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
7240 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
7241 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
7242}
7243
7244template <>
7245template <typename Deserializer>
7247 Deserializer& deserializer)
7248{
7250 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
7251 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
7252 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
7253 return obj;
7254}
7255
7256namespace Acir {
7257
7259{
7260 if (!(lhs.lhs == rhs.lhs)) {
7261 return false;
7262 }
7263 if (!(lhs.rhs == rhs.rhs)) {
7264 return false;
7265 }
7266 if (!(lhs.output == rhs.output)) {
7267 return false;
7268 }
7269 return true;
7270}
7271
7272inline std::vector<uint8_t> BlackBoxFuncCall::BigIntDiv::bincodeSerialize() const
7273{
7274 auto serializer = serde::BincodeSerializer();
7276 return std::move(serializer).bytes();
7277}
7278
7280{
7281 auto deserializer = serde::BincodeDeserializer(input);
7283 if (deserializer.get_buffer_offset() < input.size()) {
7284 throw_or_abort("Some input bytes were not read");
7285 }
7286 return value;
7287}
7288
7289} // end of namespace Acir
7290
7291template <>
7292template <typename Serializer>
7294 Serializer& serializer)
7295{
7296 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
7297 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
7298 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
7299}
7300
7301template <>
7302template <typename Deserializer>
7304 Deserializer& deserializer)
7305{
7307 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
7308 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
7309 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
7310 return obj;
7311}
7312
7313namespace Acir {
7314
7316{
7317 if (!(lhs.inputs == rhs.inputs)) {
7318 return false;
7319 }
7320 if (!(lhs.modulus == rhs.modulus)) {
7321 return false;
7322 }
7323 if (!(lhs.output == rhs.output)) {
7324 return false;
7325 }
7326 return true;
7327}
7328
7330{
7331 auto serializer = serde::BincodeSerializer();
7333 return std::move(serializer).bytes();
7334}
7335
7337 std::vector<uint8_t> input)
7338{
7339 auto deserializer = serde::BincodeDeserializer(input);
7341 if (deserializer.get_buffer_offset() < input.size()) {
7342 throw_or_abort("Some input bytes were not read");
7343 }
7344 return value;
7345}
7346
7347} // end of namespace Acir
7348
7349template <>
7350template <typename Serializer>
7352 const Acir::BlackBoxFuncCall::BigIntFromLeBytes& obj, Serializer& serializer)
7353{
7354 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
7355 serde::Serializable<decltype(obj.modulus)>::serialize(obj.modulus, serializer);
7356 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
7357}
7358
7359template <>
7360template <typename Deserializer>
7362 Deserializer& deserializer)
7363{
7365 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
7366 obj.modulus = serde::Deserializable<decltype(obj.modulus)>::deserialize(deserializer);
7367 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
7368 return obj;
7369}
7370
7371namespace Acir {
7372
7374{
7375 if (!(lhs.input == rhs.input)) {
7376 return false;
7377 }
7378 if (!(lhs.outputs == rhs.outputs)) {
7379 return false;
7380 }
7381 return true;
7382}
7383
7385{
7386 auto serializer = serde::BincodeSerializer();
7388 return std::move(serializer).bytes();
7389}
7390
7392 std::vector<uint8_t> input)
7393{
7394 auto deserializer = serde::BincodeDeserializer(input);
7396 if (deserializer.get_buffer_offset() < input.size()) {
7397 throw_or_abort("Some input bytes were not read");
7398 }
7399 return value;
7400}
7401
7402} // end of namespace Acir
7403
7404template <>
7405template <typename Serializer>
7407 const Acir::BlackBoxFuncCall::BigIntToLeBytes& obj, Serializer& serializer)
7408{
7409 serde::Serializable<decltype(obj.input)>::serialize(obj.input, serializer);
7410 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
7411}
7412
7413template <>
7414template <typename Deserializer>
7416 Deserializer& deserializer)
7417{
7419 obj.input = serde::Deserializable<decltype(obj.input)>::deserialize(deserializer);
7420 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
7421 return obj;
7422}
7423
7424namespace Acir {
7425
7428{
7429 if (!(lhs.inputs == rhs.inputs)) {
7430 return false;
7431 }
7432 if (!(lhs.outputs == rhs.outputs)) {
7433 return false;
7434 }
7435 if (!(lhs.len == rhs.len)) {
7436 return false;
7437 }
7438 return true;
7439}
7440
7442{
7443 auto serializer = serde::BincodeSerializer();
7445 return std::move(serializer).bytes();
7446}
7447
7449 std::vector<uint8_t> input)
7450{
7451 auto deserializer = serde::BincodeDeserializer(input);
7453 if (deserializer.get_buffer_offset() < input.size()) {
7454 throw_or_abort("Some input bytes were not read");
7455 }
7456 return value;
7457}
7458
7459} // end of namespace Acir
7460
7461template <>
7462template <typename Serializer>
7464 const Acir::BlackBoxFuncCall::Poseidon2Permutation& obj, Serializer& serializer)
7465{
7466 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
7467 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
7468 serde::Serializable<decltype(obj.len)>::serialize(obj.len, serializer);
7469}
7470
7471template <>
7472template <typename Deserializer>
7474 Acir::BlackBoxFuncCall::Poseidon2Permutation>::deserialize(Deserializer& deserializer)
7475{
7477 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
7478 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
7479 obj.len = serde::Deserializable<decltype(obj.len)>::deserialize(deserializer);
7480 return obj;
7481}
7482
7483namespace Acir {
7484
7486{
7487 if (!(lhs.inputs == rhs.inputs)) {
7488 return false;
7489 }
7490 if (!(lhs.hash_values == rhs.hash_values)) {
7491 return false;
7492 }
7493 if (!(lhs.outputs == rhs.outputs)) {
7494 return false;
7495 }
7496 return true;
7497}
7498
7500{
7501 auto serializer = serde::BincodeSerializer();
7503 return std::move(serializer).bytes();
7504}
7505
7507 std::vector<uint8_t> input)
7508{
7509 auto deserializer = serde::BincodeDeserializer(input);
7511 if (deserializer.get_buffer_offset() < input.size()) {
7512 throw_or_abort("Some input bytes were not read");
7513 }
7514 return value;
7515}
7516
7517} // end of namespace Acir
7518
7519template <>
7520template <typename Serializer>
7522 const Acir::BlackBoxFuncCall::Sha256Compression& obj, Serializer& serializer)
7523{
7524 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
7525 serde::Serializable<decltype(obj.hash_values)>::serialize(obj.hash_values, serializer);
7526 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
7527}
7528
7529template <>
7530template <typename Deserializer>
7532 Deserializer& deserializer)
7533{
7535 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
7536 obj.hash_values = serde::Deserializable<decltype(obj.hash_values)>::deserialize(deserializer);
7537 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
7538 return obj;
7539}
7540
7541namespace Acir {
7542
7543inline bool operator==(const BlackBoxOp& lhs, const BlackBoxOp& rhs)
7544{
7545 if (!(lhs.value == rhs.value)) {
7546 return false;
7547 }
7548 return true;
7549}
7550
7551inline std::vector<uint8_t> BlackBoxOp::bincodeSerialize() const
7552{
7553 auto serializer = serde::BincodeSerializer();
7555 return std::move(serializer).bytes();
7556}
7557
7558inline BlackBoxOp BlackBoxOp::bincodeDeserialize(std::vector<uint8_t> input)
7559{
7560 auto deserializer = serde::BincodeDeserializer(input);
7562 if (deserializer.get_buffer_offset() < input.size()) {
7563 throw_or_abort("Some input bytes were not read");
7564 }
7565 return value;
7566}
7567
7568} // end of namespace Acir
7569
7570template <>
7571template <typename Serializer>
7573{
7574 serializer.increase_container_depth();
7575 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
7576 serializer.decrease_container_depth();
7577}
7578
7579template <>
7580template <typename Deserializer>
7582{
7583 deserializer.increase_container_depth();
7584 Acir::BlackBoxOp obj;
7585 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
7586 deserializer.decrease_container_depth();
7587 return obj;
7588}
7589
7590namespace Acir {
7591
7593{
7594 if (!(lhs.inputs == rhs.inputs)) {
7595 return false;
7596 }
7597 if (!(lhs.iv == rhs.iv)) {
7598 return false;
7599 }
7600 if (!(lhs.key == rhs.key)) {
7601 return false;
7602 }
7603 if (!(lhs.outputs == rhs.outputs)) {
7604 return false;
7605 }
7606 return true;
7607}
7608
7609inline std::vector<uint8_t> BlackBoxOp::AES128Encrypt::bincodeSerialize() const
7610{
7611 auto serializer = serde::BincodeSerializer();
7613 return std::move(serializer).bytes();
7614}
7615
7617{
7618 auto deserializer = serde::BincodeDeserializer(input);
7620 if (deserializer.get_buffer_offset() < input.size()) {
7621 throw_or_abort("Some input bytes were not read");
7622 }
7623 return value;
7624}
7625
7626} // end of namespace Acir
7627
7628template <>
7629template <typename Serializer>
7631 Serializer& serializer)
7632{
7633 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
7634 serde::Serializable<decltype(obj.iv)>::serialize(obj.iv, serializer);
7635 serde::Serializable<decltype(obj.key)>::serialize(obj.key, serializer);
7636 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
7637}
7638
7639template <>
7640template <typename Deserializer>
7642 Deserializer& deserializer)
7643{
7645 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
7646 obj.iv = serde::Deserializable<decltype(obj.iv)>::deserialize(deserializer);
7647 obj.key = serde::Deserializable<decltype(obj.key)>::deserialize(deserializer);
7648 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
7649 return obj;
7650}
7651
7652namespace Acir {
7653
7654inline bool operator==(const BlackBoxOp::Blake2s& lhs, const BlackBoxOp::Blake2s& rhs)
7655{
7656 if (!(lhs.message == rhs.message)) {
7657 return false;
7658 }
7659 if (!(lhs.output == rhs.output)) {
7660 return false;
7661 }
7662 return true;
7663}
7664
7665inline std::vector<uint8_t> BlackBoxOp::Blake2s::bincodeSerialize() const
7666{
7667 auto serializer = serde::BincodeSerializer();
7669 return std::move(serializer).bytes();
7670}
7671
7673{
7674 auto deserializer = serde::BincodeDeserializer(input);
7676 if (deserializer.get_buffer_offset() < input.size()) {
7677 throw_or_abort("Some input bytes were not read");
7678 }
7679 return value;
7680}
7681
7682} // end of namespace Acir
7683
7684template <>
7685template <typename Serializer>
7687 Serializer& serializer)
7688{
7689 serde::Serializable<decltype(obj.message)>::serialize(obj.message, serializer);
7690 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
7691}
7692
7693template <>
7694template <typename Deserializer>
7696{
7698 obj.message = serde::Deserializable<decltype(obj.message)>::deserialize(deserializer);
7699 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
7700 return obj;
7701}
7702
7703namespace Acir {
7704
7705inline bool operator==(const BlackBoxOp::Blake3& lhs, const BlackBoxOp::Blake3& rhs)
7706{
7707 if (!(lhs.message == rhs.message)) {
7708 return false;
7709 }
7710 if (!(lhs.output == rhs.output)) {
7711 return false;
7712 }
7713 return true;
7714}
7715
7716inline std::vector<uint8_t> BlackBoxOp::Blake3::bincodeSerialize() const
7717{
7718 auto serializer = serde::BincodeSerializer();
7720 return std::move(serializer).bytes();
7721}
7722
7724{
7725 auto deserializer = serde::BincodeDeserializer(input);
7727 if (deserializer.get_buffer_offset() < input.size()) {
7728 throw_or_abort("Some input bytes were not read");
7729 }
7730 return value;
7731}
7732
7733} // end of namespace Acir
7734
7735template <>
7736template <typename Serializer>
7738 Serializer& serializer)
7739{
7740 serde::Serializable<decltype(obj.message)>::serialize(obj.message, serializer);
7741 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
7742}
7743
7744template <>
7745template <typename Deserializer>
7747{
7749 obj.message = serde::Deserializable<decltype(obj.message)>::deserialize(deserializer);
7750 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
7751 return obj;
7752}
7753
7754namespace Acir {
7755
7757{
7758 if (!(lhs.input == rhs.input)) {
7759 return false;
7760 }
7761 if (!(lhs.output == rhs.output)) {
7762 return false;
7763 }
7764 return true;
7765}
7766
7767inline std::vector<uint8_t> BlackBoxOp::Keccakf1600::bincodeSerialize() const
7768{
7769 auto serializer = serde::BincodeSerializer();
7771 return std::move(serializer).bytes();
7772}
7773
7775{
7776 auto deserializer = serde::BincodeDeserializer(input);
7778 if (deserializer.get_buffer_offset() < input.size()) {
7779 throw_or_abort("Some input bytes were not read");
7780 }
7781 return value;
7782}
7783
7784} // end of namespace Acir
7785
7786template <>
7787template <typename Serializer>
7789 Serializer& serializer)
7790{
7791 serde::Serializable<decltype(obj.input)>::serialize(obj.input, serializer);
7792 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
7793}
7794
7795template <>
7796template <typename Deserializer>
7798 Deserializer& deserializer)
7799{
7801 obj.input = serde::Deserializable<decltype(obj.input)>::deserialize(deserializer);
7802 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
7803 return obj;
7804}
7805
7806namespace Acir {
7807
7809{
7810 if (!(lhs.hashed_msg == rhs.hashed_msg)) {
7811 return false;
7812 }
7813 if (!(lhs.public_key_x == rhs.public_key_x)) {
7814 return false;
7815 }
7816 if (!(lhs.public_key_y == rhs.public_key_y)) {
7817 return false;
7818 }
7819 if (!(lhs.signature == rhs.signature)) {
7820 return false;
7821 }
7822 if (!(lhs.result == rhs.result)) {
7823 return false;
7824 }
7825 return true;
7826}
7827
7828inline std::vector<uint8_t> BlackBoxOp::EcdsaSecp256k1::bincodeSerialize() const
7829{
7830 auto serializer = serde::BincodeSerializer();
7832 return std::move(serializer).bytes();
7833}
7834
7836{
7837 auto deserializer = serde::BincodeDeserializer(input);
7839 if (deserializer.get_buffer_offset() < input.size()) {
7840 throw_or_abort("Some input bytes were not read");
7841 }
7842 return value;
7843}
7844
7845} // end of namespace Acir
7846
7847template <>
7848template <typename Serializer>
7850 Serializer& serializer)
7851{
7852 serde::Serializable<decltype(obj.hashed_msg)>::serialize(obj.hashed_msg, serializer);
7853 serde::Serializable<decltype(obj.public_key_x)>::serialize(obj.public_key_x, serializer);
7854 serde::Serializable<decltype(obj.public_key_y)>::serialize(obj.public_key_y, serializer);
7855 serde::Serializable<decltype(obj.signature)>::serialize(obj.signature, serializer);
7856 serde::Serializable<decltype(obj.result)>::serialize(obj.result, serializer);
7857}
7858
7859template <>
7860template <typename Deserializer>
7862 Deserializer& deserializer)
7863{
7865 obj.hashed_msg = serde::Deserializable<decltype(obj.hashed_msg)>::deserialize(deserializer);
7866 obj.public_key_x = serde::Deserializable<decltype(obj.public_key_x)>::deserialize(deserializer);
7867 obj.public_key_y = serde::Deserializable<decltype(obj.public_key_y)>::deserialize(deserializer);
7868 obj.signature = serde::Deserializable<decltype(obj.signature)>::deserialize(deserializer);
7869 obj.result = serde::Deserializable<decltype(obj.result)>::deserialize(deserializer);
7870 return obj;
7871}
7872
7873namespace Acir {
7874
7876{
7877 if (!(lhs.hashed_msg == rhs.hashed_msg)) {
7878 return false;
7879 }
7880 if (!(lhs.public_key_x == rhs.public_key_x)) {
7881 return false;
7882 }
7883 if (!(lhs.public_key_y == rhs.public_key_y)) {
7884 return false;
7885 }
7886 if (!(lhs.signature == rhs.signature)) {
7887 return false;
7888 }
7889 if (!(lhs.result == rhs.result)) {
7890 return false;
7891 }
7892 return true;
7893}
7894
7895inline std::vector<uint8_t> BlackBoxOp::EcdsaSecp256r1::bincodeSerialize() const
7896{
7897 auto serializer = serde::BincodeSerializer();
7899 return std::move(serializer).bytes();
7900}
7901
7903{
7904 auto deserializer = serde::BincodeDeserializer(input);
7906 if (deserializer.get_buffer_offset() < input.size()) {
7907 throw_or_abort("Some input bytes were not read");
7908 }
7909 return value;
7910}
7911
7912} // end of namespace Acir
7913
7914template <>
7915template <typename Serializer>
7917 Serializer& serializer)
7918{
7919 serde::Serializable<decltype(obj.hashed_msg)>::serialize(obj.hashed_msg, serializer);
7920 serde::Serializable<decltype(obj.public_key_x)>::serialize(obj.public_key_x, serializer);
7921 serde::Serializable<decltype(obj.public_key_y)>::serialize(obj.public_key_y, serializer);
7922 serde::Serializable<decltype(obj.signature)>::serialize(obj.signature, serializer);
7923 serde::Serializable<decltype(obj.result)>::serialize(obj.result, serializer);
7924}
7925
7926template <>
7927template <typename Deserializer>
7929 Deserializer& deserializer)
7930{
7932 obj.hashed_msg = serde::Deserializable<decltype(obj.hashed_msg)>::deserialize(deserializer);
7933 obj.public_key_x = serde::Deserializable<decltype(obj.public_key_x)>::deserialize(deserializer);
7934 obj.public_key_y = serde::Deserializable<decltype(obj.public_key_y)>::deserialize(deserializer);
7935 obj.signature = serde::Deserializable<decltype(obj.signature)>::deserialize(deserializer);
7936 obj.result = serde::Deserializable<decltype(obj.result)>::deserialize(deserializer);
7937 return obj;
7938}
7939
7940namespace Acir {
7941
7943{
7944 if (!(lhs.points == rhs.points)) {
7945 return false;
7946 }
7947 if (!(lhs.scalars == rhs.scalars)) {
7948 return false;
7949 }
7950 if (!(lhs.outputs == rhs.outputs)) {
7951 return false;
7952 }
7953 return true;
7954}
7955
7956inline std::vector<uint8_t> BlackBoxOp::MultiScalarMul::bincodeSerialize() const
7957{
7958 auto serializer = serde::BincodeSerializer();
7960 return std::move(serializer).bytes();
7961}
7962
7964{
7965 auto deserializer = serde::BincodeDeserializer(input);
7967 if (deserializer.get_buffer_offset() < input.size()) {
7968 throw_or_abort("Some input bytes were not read");
7969 }
7970 return value;
7971}
7972
7973} // end of namespace Acir
7974
7975template <>
7976template <typename Serializer>
7978 Serializer& serializer)
7979{
7980 serde::Serializable<decltype(obj.points)>::serialize(obj.points, serializer);
7981 serde::Serializable<decltype(obj.scalars)>::serialize(obj.scalars, serializer);
7982 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
7983}
7984
7985template <>
7986template <typename Deserializer>
7988 Deserializer& deserializer)
7989{
7991 obj.points = serde::Deserializable<decltype(obj.points)>::deserialize(deserializer);
7992 obj.scalars = serde::Deserializable<decltype(obj.scalars)>::deserialize(deserializer);
7993 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
7994 return obj;
7995}
7996
7997namespace Acir {
7998
8000{
8001 if (!(lhs.input1_x == rhs.input1_x)) {
8002 return false;
8003 }
8004 if (!(lhs.input1_y == rhs.input1_y)) {
8005 return false;
8006 }
8007 if (!(lhs.input1_infinite == rhs.input1_infinite)) {
8008 return false;
8009 }
8010 if (!(lhs.input2_x == rhs.input2_x)) {
8011 return false;
8012 }
8013 if (!(lhs.input2_y == rhs.input2_y)) {
8014 return false;
8015 }
8016 if (!(lhs.input2_infinite == rhs.input2_infinite)) {
8017 return false;
8018 }
8019 if (!(lhs.result == rhs.result)) {
8020 return false;
8021 }
8022 return true;
8023}
8024
8025inline std::vector<uint8_t> BlackBoxOp::EmbeddedCurveAdd::bincodeSerialize() const
8026{
8027 auto serializer = serde::BincodeSerializer();
8029 return std::move(serializer).bytes();
8030}
8031
8033{
8034 auto deserializer = serde::BincodeDeserializer(input);
8036 if (deserializer.get_buffer_offset() < input.size()) {
8037 throw_or_abort("Some input bytes were not read");
8038 }
8039 return value;
8040}
8041
8042} // end of namespace Acir
8043
8044template <>
8045template <typename Serializer>
8047 Serializer& serializer)
8048{
8049 serde::Serializable<decltype(obj.input1_x)>::serialize(obj.input1_x, serializer);
8050 serde::Serializable<decltype(obj.input1_y)>::serialize(obj.input1_y, serializer);
8051 serde::Serializable<decltype(obj.input1_infinite)>::serialize(obj.input1_infinite, serializer);
8052 serde::Serializable<decltype(obj.input2_x)>::serialize(obj.input2_x, serializer);
8053 serde::Serializable<decltype(obj.input2_y)>::serialize(obj.input2_y, serializer);
8054 serde::Serializable<decltype(obj.input2_infinite)>::serialize(obj.input2_infinite, serializer);
8055 serde::Serializable<decltype(obj.result)>::serialize(obj.result, serializer);
8056}
8057
8058template <>
8059template <typename Deserializer>
8061 Deserializer& deserializer)
8062{
8064 obj.input1_x = serde::Deserializable<decltype(obj.input1_x)>::deserialize(deserializer);
8065 obj.input1_y = serde::Deserializable<decltype(obj.input1_y)>::deserialize(deserializer);
8066 obj.input1_infinite = serde::Deserializable<decltype(obj.input1_infinite)>::deserialize(deserializer);
8067 obj.input2_x = serde::Deserializable<decltype(obj.input2_x)>::deserialize(deserializer);
8068 obj.input2_y = serde::Deserializable<decltype(obj.input2_y)>::deserialize(deserializer);
8069 obj.input2_infinite = serde::Deserializable<decltype(obj.input2_infinite)>::deserialize(deserializer);
8070 obj.result = serde::Deserializable<decltype(obj.result)>::deserialize(deserializer);
8071 return obj;
8072}
8073
8074namespace Acir {
8075
8076inline bool operator==(const BlackBoxOp::BigIntAdd& lhs, const BlackBoxOp::BigIntAdd& rhs)
8077{
8078 if (!(lhs.lhs == rhs.lhs)) {
8079 return false;
8080 }
8081 if (!(lhs.rhs == rhs.rhs)) {
8082 return false;
8083 }
8084 if (!(lhs.output == rhs.output)) {
8085 return false;
8086 }
8087 return true;
8088}
8089
8090inline std::vector<uint8_t> BlackBoxOp::BigIntAdd::bincodeSerialize() const
8091{
8092 auto serializer = serde::BincodeSerializer();
8094 return std::move(serializer).bytes();
8095}
8096
8098{
8099 auto deserializer = serde::BincodeDeserializer(input);
8101 if (deserializer.get_buffer_offset() < input.size()) {
8102 throw_or_abort("Some input bytes were not read");
8103 }
8104 return value;
8105}
8106
8107} // end of namespace Acir
8108
8109template <>
8110template <typename Serializer>
8112 Serializer& serializer)
8113{
8114 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
8115 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
8116 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
8117}
8118
8119template <>
8120template <typename Deserializer>
8122{
8124 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
8125 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
8126 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
8127 return obj;
8128}
8129
8130namespace Acir {
8131
8132inline bool operator==(const BlackBoxOp::BigIntSub& lhs, const BlackBoxOp::BigIntSub& rhs)
8133{
8134 if (!(lhs.lhs == rhs.lhs)) {
8135 return false;
8136 }
8137 if (!(lhs.rhs == rhs.rhs)) {
8138 return false;
8139 }
8140 if (!(lhs.output == rhs.output)) {
8141 return false;
8142 }
8143 return true;
8144}
8145
8146inline std::vector<uint8_t> BlackBoxOp::BigIntSub::bincodeSerialize() const
8147{
8148 auto serializer = serde::BincodeSerializer();
8150 return std::move(serializer).bytes();
8151}
8152
8154{
8155 auto deserializer = serde::BincodeDeserializer(input);
8157 if (deserializer.get_buffer_offset() < input.size()) {
8158 throw_or_abort("Some input bytes were not read");
8159 }
8160 return value;
8161}
8162
8163} // end of namespace Acir
8164
8165template <>
8166template <typename Serializer>
8168 Serializer& serializer)
8169{
8170 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
8171 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
8172 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
8173}
8174
8175template <>
8176template <typename Deserializer>
8178{
8180 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
8181 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
8182 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
8183 return obj;
8184}
8185
8186namespace Acir {
8187
8188inline bool operator==(const BlackBoxOp::BigIntMul& lhs, const BlackBoxOp::BigIntMul& rhs)
8189{
8190 if (!(lhs.lhs == rhs.lhs)) {
8191 return false;
8192 }
8193 if (!(lhs.rhs == rhs.rhs)) {
8194 return false;
8195 }
8196 if (!(lhs.output == rhs.output)) {
8197 return false;
8198 }
8199 return true;
8200}
8201
8202inline std::vector<uint8_t> BlackBoxOp::BigIntMul::bincodeSerialize() const
8203{
8204 auto serializer = serde::BincodeSerializer();
8206 return std::move(serializer).bytes();
8207}
8208
8210{
8211 auto deserializer = serde::BincodeDeserializer(input);
8213 if (deserializer.get_buffer_offset() < input.size()) {
8214 throw_or_abort("Some input bytes were not read");
8215 }
8216 return value;
8217}
8218
8219} // end of namespace Acir
8220
8221template <>
8222template <typename Serializer>
8224 Serializer& serializer)
8225{
8226 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
8227 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
8228 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
8229}
8230
8231template <>
8232template <typename Deserializer>
8234{
8236 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
8237 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
8238 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
8239 return obj;
8240}
8241
8242namespace Acir {
8243
8244inline bool operator==(const BlackBoxOp::BigIntDiv& lhs, const BlackBoxOp::BigIntDiv& rhs)
8245{
8246 if (!(lhs.lhs == rhs.lhs)) {
8247 return false;
8248 }
8249 if (!(lhs.rhs == rhs.rhs)) {
8250 return false;
8251 }
8252 if (!(lhs.output == rhs.output)) {
8253 return false;
8254 }
8255 return true;
8256}
8257
8258inline std::vector<uint8_t> BlackBoxOp::BigIntDiv::bincodeSerialize() const
8259{
8260 auto serializer = serde::BincodeSerializer();
8262 return std::move(serializer).bytes();
8263}
8264
8266{
8267 auto deserializer = serde::BincodeDeserializer(input);
8269 if (deserializer.get_buffer_offset() < input.size()) {
8270 throw_or_abort("Some input bytes were not read");
8271 }
8272 return value;
8273}
8274
8275} // end of namespace Acir
8276
8277template <>
8278template <typename Serializer>
8280 Serializer& serializer)
8281{
8282 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
8283 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
8284 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
8285}
8286
8287template <>
8288template <typename Deserializer>
8290{
8292 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
8293 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
8294 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
8295 return obj;
8296}
8297
8298namespace Acir {
8299
8301{
8302 if (!(lhs.inputs == rhs.inputs)) {
8303 return false;
8304 }
8305 if (!(lhs.modulus == rhs.modulus)) {
8306 return false;
8307 }
8308 if (!(lhs.output == rhs.output)) {
8309 return false;
8310 }
8311 return true;
8312}
8313
8314inline std::vector<uint8_t> BlackBoxOp::BigIntFromLeBytes::bincodeSerialize() const
8315{
8316 auto serializer = serde::BincodeSerializer();
8318 return std::move(serializer).bytes();
8319}
8320
8322{
8323 auto deserializer = serde::BincodeDeserializer(input);
8325 if (deserializer.get_buffer_offset() < input.size()) {
8326 throw_or_abort("Some input bytes were not read");
8327 }
8328 return value;
8329}
8330
8331} // end of namespace Acir
8332
8333template <>
8334template <typename Serializer>
8336 Serializer& serializer)
8337{
8338 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
8339 serde::Serializable<decltype(obj.modulus)>::serialize(obj.modulus, serializer);
8340 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
8341}
8342
8343template <>
8344template <typename Deserializer>
8346 Deserializer& deserializer)
8347{
8349 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
8350 obj.modulus = serde::Deserializable<decltype(obj.modulus)>::deserialize(deserializer);
8351 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
8352 return obj;
8353}
8354
8355namespace Acir {
8356
8358{
8359 if (!(lhs.input == rhs.input)) {
8360 return false;
8361 }
8362 if (!(lhs.output == rhs.output)) {
8363 return false;
8364 }
8365 return true;
8366}
8367
8368inline std::vector<uint8_t> BlackBoxOp::BigIntToLeBytes::bincodeSerialize() const
8369{
8370 auto serializer = serde::BincodeSerializer();
8372 return std::move(serializer).bytes();
8373}
8374
8376{
8377 auto deserializer = serde::BincodeDeserializer(input);
8379 if (deserializer.get_buffer_offset() < input.size()) {
8380 throw_or_abort("Some input bytes were not read");
8381 }
8382 return value;
8383}
8384
8385} // end of namespace Acir
8386
8387template <>
8388template <typename Serializer>
8390 Serializer& serializer)
8391{
8392 serde::Serializable<decltype(obj.input)>::serialize(obj.input, serializer);
8393 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
8394}
8395
8396template <>
8397template <typename Deserializer>
8399 Deserializer& deserializer)
8400{
8402 obj.input = serde::Deserializable<decltype(obj.input)>::deserialize(deserializer);
8403 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
8404 return obj;
8405}
8406
8407namespace Acir {
8408
8410{
8411 if (!(lhs.message == rhs.message)) {
8412 return false;
8413 }
8414 if (!(lhs.output == rhs.output)) {
8415 return false;
8416 }
8417 if (!(lhs.len == rhs.len)) {
8418 return false;
8419 }
8420 return true;
8421}
8422
8424{
8425 auto serializer = serde::BincodeSerializer();
8427 return std::move(serializer).bytes();
8428}
8429
8431{
8432 auto deserializer = serde::BincodeDeserializer(input);
8434 if (deserializer.get_buffer_offset() < input.size()) {
8435 throw_or_abort("Some input bytes were not read");
8436 }
8437 return value;
8438}
8439
8440} // end of namespace Acir
8441
8442template <>
8443template <typename Serializer>
8445 const Acir::BlackBoxOp::Poseidon2Permutation& obj, Serializer& serializer)
8446{
8447 serde::Serializable<decltype(obj.message)>::serialize(obj.message, serializer);
8448 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
8449 serde::Serializable<decltype(obj.len)>::serialize(obj.len, serializer);
8450}
8451
8452template <>
8453template <typename Deserializer>
8455 Deserializer& deserializer)
8456{
8458 obj.message = serde::Deserializable<decltype(obj.message)>::deserialize(deserializer);
8459 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
8460 obj.len = serde::Deserializable<decltype(obj.len)>::deserialize(deserializer);
8461 return obj;
8462}
8463
8464namespace Acir {
8465
8467{
8468 if (!(lhs.input == rhs.input)) {
8469 return false;
8470 }
8471 if (!(lhs.hash_values == rhs.hash_values)) {
8472 return false;
8473 }
8474 if (!(lhs.output == rhs.output)) {
8475 return false;
8476 }
8477 return true;
8478}
8479
8480inline std::vector<uint8_t> BlackBoxOp::Sha256Compression::bincodeSerialize() const
8481{
8482 auto serializer = serde::BincodeSerializer();
8484 return std::move(serializer).bytes();
8485}
8486
8488{
8489 auto deserializer = serde::BincodeDeserializer(input);
8491 if (deserializer.get_buffer_offset() < input.size()) {
8492 throw_or_abort("Some input bytes were not read");
8493 }
8494 return value;
8495}
8496
8497} // end of namespace Acir
8498
8499template <>
8500template <typename Serializer>
8502 Serializer& serializer)
8503{
8504 serde::Serializable<decltype(obj.input)>::serialize(obj.input, serializer);
8505 serde::Serializable<decltype(obj.hash_values)>::serialize(obj.hash_values, serializer);
8506 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
8507}
8508
8509template <>
8510template <typename Deserializer>
8512 Deserializer& deserializer)
8513{
8515 obj.input = serde::Deserializable<decltype(obj.input)>::deserialize(deserializer);
8516 obj.hash_values = serde::Deserializable<decltype(obj.hash_values)>::deserialize(deserializer);
8517 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
8518 return obj;
8519}
8520
8521namespace Acir {
8522
8523inline bool operator==(const BlackBoxOp::ToRadix& lhs, const BlackBoxOp::ToRadix& rhs)
8524{
8525 if (!(lhs.input == rhs.input)) {
8526 return false;
8527 }
8528 if (!(lhs.radix == rhs.radix)) {
8529 return false;
8530 }
8531 if (!(lhs.output_pointer == rhs.output_pointer)) {
8532 return false;
8533 }
8534 if (!(lhs.num_limbs == rhs.num_limbs)) {
8535 return false;
8536 }
8537 if (!(lhs.output_bits == rhs.output_bits)) {
8538 return false;
8539 }
8540 return true;
8541}
8542
8543inline std::vector<uint8_t> BlackBoxOp::ToRadix::bincodeSerialize() const
8544{
8545 auto serializer = serde::BincodeSerializer();
8547 return std::move(serializer).bytes();
8548}
8549
8551{
8552 auto deserializer = serde::BincodeDeserializer(input);
8554 if (deserializer.get_buffer_offset() < input.size()) {
8555 throw_or_abort("Some input bytes were not read");
8556 }
8557 return value;
8558}
8559
8560} // end of namespace Acir
8561
8562template <>
8563template <typename Serializer>
8565 Serializer& serializer)
8566{
8567 serde::Serializable<decltype(obj.input)>::serialize(obj.input, serializer);
8568 serde::Serializable<decltype(obj.radix)>::serialize(obj.radix, serializer);
8569 serde::Serializable<decltype(obj.output_pointer)>::serialize(obj.output_pointer, serializer);
8570 serde::Serializable<decltype(obj.num_limbs)>::serialize(obj.num_limbs, serializer);
8571 serde::Serializable<decltype(obj.output_bits)>::serialize(obj.output_bits, serializer);
8572}
8573
8574template <>
8575template <typename Deserializer>
8577{
8579 obj.input = serde::Deserializable<decltype(obj.input)>::deserialize(deserializer);
8580 obj.radix = serde::Deserializable<decltype(obj.radix)>::deserialize(deserializer);
8581 obj.output_pointer = serde::Deserializable<decltype(obj.output_pointer)>::deserialize(deserializer);
8582 obj.num_limbs = serde::Deserializable<decltype(obj.num_limbs)>::deserialize(deserializer);
8583 obj.output_bits = serde::Deserializable<decltype(obj.output_bits)>::deserialize(deserializer);
8584 return obj;
8585}
8586
8587namespace Acir {
8588
8589inline bool operator==(const BlockId& lhs, const BlockId& rhs)
8590{
8591 if (!(lhs.value == rhs.value)) {
8592 return false;
8593 }
8594 return true;
8595}
8596
8597inline std::vector<uint8_t> BlockId::bincodeSerialize() const
8598{
8599 auto serializer = serde::BincodeSerializer();
8600 serde::Serializable<BlockId>::serialize(*this, serializer);
8601 return std::move(serializer).bytes();
8602}
8603
8604inline BlockId BlockId::bincodeDeserialize(std::vector<uint8_t> input)
8605{
8606 auto deserializer = serde::BincodeDeserializer(input);
8608 if (deserializer.get_buffer_offset() < input.size()) {
8609 throw_or_abort("Some input bytes were not read");
8610 }
8611 return value;
8612}
8613
8614} // end of namespace Acir
8615
8616template <>
8617template <typename Serializer>
8618void serde::Serializable<Acir::BlockId>::serialize(const Acir::BlockId& obj, Serializer& serializer)
8619{
8620 serializer.increase_container_depth();
8621 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
8622 serializer.decrease_container_depth();
8623}
8624
8625template <>
8626template <typename Deserializer>
8628{
8629 deserializer.increase_container_depth();
8630 Acir::BlockId obj;
8631 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
8632 deserializer.decrease_container_depth();
8633 return obj;
8634}
8635
8636namespace Acir {
8637
8638inline bool operator==(const BlockType& lhs, const BlockType& rhs)
8639{
8640 if (!(lhs.value == rhs.value)) {
8641 return false;
8642 }
8643 return true;
8644}
8645
8646inline std::vector<uint8_t> BlockType::bincodeSerialize() const
8647{
8648 auto serializer = serde::BincodeSerializer();
8650 return std::move(serializer).bytes();
8651}
8652
8653inline BlockType BlockType::bincodeDeserialize(std::vector<uint8_t> input)
8654{
8655 auto deserializer = serde::BincodeDeserializer(input);
8657 if (deserializer.get_buffer_offset() < input.size()) {
8658 throw_or_abort("Some input bytes were not read");
8659 }
8660 return value;
8661}
8662
8663} // end of namespace Acir
8664
8665template <>
8666template <typename Serializer>
8668{
8669 serializer.increase_container_depth();
8670 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
8671 serializer.decrease_container_depth();
8672}
8673
8674template <>
8675template <typename Deserializer>
8677{
8678 deserializer.increase_container_depth();
8679 Acir::BlockType obj;
8680 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
8681 deserializer.decrease_container_depth();
8682 return obj;
8683}
8684
8685namespace Acir {
8686
8687inline bool operator==(const BlockType::Memory& lhs, const BlockType::Memory& rhs)
8688{
8689 return true;
8690}
8691
8692inline std::vector<uint8_t> BlockType::Memory::bincodeSerialize() const
8693{
8694 auto serializer = serde::BincodeSerializer();
8696 return std::move(serializer).bytes();
8697}
8698
8700{
8701 auto deserializer = serde::BincodeDeserializer(input);
8703 if (deserializer.get_buffer_offset() < input.size()) {
8704 throw_or_abort("Some input bytes were not read");
8705 }
8706 return value;
8707}
8708
8709} // end of namespace Acir
8710
8711template <>
8712template <typename Serializer>
8715
8716template <>
8717template <typename Deserializer>
8723
8724namespace Acir {
8725
8726inline bool operator==(const BlockType::CallData& lhs, const BlockType::CallData& rhs)
8727{
8728 if (!(lhs.value == rhs.value)) {
8729 return false;
8730 }
8731 return true;
8732}
8733
8734inline std::vector<uint8_t> BlockType::CallData::bincodeSerialize() const
8735{
8736 auto serializer = serde::BincodeSerializer();
8738 return std::move(serializer).bytes();
8739}
8740
8742{
8743 auto deserializer = serde::BincodeDeserializer(input);
8745 if (deserializer.get_buffer_offset() < input.size()) {
8746 throw_or_abort("Some input bytes were not read");
8747 }
8748 return value;
8749}
8750
8751} // end of namespace Acir
8752
8753template <>
8754template <typename Serializer>
8756 Serializer& serializer)
8757{
8758 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
8759}
8760
8761template <>
8762template <typename Deserializer>
8764{
8766 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
8767 return obj;
8768}
8769
8770namespace Acir {
8771
8772inline bool operator==(const BlockType::ReturnData& lhs, const BlockType::ReturnData& rhs)
8773{
8774 return true;
8775}
8776
8777inline std::vector<uint8_t> BlockType::ReturnData::bincodeSerialize() const
8778{
8779 auto serializer = serde::BincodeSerializer();
8781 return std::move(serializer).bytes();
8782}
8783
8785{
8786 auto deserializer = serde::BincodeDeserializer(input);
8788 if (deserializer.get_buffer_offset() < input.size()) {
8789 throw_or_abort("Some input bytes were not read");
8790 }
8791 return value;
8792}
8793
8794} // end of namespace Acir
8795
8796template <>
8797template <typename Serializer>
8801
8802template <>
8803template <typename Deserializer>
8809
8810namespace Acir {
8811
8812inline bool operator==(const BrilligBytecode& lhs, const BrilligBytecode& rhs)
8813{
8814 if (!(lhs.bytecode == rhs.bytecode)) {
8815 return false;
8816 }
8817 return true;
8818}
8819
8820inline std::vector<uint8_t> BrilligBytecode::bincodeSerialize() const
8821{
8822 auto serializer = serde::BincodeSerializer();
8824 return std::move(serializer).bytes();
8825}
8826
8828{
8829 auto deserializer = serde::BincodeDeserializer(input);
8831 if (deserializer.get_buffer_offset() < input.size()) {
8832 throw_or_abort("Some input bytes were not read");
8833 }
8834 return value;
8835}
8836
8837} // end of namespace Acir
8838
8839template <>
8840template <typename Serializer>
8842{
8843 serializer.increase_container_depth();
8844 serde::Serializable<decltype(obj.bytecode)>::serialize(obj.bytecode, serializer);
8845 serializer.decrease_container_depth();
8846}
8847
8848template <>
8849template <typename Deserializer>
8851{
8852 deserializer.increase_container_depth();
8854 obj.bytecode = serde::Deserializable<decltype(obj.bytecode)>::deserialize(deserializer);
8855 deserializer.decrease_container_depth();
8856 return obj;
8857}
8858
8859namespace Acir {
8860
8861inline bool operator==(const BrilligInputs& lhs, const BrilligInputs& rhs)
8862{
8863 if (!(lhs.value == rhs.value)) {
8864 return false;
8865 }
8866 return true;
8867}
8868
8869inline std::vector<uint8_t> BrilligInputs::bincodeSerialize() const
8870{
8871 auto serializer = serde::BincodeSerializer();
8873 return std::move(serializer).bytes();
8874}
8875
8876inline BrilligInputs BrilligInputs::bincodeDeserialize(std::vector<uint8_t> input)
8877{
8878 auto deserializer = serde::BincodeDeserializer(input);
8880 if (deserializer.get_buffer_offset() < input.size()) {
8881 throw_or_abort("Some input bytes were not read");
8882 }
8883 return value;
8884}
8885
8886} // end of namespace Acir
8887
8888template <>
8889template <typename Serializer>
8891{
8892 serializer.increase_container_depth();
8893 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
8894 serializer.decrease_container_depth();
8895}
8896
8897template <>
8898template <typename Deserializer>
8900{
8901 deserializer.increase_container_depth();
8903 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
8904 deserializer.decrease_container_depth();
8905 return obj;
8906}
8907
8908namespace Acir {
8909
8910inline bool operator==(const BrilligInputs::Single& lhs, const BrilligInputs::Single& rhs)
8911{
8912 if (!(lhs.value == rhs.value)) {
8913 return false;
8914 }
8915 return true;
8916}
8917
8918inline std::vector<uint8_t> BrilligInputs::Single::bincodeSerialize() const
8919{
8920 auto serializer = serde::BincodeSerializer();
8922 return std::move(serializer).bytes();
8923}
8924
8926{
8927 auto deserializer = serde::BincodeDeserializer(input);
8929 if (deserializer.get_buffer_offset() < input.size()) {
8930 throw_or_abort("Some input bytes were not read");
8931 }
8932 return value;
8933}
8934
8935} // end of namespace Acir
8936
8937template <>
8938template <typename Serializer>
8940 Serializer& serializer)
8941{
8942 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
8943}
8944
8945template <>
8946template <typename Deserializer>
8948{
8950 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
8951 return obj;
8952}
8953
8954namespace Acir {
8955
8956inline bool operator==(const BrilligInputs::Array& lhs, const BrilligInputs::Array& rhs)
8957{
8958 if (!(lhs.value == rhs.value)) {
8959 return false;
8960 }
8961 return true;
8962}
8963
8964inline std::vector<uint8_t> BrilligInputs::Array::bincodeSerialize() const
8965{
8966 auto serializer = serde::BincodeSerializer();
8968 return std::move(serializer).bytes();
8969}
8970
8972{
8973 auto deserializer = serde::BincodeDeserializer(input);
8975 if (deserializer.get_buffer_offset() < input.size()) {
8976 throw_or_abort("Some input bytes were not read");
8977 }
8978 return value;
8979}
8980
8981} // end of namespace Acir
8982
8983template <>
8984template <typename Serializer>
8986 Serializer& serializer)
8987{
8988 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
8989}
8990
8991template <>
8992template <typename Deserializer>
8994{
8996 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
8997 return obj;
8998}
8999
9000namespace Acir {
9001
9003{
9004 if (!(lhs.value == rhs.value)) {
9005 return false;
9006 }
9007 return true;
9008}
9009
9010inline std::vector<uint8_t> BrilligInputs::MemoryArray::bincodeSerialize() const
9011{
9012 auto serializer = serde::BincodeSerializer();
9014 return std::move(serializer).bytes();
9015}
9016
9018{
9019 auto deserializer = serde::BincodeDeserializer(input);
9021 if (deserializer.get_buffer_offset() < input.size()) {
9022 throw_or_abort("Some input bytes were not read");
9023 }
9024 return value;
9025}
9026
9027} // end of namespace Acir
9028
9029template <>
9030template <typename Serializer>
9032 Serializer& serializer)
9033{
9034 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9035}
9036
9037template <>
9038template <typename Deserializer>
9040 Deserializer& deserializer)
9041{
9043 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9044 return obj;
9045}
9046
9047namespace Acir {
9048
9049inline bool operator==(const BrilligOpcode& lhs, const BrilligOpcode& rhs)
9050{
9051 if (!(lhs.value == rhs.value)) {
9052 return false;
9053 }
9054 return true;
9055}
9056
9057inline std::vector<uint8_t> BrilligOpcode::bincodeSerialize() const
9058{
9059 auto serializer = serde::BincodeSerializer();
9061 return std::move(serializer).bytes();
9062}
9063
9064inline BrilligOpcode BrilligOpcode::bincodeDeserialize(std::vector<uint8_t> input)
9065{
9066 auto deserializer = serde::BincodeDeserializer(input);
9068 if (deserializer.get_buffer_offset() < input.size()) {
9069 throw_or_abort("Some input bytes were not read");
9070 }
9071 return value;
9072}
9073
9074} // end of namespace Acir
9075
9076template <>
9077template <typename Serializer>
9079{
9080 serializer.increase_container_depth();
9081 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9082 serializer.decrease_container_depth();
9083}
9084
9085template <>
9086template <typename Deserializer>
9088{
9089 deserializer.increase_container_depth();
9091 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9092 deserializer.decrease_container_depth();
9093 return obj;
9094}
9095
9096namespace Acir {
9097
9099{
9100 if (!(lhs.destination == rhs.destination)) {
9101 return false;
9102 }
9103 if (!(lhs.op == rhs.op)) {
9104 return false;
9105 }
9106 if (!(lhs.lhs == rhs.lhs)) {
9107 return false;
9108 }
9109 if (!(lhs.rhs == rhs.rhs)) {
9110 return false;
9111 }
9112 return true;
9113}
9114
9115inline std::vector<uint8_t> BrilligOpcode::BinaryFieldOp::bincodeSerialize() const
9116{
9117 auto serializer = serde::BincodeSerializer();
9119 return std::move(serializer).bytes();
9120}
9121
9123{
9124 auto deserializer = serde::BincodeDeserializer(input);
9126 if (deserializer.get_buffer_offset() < input.size()) {
9127 throw_or_abort("Some input bytes were not read");
9128 }
9129 return value;
9130}
9131
9132} // end of namespace Acir
9133
9134template <>
9135template <typename Serializer>
9137 Serializer& serializer)
9138{
9139 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
9140 serde::Serializable<decltype(obj.op)>::serialize(obj.op, serializer);
9141 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
9142 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
9143}
9144
9145template <>
9146template <typename Deserializer>
9148 Deserializer& deserializer)
9149{
9151 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
9152 obj.op = serde::Deserializable<decltype(obj.op)>::deserialize(deserializer);
9153 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
9154 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
9155 return obj;
9156}
9157
9158namespace Acir {
9159
9161{
9162 if (!(lhs.destination == rhs.destination)) {
9163 return false;
9164 }
9165 if (!(lhs.op == rhs.op)) {
9166 return false;
9167 }
9168 if (!(lhs.bit_size == rhs.bit_size)) {
9169 return false;
9170 }
9171 if (!(lhs.lhs == rhs.lhs)) {
9172 return false;
9173 }
9174 if (!(lhs.rhs == rhs.rhs)) {
9175 return false;
9176 }
9177 return true;
9178}
9179
9180inline std::vector<uint8_t> BrilligOpcode::BinaryIntOp::bincodeSerialize() const
9181{
9182 auto serializer = serde::BincodeSerializer();
9184 return std::move(serializer).bytes();
9185}
9186
9188{
9189 auto deserializer = serde::BincodeDeserializer(input);
9191 if (deserializer.get_buffer_offset() < input.size()) {
9192 throw_or_abort("Some input bytes were not read");
9193 }
9194 return value;
9195}
9196
9197} // end of namespace Acir
9198
9199template <>
9200template <typename Serializer>
9202 Serializer& serializer)
9203{
9204 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
9205 serde::Serializable<decltype(obj.op)>::serialize(obj.op, serializer);
9206 serde::Serializable<decltype(obj.bit_size)>::serialize(obj.bit_size, serializer);
9207 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
9208 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
9209}
9210
9211template <>
9212template <typename Deserializer>
9214 Deserializer& deserializer)
9215{
9217 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
9218 obj.op = serde::Deserializable<decltype(obj.op)>::deserialize(deserializer);
9219 obj.bit_size = serde::Deserializable<decltype(obj.bit_size)>::deserialize(deserializer);
9220 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
9221 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
9222 return obj;
9223}
9224
9225namespace Acir {
9226
9227inline bool operator==(const BrilligOpcode::Not& lhs, const BrilligOpcode::Not& rhs)
9228{
9229 if (!(lhs.destination == rhs.destination)) {
9230 return false;
9231 }
9232 if (!(lhs.source == rhs.source)) {
9233 return false;
9234 }
9235 if (!(lhs.bit_size == rhs.bit_size)) {
9236 return false;
9237 }
9238 return true;
9239}
9240
9241inline std::vector<uint8_t> BrilligOpcode::Not::bincodeSerialize() const
9242{
9243 auto serializer = serde::BincodeSerializer();
9245 return std::move(serializer).bytes();
9246}
9247
9249{
9250 auto deserializer = serde::BincodeDeserializer(input);
9252 if (deserializer.get_buffer_offset() < input.size()) {
9253 throw_or_abort("Some input bytes were not read");
9254 }
9255 return value;
9256}
9257
9258} // end of namespace Acir
9259
9260template <>
9261template <typename Serializer>
9263 Serializer& serializer)
9264{
9265 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
9266 serde::Serializable<decltype(obj.source)>::serialize(obj.source, serializer);
9267 serde::Serializable<decltype(obj.bit_size)>::serialize(obj.bit_size, serializer);
9268}
9269
9270template <>
9271template <typename Deserializer>
9273{
9275 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
9276 obj.source = serde::Deserializable<decltype(obj.source)>::deserialize(deserializer);
9277 obj.bit_size = serde::Deserializable<decltype(obj.bit_size)>::deserialize(deserializer);
9278 return obj;
9279}
9280
9281namespace Acir {
9282
9283inline bool operator==(const BrilligOpcode::Cast& lhs, const BrilligOpcode::Cast& rhs)
9284{
9285 if (!(lhs.destination == rhs.destination)) {
9286 return false;
9287 }
9288 if (!(lhs.source == rhs.source)) {
9289 return false;
9290 }
9291 if (!(lhs.bit_size == rhs.bit_size)) {
9292 return false;
9293 }
9294 return true;
9295}
9296
9297inline std::vector<uint8_t> BrilligOpcode::Cast::bincodeSerialize() const
9298{
9299 auto serializer = serde::BincodeSerializer();
9301 return std::move(serializer).bytes();
9302}
9303
9305{
9306 auto deserializer = serde::BincodeDeserializer(input);
9308 if (deserializer.get_buffer_offset() < input.size()) {
9309 throw_or_abort("Some input bytes were not read");
9310 }
9311 return value;
9312}
9313
9314} // end of namespace Acir
9315
9316template <>
9317template <typename Serializer>
9319 Serializer& serializer)
9320{
9321 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
9322 serde::Serializable<decltype(obj.source)>::serialize(obj.source, serializer);
9323 serde::Serializable<decltype(obj.bit_size)>::serialize(obj.bit_size, serializer);
9324}
9325
9326template <>
9327template <typename Deserializer>
9329{
9331 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
9332 obj.source = serde::Deserializable<decltype(obj.source)>::deserialize(deserializer);
9333 obj.bit_size = serde::Deserializable<decltype(obj.bit_size)>::deserialize(deserializer);
9334 return obj;
9335}
9336
9337namespace Acir {
9338
9340{
9341 if (!(lhs.condition == rhs.condition)) {
9342 return false;
9343 }
9344 if (!(lhs.location == rhs.location)) {
9345 return false;
9346 }
9347 return true;
9348}
9349
9350inline std::vector<uint8_t> BrilligOpcode::JumpIfNot::bincodeSerialize() const
9351{
9352 auto serializer = serde::BincodeSerializer();
9354 return std::move(serializer).bytes();
9355}
9356
9358{
9359 auto deserializer = serde::BincodeDeserializer(input);
9361 if (deserializer.get_buffer_offset() < input.size()) {
9362 throw_or_abort("Some input bytes were not read");
9363 }
9364 return value;
9365}
9366
9367} // end of namespace Acir
9368
9369template <>
9370template <typename Serializer>
9372 Serializer& serializer)
9373{
9374 serde::Serializable<decltype(obj.condition)>::serialize(obj.condition, serializer);
9375 serde::Serializable<decltype(obj.location)>::serialize(obj.location, serializer);
9376}
9377
9378template <>
9379template <typename Deserializer>
9381 Deserializer& deserializer)
9382{
9384 obj.condition = serde::Deserializable<decltype(obj.condition)>::deserialize(deserializer);
9385 obj.location = serde::Deserializable<decltype(obj.location)>::deserialize(deserializer);
9386 return obj;
9387}
9388
9389namespace Acir {
9390
9391inline bool operator==(const BrilligOpcode::JumpIf& lhs, const BrilligOpcode::JumpIf& rhs)
9392{
9393 if (!(lhs.condition == rhs.condition)) {
9394 return false;
9395 }
9396 if (!(lhs.location == rhs.location)) {
9397 return false;
9398 }
9399 return true;
9400}
9401
9402inline std::vector<uint8_t> BrilligOpcode::JumpIf::bincodeSerialize() const
9403{
9404 auto serializer = serde::BincodeSerializer();
9406 return std::move(serializer).bytes();
9407}
9408
9410{
9411 auto deserializer = serde::BincodeDeserializer(input);
9413 if (deserializer.get_buffer_offset() < input.size()) {
9414 throw_or_abort("Some input bytes were not read");
9415 }
9416 return value;
9417}
9418
9419} // end of namespace Acir
9420
9421template <>
9422template <typename Serializer>
9424 Serializer& serializer)
9425{
9426 serde::Serializable<decltype(obj.condition)>::serialize(obj.condition, serializer);
9427 serde::Serializable<decltype(obj.location)>::serialize(obj.location, serializer);
9428}
9429
9430template <>
9431template <typename Deserializer>
9433{
9435 obj.condition = serde::Deserializable<decltype(obj.condition)>::deserialize(deserializer);
9436 obj.location = serde::Deserializable<decltype(obj.location)>::deserialize(deserializer);
9437 return obj;
9438}
9439
9440namespace Acir {
9441
9442inline bool operator==(const BrilligOpcode::Jump& lhs, const BrilligOpcode::Jump& rhs)
9443{
9444 if (!(lhs.location == rhs.location)) {
9445 return false;
9446 }
9447 return true;
9448}
9449
9450inline std::vector<uint8_t> BrilligOpcode::Jump::bincodeSerialize() const
9451{
9452 auto serializer = serde::BincodeSerializer();
9454 return std::move(serializer).bytes();
9455}
9456
9458{
9459 auto deserializer = serde::BincodeDeserializer(input);
9461 if (deserializer.get_buffer_offset() < input.size()) {
9462 throw_or_abort("Some input bytes were not read");
9463 }
9464 return value;
9465}
9466
9467} // end of namespace Acir
9468
9469template <>
9470template <typename Serializer>
9472 Serializer& serializer)
9473{
9474 serde::Serializable<decltype(obj.location)>::serialize(obj.location, serializer);
9475}
9476
9477template <>
9478template <typename Deserializer>
9480{
9482 obj.location = serde::Deserializable<decltype(obj.location)>::deserialize(deserializer);
9483 return obj;
9484}
9485
9486namespace Acir {
9487
9489{
9490 if (!(lhs.destination_address == rhs.destination_address)) {
9491 return false;
9492 }
9493 if (!(lhs.size_address == rhs.size_address)) {
9494 return false;
9495 }
9496 if (!(lhs.offset_address == rhs.offset_address)) {
9497 return false;
9498 }
9499 return true;
9500}
9501
9502inline std::vector<uint8_t> BrilligOpcode::CalldataCopy::bincodeSerialize() const
9503{
9504 auto serializer = serde::BincodeSerializer();
9506 return std::move(serializer).bytes();
9507}
9508
9510{
9511 auto deserializer = serde::BincodeDeserializer(input);
9513 if (deserializer.get_buffer_offset() < input.size()) {
9514 throw_or_abort("Some input bytes were not read");
9515 }
9516 return value;
9517}
9518
9519} // end of namespace Acir
9520
9521template <>
9522template <typename Serializer>
9524 Serializer& serializer)
9525{
9526 serde::Serializable<decltype(obj.destination_address)>::serialize(obj.destination_address, serializer);
9527 serde::Serializable<decltype(obj.size_address)>::serialize(obj.size_address, serializer);
9528 serde::Serializable<decltype(obj.offset_address)>::serialize(obj.offset_address, serializer);
9529}
9530
9531template <>
9532template <typename Deserializer>
9534 Deserializer& deserializer)
9535{
9537 obj.destination_address = serde::Deserializable<decltype(obj.destination_address)>::deserialize(deserializer);
9538 obj.size_address = serde::Deserializable<decltype(obj.size_address)>::deserialize(deserializer);
9539 obj.offset_address = serde::Deserializable<decltype(obj.offset_address)>::deserialize(deserializer);
9540 return obj;
9541}
9542
9543namespace Acir {
9544
9545inline bool operator==(const BrilligOpcode::Call& lhs, const BrilligOpcode::Call& rhs)
9546{
9547 if (!(lhs.location == rhs.location)) {
9548 return false;
9549 }
9550 return true;
9551}
9552
9553inline std::vector<uint8_t> BrilligOpcode::Call::bincodeSerialize() const
9554{
9555 auto serializer = serde::BincodeSerializer();
9557 return std::move(serializer).bytes();
9558}
9559
9561{
9562 auto deserializer = serde::BincodeDeserializer(input);
9564 if (deserializer.get_buffer_offset() < input.size()) {
9565 throw_or_abort("Some input bytes were not read");
9566 }
9567 return value;
9568}
9569
9570} // end of namespace Acir
9571
9572template <>
9573template <typename Serializer>
9575 Serializer& serializer)
9576{
9577 serde::Serializable<decltype(obj.location)>::serialize(obj.location, serializer);
9578}
9579
9580template <>
9581template <typename Deserializer>
9583{
9585 obj.location = serde::Deserializable<decltype(obj.location)>::deserialize(deserializer);
9586 return obj;
9587}
9588
9589namespace Acir {
9590
9591inline bool operator==(const BrilligOpcode::Const& lhs, const BrilligOpcode::Const& rhs)
9592{
9593 if (!(lhs.destination == rhs.destination)) {
9594 return false;
9595 }
9596 if (!(lhs.bit_size == rhs.bit_size)) {
9597 return false;
9598 }
9599 if (!(lhs.value == rhs.value)) {
9600 return false;
9601 }
9602 return true;
9603}
9604
9605inline std::vector<uint8_t> BrilligOpcode::Const::bincodeSerialize() const
9606{
9607 auto serializer = serde::BincodeSerializer();
9609 return std::move(serializer).bytes();
9610}
9611
9613{
9614 auto deserializer = serde::BincodeDeserializer(input);
9616 if (deserializer.get_buffer_offset() < input.size()) {
9617 throw_or_abort("Some input bytes were not read");
9618 }
9619 return value;
9620}
9621
9622} // end of namespace Acir
9623
9624template <>
9625template <typename Serializer>
9627 Serializer& serializer)
9628{
9629 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
9630 serde::Serializable<decltype(obj.bit_size)>::serialize(obj.bit_size, serializer);
9631 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9632}
9633
9634template <>
9635template <typename Deserializer>
9637{
9639 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
9640 obj.bit_size = serde::Deserializable<decltype(obj.bit_size)>::deserialize(deserializer);
9641 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9642 return obj;
9643}
9644
9645namespace Acir {
9646
9648{
9649 if (!(lhs.destination_pointer == rhs.destination_pointer)) {
9650 return false;
9651 }
9652 if (!(lhs.bit_size == rhs.bit_size)) {
9653 return false;
9654 }
9655 if (!(lhs.value == rhs.value)) {
9656 return false;
9657 }
9658 return true;
9659}
9660
9661inline std::vector<uint8_t> BrilligOpcode::IndirectConst::bincodeSerialize() const
9662{
9663 auto serializer = serde::BincodeSerializer();
9665 return std::move(serializer).bytes();
9666}
9667
9669{
9670 auto deserializer = serde::BincodeDeserializer(input);
9672 if (deserializer.get_buffer_offset() < input.size()) {
9673 throw_or_abort("Some input bytes were not read");
9674 }
9675 return value;
9676}
9677
9678} // end of namespace Acir
9679
9680template <>
9681template <typename Serializer>
9683 Serializer& serializer)
9684{
9685 serde::Serializable<decltype(obj.destination_pointer)>::serialize(obj.destination_pointer, serializer);
9686 serde::Serializable<decltype(obj.bit_size)>::serialize(obj.bit_size, serializer);
9687 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9688}
9689
9690template <>
9691template <typename Deserializer>
9693 Deserializer& deserializer)
9694{
9696 obj.destination_pointer = serde::Deserializable<decltype(obj.destination_pointer)>::deserialize(deserializer);
9697 obj.bit_size = serde::Deserializable<decltype(obj.bit_size)>::deserialize(deserializer);
9698 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9699 return obj;
9700}
9701
9702namespace Acir {
9703
9704inline bool operator==(const BrilligOpcode::Return& lhs, const BrilligOpcode::Return& rhs)
9705{
9706 return true;
9707}
9708
9709inline std::vector<uint8_t> BrilligOpcode::Return::bincodeSerialize() const
9710{
9711 auto serializer = serde::BincodeSerializer();
9713 return std::move(serializer).bytes();
9714}
9715
9717{
9718 auto deserializer = serde::BincodeDeserializer(input);
9720 if (deserializer.get_buffer_offset() < input.size()) {
9721 throw_or_abort("Some input bytes were not read");
9722 }
9723 return value;
9724}
9725
9726} // end of namespace Acir
9727
9728template <>
9729template <typename Serializer>
9733
9734template <>
9735template <typename Deserializer>
9741
9742namespace Acir {
9743
9745{
9746 if (!(lhs.function == rhs.function)) {
9747 return false;
9748 }
9749 if (!(lhs.destinations == rhs.destinations)) {
9750 return false;
9751 }
9753 return false;
9754 }
9755 if (!(lhs.inputs == rhs.inputs)) {
9756 return false;
9757 }
9758 if (!(lhs.input_value_types == rhs.input_value_types)) {
9759 return false;
9760 }
9761 return true;
9762}
9763
9764inline std::vector<uint8_t> BrilligOpcode::ForeignCall::bincodeSerialize() const
9765{
9766 auto serializer = serde::BincodeSerializer();
9768 return std::move(serializer).bytes();
9769}
9770
9772{
9773 auto deserializer = serde::BincodeDeserializer(input);
9775 if (deserializer.get_buffer_offset() < input.size()) {
9776 throw_or_abort("Some input bytes were not read");
9777 }
9778 return value;
9779}
9780
9781} // end of namespace Acir
9782
9783template <>
9784template <typename Serializer>
9786 Serializer& serializer)
9787{
9788 serde::Serializable<decltype(obj.function)>::serialize(obj.function, serializer);
9789 serde::Serializable<decltype(obj.destinations)>::serialize(obj.destinations, serializer);
9790 serde::Serializable<decltype(obj.destination_value_types)>::serialize(obj.destination_value_types, serializer);
9791 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
9792 serde::Serializable<decltype(obj.input_value_types)>::serialize(obj.input_value_types, serializer);
9793}
9794
9795template <>
9796template <typename Deserializer>
9798 Deserializer& deserializer)
9799{
9801 obj.function = serde::Deserializable<decltype(obj.function)>::deserialize(deserializer);
9802 obj.destinations = serde::Deserializable<decltype(obj.destinations)>::deserialize(deserializer);
9804 serde::Deserializable<decltype(obj.destination_value_types)>::deserialize(deserializer);
9805 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
9806 obj.input_value_types = serde::Deserializable<decltype(obj.input_value_types)>::deserialize(deserializer);
9807 return obj;
9808}
9809
9810namespace Acir {
9811
9812inline bool operator==(const BrilligOpcode::Mov& lhs, const BrilligOpcode::Mov& rhs)
9813{
9814 if (!(lhs.destination == rhs.destination)) {
9815 return false;
9816 }
9817 if (!(lhs.source == rhs.source)) {
9818 return false;
9819 }
9820 return true;
9821}
9822
9823inline std::vector<uint8_t> BrilligOpcode::Mov::bincodeSerialize() const
9824{
9825 auto serializer = serde::BincodeSerializer();
9827 return std::move(serializer).bytes();
9828}
9829
9831{
9832 auto deserializer = serde::BincodeDeserializer(input);
9834 if (deserializer.get_buffer_offset() < input.size()) {
9835 throw_or_abort("Some input bytes were not read");
9836 }
9837 return value;
9838}
9839
9840} // end of namespace Acir
9841
9842template <>
9843template <typename Serializer>
9845 Serializer& serializer)
9846{
9847 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
9848 serde::Serializable<decltype(obj.source)>::serialize(obj.source, serializer);
9849}
9850
9851template <>
9852template <typename Deserializer>
9854{
9856 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
9857 obj.source = serde::Deserializable<decltype(obj.source)>::deserialize(deserializer);
9858 return obj;
9859}
9860
9861namespace Acir {
9862
9864{
9865 if (!(lhs.destination == rhs.destination)) {
9866 return false;
9867 }
9868 if (!(lhs.source_a == rhs.source_a)) {
9869 return false;
9870 }
9871 if (!(lhs.source_b == rhs.source_b)) {
9872 return false;
9873 }
9874 if (!(lhs.condition == rhs.condition)) {
9875 return false;
9876 }
9877 return true;
9878}
9879
9880inline std::vector<uint8_t> BrilligOpcode::ConditionalMov::bincodeSerialize() const
9881{
9882 auto serializer = serde::BincodeSerializer();
9884 return std::move(serializer).bytes();
9885}
9886
9888{
9889 auto deserializer = serde::BincodeDeserializer(input);
9891 if (deserializer.get_buffer_offset() < input.size()) {
9892 throw_or_abort("Some input bytes were not read");
9893 }
9894 return value;
9895}
9896
9897} // end of namespace Acir
9898
9899template <>
9900template <typename Serializer>
9902 Serializer& serializer)
9903{
9904 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
9905 serde::Serializable<decltype(obj.source_a)>::serialize(obj.source_a, serializer);
9906 serde::Serializable<decltype(obj.source_b)>::serialize(obj.source_b, serializer);
9907 serde::Serializable<decltype(obj.condition)>::serialize(obj.condition, serializer);
9908}
9909
9910template <>
9911template <typename Deserializer>
9913 Deserializer& deserializer)
9914{
9916 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
9917 obj.source_a = serde::Deserializable<decltype(obj.source_a)>::deserialize(deserializer);
9918 obj.source_b = serde::Deserializable<decltype(obj.source_b)>::deserialize(deserializer);
9919 obj.condition = serde::Deserializable<decltype(obj.condition)>::deserialize(deserializer);
9920 return obj;
9921}
9922
9923namespace Acir {
9924
9925inline bool operator==(const BrilligOpcode::Load& lhs, const BrilligOpcode::Load& rhs)
9926{
9927 if (!(lhs.destination == rhs.destination)) {
9928 return false;
9929 }
9930 if (!(lhs.source_pointer == rhs.source_pointer)) {
9931 return false;
9932 }
9933 return true;
9934}
9935
9936inline std::vector<uint8_t> BrilligOpcode::Load::bincodeSerialize() const
9937{
9938 auto serializer = serde::BincodeSerializer();
9940 return std::move(serializer).bytes();
9941}
9942
9944{
9945 auto deserializer = serde::BincodeDeserializer(input);
9947 if (deserializer.get_buffer_offset() < input.size()) {
9948 throw_or_abort("Some input bytes were not read");
9949 }
9950 return value;
9951}
9952
9953} // end of namespace Acir
9954
9955template <>
9956template <typename Serializer>
9958 Serializer& serializer)
9959{
9960 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
9961 serde::Serializable<decltype(obj.source_pointer)>::serialize(obj.source_pointer, serializer);
9962}
9963
9964template <>
9965template <typename Deserializer>
9967{
9969 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
9970 obj.source_pointer = serde::Deserializable<decltype(obj.source_pointer)>::deserialize(deserializer);
9971 return obj;
9972}
9973
9974namespace Acir {
9975
9976inline bool operator==(const BrilligOpcode::Store& lhs, const BrilligOpcode::Store& rhs)
9977{
9978 if (!(lhs.destination_pointer == rhs.destination_pointer)) {
9979 return false;
9980 }
9981 if (!(lhs.source == rhs.source)) {
9982 return false;
9983 }
9984 return true;
9985}
9986
9987inline std::vector<uint8_t> BrilligOpcode::Store::bincodeSerialize() const
9988{
9989 auto serializer = serde::BincodeSerializer();
9991 return std::move(serializer).bytes();
9992}
9993
9994inline BrilligOpcode::Store BrilligOpcode::Store::bincodeDeserialize(std::vector<uint8_t> input)
9995{
9996 auto deserializer = serde::BincodeDeserializer(input);
9998 if (deserializer.get_buffer_offset() < input.size()) {
9999 throw_or_abort("Some input bytes were not read");
10000 }
10001 return value;
10002}
10003
10004} // end of namespace Acir
10005
10006template <>
10007template <typename Serializer>
10009 Serializer& serializer)
10010{
10011 serde::Serializable<decltype(obj.destination_pointer)>::serialize(obj.destination_pointer, serializer);
10012 serde::Serializable<decltype(obj.source)>::serialize(obj.source, serializer);
10013}
10014
10015template <>
10016template <typename Deserializer>
10018{
10020 obj.destination_pointer = serde::Deserializable<decltype(obj.destination_pointer)>::deserialize(deserializer);
10021 obj.source = serde::Deserializable<decltype(obj.source)>::deserialize(deserializer);
10022 return obj;
10023}
10024
10025namespace Acir {
10026
10028{
10029 if (!(lhs.value == rhs.value)) {
10030 return false;
10031 }
10032 return true;
10033}
10034
10035inline std::vector<uint8_t> BrilligOpcode::BlackBox::bincodeSerialize() const
10036{
10037 auto serializer = serde::BincodeSerializer();
10039 return std::move(serializer).bytes();
10040}
10041
10043{
10044 auto deserializer = serde::BincodeDeserializer(input);
10046 if (deserializer.get_buffer_offset() < input.size()) {
10047 throw_or_abort("Some input bytes were not read");
10048 }
10049 return value;
10050}
10051
10052} // end of namespace Acir
10053
10054template <>
10055template <typename Serializer>
10057 Serializer& serializer)
10058{
10059 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10060}
10061
10062template <>
10063template <typename Deserializer>
10065 Deserializer& deserializer)
10066{
10068 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10069 return obj;
10070}
10071
10072namespace Acir {
10073
10074inline bool operator==(const BrilligOpcode::Trap& lhs, const BrilligOpcode::Trap& rhs)
10075{
10076 if (!(lhs.revert_data == rhs.revert_data)) {
10077 return false;
10078 }
10079 return true;
10080}
10081
10082inline std::vector<uint8_t> BrilligOpcode::Trap::bincodeSerialize() const
10083{
10084 auto serializer = serde::BincodeSerializer();
10086 return std::move(serializer).bytes();
10087}
10088
10090{
10091 auto deserializer = serde::BincodeDeserializer(input);
10093 if (deserializer.get_buffer_offset() < input.size()) {
10094 throw_or_abort("Some input bytes were not read");
10095 }
10096 return value;
10097}
10098
10099} // end of namespace Acir
10100
10101template <>
10102template <typename Serializer>
10104 Serializer& serializer)
10105{
10106 serde::Serializable<decltype(obj.revert_data)>::serialize(obj.revert_data, serializer);
10107}
10108
10109template <>
10110template <typename Deserializer>
10112{
10114 obj.revert_data = serde::Deserializable<decltype(obj.revert_data)>::deserialize(deserializer);
10115 return obj;
10116}
10117
10118namespace Acir {
10119
10120inline bool operator==(const BrilligOpcode::Stop& lhs, const BrilligOpcode::Stop& rhs)
10121{
10122 if (!(lhs.return_data == rhs.return_data)) {
10123 return false;
10124 }
10125 return true;
10126}
10127
10128inline std::vector<uint8_t> BrilligOpcode::Stop::bincodeSerialize() const
10129{
10130 auto serializer = serde::BincodeSerializer();
10132 return std::move(serializer).bytes();
10133}
10134
10136{
10137 auto deserializer = serde::BincodeDeserializer(input);
10139 if (deserializer.get_buffer_offset() < input.size()) {
10140 throw_or_abort("Some input bytes were not read");
10141 }
10142 return value;
10143}
10144
10145} // end of namespace Acir
10146
10147template <>
10148template <typename Serializer>
10150 Serializer& serializer)
10151{
10152 serde::Serializable<decltype(obj.return_data)>::serialize(obj.return_data, serializer);
10153}
10154
10155template <>
10156template <typename Deserializer>
10158{
10160 obj.return_data = serde::Deserializable<decltype(obj.return_data)>::deserialize(deserializer);
10161 return obj;
10162}
10163
10164namespace Acir {
10165
10166inline bool operator==(const BrilligOutputs& lhs, const BrilligOutputs& rhs)
10167{
10168 if (!(lhs.value == rhs.value)) {
10169 return false;
10170 }
10171 return true;
10172}
10173
10174inline std::vector<uint8_t> BrilligOutputs::bincodeSerialize() const
10175{
10176 auto serializer = serde::BincodeSerializer();
10178 return std::move(serializer).bytes();
10179}
10180
10181inline BrilligOutputs BrilligOutputs::bincodeDeserialize(std::vector<uint8_t> input)
10182{
10183 auto deserializer = serde::BincodeDeserializer(input);
10185 if (deserializer.get_buffer_offset() < input.size()) {
10186 throw_or_abort("Some input bytes were not read");
10187 }
10188 return value;
10189}
10190
10191} // end of namespace Acir
10192
10193template <>
10194template <typename Serializer>
10196{
10197 serializer.increase_container_depth();
10198 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10199 serializer.decrease_container_depth();
10200}
10201
10202template <>
10203template <typename Deserializer>
10205{
10206 deserializer.increase_container_depth();
10208 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10209 deserializer.decrease_container_depth();
10210 return obj;
10211}
10212
10213namespace Acir {
10214
10216{
10217 if (!(lhs.value == rhs.value)) {
10218 return false;
10219 }
10220 return true;
10221}
10222
10223inline std::vector<uint8_t> BrilligOutputs::Simple::bincodeSerialize() const
10224{
10225 auto serializer = serde::BincodeSerializer();
10227 return std::move(serializer).bytes();
10228}
10229
10231{
10232 auto deserializer = serde::BincodeDeserializer(input);
10234 if (deserializer.get_buffer_offset() < input.size()) {
10235 throw_or_abort("Some input bytes were not read");
10236 }
10237 return value;
10238}
10239
10240} // end of namespace Acir
10241
10242template <>
10243template <typename Serializer>
10245 Serializer& serializer)
10246{
10247 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10248}
10249
10250template <>
10251template <typename Deserializer>
10253 Deserializer& deserializer)
10254{
10256 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10257 return obj;
10258}
10259
10260namespace Acir {
10261
10262inline bool operator==(const BrilligOutputs::Array& lhs, const BrilligOutputs::Array& rhs)
10263{
10264 if (!(lhs.value == rhs.value)) {
10265 return false;
10266 }
10267 return true;
10268}
10269
10270inline std::vector<uint8_t> BrilligOutputs::Array::bincodeSerialize() const
10271{
10272 auto serializer = serde::BincodeSerializer();
10274 return std::move(serializer).bytes();
10275}
10276
10278{
10279 auto deserializer = serde::BincodeDeserializer(input);
10281 if (deserializer.get_buffer_offset() < input.size()) {
10282 throw_or_abort("Some input bytes were not read");
10283 }
10284 return value;
10285}
10286
10287} // end of namespace Acir
10288
10289template <>
10290template <typename Serializer>
10292 Serializer& serializer)
10293{
10294 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10295}
10296
10297template <>
10298template <typename Deserializer>
10300{
10302 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10303 return obj;
10304}
10305
10306namespace Acir {
10307
10308inline bool operator==(const Circuit& lhs, const Circuit& rhs)
10309{
10310 if (!(lhs.current_witness_index == rhs.current_witness_index)) {
10311 return false;
10312 }
10313 if (!(lhs.opcodes == rhs.opcodes)) {
10314 return false;
10315 }
10316 if (!(lhs.expression_width == rhs.expression_width)) {
10317 return false;
10318 }
10319 if (!(lhs.private_parameters == rhs.private_parameters)) {
10320 return false;
10321 }
10322 if (!(lhs.public_parameters == rhs.public_parameters)) {
10323 return false;
10324 }
10325 if (!(lhs.return_values == rhs.return_values)) {
10326 return false;
10327 }
10328 if (!(lhs.assert_messages == rhs.assert_messages)) {
10329 return false;
10330 }
10331 return true;
10332}
10333
10334inline std::vector<uint8_t> Circuit::bincodeSerialize() const
10335{
10336 auto serializer = serde::BincodeSerializer();
10337 serde::Serializable<Circuit>::serialize(*this, serializer);
10338 return std::move(serializer).bytes();
10339}
10340
10341inline Circuit Circuit::bincodeDeserialize(std::vector<uint8_t> input)
10342{
10343 auto deserializer = serde::BincodeDeserializer(input);
10345 if (deserializer.get_buffer_offset() < input.size()) {
10346 throw_or_abort("Some input bytes were not read");
10347 }
10348 return value;
10349}
10350
10351} // end of namespace Acir
10352
10353template <>
10354template <typename Serializer>
10355void serde::Serializable<Acir::Circuit>::serialize(const Acir::Circuit& obj, Serializer& serializer)
10356{
10357 serializer.increase_container_depth();
10358 serde::Serializable<decltype(obj.current_witness_index)>::serialize(obj.current_witness_index, serializer);
10359 serde::Serializable<decltype(obj.opcodes)>::serialize(obj.opcodes, serializer);
10360 serde::Serializable<decltype(obj.expression_width)>::serialize(obj.expression_width, serializer);
10361 serde::Serializable<decltype(obj.private_parameters)>::serialize(obj.private_parameters, serializer);
10362 serde::Serializable<decltype(obj.public_parameters)>::serialize(obj.public_parameters, serializer);
10363 serde::Serializable<decltype(obj.return_values)>::serialize(obj.return_values, serializer);
10364 serde::Serializable<decltype(obj.assert_messages)>::serialize(obj.assert_messages, serializer);
10365 serializer.decrease_container_depth();
10366}
10367
10368template <>
10369template <typename Deserializer>
10371{
10372 deserializer.increase_container_depth();
10373 Acir::Circuit obj;
10374 obj.current_witness_index = serde::Deserializable<decltype(obj.current_witness_index)>::deserialize(deserializer);
10375 obj.opcodes = serde::Deserializable<decltype(obj.opcodes)>::deserialize(deserializer);
10376 obj.expression_width = serde::Deserializable<decltype(obj.expression_width)>::deserialize(deserializer);
10377 obj.private_parameters = serde::Deserializable<decltype(obj.private_parameters)>::deserialize(deserializer);
10378 obj.public_parameters = serde::Deserializable<decltype(obj.public_parameters)>::deserialize(deserializer);
10379 obj.return_values = serde::Deserializable<decltype(obj.return_values)>::deserialize(deserializer);
10380 obj.assert_messages = serde::Deserializable<decltype(obj.assert_messages)>::deserialize(deserializer);
10381 deserializer.decrease_container_depth();
10382 return obj;
10383}
10384
10385namespace Acir {
10386
10387inline bool operator==(const ConstantOrWitnessEnum& lhs, const ConstantOrWitnessEnum& rhs)
10388{
10389 if (!(lhs.value == rhs.value)) {
10390 return false;
10391 }
10392 return true;
10393}
10394
10395inline std::vector<uint8_t> ConstantOrWitnessEnum::bincodeSerialize() const
10396{
10397 auto serializer = serde::BincodeSerializer();
10399 return std::move(serializer).bytes();
10400}
10401
10403{
10404 auto deserializer = serde::BincodeDeserializer(input);
10406 if (deserializer.get_buffer_offset() < input.size()) {
10407 throw_or_abort("Some input bytes were not read");
10408 }
10409 return value;
10410}
10411
10412} // end of namespace Acir
10413
10414template <>
10415template <typename Serializer>
10417 Serializer& serializer)
10418{
10419 serializer.increase_container_depth();
10420 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10421 serializer.decrease_container_depth();
10422}
10423
10424template <>
10425template <typename Deserializer>
10427{
10428 deserializer.increase_container_depth();
10430 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10431 deserializer.decrease_container_depth();
10432 return obj;
10433}
10434
10435namespace Acir {
10436
10438{
10439 if (!(lhs.value == rhs.value)) {
10440 return false;
10441 }
10442 return true;
10443}
10444
10445inline std::vector<uint8_t> ConstantOrWitnessEnum::Constant::bincodeSerialize() const
10446{
10447 auto serializer = serde::BincodeSerializer();
10449 return std::move(serializer).bytes();
10450}
10451
10453{
10454 auto deserializer = serde::BincodeDeserializer(input);
10456 if (deserializer.get_buffer_offset() < input.size()) {
10457 throw_or_abort("Some input bytes were not read");
10458 }
10459 return value;
10460}
10461
10462} // end of namespace Acir
10463
10464template <>
10465template <typename Serializer>
10467 const Acir::ConstantOrWitnessEnum::Constant& obj, Serializer& serializer)
10468{
10469 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10470}
10471
10472template <>
10473template <typename Deserializer>
10475 Deserializer& deserializer)
10476{
10478 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10479 return obj;
10480}
10481
10482namespace Acir {
10483
10485{
10486 if (!(lhs.value == rhs.value)) {
10487 return false;
10488 }
10489 return true;
10490}
10491
10492inline std::vector<uint8_t> ConstantOrWitnessEnum::Witness::bincodeSerialize() const
10493{
10494 auto serializer = serde::BincodeSerializer();
10496 return std::move(serializer).bytes();
10497}
10498
10500{
10501 auto deserializer = serde::BincodeDeserializer(input);
10503 if (deserializer.get_buffer_offset() < input.size()) {
10504 throw_or_abort("Some input bytes were not read");
10505 }
10506 return value;
10507}
10508
10509} // end of namespace Acir
10510
10511template <>
10512template <typename Serializer>
10514 const Acir::ConstantOrWitnessEnum::Witness& obj, Serializer& serializer)
10515{
10516 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10517}
10518
10519template <>
10520template <typename Deserializer>
10522 Deserializer& deserializer)
10523{
10525 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10526 return obj;
10527}
10528
10529namespace Acir {
10530
10531inline bool operator==(const Expression& lhs, const Expression& rhs)
10532{
10533 if (!(lhs.mul_terms == rhs.mul_terms)) {
10534 return false;
10535 }
10536 if (!(lhs.linear_combinations == rhs.linear_combinations)) {
10537 return false;
10538 }
10539 if (!(lhs.q_c == rhs.q_c)) {
10540 return false;
10541 }
10542 return true;
10543}
10544
10545inline std::vector<uint8_t> Expression::bincodeSerialize() const
10546{
10547 auto serializer = serde::BincodeSerializer();
10549 return std::move(serializer).bytes();
10550}
10551
10552inline Expression Expression::bincodeDeserialize(std::vector<uint8_t> input)
10553{
10554 auto deserializer = serde::BincodeDeserializer(input);
10556 if (deserializer.get_buffer_offset() < input.size()) {
10557 throw_or_abort("Some input bytes were not read");
10558 }
10559 return value;
10560}
10561
10562} // end of namespace Acir
10563
10564template <>
10565template <typename Serializer>
10567{
10568 serializer.increase_container_depth();
10569 serde::Serializable<decltype(obj.mul_terms)>::serialize(obj.mul_terms, serializer);
10570 serde::Serializable<decltype(obj.linear_combinations)>::serialize(obj.linear_combinations, serializer);
10571 serde::Serializable<decltype(obj.q_c)>::serialize(obj.q_c, serializer);
10572 serializer.decrease_container_depth();
10573}
10574
10575template <>
10576template <typename Deserializer>
10578{
10579 deserializer.increase_container_depth();
10580 Acir::Expression obj;
10581 obj.mul_terms = serde::Deserializable<decltype(obj.mul_terms)>::deserialize(deserializer);
10582 obj.linear_combinations = serde::Deserializable<decltype(obj.linear_combinations)>::deserialize(deserializer);
10583 obj.q_c = serde::Deserializable<decltype(obj.q_c)>::deserialize(deserializer);
10584 deserializer.decrease_container_depth();
10585 return obj;
10586}
10587
10588namespace Acir {
10589
10590inline bool operator==(const ExpressionOrMemory& lhs, const ExpressionOrMemory& rhs)
10591{
10592 if (!(lhs.value == rhs.value)) {
10593 return false;
10594 }
10595 return true;
10596}
10597
10598inline std::vector<uint8_t> ExpressionOrMemory::bincodeSerialize() const
10599{
10600 auto serializer = serde::BincodeSerializer();
10602 return std::move(serializer).bytes();
10603}
10604
10606{
10607 auto deserializer = serde::BincodeDeserializer(input);
10609 if (deserializer.get_buffer_offset() < input.size()) {
10610 throw_or_abort("Some input bytes were not read");
10611 }
10612 return value;
10613}
10614
10615} // end of namespace Acir
10616
10617template <>
10618template <typename Serializer>
10620 Serializer& serializer)
10621{
10622 serializer.increase_container_depth();
10623 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10624 serializer.decrease_container_depth();
10625}
10626
10627template <>
10628template <typename Deserializer>
10630{
10631 deserializer.increase_container_depth();
10633 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10634 deserializer.decrease_container_depth();
10635 return obj;
10636}
10637
10638namespace Acir {
10639
10641{
10642 if (!(lhs.value == rhs.value)) {
10643 return false;
10644 }
10645 return true;
10646}
10647
10648inline std::vector<uint8_t> ExpressionOrMemory::Expression::bincodeSerialize() const
10649{
10650 auto serializer = serde::BincodeSerializer();
10652 return std::move(serializer).bytes();
10653}
10654
10656{
10657 auto deserializer = serde::BincodeDeserializer(input);
10659 if (deserializer.get_buffer_offset() < input.size()) {
10660 throw_or_abort("Some input bytes were not read");
10661 }
10662 return value;
10663}
10664
10665} // end of namespace Acir
10666
10667template <>
10668template <typename Serializer>
10670 const Acir::ExpressionOrMemory::Expression& obj, Serializer& serializer)
10671{
10672 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10673}
10674
10675template <>
10676template <typename Deserializer>
10678 Deserializer& deserializer)
10679{
10681 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10682 return obj;
10683}
10684
10685namespace Acir {
10686
10688{
10689 if (!(lhs.value == rhs.value)) {
10690 return false;
10691 }
10692 return true;
10693}
10694
10695inline std::vector<uint8_t> ExpressionOrMemory::Memory::bincodeSerialize() const
10696{
10697 auto serializer = serde::BincodeSerializer();
10699 return std::move(serializer).bytes();
10700}
10701
10703{
10704 auto deserializer = serde::BincodeDeserializer(input);
10706 if (deserializer.get_buffer_offset() < input.size()) {
10707 throw_or_abort("Some input bytes were not read");
10708 }
10709 return value;
10710}
10711
10712} // end of namespace Acir
10713
10714template <>
10715template <typename Serializer>
10717 Serializer& serializer)
10718{
10719 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10720}
10721
10722template <>
10723template <typename Deserializer>
10725 Deserializer& deserializer)
10726{
10728 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10729 return obj;
10730}
10731
10732namespace Acir {
10733
10734inline bool operator==(const ExpressionWidth& lhs, const ExpressionWidth& rhs)
10735{
10736 if (!(lhs.value == rhs.value)) {
10737 return false;
10738 }
10739 return true;
10740}
10741
10742inline std::vector<uint8_t> ExpressionWidth::bincodeSerialize() const
10743{
10744 auto serializer = serde::BincodeSerializer();
10746 return std::move(serializer).bytes();
10747}
10748
10750{
10751 auto deserializer = serde::BincodeDeserializer(input);
10753 if (deserializer.get_buffer_offset() < input.size()) {
10754 throw_or_abort("Some input bytes were not read");
10755 }
10756 return value;
10757}
10758
10759} // end of namespace Acir
10760
10761template <>
10762template <typename Serializer>
10764{
10765 serializer.increase_container_depth();
10766 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10767 serializer.decrease_container_depth();
10768}
10769
10770template <>
10771template <typename Deserializer>
10773{
10774 deserializer.increase_container_depth();
10776 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10777 deserializer.decrease_container_depth();
10778 return obj;
10779}
10780
10781namespace Acir {
10782
10784{
10785 return true;
10786}
10787
10788inline std::vector<uint8_t> ExpressionWidth::Unbounded::bincodeSerialize() const
10789{
10790 auto serializer = serde::BincodeSerializer();
10792 return std::move(serializer).bytes();
10793}
10794
10796{
10797 auto deserializer = serde::BincodeDeserializer(input);
10799 if (deserializer.get_buffer_offset() < input.size()) {
10800 throw_or_abort("Some input bytes were not read");
10801 }
10802 return value;
10803}
10804
10805} // end of namespace Acir
10806
10807template <>
10808template <typename Serializer>
10812
10813template <>
10814template <typename Deserializer>
10821
10822namespace Acir {
10823
10825{
10826 if (!(lhs.width == rhs.width)) {
10827 return false;
10828 }
10829 return true;
10830}
10831
10832inline std::vector<uint8_t> ExpressionWidth::Bounded::bincodeSerialize() const
10833{
10834 auto serializer = serde::BincodeSerializer();
10836 return std::move(serializer).bytes();
10837}
10838
10840{
10841 auto deserializer = serde::BincodeDeserializer(input);
10843 if (deserializer.get_buffer_offset() < input.size()) {
10844 throw_or_abort("Some input bytes were not read");
10845 }
10846 return value;
10847}
10848
10849} // end of namespace Acir
10850
10851template <>
10852template <typename Serializer>
10854 Serializer& serializer)
10855{
10856 serde::Serializable<decltype(obj.width)>::serialize(obj.width, serializer);
10857}
10858
10859template <>
10860template <typename Deserializer>
10862 Deserializer& deserializer)
10863{
10865 obj.width = serde::Deserializable<decltype(obj.width)>::deserialize(deserializer);
10866 return obj;
10867}
10868
10869namespace Acir {
10870
10871inline bool operator==(const FunctionInput& lhs, const FunctionInput& rhs)
10872{
10873 if (!(lhs.input == rhs.input)) {
10874 return false;
10875 }
10876 if (!(lhs.num_bits == rhs.num_bits)) {
10877 return false;
10878 }
10879 return true;
10880}
10881
10882inline std::vector<uint8_t> FunctionInput::bincodeSerialize() const
10883{
10884 auto serializer = serde::BincodeSerializer();
10886 return std::move(serializer).bytes();
10887}
10888
10889inline FunctionInput FunctionInput::bincodeDeserialize(std::vector<uint8_t> input)
10890{
10891 auto deserializer = serde::BincodeDeserializer(input);
10893 if (deserializer.get_buffer_offset() < input.size()) {
10894 throw_or_abort("Some input bytes were not read");
10895 }
10896 return value;
10897}
10898
10899} // end of namespace Acir
10900
10901template <>
10902template <typename Serializer>
10904{
10905 serializer.increase_container_depth();
10906 serde::Serializable<decltype(obj.input)>::serialize(obj.input, serializer);
10907 serde::Serializable<decltype(obj.num_bits)>::serialize(obj.num_bits, serializer);
10908 serializer.decrease_container_depth();
10909}
10910
10911template <>
10912template <typename Deserializer>
10914{
10915 deserializer.increase_container_depth();
10917 obj.input = serde::Deserializable<decltype(obj.input)>::deserialize(deserializer);
10918 obj.num_bits = serde::Deserializable<decltype(obj.num_bits)>::deserialize(deserializer);
10919 deserializer.decrease_container_depth();
10920 return obj;
10921}
10922
10923namespace Acir {
10924
10925inline bool operator==(const HeapArray& lhs, const HeapArray& rhs)
10926{
10927 if (!(lhs.pointer == rhs.pointer)) {
10928 return false;
10929 }
10930 if (!(lhs.size == rhs.size)) {
10931 return false;
10932 }
10933 return true;
10934}
10935
10936inline std::vector<uint8_t> HeapArray::bincodeSerialize() const
10937{
10938 auto serializer = serde::BincodeSerializer();
10940 return std::move(serializer).bytes();
10941}
10942
10943inline HeapArray HeapArray::bincodeDeserialize(std::vector<uint8_t> input)
10944{
10945 auto deserializer = serde::BincodeDeserializer(input);
10947 if (deserializer.get_buffer_offset() < input.size()) {
10948 throw_or_abort("Some input bytes were not read");
10949 }
10950 return value;
10951}
10952
10953} // end of namespace Acir
10954
10955template <>
10956template <typename Serializer>
10958{
10959 serializer.increase_container_depth();
10960 serde::Serializable<decltype(obj.pointer)>::serialize(obj.pointer, serializer);
10961 serde::Serializable<decltype(obj.size)>::serialize(obj.size, serializer);
10962 serializer.decrease_container_depth();
10963}
10964
10965template <>
10966template <typename Deserializer>
10968{
10969 deserializer.increase_container_depth();
10970 Acir::HeapArray obj;
10971 obj.pointer = serde::Deserializable<decltype(obj.pointer)>::deserialize(deserializer);
10972 obj.size = serde::Deserializable<decltype(obj.size)>::deserialize(deserializer);
10973 deserializer.decrease_container_depth();
10974 return obj;
10975}
10976
10977namespace Acir {
10978
10979inline bool operator==(const HeapValueType& lhs, const HeapValueType& rhs)
10980{
10981 if (!(lhs.value == rhs.value)) {
10982 return false;
10983 }
10984 return true;
10985}
10986
10987inline std::vector<uint8_t> HeapValueType::bincodeSerialize() const
10988{
10989 auto serializer = serde::BincodeSerializer();
10991 return std::move(serializer).bytes();
10992}
10993
10994inline HeapValueType HeapValueType::bincodeDeserialize(std::vector<uint8_t> input)
10995{
10996 auto deserializer = serde::BincodeDeserializer(input);
10998 if (deserializer.get_buffer_offset() < input.size()) {
10999 throw_or_abort("Some input bytes were not read");
11000 }
11001 return value;
11002}
11003
11004} // end of namespace Acir
11005
11006template <>
11007template <typename Serializer>
11009{
11010 serializer.increase_container_depth();
11011 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11012 serializer.decrease_container_depth();
11013}
11014
11015template <>
11016template <typename Deserializer>
11018{
11019 deserializer.increase_container_depth();
11021 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11022 deserializer.decrease_container_depth();
11023 return obj;
11024}
11025
11026namespace Acir {
11027
11028inline bool operator==(const HeapValueType::Simple& lhs, const HeapValueType::Simple& rhs)
11029{
11030 if (!(lhs.value == rhs.value)) {
11031 return false;
11032 }
11033 return true;
11034}
11035
11036inline std::vector<uint8_t> HeapValueType::Simple::bincodeSerialize() const
11037{
11038 auto serializer = serde::BincodeSerializer();
11040 return std::move(serializer).bytes();
11041}
11042
11044{
11045 auto deserializer = serde::BincodeDeserializer(input);
11047 if (deserializer.get_buffer_offset() < input.size()) {
11048 throw_or_abort("Some input bytes were not read");
11049 }
11050 return value;
11051}
11052
11053} // end of namespace Acir
11054
11055template <>
11056template <typename Serializer>
11058 Serializer& serializer)
11059{
11060 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11061}
11062
11063template <>
11064template <typename Deserializer>
11066{
11068 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11069 return obj;
11070}
11071
11072namespace Acir {
11073
11074inline bool operator==(const HeapValueType::Array& lhs, const HeapValueType::Array& rhs)
11075{
11076 if (!(lhs.value_types == rhs.value_types)) {
11077 return false;
11078 }
11079 if (!(lhs.size == rhs.size)) {
11080 return false;
11081 }
11082 return true;
11083}
11084
11085inline std::vector<uint8_t> HeapValueType::Array::bincodeSerialize() const
11086{
11087 auto serializer = serde::BincodeSerializer();
11089 return std::move(serializer).bytes();
11090}
11091
11093{
11094 auto deserializer = serde::BincodeDeserializer(input);
11096 if (deserializer.get_buffer_offset() < input.size()) {
11097 throw_or_abort("Some input bytes were not read");
11098 }
11099 return value;
11100}
11101
11102} // end of namespace Acir
11103
11104template <>
11105template <typename Serializer>
11107 Serializer& serializer)
11108{
11109 serde::Serializable<decltype(obj.value_types)>::serialize(obj.value_types, serializer);
11110 serde::Serializable<decltype(obj.size)>::serialize(obj.size, serializer);
11111}
11112
11113template <>
11114template <typename Deserializer>
11116{
11118 obj.value_types = serde::Deserializable<decltype(obj.value_types)>::deserialize(deserializer);
11119 obj.size = serde::Deserializable<decltype(obj.size)>::deserialize(deserializer);
11120 return obj;
11121}
11122
11123namespace Acir {
11124
11125inline bool operator==(const HeapValueType::Vector& lhs, const HeapValueType::Vector& rhs)
11126{
11127 if (!(lhs.value_types == rhs.value_types)) {
11128 return false;
11129 }
11130 return true;
11131}
11132
11133inline std::vector<uint8_t> HeapValueType::Vector::bincodeSerialize() const
11134{
11135 auto serializer = serde::BincodeSerializer();
11137 return std::move(serializer).bytes();
11138}
11139
11141{
11142 auto deserializer = serde::BincodeDeserializer(input);
11144 if (deserializer.get_buffer_offset() < input.size()) {
11145 throw_or_abort("Some input bytes were not read");
11146 }
11147 return value;
11148}
11149
11150} // end of namespace Acir
11151
11152template <>
11153template <typename Serializer>
11155 Serializer& serializer)
11156{
11157 serde::Serializable<decltype(obj.value_types)>::serialize(obj.value_types, serializer);
11158}
11159
11160template <>
11161template <typename Deserializer>
11163{
11165 obj.value_types = serde::Deserializable<decltype(obj.value_types)>::deserialize(deserializer);
11166 return obj;
11167}
11168
11169namespace Acir {
11170
11171inline bool operator==(const HeapVector& lhs, const HeapVector& rhs)
11172{
11173 if (!(lhs.pointer == rhs.pointer)) {
11174 return false;
11175 }
11176 if (!(lhs.size == rhs.size)) {
11177 return false;
11178 }
11179 return true;
11180}
11181
11182inline std::vector<uint8_t> HeapVector::bincodeSerialize() const
11183{
11184 auto serializer = serde::BincodeSerializer();
11186 return std::move(serializer).bytes();
11187}
11188
11189inline HeapVector HeapVector::bincodeDeserialize(std::vector<uint8_t> input)
11190{
11191 auto deserializer = serde::BincodeDeserializer(input);
11193 if (deserializer.get_buffer_offset() < input.size()) {
11194 throw_or_abort("Some input bytes were not read");
11195 }
11196 return value;
11197}
11198
11199} // end of namespace Acir
11200
11201template <>
11202template <typename Serializer>
11204{
11205 serializer.increase_container_depth();
11206 serde::Serializable<decltype(obj.pointer)>::serialize(obj.pointer, serializer);
11207 serde::Serializable<decltype(obj.size)>::serialize(obj.size, serializer);
11208 serializer.decrease_container_depth();
11209}
11210
11211template <>
11212template <typename Deserializer>
11214{
11215 deserializer.increase_container_depth();
11216 Acir::HeapVector obj;
11217 obj.pointer = serde::Deserializable<decltype(obj.pointer)>::deserialize(deserializer);
11218 obj.size = serde::Deserializable<decltype(obj.size)>::deserialize(deserializer);
11219 deserializer.decrease_container_depth();
11220 return obj;
11221}
11222
11223namespace Acir {
11224
11225inline bool operator==(const IntegerBitSize& lhs, const IntegerBitSize& rhs)
11226{
11227 if (!(lhs.value == rhs.value)) {
11228 return false;
11229 }
11230 return true;
11231}
11232
11233inline std::vector<uint8_t> IntegerBitSize::bincodeSerialize() const
11234{
11235 auto serializer = serde::BincodeSerializer();
11237 return std::move(serializer).bytes();
11238}
11239
11240inline IntegerBitSize IntegerBitSize::bincodeDeserialize(std::vector<uint8_t> input)
11241{
11242 auto deserializer = serde::BincodeDeserializer(input);
11244 if (deserializer.get_buffer_offset() < input.size()) {
11245 throw_or_abort("Some input bytes were not read");
11246 }
11247 return value;
11248}
11249
11250} // end of namespace Acir
11251
11252template <>
11253template <typename Serializer>
11255{
11256 serializer.increase_container_depth();
11257 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11258 serializer.decrease_container_depth();
11259}
11260
11261template <>
11262template <typename Deserializer>
11264{
11265 deserializer.increase_container_depth();
11267 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11268 deserializer.decrease_container_depth();
11269 return obj;
11270}
11271
11272namespace Acir {
11273
11274inline bool operator==(const IntegerBitSize::U1& lhs, const IntegerBitSize::U1& rhs)
11275{
11276 return true;
11277}
11278
11279inline std::vector<uint8_t> IntegerBitSize::U1::bincodeSerialize() const
11280{
11281 auto serializer = serde::BincodeSerializer();
11283 return std::move(serializer).bytes();
11284}
11285
11287{
11288 auto deserializer = serde::BincodeDeserializer(input);
11290 if (deserializer.get_buffer_offset() < input.size()) {
11291 throw_or_abort("Some input bytes were not read");
11292 }
11293 return value;
11294}
11295
11296} // end of namespace Acir
11297
11298template <>
11299template <typename Serializer>
11301 Serializer& serializer)
11302{}
11303
11304template <>
11305template <typename Deserializer>
11311
11312namespace Acir {
11313
11314inline bool operator==(const IntegerBitSize::U8& lhs, const IntegerBitSize::U8& rhs)
11315{
11316 return true;
11317}
11318
11319inline std::vector<uint8_t> IntegerBitSize::U8::bincodeSerialize() const
11320{
11321 auto serializer = serde::BincodeSerializer();
11323 return std::move(serializer).bytes();
11324}
11325
11327{
11328 auto deserializer = serde::BincodeDeserializer(input);
11330 if (deserializer.get_buffer_offset() < input.size()) {
11331 throw_or_abort("Some input bytes were not read");
11332 }
11333 return value;
11334}
11335
11336} // end of namespace Acir
11337
11338template <>
11339template <typename Serializer>
11341 Serializer& serializer)
11342{}
11343
11344template <>
11345template <typename Deserializer>
11351
11352namespace Acir {
11353
11354inline bool operator==(const IntegerBitSize::U16& lhs, const IntegerBitSize::U16& rhs)
11355{
11356 return true;
11357}
11358
11359inline std::vector<uint8_t> IntegerBitSize::U16::bincodeSerialize() const
11360{
11361 auto serializer = serde::BincodeSerializer();
11363 return std::move(serializer).bytes();
11364}
11365
11367{
11368 auto deserializer = serde::BincodeDeserializer(input);
11370 if (deserializer.get_buffer_offset() < input.size()) {
11371 throw_or_abort("Some input bytes were not read");
11372 }
11373 return value;
11374}
11375
11376} // end of namespace Acir
11377
11378template <>
11379template <typename Serializer>
11381 Serializer& serializer)
11382{}
11383
11384template <>
11385template <typename Deserializer>
11391
11392namespace Acir {
11393
11394inline bool operator==(const IntegerBitSize::U32& lhs, const IntegerBitSize::U32& rhs)
11395{
11396 return true;
11397}
11398
11399inline std::vector<uint8_t> IntegerBitSize::U32::bincodeSerialize() const
11400{
11401 auto serializer = serde::BincodeSerializer();
11403 return std::move(serializer).bytes();
11404}
11405
11407{
11408 auto deserializer = serde::BincodeDeserializer(input);
11410 if (deserializer.get_buffer_offset() < input.size()) {
11411 throw_or_abort("Some input bytes were not read");
11412 }
11413 return value;
11414}
11415
11416} // end of namespace Acir
11417
11418template <>
11419template <typename Serializer>
11421 Serializer& serializer)
11422{}
11423
11424template <>
11425template <typename Deserializer>
11431
11432namespace Acir {
11433
11434inline bool operator==(const IntegerBitSize::U64& lhs, const IntegerBitSize::U64& rhs)
11435{
11436 return true;
11437}
11438
11439inline std::vector<uint8_t> IntegerBitSize::U64::bincodeSerialize() const
11440{
11441 auto serializer = serde::BincodeSerializer();
11443 return std::move(serializer).bytes();
11444}
11445
11447{
11448 auto deserializer = serde::BincodeDeserializer(input);
11450 if (deserializer.get_buffer_offset() < input.size()) {
11451 throw_or_abort("Some input bytes were not read");
11452 }
11453 return value;
11454}
11455
11456} // end of namespace Acir
11457
11458template <>
11459template <typename Serializer>
11461 Serializer& serializer)
11462{}
11463
11464template <>
11465template <typename Deserializer>
11471
11472namespace Acir {
11473
11474inline bool operator==(const IntegerBitSize::U128& lhs, const IntegerBitSize::U128& rhs)
11475{
11476 return true;
11477}
11478
11479inline std::vector<uint8_t> IntegerBitSize::U128::bincodeSerialize() const
11480{
11481 auto serializer = serde::BincodeSerializer();
11483 return std::move(serializer).bytes();
11484}
11485
11487{
11488 auto deserializer = serde::BincodeDeserializer(input);
11490 if (deserializer.get_buffer_offset() < input.size()) {
11491 throw_or_abort("Some input bytes were not read");
11492 }
11493 return value;
11494}
11495
11496} // end of namespace Acir
11497
11498template <>
11499template <typename Serializer>
11503
11504template <>
11505template <typename Deserializer>
11511
11512namespace Acir {
11513
11514inline bool operator==(const MemOp& lhs, const MemOp& rhs)
11515{
11516 if (!(lhs.operation == rhs.operation)) {
11517 return false;
11518 }
11519 if (!(lhs.index == rhs.index)) {
11520 return false;
11521 }
11522 if (!(lhs.value == rhs.value)) {
11523 return false;
11524 }
11525 return true;
11526}
11527
11528inline std::vector<uint8_t> MemOp::bincodeSerialize() const
11529{
11530 auto serializer = serde::BincodeSerializer();
11531 serde::Serializable<MemOp>::serialize(*this, serializer);
11532 return std::move(serializer).bytes();
11533}
11534
11535inline MemOp MemOp::bincodeDeserialize(std::vector<uint8_t> input)
11536{
11537 auto deserializer = serde::BincodeDeserializer(input);
11539 if (deserializer.get_buffer_offset() < input.size()) {
11540 throw_or_abort("Some input bytes were not read");
11541 }
11542 return value;
11543}
11544
11545} // end of namespace Acir
11546
11547template <>
11548template <typename Serializer>
11549void serde::Serializable<Acir::MemOp>::serialize(const Acir::MemOp& obj, Serializer& serializer)
11550{
11551 serializer.increase_container_depth();
11552 serde::Serializable<decltype(obj.operation)>::serialize(obj.operation, serializer);
11553 serde::Serializable<decltype(obj.index)>::serialize(obj.index, serializer);
11554 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11555 serializer.decrease_container_depth();
11556}
11557
11558template <>
11559template <typename Deserializer>
11561{
11562 deserializer.increase_container_depth();
11563 Acir::MemOp obj;
11564 obj.operation = serde::Deserializable<decltype(obj.operation)>::deserialize(deserializer);
11565 obj.index = serde::Deserializable<decltype(obj.index)>::deserialize(deserializer);
11566 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11567 deserializer.decrease_container_depth();
11568 return obj;
11569}
11570
11571namespace Acir {
11572
11573inline bool operator==(const MemoryAddress& lhs, const MemoryAddress& rhs)
11574{
11575 if (!(lhs.value == rhs.value)) {
11576 return false;
11577 }
11578 return true;
11579}
11580
11581inline std::vector<uint8_t> MemoryAddress::bincodeSerialize() const
11582{
11583 auto serializer = serde::BincodeSerializer();
11585 return std::move(serializer).bytes();
11586}
11587
11588inline MemoryAddress MemoryAddress::bincodeDeserialize(std::vector<uint8_t> input)
11589{
11590 auto deserializer = serde::BincodeDeserializer(input);
11592 if (deserializer.get_buffer_offset() < input.size()) {
11593 throw_or_abort("Some input bytes were not read");
11594 }
11595 return value;
11596}
11597
11598} // end of namespace Acir
11599
11600template <>
11601template <typename Serializer>
11603{
11604 serializer.increase_container_depth();
11605 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11606 serializer.decrease_container_depth();
11607}
11608
11609template <>
11610template <typename Deserializer>
11612{
11613 deserializer.increase_container_depth();
11615 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11616 deserializer.decrease_container_depth();
11617 return obj;
11618}
11619
11620namespace Acir {
11621
11622inline bool operator==(const MemoryAddress::Direct& lhs, const MemoryAddress::Direct& rhs)
11623{
11624 if (!(lhs.value == rhs.value)) {
11625 return false;
11626 }
11627 return true;
11628}
11629
11630inline std::vector<uint8_t> MemoryAddress::Direct::bincodeSerialize() const
11631{
11632 auto serializer = serde::BincodeSerializer();
11634 return std::move(serializer).bytes();
11635}
11636
11638{
11639 auto deserializer = serde::BincodeDeserializer(input);
11641 if (deserializer.get_buffer_offset() < input.size()) {
11642 throw_or_abort("Some input bytes were not read");
11643 }
11644 return value;
11645}
11646
11647} // end of namespace Acir
11648
11649template <>
11650template <typename Serializer>
11652 Serializer& serializer)
11653{
11654 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11655}
11656
11657template <>
11658template <typename Deserializer>
11660{
11662 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11663 return obj;
11664}
11665
11666namespace Acir {
11667
11669{
11670 if (!(lhs.value == rhs.value)) {
11671 return false;
11672 }
11673 return true;
11674}
11675
11676inline std::vector<uint8_t> MemoryAddress::Relative::bincodeSerialize() const
11677{
11678 auto serializer = serde::BincodeSerializer();
11680 return std::move(serializer).bytes();
11681}
11682
11684{
11685 auto deserializer = serde::BincodeDeserializer(input);
11687 if (deserializer.get_buffer_offset() < input.size()) {
11688 throw_or_abort("Some input bytes were not read");
11689 }
11690 return value;
11691}
11692
11693} // end of namespace Acir
11694
11695template <>
11696template <typename Serializer>
11698 Serializer& serializer)
11699{
11700 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11701}
11702
11703template <>
11704template <typename Deserializer>
11706 Deserializer& deserializer)
11707{
11709 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11710 return obj;
11711}
11712
11713namespace Acir {
11714
11715inline bool operator==(const Opcode& lhs, const Opcode& rhs)
11716{
11717 if (!(lhs.value == rhs.value)) {
11718 return false;
11719 }
11720 return true;
11721}
11722
11723inline std::vector<uint8_t> Opcode::bincodeSerialize() const
11724{
11725 auto serializer = serde::BincodeSerializer();
11726 serde::Serializable<Opcode>::serialize(*this, serializer);
11727 return std::move(serializer).bytes();
11728}
11729
11730inline Opcode Opcode::bincodeDeserialize(std::vector<uint8_t> input)
11731{
11732 auto deserializer = serde::BincodeDeserializer(input);
11734 if (deserializer.get_buffer_offset() < input.size()) {
11735 throw_or_abort("Some input bytes were not read");
11736 }
11737 return value;
11738}
11739
11740} // end of namespace Acir
11741
11742template <>
11743template <typename Serializer>
11744void serde::Serializable<Acir::Opcode>::serialize(const Acir::Opcode& obj, Serializer& serializer)
11745{
11746 serializer.increase_container_depth();
11747 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11748 serializer.decrease_container_depth();
11749}
11750
11751template <>
11752template <typename Deserializer>
11754{
11755 deserializer.increase_container_depth();
11756 Acir::Opcode obj;
11757 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11758 deserializer.decrease_container_depth();
11759 return obj;
11760}
11761
11762namespace Acir {
11763
11764inline bool operator==(const Opcode::AssertZero& lhs, const Opcode::AssertZero& rhs)
11765{
11766 if (!(lhs.value == rhs.value)) {
11767 return false;
11768 }
11769 return true;
11770}
11771
11772inline std::vector<uint8_t> Opcode::AssertZero::bincodeSerialize() const
11773{
11774 auto serializer = serde::BincodeSerializer();
11776 return std::move(serializer).bytes();
11777}
11778
11780{
11781 auto deserializer = serde::BincodeDeserializer(input);
11783 if (deserializer.get_buffer_offset() < input.size()) {
11784 throw_or_abort("Some input bytes were not read");
11785 }
11786 return value;
11787}
11788
11789} // end of namespace Acir
11790
11791template <>
11792template <typename Serializer>
11794 Serializer& serializer)
11795{
11796 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11797}
11798
11799template <>
11800template <typename Deserializer>
11802{
11804 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11805 return obj;
11806}
11807
11808namespace Acir {
11809
11811{
11812 if (!(lhs.value == rhs.value)) {
11813 return false;
11814 }
11815 return true;
11816}
11817
11818inline std::vector<uint8_t> Opcode::BlackBoxFuncCall::bincodeSerialize() const
11819{
11820 auto serializer = serde::BincodeSerializer();
11822 return std::move(serializer).bytes();
11823}
11824
11826{
11827 auto deserializer = serde::BincodeDeserializer(input);
11829 if (deserializer.get_buffer_offset() < input.size()) {
11830 throw_or_abort("Some input bytes were not read");
11831 }
11832 return value;
11833}
11834
11835} // end of namespace Acir
11836
11837template <>
11838template <typename Serializer>
11840 Serializer& serializer)
11841{
11842 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11843}
11844
11845template <>
11846template <typename Deserializer>
11848 Deserializer& deserializer)
11849{
11851 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11852 return obj;
11853}
11854
11855namespace Acir {
11856
11857inline bool operator==(const Opcode::MemoryOp& lhs, const Opcode::MemoryOp& rhs)
11858{
11859 if (!(lhs.block_id == rhs.block_id)) {
11860 return false;
11861 }
11862 if (!(lhs.op == rhs.op)) {
11863 return false;
11864 }
11865 if (!(lhs.predicate == rhs.predicate)) {
11866 return false;
11867 }
11868 return true;
11869}
11870
11871inline std::vector<uint8_t> Opcode::MemoryOp::bincodeSerialize() const
11872{
11873 auto serializer = serde::BincodeSerializer();
11875 return std::move(serializer).bytes();
11876}
11877
11879{
11880 auto deserializer = serde::BincodeDeserializer(input);
11882 if (deserializer.get_buffer_offset() < input.size()) {
11883 throw_or_abort("Some input bytes were not read");
11884 }
11885 return value;
11886}
11887
11888} // end of namespace Acir
11889
11890template <>
11891template <typename Serializer>
11893{
11894 serde::Serializable<decltype(obj.block_id)>::serialize(obj.block_id, serializer);
11895 serde::Serializable<decltype(obj.op)>::serialize(obj.op, serializer);
11896 serde::Serializable<decltype(obj.predicate)>::serialize(obj.predicate, serializer);
11897}
11898
11899template <>
11900template <typename Deserializer>
11902{
11904 obj.block_id = serde::Deserializable<decltype(obj.block_id)>::deserialize(deserializer);
11905 obj.op = serde::Deserializable<decltype(obj.op)>::deserialize(deserializer);
11906 obj.predicate = serde::Deserializable<decltype(obj.predicate)>::deserialize(deserializer);
11907 return obj;
11908}
11909
11910namespace Acir {
11911
11912inline bool operator==(const Opcode::MemoryInit& lhs, const Opcode::MemoryInit& rhs)
11913{
11914 if (!(lhs.block_id == rhs.block_id)) {
11915 return false;
11916 }
11917 if (!(lhs.init == rhs.init)) {
11918 return false;
11919 }
11920 if (!(lhs.block_type == rhs.block_type)) {
11921 return false;
11922 }
11923 return true;
11924}
11925
11926inline std::vector<uint8_t> Opcode::MemoryInit::bincodeSerialize() const
11927{
11928 auto serializer = serde::BincodeSerializer();
11930 return std::move(serializer).bytes();
11931}
11932
11934{
11935 auto deserializer = serde::BincodeDeserializer(input);
11937 if (deserializer.get_buffer_offset() < input.size()) {
11938 throw_or_abort("Some input bytes were not read");
11939 }
11940 return value;
11941}
11942
11943} // end of namespace Acir
11944
11945template <>
11946template <typename Serializer>
11948 Serializer& serializer)
11949{
11950 serde::Serializable<decltype(obj.block_id)>::serialize(obj.block_id, serializer);
11951 serde::Serializable<decltype(obj.init)>::serialize(obj.init, serializer);
11952 serde::Serializable<decltype(obj.block_type)>::serialize(obj.block_type, serializer);
11953}
11954
11955template <>
11956template <typename Deserializer>
11958{
11960 obj.block_id = serde::Deserializable<decltype(obj.block_id)>::deserialize(deserializer);
11961 obj.init = serde::Deserializable<decltype(obj.init)>::deserialize(deserializer);
11962 obj.block_type = serde::Deserializable<decltype(obj.block_type)>::deserialize(deserializer);
11963 return obj;
11964}
11965
11966namespace Acir {
11967
11968inline bool operator==(const Opcode::BrilligCall& lhs, const Opcode::BrilligCall& rhs)
11969{
11970 if (!(lhs.id == rhs.id)) {
11971 return false;
11972 }
11973 if (!(lhs.inputs == rhs.inputs)) {
11974 return false;
11975 }
11976 if (!(lhs.outputs == rhs.outputs)) {
11977 return false;
11978 }
11979 if (!(lhs.predicate == rhs.predicate)) {
11980 return false;
11981 }
11982 return true;
11983}
11984
11985inline std::vector<uint8_t> Opcode::BrilligCall::bincodeSerialize() const
11986{
11987 auto serializer = serde::BincodeSerializer();
11989 return std::move(serializer).bytes();
11990}
11991
11993{
11994 auto deserializer = serde::BincodeDeserializer(input);
11996 if (deserializer.get_buffer_offset() < input.size()) {
11997 throw_or_abort("Some input bytes were not read");
11998 }
11999 return value;
12000}
12001
12002} // end of namespace Acir
12003
12004template <>
12005template <typename Serializer>
12007 Serializer& serializer)
12008{
12009 serde::Serializable<decltype(obj.id)>::serialize(obj.id, serializer);
12010 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
12011 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
12012 serde::Serializable<decltype(obj.predicate)>::serialize(obj.predicate, serializer);
12013}
12014
12015template <>
12016template <typename Deserializer>
12018{
12020 obj.id = serde::Deserializable<decltype(obj.id)>::deserialize(deserializer);
12021 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
12022 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
12023 obj.predicate = serde::Deserializable<decltype(obj.predicate)>::deserialize(deserializer);
12024 return obj;
12025}
12026
12027namespace Acir {
12028
12029inline bool operator==(const Opcode::Call& lhs, const Opcode::Call& rhs)
12030{
12031 if (!(lhs.id == rhs.id)) {
12032 return false;
12033 }
12034 if (!(lhs.inputs == rhs.inputs)) {
12035 return false;
12036 }
12037 if (!(lhs.outputs == rhs.outputs)) {
12038 return false;
12039 }
12040 if (!(lhs.predicate == rhs.predicate)) {
12041 return false;
12042 }
12043 return true;
12044}
12045
12046inline std::vector<uint8_t> Opcode::Call::bincodeSerialize() const
12047{
12048 auto serializer = serde::BincodeSerializer();
12050 return std::move(serializer).bytes();
12051}
12052
12053inline Opcode::Call Opcode::Call::bincodeDeserialize(std::vector<uint8_t> input)
12054{
12055 auto deserializer = serde::BincodeDeserializer(input);
12057 if (deserializer.get_buffer_offset() < input.size()) {
12058 throw_or_abort("Some input bytes were not read");
12059 }
12060 return value;
12061}
12062
12063} // end of namespace Acir
12064
12065template <>
12066template <typename Serializer>
12068{
12069 serde::Serializable<decltype(obj.id)>::serialize(obj.id, serializer);
12070 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
12071 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
12072 serde::Serializable<decltype(obj.predicate)>::serialize(obj.predicate, serializer);
12073}
12074
12075template <>
12076template <typename Deserializer>
12078{
12080 obj.id = serde::Deserializable<decltype(obj.id)>::deserialize(deserializer);
12081 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
12082 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
12083 obj.predicate = serde::Deserializable<decltype(obj.predicate)>::deserialize(deserializer);
12084 return obj;
12085}
12086
12087namespace Acir {
12088
12089inline bool operator==(const OpcodeLocation& lhs, const OpcodeLocation& rhs)
12090{
12091 if (!(lhs.value == rhs.value)) {
12092 return false;
12093 }
12094 return true;
12095}
12096
12097inline std::vector<uint8_t> OpcodeLocation::bincodeSerialize() const
12098{
12099 auto serializer = serde::BincodeSerializer();
12101 return std::move(serializer).bytes();
12102}
12103
12104inline OpcodeLocation OpcodeLocation::bincodeDeserialize(std::vector<uint8_t> input)
12105{
12106 auto deserializer = serde::BincodeDeserializer(input);
12108 if (deserializer.get_buffer_offset() < input.size()) {
12109 throw_or_abort("Some input bytes were not read");
12110 }
12111 return value;
12112}
12113
12114} // end of namespace Acir
12115
12116template <>
12117template <typename Serializer>
12119{
12120 serializer.increase_container_depth();
12121 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
12122 serializer.decrease_container_depth();
12123}
12124
12125template <>
12126template <typename Deserializer>
12128{
12129 deserializer.increase_container_depth();
12131 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
12132 deserializer.decrease_container_depth();
12133 return obj;
12134}
12135
12136namespace Acir {
12137
12138inline bool operator==(const OpcodeLocation::Acir& lhs, const OpcodeLocation::Acir& rhs)
12139{
12140 if (!(lhs.value == rhs.value)) {
12141 return false;
12142 }
12143 return true;
12144}
12145
12146inline std::vector<uint8_t> OpcodeLocation::Acir::bincodeSerialize() const
12147{
12148 auto serializer = serde::BincodeSerializer();
12150 return std::move(serializer).bytes();
12151}
12152
12154{
12155 auto deserializer = serde::BincodeDeserializer(input);
12157 if (deserializer.get_buffer_offset() < input.size()) {
12158 throw_or_abort("Some input bytes were not read");
12159 }
12160 return value;
12161}
12162
12163} // end of namespace Acir
12164
12165template <>
12166template <typename Serializer>
12168 Serializer& serializer)
12169{
12170 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
12171}
12172
12173template <>
12174template <typename Deserializer>
12176{
12178 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
12179 return obj;
12180}
12181
12182namespace Acir {
12183
12185{
12186 if (!(lhs.acir_index == rhs.acir_index)) {
12187 return false;
12188 }
12189 if (!(lhs.brillig_index == rhs.brillig_index)) {
12190 return false;
12191 }
12192 return true;
12193}
12194
12195inline std::vector<uint8_t> OpcodeLocation::Brillig::bincodeSerialize() const
12196{
12197 auto serializer = serde::BincodeSerializer();
12199 return std::move(serializer).bytes();
12200}
12201
12203{
12204 auto deserializer = serde::BincodeDeserializer(input);
12206 if (deserializer.get_buffer_offset() < input.size()) {
12207 throw_or_abort("Some input bytes were not read");
12208 }
12209 return value;
12210}
12211
12212} // end of namespace Acir
12213
12214template <>
12215template <typename Serializer>
12217 Serializer& serializer)
12218{
12219 serde::Serializable<decltype(obj.acir_index)>::serialize(obj.acir_index, serializer);
12220 serde::Serializable<decltype(obj.brillig_index)>::serialize(obj.brillig_index, serializer);
12221}
12222
12223template <>
12224template <typename Deserializer>
12226 Deserializer& deserializer)
12227{
12229 obj.acir_index = serde::Deserializable<decltype(obj.acir_index)>::deserialize(deserializer);
12230 obj.brillig_index = serde::Deserializable<decltype(obj.brillig_index)>::deserialize(deserializer);
12231 return obj;
12232}
12233
12234namespace Acir {
12235
12236inline bool operator==(const Program& lhs, const Program& rhs)
12237{
12238 if (!(lhs.functions == rhs.functions)) {
12239 return false;
12240 }
12242 return false;
12243 }
12244 return true;
12245}
12246
12247inline std::vector<uint8_t> Program::bincodeSerialize() const
12248{
12249 auto serializer = serde::BincodeSerializer();
12250 serde::Serializable<Program>::serialize(*this, serializer);
12251 return std::move(serializer).bytes();
12252}
12253
12254inline Program Program::bincodeDeserialize(std::vector<uint8_t> input)
12255{
12256 auto deserializer = serde::BincodeDeserializer(input);
12258 if (deserializer.get_buffer_offset() < input.size()) {
12259 throw_or_abort("Some input bytes were not read");
12260 }
12261 return value;
12262}
12263
12264} // end of namespace Acir
12265
12266template <>
12267template <typename Serializer>
12268void serde::Serializable<Acir::Program>::serialize(const Acir::Program& obj, Serializer& serializer)
12269{
12270 serializer.increase_container_depth();
12271 serde::Serializable<decltype(obj.functions)>::serialize(obj.functions, serializer);
12272 serde::Serializable<decltype(obj.unconstrained_functions)>::serialize(obj.unconstrained_functions, serializer);
12273 serializer.decrease_container_depth();
12274}
12275
12276template <>
12277template <typename Deserializer>
12279{
12280 deserializer.increase_container_depth();
12281 Acir::Program obj;
12282 obj.functions = serde::Deserializable<decltype(obj.functions)>::deserialize(deserializer);
12284 serde::Deserializable<decltype(obj.unconstrained_functions)>::deserialize(deserializer);
12285 deserializer.decrease_container_depth();
12286 return obj;
12287}
12288
12289namespace Acir {
12290
12291inline bool operator==(const ProgramWithoutBrillig& lhs, const ProgramWithoutBrillig& rhs)
12292{
12293 if (!(lhs.functions == rhs.functions)) {
12294 return false;
12295 }
12296 return true;
12297}
12298
12299inline std::vector<uint8_t> ProgramWithoutBrillig::bincodeSerialize() const
12300{
12301 auto serializer = serde::BincodeSerializer();
12303 return std::move(serializer).bytes();
12304}
12305
12307{
12308 auto deserializer = serde::BincodeDeserializer(input);
12310 if (deserializer.get_buffer_offset() < input.size()) {
12311 throw_or_abort("Some input bytes were not read");
12312 }
12313 return value;
12314}
12315
12316} // end of namespace Acir
12317
12318template <>
12319template <typename Serializer>
12321 Serializer& serializer)
12322{
12323 serializer.increase_container_depth();
12324 serde::Serializable<decltype(obj.functions)>::serialize(obj.functions, serializer);
12325 serializer.decrease_container_depth();
12326}
12327
12328template <>
12329template <typename Deserializer>
12331{
12332 deserializer.increase_container_depth();
12334 obj.functions = serde::Deserializable<decltype(obj.functions)>::deserialize(deserializer);
12335 deserializer.decrease_container_depth();
12336 return obj;
12337}
12338
12339namespace Acir {
12340
12341inline bool operator==(const PublicInputs& lhs, const PublicInputs& rhs)
12342{
12343 if (!(lhs.value == rhs.value)) {
12344 return false;
12345 }
12346 return true;
12347}
12348
12349inline std::vector<uint8_t> PublicInputs::bincodeSerialize() const
12350{
12351 auto serializer = serde::BincodeSerializer();
12353 return std::move(serializer).bytes();
12354}
12355
12356inline PublicInputs PublicInputs::bincodeDeserialize(std::vector<uint8_t> input)
12357{
12358 auto deserializer = serde::BincodeDeserializer(input);
12360 if (deserializer.get_buffer_offset() < input.size()) {
12361 throw_or_abort("Some input bytes were not read");
12362 }
12363 return value;
12364}
12365
12366} // end of namespace Acir
12367
12368template <>
12369template <typename Serializer>
12371{
12372 serializer.increase_container_depth();
12373 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
12374 serializer.decrease_container_depth();
12375}
12376
12377template <>
12378template <typename Deserializer>
12380{
12381 deserializer.increase_container_depth();
12383 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
12384 deserializer.decrease_container_depth();
12385 return obj;
12386}
12387
12388namespace Acir {
12389
12390inline bool operator==(const ValueOrArray& lhs, const ValueOrArray& rhs)
12391{
12392 if (!(lhs.value == rhs.value)) {
12393 return false;
12394 }
12395 return true;
12396}
12397
12398inline std::vector<uint8_t> ValueOrArray::bincodeSerialize() const
12399{
12400 auto serializer = serde::BincodeSerializer();
12402 return std::move(serializer).bytes();
12403}
12404
12405inline ValueOrArray ValueOrArray::bincodeDeserialize(std::vector<uint8_t> input)
12406{
12407 auto deserializer = serde::BincodeDeserializer(input);
12409 if (deserializer.get_buffer_offset() < input.size()) {
12410 throw_or_abort("Some input bytes were not read");
12411 }
12412 return value;
12413}
12414
12415} // end of namespace Acir
12416
12417template <>
12418template <typename Serializer>
12420{
12421 serializer.increase_container_depth();
12422 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
12423 serializer.decrease_container_depth();
12424}
12425
12426template <>
12427template <typename Deserializer>
12429{
12430 deserializer.increase_container_depth();
12432 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
12433 deserializer.decrease_container_depth();
12434 return obj;
12435}
12436
12437namespace Acir {
12438
12440{
12441 if (!(lhs.value == rhs.value)) {
12442 return false;
12443 }
12444 return true;
12445}
12446
12447inline std::vector<uint8_t> ValueOrArray::MemoryAddress::bincodeSerialize() const
12448{
12449 auto serializer = serde::BincodeSerializer();
12451 return std::move(serializer).bytes();
12452}
12453
12455{
12456 auto deserializer = serde::BincodeDeserializer(input);
12458 if (deserializer.get_buffer_offset() < input.size()) {
12459 throw_or_abort("Some input bytes were not read");
12460 }
12461 return value;
12462}
12463
12464} // end of namespace Acir
12465
12466template <>
12467template <typename Serializer>
12469 Serializer& serializer)
12470{
12471 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
12472}
12473
12474template <>
12475template <typename Deserializer>
12477 Deserializer& deserializer)
12478{
12480 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
12481 return obj;
12482}
12483
12484namespace Acir {
12485
12487{
12488 if (!(lhs.value == rhs.value)) {
12489 return false;
12490 }
12491 return true;
12492}
12493
12494inline std::vector<uint8_t> ValueOrArray::HeapArray::bincodeSerialize() const
12495{
12496 auto serializer = serde::BincodeSerializer();
12498 return std::move(serializer).bytes();
12499}
12500
12502{
12503 auto deserializer = serde::BincodeDeserializer(input);
12505 if (deserializer.get_buffer_offset() < input.size()) {
12506 throw_or_abort("Some input bytes were not read");
12507 }
12508 return value;
12509}
12510
12511} // end of namespace Acir
12512
12513template <>
12514template <typename Serializer>
12516 Serializer& serializer)
12517{
12518 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
12519}
12520
12521template <>
12522template <typename Deserializer>
12524 Deserializer& deserializer)
12525{
12527 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
12528 return obj;
12529}
12530
12531namespace Acir {
12532
12534{
12535 if (!(lhs.value == rhs.value)) {
12536 return false;
12537 }
12538 return true;
12539}
12540
12541inline std::vector<uint8_t> ValueOrArray::HeapVector::bincodeSerialize() const
12542{
12543 auto serializer = serde::BincodeSerializer();
12545 return std::move(serializer).bytes();
12546}
12547
12549{
12550 auto deserializer = serde::BincodeDeserializer(input);
12552 if (deserializer.get_buffer_offset() < input.size()) {
12553 throw_or_abort("Some input bytes were not read");
12554 }
12555 return value;
12556}
12557
12558} // end of namespace Acir
12559
12560template <>
12561template <typename Serializer>
12563 Serializer& serializer)
12564{
12565 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
12566}
12567
12568template <>
12569template <typename Deserializer>
12571 Deserializer& deserializer)
12572{
12574 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
12575 return obj;
12576}
12577
12578namespace Acir {
12579
12580inline bool operator==(const Witness& lhs, const Witness& rhs)
12581{
12582 if (!(lhs.value == rhs.value)) {
12583 return false;
12584 }
12585 return true;
12586}
12587
12588inline std::vector<uint8_t> Witness::bincodeSerialize() const
12589{
12590 auto serializer = serde::BincodeSerializer();
12591 serde::Serializable<Witness>::serialize(*this, serializer);
12592 return std::move(serializer).bytes();
12593}
12594
12595inline Witness Witness::bincodeDeserialize(std::vector<uint8_t> input)
12596{
12597 auto deserializer = serde::BincodeDeserializer(input);
12599 if (deserializer.get_buffer_offset() < input.size()) {
12600 throw_or_abort("Some input bytes were not read");
12601 }
12602 return value;
12603}
12604
12605} // end of namespace Acir
12606
12607template <>
12608template <typename Serializer>
12609void serde::Serializable<Acir::Witness>::serialize(const Acir::Witness& obj, Serializer& serializer)
12610{
12611 serializer.increase_container_depth();
12612 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
12613 serializer.decrease_container_depth();
12614}
12615
12616template <>
12617template <typename Deserializer>
12619{
12620 deserializer.increase_container_depth();
12621 Acir::Witness obj;
12622 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
12623 deserializer.decrease_container_depth();
12624 return obj;
12625}
Serves as a key-value node store for merkle trees. Caches all changes in memory before persisting the...
const std::vector< FF > data
Definition acir.hpp:13
bool operator==(const AssertionPayload &lhs, const AssertionPayload &rhs)
Definition acir.hpp:5262
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
std::string to_string(bb::avm2::ValueTag tag)
static AssertionPayload bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5280
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5273
uint64_t error_selector
Definition acir.hpp:4871
std::vector< Acir::ExpressionOrMemory > payload
Definition acir.hpp:4872
friend bool operator==(const AssertionPayload &, const AssertionPayload &)
Definition acir.hpp:5262
void msgpack_pack(auto &packer) const
Definition acir.hpp:4878
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4885
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:64
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5371
void msgpack_pack(auto &packer) const
Definition acir.hpp:63
static Add bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5378
friend bool operator==(const Add &, const Add &)
Definition acir.hpp:5366
void msgpack_pack(auto &packer) const
Definition acir.hpp:90
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:91
friend bool operator==(const Div &, const Div &)
Definition acir.hpp:5486
static Div bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5498
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5491
void msgpack_pack(auto &packer) const
Definition acir.hpp:108
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5572
static Equals bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5579
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:109
friend bool operator==(const Equals &, const Equals &)
Definition acir.hpp:5567
static IntegerDiv bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5538
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5531
friend bool operator==(const IntegerDiv &, const IntegerDiv &)
Definition acir.hpp:5526
void msgpack_pack(auto &packer) const
Definition acir.hpp:99
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:100
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5653
friend bool operator==(const LessThanEquals &, const LessThanEquals &)
Definition acir.hpp:5648
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:127
void msgpack_pack(auto &packer) const
Definition acir.hpp:126
static LessThanEquals bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5660
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:118
static LessThan bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5619
void msgpack_pack(auto &packer) const
Definition acir.hpp:117
friend bool operator==(const LessThan &, const LessThan &)
Definition acir.hpp:5607
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5612
void msgpack_pack(auto &packer) const
Definition acir.hpp:81
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:82
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5451
friend bool operator==(const Mul &, const Mul &)
Definition acir.hpp:5446
static Mul bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5458
void msgpack_pack(auto &packer) const
Definition acir.hpp:72
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:73
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5411
friend bool operator==(const Sub &, const Sub &)
Definition acir.hpp:5406
static Sub bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5418
std::variant< Add, Sub, Mul, Div, IntegerDiv, Equals, LessThan, LessThanEquals > value
Definition acir.hpp:130
void msgpack_pack(auto &packer) const
Definition acir.hpp:136
static BinaryFieldOp bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5332
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:190
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5325
friend bool operator==(const BinaryFieldOp &, const BinaryFieldOp &)
Definition acir.hpp:5317
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5743
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:250
static Add bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5750
friend bool operator==(const Add &, const Add &)
Definition acir.hpp:5738
void msgpack_pack(auto &packer) const
Definition acir.hpp:249
void msgpack_pack(auto &packer) const
Definition acir.hpp:312
static And bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6027
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6020
friend bool operator==(const And &, const And &)
Definition acir.hpp:6015
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:313
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:277
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5860
static Div bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5867
friend bool operator==(const Div &, const Div &)
Definition acir.hpp:5855
void msgpack_pack(auto &packer) const
Definition acir.hpp:276
void msgpack_pack(auto &packer) const
Definition acir.hpp:285
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:286
static Equals bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5906
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5899
friend bool operator==(const Equals &, const Equals &)
Definition acir.hpp:5894
friend bool operator==(const LessThanEquals &, const LessThanEquals &)
Definition acir.hpp:5974
static LessThanEquals bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5986
void msgpack_pack(auto &packer) const
Definition acir.hpp:303
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5979
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:304
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5939
static LessThan bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5946
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:295
friend bool operator==(const LessThan &, const LessThan &)
Definition acir.hpp:5934
void msgpack_pack(auto &packer) const
Definition acir.hpp:294
void msgpack_pack(auto &packer) const
Definition acir.hpp:267
friend bool operator==(const Mul &, const Mul &)
Definition acir.hpp:5816
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5821
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:268
static Mul bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5828
static Or bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6066
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6059
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:322
void msgpack_pack(auto &packer) const
Definition acir.hpp:321
friend bool operator==(const Or &, const Or &)
Definition acir.hpp:6054
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6137
friend bool operator==(const Shl &, const Shl &)
Definition acir.hpp:6132
static Shl bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6144
void msgpack_pack(auto &packer) const
Definition acir.hpp:339
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:340
void msgpack_pack(auto &packer) const
Definition acir.hpp:348
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:349
friend bool operator==(const Shr &, const Shr &)
Definition acir.hpp:6171
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6176
static Shr bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6183
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:259
void msgpack_pack(auto &packer) const
Definition acir.hpp:258
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5782
static Sub bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5789
friend bool operator==(const Sub &, const Sub &)
Definition acir.hpp:5777
friend bool operator==(const Xor &, const Xor &)
Definition acir.hpp:6093
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:331
void msgpack_pack(auto &packer) const
Definition acir.hpp:330
static Xor bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6105
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6098
void msgpack_pack(auto &packer) const
Definition acir.hpp:358
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5697
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:428
static BinaryIntOp bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5704
std::variant< Add, Sub, Mul, Div, Equals, LessThan, LessThanEquals, And, Or, Xor, Shl, Shr > value
Definition acir.hpp:352
friend bool operator==(const BinaryIntOp &, const BinaryIntOp &)
Definition acir.hpp:5689
static Field bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6271
friend bool operator==(const Field &, const Field &)
Definition acir.hpp:6259
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:654
void msgpack_pack(auto &packer) const
Definition acir.hpp:653
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6264
Acir::IntegerBitSize value
Definition acir.hpp:658
static Integer bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6313
friend bool operator==(const Integer &, const Integer &)
Definition acir.hpp:6298
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6306
void msgpack_pack(auto &packer) const
Definition acir.hpp:664
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:666
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6218
std::variant< Field, Integer > value
Definition acir.hpp:677
static BitSize bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6225
friend bool operator==(const BitSize &, const BitSize &)
Definition acir.hpp:6210
void msgpack_pack(auto &packer) const
Definition acir.hpp:683
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:713
void msgpack_pack(auto &packer) const
Definition acir.hpp:3075
std::shared_ptr< std::array< Acir::FunctionInput, 16 > > key
Definition acir.hpp:3068
std::vector< Acir::Witness > outputs
Definition acir.hpp:3069
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6409
std::vector< Acir::FunctionInput > inputs
Definition acir.hpp:3066
friend bool operator==(const AES128Encrypt &, const AES128Encrypt &)
Definition acir.hpp:6392
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3084
static AES128Encrypt bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6416
std::shared_ptr< std::array< Acir::FunctionInput, 16 > > iv
Definition acir.hpp:3067
friend bool operator==(const AND &, const AND &)
Definition acir.hpp:6454
static AND bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6475
Acir::FunctionInput lhs
Definition acir.hpp:3096
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3112
Acir::FunctionInput rhs
Definition acir.hpp:3097
void msgpack_pack(auto &packer) const
Definition acir.hpp:3104
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6468
void msgpack_pack(auto &packer) const
Definition acir.hpp:3404
friend bool operator==(const BigIntAdd &, const BigIntAdd &)
Definition acir.hpp:7087
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3412
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7101
static BigIntAdd bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7108
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3493
void msgpack_pack(auto &packer) const
Definition acir.hpp:3485
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7272
friend bool operator==(const BigIntDiv &, const BigIntDiv &)
Definition acir.hpp:7258
static BigIntDiv bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7279
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3520
static BigIntFromLeBytes bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7336
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7329
friend bool operator==(const BigIntFromLeBytes &, const BigIntFromLeBytes &)
Definition acir.hpp:7315
std::vector< Acir::FunctionInput > inputs
Definition acir.hpp:3504
void msgpack_pack(auto &packer) const
Definition acir.hpp:3512
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7215
void msgpack_pack(auto &packer) const
Definition acir.hpp:3458
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3466
static BigIntMul bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7222
friend bool operator==(const BigIntMul &, const BigIntMul &)
Definition acir.hpp:7201
friend bool operator==(const BigIntSub &, const BigIntSub &)
Definition acir.hpp:7144
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7158
static BigIntSub bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7165
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3439
void msgpack_pack(auto &packer) const
Definition acir.hpp:3431
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3545
static BigIntToLeBytes bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7391
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7384
void msgpack_pack(auto &packer) const
Definition acir.hpp:3538
std::vector< Acir::Witness > outputs
Definition acir.hpp:3532
friend bool operator==(const BigIntToLeBytes &, const BigIntToLeBytes &)
Definition acir.hpp:7373
std::shared_ptr< std::array< Acir::Witness, 32 > > outputs
Definition acir.hpp:3172
static Blake2s bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6631
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6624
void msgpack_pack(auto &packer) const
Definition acir.hpp:3178
friend bool operator==(const Blake2s &, const Blake2s &)
Definition acir.hpp:6613
std::vector< Acir::FunctionInput > inputs
Definition acir.hpp:3171
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3185
void msgpack_pack(auto &packer) const
Definition acir.hpp:3202
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3209
static Blake3 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6683
std::shared_ptr< std::array< Acir::Witness, 32 > > outputs
Definition acir.hpp:3196
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6676
std::vector< Acir::FunctionInput > inputs
Definition acir.hpp:3195
friend bool operator==(const Blake3 &, const Blake3 &)
Definition acir.hpp:6665
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6737
static EcdsaSecp256k1 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6744
std::shared_ptr< std::array< Acir::FunctionInput, 32 > > public_key_x
Definition acir.hpp:3219
std::shared_ptr< std::array< Acir::FunctionInput, 32 > > hashed_message
Definition acir.hpp:3222
void msgpack_pack(auto &packer) const
Definition acir.hpp:3229
friend bool operator==(const EcdsaSecp256k1 &, const EcdsaSecp256k1 &)
Definition acir.hpp:6717
std::shared_ptr< std::array< Acir::FunctionInput, 32 > > public_key_y
Definition acir.hpp:3220
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3239
std::shared_ptr< std::array< Acir::FunctionInput, 64 > > signature
Definition acir.hpp:3221
std::shared_ptr< std::array< Acir::FunctionInput, 32 > > public_key_x
Definition acir.hpp:3252
static EcdsaSecp256r1 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6811
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6804
friend bool operator==(const EcdsaSecp256r1 &, const EcdsaSecp256r1 &)
Definition acir.hpp:6784
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3272
std::shared_ptr< std::array< Acir::FunctionInput, 32 > > hashed_message
Definition acir.hpp:3255
void msgpack_pack(auto &packer) const
Definition acir.hpp:3262
std::shared_ptr< std::array< Acir::FunctionInput, 32 > > public_key_y
Definition acir.hpp:3253
std::shared_ptr< std::array< Acir::FunctionInput, 64 > > signature
Definition acir.hpp:3254
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6922
std::shared_ptr< std::array< Acir::Witness, 3 > > outputs
Definition acir.hpp:3314
friend bool operator==(const EmbeddedCurveAdd &, const EmbeddedCurveAdd &)
Definition acir.hpp:6908
void msgpack_pack(auto &packer) const
Definition acir.hpp:3320
std::shared_ptr< std::array< Acir::FunctionInput, 3 > > input2
Definition acir.hpp:3313
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3328
std::shared_ptr< std::array< Acir::FunctionInput, 3 > > input1
Definition acir.hpp:3312
static EmbeddedCurveAdd bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6929
std::shared_ptr< std::array< Acir::FunctionInput, 25 > > inputs
Definition acir.hpp:3339
friend bool operator==(const Keccakf1600 &, const Keccakf1600 &)
Definition acir.hpp:6966
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3353
static Keccakf1600 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6984
void msgpack_pack(auto &packer) const
Definition acir.hpp:3346
std::shared_ptr< std::array< Acir::Witness, 25 > > outputs
Definition acir.hpp:3340
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6977
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6865
std::vector< Acir::FunctionInput > scalars
Definition acir.hpp:3286
std::vector< Acir::FunctionInput > points
Definition acir.hpp:3285
std::shared_ptr< std::array< Acir::Witness, 3 > > outputs
Definition acir.hpp:3287
static MultiScalarMul bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6872
friend bool operator==(const MultiScalarMul &, const MultiScalarMul &)
Definition acir.hpp:6851
void msgpack_pack(auto &packer) const
Definition acir.hpp:3293
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3301
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7441
std::vector< Acir::Witness > outputs
Definition acir.hpp:3556
std::vector< Acir::FunctionInput > inputs
Definition acir.hpp:3555
static Poseidon2Permutation bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7448
void msgpack_pack(auto &packer) const
Definition acir.hpp:3563
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3571
friend bool operator==(const Poseidon2Permutation &, const Poseidon2Permutation &)
Definition acir.hpp:7426
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3162
friend bool operator==(const RANGE &, const RANGE &)
Definition acir.hpp:6566
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6574
void msgpack_pack(auto &packer) const
Definition acir.hpp:3156
static RANGE bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6581
Acir::FunctionInput input
Definition acir.hpp:3150
std::vector< Acir::FunctionInput > verification_key
Definition acir.hpp:3363
std::vector< Acir::FunctionInput > proof
Definition acir.hpp:3364
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7039
void msgpack_pack(auto &packer) const
Definition acir.hpp:3373
std::vector< Acir::FunctionInput > public_inputs
Definition acir.hpp:3365
static RecursiveAggregation bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7046
friend bool operator==(const RecursiveAggregation &, const RecursiveAggregation &)
Definition acir.hpp:7018
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3383
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3598
static Sha256Compression bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7506
std::shared_ptr< std::array< Acir::FunctionInput, 8 > > hash_values
Definition acir.hpp:3583
friend bool operator==(const Sha256Compression &, const Sha256Compression &)
Definition acir.hpp:7485
std::shared_ptr< std::array< Acir::FunctionInput, 16 > > inputs
Definition acir.hpp:3582
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7499
std::shared_ptr< std::array< Acir::Witness, 8 > > outputs
Definition acir.hpp:3584
void msgpack_pack(auto &packer) const
Definition acir.hpp:3590
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3139
Acir::FunctionInput rhs
Definition acir.hpp:3124
Acir::FunctionInput lhs
Definition acir.hpp:3123
static XOR bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6531
void msgpack_pack(auto &packer) const
Definition acir.hpp:3131
friend bool operator==(const XOR &, const XOR &)
Definition acir.hpp:6510
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6524
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6351
std::variant< AES128Encrypt, AND, XOR, RANGE, Blake2s, Blake3, EcdsaSecp256k1, EcdsaSecp256r1, MultiScalarMul, EmbeddedCurveAdd, Keccakf1600, RecursiveAggregation, BigIntAdd, BigIntSub, BigIntMul, BigIntDiv, BigIntFromLeBytes, BigIntToLeBytes, Poseidon2Permutation, Sha256Compression > value
Definition acir.hpp:3628
void msgpack_pack(auto &packer) const
Definition acir.hpp:3634
friend bool operator==(const BlackBoxFuncCall &, const BlackBoxFuncCall &)
Definition acir.hpp:6343
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3736
static BlackBoxFuncCall bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6358
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:949
void msgpack_pack(auto &packer) const
Definition acir.hpp:940
Acir::HeapVector outputs
Definition acir.hpp:934
friend bool operator==(const AES128Encrypt &, const AES128Encrypt &)
Definition acir.hpp:7592
Acir::HeapVector inputs
Definition acir.hpp:931
static AES128Encrypt bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7616
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7609
Acir::MemoryAddress lhs
Definition acir.hpp:1165
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8090
friend bool operator==(const BigIntAdd &, const BigIntAdd &)
Definition acir.hpp:8076
static BigIntAdd bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8097
Acir::MemoryAddress output
Definition acir.hpp:1167
void msgpack_pack(auto &packer) const
Definition acir.hpp:1173
Acir::MemoryAddress rhs
Definition acir.hpp:1166
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1181
void msgpack_pack(auto &packer) const
Definition acir.hpp:1254
static BigIntDiv bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8265
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1262
Acir::MemoryAddress output
Definition acir.hpp:1248
Acir::MemoryAddress rhs
Definition acir.hpp:1247
Acir::MemoryAddress lhs
Definition acir.hpp:1246
friend bool operator==(const BigIntDiv &, const BigIntDiv &)
Definition acir.hpp:8244
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8258
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8314
void msgpack_pack(auto &packer) const
Definition acir.hpp:1281
static BigIntFromLeBytes bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8321
friend bool operator==(const BigIntFromLeBytes &, const BigIntFromLeBytes &)
Definition acir.hpp:8300
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1289
Acir::MemoryAddress rhs
Definition acir.hpp:1220
Acir::MemoryAddress output
Definition acir.hpp:1221
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1235
friend bool operator==(const BigIntMul &, const BigIntMul &)
Definition acir.hpp:8188
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8202
void msgpack_pack(auto &packer) const
Definition acir.hpp:1227
static BigIntMul bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8209
Acir::MemoryAddress lhs
Definition acir.hpp:1219
friend bool operator==(const BigIntSub &, const BigIntSub &)
Definition acir.hpp:8132
void msgpack_pack(auto &packer) const
Definition acir.hpp:1200
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8146
Acir::MemoryAddress output
Definition acir.hpp:1194
Acir::MemoryAddress rhs
Definition acir.hpp:1193
Acir::MemoryAddress lhs
Definition acir.hpp:1192
static BigIntSub bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8153
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1208
Acir::MemoryAddress input
Definition acir.hpp:1300
void msgpack_pack(auto &packer) const
Definition acir.hpp:1307
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1314
static BigIntToLeBytes bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8375
friend bool operator==(const BigIntToLeBytes &, const BigIntToLeBytes &)
Definition acir.hpp:8357
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8368
Acir::HeapVector message
Definition acir.hpp:961
static Blake2s bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7672
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7665
Acir::HeapArray output
Definition acir.hpp:962
friend bool operator==(const Blake2s &, const Blake2s &)
Definition acir.hpp:7654
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:975
void msgpack_pack(auto &packer) const
Definition acir.hpp:968
Acir::HeapArray output
Definition acir.hpp:986
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7716
void msgpack_pack(auto &packer) const
Definition acir.hpp:992
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:999
Acir::HeapVector message
Definition acir.hpp:985
static Blake3 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7723
friend bool operator==(const Blake3 &, const Blake3 &)
Definition acir.hpp:7705
Acir::MemoryAddress result
Definition acir.hpp:1037
static EcdsaSecp256k1 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7835
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7828
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1053
Acir::HeapVector hashed_msg
Definition acir.hpp:1033
friend bool operator==(const EcdsaSecp256k1 &, const EcdsaSecp256k1 &)
Definition acir.hpp:7808
void msgpack_pack(auto &packer) const
Definition acir.hpp:1043
Acir::MemoryAddress result
Definition acir.hpp:1070
Acir::HeapVector hashed_msg
Definition acir.hpp:1066
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1086
friend bool operator==(const EcdsaSecp256r1 &, const EcdsaSecp256r1 &)
Definition acir.hpp:7875
void msgpack_pack(auto &packer) const
Definition acir.hpp:1076
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7895
static EcdsaSecp256r1 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7902
static EmbeddedCurveAdd bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8032
Acir::MemoryAddress input1_x
Definition acir.hpp:1126
friend bool operator==(const EmbeddedCurveAdd &, const EmbeddedCurveAdd &)
Definition acir.hpp:7999
Acir::MemoryAddress input2_infinite
Definition acir.hpp:1131
Acir::MemoryAddress input1_y
Definition acir.hpp:1127
Acir::MemoryAddress input1_infinite
Definition acir.hpp:1128
Acir::MemoryAddress input2_x
Definition acir.hpp:1129
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8025
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1150
void msgpack_pack(auto &packer) const
Definition acir.hpp:1138
Acir::MemoryAddress input2_y
Definition acir.hpp:1130
static Keccakf1600 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7774
friend bool operator==(const Keccakf1600 &, const Keccakf1600 &)
Definition acir.hpp:7756
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7767
void msgpack_pack(auto &packer) const
Definition acir.hpp:1016
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1023
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7956
friend bool operator==(const MultiScalarMul &, const MultiScalarMul &)
Definition acir.hpp:7942
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1115
void msgpack_pack(auto &packer) const
Definition acir.hpp:1107
static MultiScalarMul bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7963
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8423
static Poseidon2Permutation bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8430
void msgpack_pack(auto &packer) const
Definition acir.hpp:1332
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1340
friend bool operator==(const Poseidon2Permutation &, const Poseidon2Permutation &)
Definition acir.hpp:8409
friend bool operator==(const Sha256Compression &, const Sha256Compression &)
Definition acir.hpp:8466
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8480
void msgpack_pack(auto &packer) const
Definition acir.hpp:1359
static Sha256Compression bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8487
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1367
friend bool operator==(const ToRadix &, const ToRadix &)
Definition acir.hpp:8523
Acir::MemoryAddress output_pointer
Definition acir.hpp:1380
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8543
static ToRadix bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8550
Acir::MemoryAddress radix
Definition acir.hpp:1379
Acir::MemoryAddress output_bits
Definition acir.hpp:1382
Acir::MemoryAddress input
Definition acir.hpp:1378
Acir::MemoryAddress num_limbs
Definition acir.hpp:1381
void msgpack_pack(auto &packer) const
Definition acir.hpp:1388
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1398
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1523
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7551
void msgpack_pack(auto &packer) const
Definition acir.hpp:1433
friend bool operator==(const BlackBoxOp &, const BlackBoxOp &)
Definition acir.hpp:7543
static BlackBoxOp bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7558
std::variant< AES128Encrypt, Blake2s, Blake3, Keccakf1600, EcdsaSecp256k1, EcdsaSecp256r1, MultiScalarMul, EmbeddedCurveAdd, BigIntAdd, BigIntSub, BigIntMul, BigIntDiv, BigIntFromLeBytes, BigIntToLeBytes, Poseidon2Permutation, Sha256Compression, ToRadix > value
Definition acir.hpp:1427
void msgpack_pack(auto &packer) const
Definition acir.hpp:3971
friend bool operator==(const BlockId &, const BlockId &)
Definition acir.hpp:8589
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3973
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8597
static BlockId bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8604
uint32_t value
Definition acir.hpp:3965
static CallData bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8741
friend bool operator==(const CallData &, const CallData &)
Definition acir.hpp:8726
void msgpack_pack(auto &packer) const
Definition acir.hpp:4002
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8734
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4004
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3992
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8692
friend bool operator==(const Memory &, const Memory &)
Definition acir.hpp:8687
void msgpack_pack(auto &packer) const
Definition acir.hpp:3991
static Memory bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8699
static ReturnData bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8784
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4021
friend bool operator==(const ReturnData &, const ReturnData &)
Definition acir.hpp:8772
void msgpack_pack(auto &packer) const
Definition acir.hpp:4020
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8777
void msgpack_pack(auto &packer) const
Definition acir.hpp:4030
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8646
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4064
static BlockType bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8653
std::variant< Memory, CallData, ReturnData > value
Definition acir.hpp:4024
friend bool operator==(const BlockType &, const BlockType &)
Definition acir.hpp:8638
void msgpack_pack(auto &packer) const
Definition acir.hpp:5199
static BrilligBytecode bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8827
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8820
friend bool operator==(const BrilligBytecode &, const BrilligBytecode &)
Definition acir.hpp:8812
std::vector< Acir::BrilligOpcode > bytecode
Definition acir.hpp:5193
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:5205
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4166
void msgpack_pack(auto &packer) const
Definition acir.hpp:4164
std::vector< Acir::Expression > value
Definition acir.hpp:4158
static Array bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8971
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8964
friend bool operator==(const Array &, const Array &)
Definition acir.hpp:8956
static MemoryArray bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9017
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9010
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4186
void msgpack_pack(auto &packer) const
Definition acir.hpp:4184
friend bool operator==(const MemoryArray &, const MemoryArray &)
Definition acir.hpp:9002
Acir::Expression value
Definition acir.hpp:4138
static Single bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8925
friend bool operator==(const Single &, const Single &)
Definition acir.hpp:8910
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4146
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8918
void msgpack_pack(auto &packer) const
Definition acir.hpp:4144
static BrilligInputs bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8876
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4237
std::variant< Single, Array, MemoryArray > value
Definition acir.hpp:4197
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8869
void msgpack_pack(auto &packer) const
Definition acir.hpp:4203
friend bool operator==(const BrilligInputs &, const BrilligInputs &)
Definition acir.hpp:8861
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9115
static BinaryFieldOp bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9122
void msgpack_pack(auto &packer) const
Definition acir.hpp:2060
friend bool operator==(const BinaryFieldOp &, const BinaryFieldOp &)
Definition acir.hpp:9098
Acir::MemoryAddress destination
Definition acir.hpp:2051
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2069
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2101
Acir::MemoryAddress destination
Definition acir.hpp:2081
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9180
Acir::MemoryAddress rhs
Definition acir.hpp:2085
static BinaryIntOp bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9187
void msgpack_pack(auto &packer) const
Definition acir.hpp:2091
friend bool operator==(const BinaryIntOp &, const BinaryIntOp &)
Definition acir.hpp:9160
Acir::IntegerBitSize bit_size
Definition acir.hpp:2083
Acir::MemoryAddress lhs
Definition acir.hpp:2084
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2491
static BlackBox bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10042
Acir::BlackBoxOp value
Definition acir.hpp:2483
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10035
friend bool operator==(const BlackBox &, const BlackBox &)
Definition acir.hpp:10027
void msgpack_pack(auto &packer) const
Definition acir.hpp:2489
void msgpack_pack(auto &packer) const
Definition acir.hpp:2270
static Call bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9560
friend bool operator==(const Call &, const Call &)
Definition acir.hpp:9545
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9553
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2276
Acir::MemoryAddress offset_address
Definition acir.hpp:2239
static CalldataCopy bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9509
friend bool operator==(const CalldataCopy &, const CalldataCopy &)
Definition acir.hpp:9488
Acir::MemoryAddress destination_address
Definition acir.hpp:2237
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9502
void msgpack_pack(auto &packer) const
Definition acir.hpp:2245
Acir::MemoryAddress size_address
Definition acir.hpp:2238
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2253
Acir::MemoryAddress source
Definition acir.hpp:2142
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2157
void msgpack_pack(auto &packer) const
Definition acir.hpp:2149
Acir::MemoryAddress destination
Definition acir.hpp:2141
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9297
static Cast bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9304
Acir::BitSize bit_size
Definition acir.hpp:2143
friend bool operator==(const Cast &, const Cast &)
Definition acir.hpp:9283
Acir::MemoryAddress source_b
Definition acir.hpp:2407
static ConditionalMov bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9887
friend bool operator==(const ConditionalMov &, const ConditionalMov &)
Definition acir.hpp:9863
Acir::MemoryAddress source_a
Definition acir.hpp:2406
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2423
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9880
void msgpack_pack(auto &packer) const
Definition acir.hpp:2414
Acir::MemoryAddress destination
Definition acir.hpp:2405
Acir::MemoryAddress condition
Definition acir.hpp:2408
static Const bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9612
Acir::BitSize bit_size
Definition acir.hpp:2286
friend bool operator==(const Const &, const Const &)
Definition acir.hpp:9591
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2301
void msgpack_pack(auto &packer) const
Definition acir.hpp:2293
Acir::MemoryAddress destination
Definition acir.hpp:2285
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9605
std::vector< Acir::HeapValueType > input_value_types
Definition acir.hpp:2352
std::vector< Acir::HeapValueType > destination_value_types
Definition acir.hpp:2350
static ForeignCall bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9771
std::vector< Acir::ValueOrArray > destinations
Definition acir.hpp:2349
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9764
friend bool operator==(const ForeignCall &, const ForeignCall &)
Definition acir.hpp:9744
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2368
void msgpack_pack(auto &packer) const
Definition acir.hpp:2358
std::vector< Acir::ValueOrArray > inputs
Definition acir.hpp:2351
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9661
void msgpack_pack(auto &packer) const
Definition acir.hpp:2320
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2328
static IndirectConst bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9668
friend bool operator==(const IndirectConst &, const IndirectConst &)
Definition acir.hpp:9647
Acir::MemoryAddress destination_pointer
Definition acir.hpp:2312
void msgpack_pack(auto &packer) const
Definition acir.hpp:2222
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9450
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2228
friend bool operator==(const Jump &, const Jump &)
Definition acir.hpp:9442
static Jump bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9457
void msgpack_pack(auto &packer) const
Definition acir.hpp:2199
Acir::MemoryAddress condition
Definition acir.hpp:2192
static JumpIf bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9409
friend bool operator==(const JumpIf &, const JumpIf &)
Definition acir.hpp:9391
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9402
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2206
Acir::MemoryAddress condition
Definition acir.hpp:2168
void msgpack_pack(auto &packer) const
Definition acir.hpp:2175
static JumpIfNot bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9357
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2182
friend bool operator==(const JumpIfNot &, const JumpIfNot &)
Definition acir.hpp:9339
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9350
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2449
static Load bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9943
Acir::MemoryAddress destination
Definition acir.hpp:2435
Acir::MemoryAddress source_pointer
Definition acir.hpp:2436
friend bool operator==(const Load &, const Load &)
Definition acir.hpp:9925
void msgpack_pack(auto &packer) const
Definition acir.hpp:2442
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9936
Acir::MemoryAddress destination
Definition acir.hpp:2381
friend bool operator==(const Mov &, const Mov &)
Definition acir.hpp:9812
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2395
static Mov bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9830
Acir::MemoryAddress source
Definition acir.hpp:2382
void msgpack_pack(auto &packer) const
Definition acir.hpp:2388
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9823
friend bool operator==(const Not &, const Not &)
Definition acir.hpp:9227
Acir::MemoryAddress source
Definition acir.hpp:2115
void msgpack_pack(auto &packer) const
Definition acir.hpp:2122
static Not bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9248
Acir::IntegerBitSize bit_size
Definition acir.hpp:2116
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9241
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2130
Acir::MemoryAddress destination
Definition acir.hpp:2114
friend bool operator==(const Return &, const Return &)
Definition acir.hpp:9704
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2344
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9709
void msgpack_pack(auto &packer) const
Definition acir.hpp:2343
static Return bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9716
friend bool operator==(const Stop &, const Stop &)
Definition acir.hpp:10120
static Stop bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10135
void msgpack_pack(auto &packer) const
Definition acir.hpp:2530
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10128
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2536
Acir::HeapVector return_data
Definition acir.hpp:2524
static Store bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9994
friend bool operator==(const Store &, const Store &)
Definition acir.hpp:9976
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2473
Acir::MemoryAddress source
Definition acir.hpp:2460
Acir::MemoryAddress destination_pointer
Definition acir.hpp:2459
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9987
void msgpack_pack(auto &packer) const
Definition acir.hpp:2466
friend bool operator==(const Trap &, const Trap &)
Definition acir.hpp:10074
void msgpack_pack(auto &packer) const
Definition acir.hpp:2509
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2515
Acir::HeapVector revert_data
Definition acir.hpp:2503
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10082
static Trap bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10089
static BrilligOpcode bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9064
friend bool operator==(const BrilligOpcode &, const BrilligOpcode &)
Definition acir.hpp:9049
void msgpack_pack(auto &packer) const
Definition acir.hpp:2570
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9057
std::variant< BinaryFieldOp, BinaryIntOp, Not, Cast, JumpIfNot, JumpIf, Jump, CalldataCopy, Call, Const, IndirectConst, Return, ForeignCall, Mov, ConditionalMov, Load, Store, BlackBox, Trap, Stop > value
Definition acir.hpp:2564
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2672
static Array bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10277
void msgpack_pack(auto &packer) const
Definition acir.hpp:4324
std::vector< Acir::Witness > value
Definition acir.hpp:4318
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10270
friend bool operator==(const Array &, const Array &)
Definition acir.hpp:10262
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4326
void msgpack_pack(auto &packer) const
Definition acir.hpp:4304
friend bool operator==(const Simple &, const Simple &)
Definition acir.hpp:10215
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4306
static Simple bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10230
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10223
friend bool operator==(const BrilligOutputs &, const BrilligOutputs &)
Definition acir.hpp:10166
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10174
void msgpack_pack(auto &packer) const
Definition acir.hpp:4343
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4373
static BrilligOutputs bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10181
std::variant< Simple, Array > value
Definition acir.hpp:4337
Acir::PublicInputs return_values
Definition acir.hpp:5159
static Circuit bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10341
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10334
void msgpack_pack(auto &packer) const
Definition acir.hpp:5166
std::vector< Acir::Opcode > opcodes
Definition acir.hpp:5155
friend bool operator==(const Circuit &, const Circuit &)
Definition acir.hpp:10308
Acir::ExpressionWidth expression_width
Definition acir.hpp:5156
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:5178
uint32_t current_witness_index
Definition acir.hpp:5154
std::vector< Acir::Witness > private_parameters
Definition acir.hpp:5157
Acir::PublicInputs public_parameters
Definition acir.hpp:5158
std::vector< std::tuple< Acir::OpcodeLocation, Acir::AssertionPayload > > assert_messages
Definition acir.hpp:5160
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10445
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2924
static Constant bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10452
friend bool operator==(const Constant &, const Constant &)
Definition acir.hpp:10437
void msgpack_pack(auto &packer) const
Definition acir.hpp:2922
static Witness bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10499
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10492
friend bool operator==(const Witness &, const Witness &)
Definition acir.hpp:10484
void msgpack_pack(auto &packer) const
Definition acir.hpp:2942
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2944
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2991
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10395
std::variant< Constant, Witness > value
Definition acir.hpp:2955
void msgpack_pack(auto &packer) const
Definition acir.hpp:2961
static ConstantOrWitnessEnum bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10402
friend bool operator==(const ConstantOrWitnessEnum &, const ConstantOrWitnessEnum &)
Definition acir.hpp:10387
std::vector< std::tuple< std::string, Acir::Witness, Acir::Witness > > mul_terms
Definition acir.hpp:4109
static Expression bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10552
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10545
std::string q_c
Definition acir.hpp:4111
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4125
void msgpack_pack(auto &packer) const
Definition acir.hpp:4117
std::vector< std::tuple< std::string, Acir::Witness > > linear_combinations
Definition acir.hpp:4110
friend bool operator==(const Expression &, const Expression &)
Definition acir.hpp:10531
void msgpack_pack(auto &packer) const
Definition acir.hpp:4753
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4755
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10648
static Expression bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10655
friend bool operator==(const Expression &, const Expression &)
Definition acir.hpp:10640
void msgpack_pack(auto &packer) const
Definition acir.hpp:4773
friend bool operator==(const Memory &, const Memory &)
Definition acir.hpp:10687
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10695
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4775
static Memory bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10702
std::variant< Expression, Memory > value
Definition acir.hpp:4786
void msgpack_pack(auto &packer) const
Definition acir.hpp:4792
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10598
static ExpressionOrMemory bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10605
friend bool operator==(const ExpressionOrMemory &, const ExpressionOrMemory &)
Definition acir.hpp:10590
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4822
void msgpack_pack(auto &packer) const
Definition acir.hpp:4912
friend bool operator==(const Bounded &, const Bounded &)
Definition acir.hpp:10824
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4918
static Bounded bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10839
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10832
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10788
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4902
static Unbounded bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10795
friend bool operator==(const Unbounded &, const Unbounded &)
Definition acir.hpp:10783
void msgpack_pack(auto &packer) const
Definition acir.hpp:4901
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10742
std::variant< Unbounded, Bounded > value
Definition acir.hpp:4926
void msgpack_pack(auto &packer) const
Definition acir.hpp:4932
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4962
friend bool operator==(const ExpressionWidth &, const ExpressionWidth &)
Definition acir.hpp:10734
static ExpressionWidth bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10749
Acir::ConstantOrWitnessEnum input
Definition acir.hpp:3040
static FunctionInput bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10889
uint32_t num_bits
Definition acir.hpp:3041
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3054
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10882
void msgpack_pack(auto &packer) const
Definition acir.hpp:3047
friend bool operator==(const FunctionInput &, const FunctionInput &)
Definition acir.hpp:10871
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10936
void msgpack_pack(auto &packer) const
Definition acir.hpp:888
uint64_t size
Definition acir.hpp:882
static HeapArray bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10943
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:895
friend bool operator==(const HeapArray &, const HeapArray &)
Definition acir.hpp:10925
Acir::MemoryAddress pointer
Definition acir.hpp:881
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11085
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1760
static Array bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11092
void msgpack_pack(auto &packer) const
Definition acir.hpp:1753
friend bool operator==(const Array &, const Array &)
Definition acir.hpp:11074
std::vector< Acir::HeapValueType > value_types
Definition acir.hpp:1746
void msgpack_pack(auto &packer) const
Definition acir.hpp:1732
friend bool operator==(const Simple &, const Simple &)
Definition acir.hpp:11028
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11036
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1734
static Simple bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11043
static Vector bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11140
friend bool operator==(const Vector &, const Vector &)
Definition acir.hpp:11125
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1782
void msgpack_pack(auto &packer) const
Definition acir.hpp:1776
std::vector< Acir::HeapValueType > value_types
Definition acir.hpp:1770
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11133
static HeapValueType bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10994
void msgpack_pack(auto &packer) const
Definition acir.hpp:1796
friend bool operator==(const HeapValueType &, const HeapValueType &)
Definition acir.hpp:10979
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10987
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1830
std::variant< Simple, Array, Vector > value
Definition acir.hpp:1790
void msgpack_pack(auto &packer) const
Definition acir.hpp:912
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:919
static HeapVector bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11189
friend bool operator==(const HeapVector &, const HeapVector &)
Definition acir.hpp:11171
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11182
Acir::MemoryAddress size
Definition acir.hpp:906
Acir::MemoryAddress pointer
Definition acir.hpp:905
static void conv_fld_from_kvmap(std::map< std::string, msgpack::object const * > const &kvmap, std::string const &struct_name, std::string const &field_name, T &field, bool is_optional)
Definition acir.hpp:33
static std::map< std::string, msgpack::object const * > make_kvmap(msgpack::object const &o, std::string const &name)
Definition acir.hpp:15
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11479
friend bool operator==(const U128 &, const U128 &)
Definition acir.hpp:11474
static U128 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11486
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:545
void msgpack_pack(auto &packer) const
Definition acir.hpp:544
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:518
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11359
friend bool operator==(const U16 &, const U16 &)
Definition acir.hpp:11354
static U16 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11366
void msgpack_pack(auto &packer) const
Definition acir.hpp:517
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11279
static U1 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11286
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:500
void msgpack_pack(auto &packer) const
Definition acir.hpp:499
friend bool operator==(const U1 &, const U1 &)
Definition acir.hpp:11274
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11399
void msgpack_pack(auto &packer) const
Definition acir.hpp:526
friend bool operator==(const U32 &, const U32 &)
Definition acir.hpp:11394
static U32 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11406
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:527
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11439
static U64 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11446
void msgpack_pack(auto &packer) const
Definition acir.hpp:535
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:536
friend bool operator==(const U64 &, const U64 &)
Definition acir.hpp:11434
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11319
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:509
void msgpack_pack(auto &packer) const
Definition acir.hpp:508
static U8 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11326
friend bool operator==(const U8 &, const U8 &)
Definition acir.hpp:11314
static IntegerBitSize bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11240
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:600
friend bool operator==(const IntegerBitSize &, const IntegerBitSize &)
Definition acir.hpp:11225
std::variant< U1, U8, U16, U32, U64, U128 > value
Definition acir.hpp:548
void msgpack_pack(auto &packer) const
Definition acir.hpp:554
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11233
Acir::Expression value
Definition acir.hpp:4424
friend bool operator==(const MemOp &, const MemOp &)
Definition acir.hpp:11514
void msgpack_pack(auto &packer) const
Definition acir.hpp:4430
static MemOp bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11535
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4438
Acir::Expression operation
Definition acir.hpp:4422
Acir::Expression index
Definition acir.hpp:4423
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11528
static Direct bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11637
void msgpack_pack(auto &packer) const
Definition acir.hpp:763
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11630
friend bool operator==(const Direct &, const Direct &)
Definition acir.hpp:11622
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:765
void msgpack_pack(auto &packer) const
Definition acir.hpp:783
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11676
static Relative bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11683
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:785
friend bool operator==(const Relative &, const Relative &)
Definition acir.hpp:11668
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11581
static MemoryAddress bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11588
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:832
friend bool operator==(const MemoryAddress &, const MemoryAddress &)
Definition acir.hpp:11573
void msgpack_pack(auto &packer) const
Definition acir.hpp:802
std::variant< Direct, Relative > value
Definition acir.hpp:796
void msgpack_pack(auto &packer) const
Definition acir.hpp:4457
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4459
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11772
Acir::Expression value
Definition acir.hpp:4451
static AssertZero bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11779
friend bool operator==(const AssertZero &, const AssertZero &)
Definition acir.hpp:11764
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11818
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4479
Acir::BlackBoxFuncCall value
Definition acir.hpp:4471
static BlackBoxFuncCall bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11825
friend bool operator==(const BlackBoxFuncCall &, const BlackBoxFuncCall &)
Definition acir.hpp:11810
void msgpack_pack(auto &packer) const
Definition acir.hpp:4477
std::optional< Acir::Expression > predicate
Definition acir.hpp:4548
friend bool operator==(const BrilligCall &, const BrilligCall &)
Definition acir.hpp:11968
static BrilligCall bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11992
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11985
std::vector< Acir::BrilligInputs > inputs
Definition acir.hpp:4546
void msgpack_pack(auto &packer) const
Definition acir.hpp:4554
std::vector< Acir::BrilligOutputs > outputs
Definition acir.hpp:4547
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4563
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4593
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:12046
friend bool operator==(const Call &, const Call &)
Definition acir.hpp:12029
void msgpack_pack(auto &packer) const
Definition acir.hpp:4584
std::vector< Acir::Witness > outputs
Definition acir.hpp:4577
std::optional< Acir::Expression > predicate
Definition acir.hpp:4578
std::vector< Acir::Witness > inputs
Definition acir.hpp:4576
static Call bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:12053
Acir::BlockId block_id
Definition acir.hpp:4518
static MemoryInit bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11933
std::vector< Acir::Witness > init
Definition acir.hpp:4519
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11926
Acir::BlockType block_type
Definition acir.hpp:4520
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4534
void msgpack_pack(auto &packer) const
Definition acir.hpp:4526
friend bool operator==(const MemoryInit &, const MemoryInit &)
Definition acir.hpp:11912
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11871
std::optional< Acir::Expression > predicate
Definition acir.hpp:4493
friend bool operator==(const MemoryOp &, const MemoryOp &)
Definition acir.hpp:11857
static MemoryOp bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11878
void msgpack_pack(auto &packer) const
Definition acir.hpp:4499
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4507
Acir::BlockId block_id
Definition acir.hpp:4491
static Opcode bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11730
std::variant< AssertZero, BlackBoxFuncCall, MemoryOp, MemoryInit, BrilligCall, Call > value
Definition acir.hpp:4604
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4656
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11723
friend bool operator==(const Opcode &, const Opcode &)
Definition acir.hpp:11715
void msgpack_pack(auto &packer) const
Definition acir.hpp:4610
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:5014
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:12146
static Acir bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:12153
friend bool operator==(const Acir &, const Acir &)
Definition acir.hpp:12138
void msgpack_pack(auto &packer) const
Definition acir.hpp:5012
friend bool operator==(const Brillig &, const Brillig &)
Definition acir.hpp:12184
void msgpack_pack(auto &packer) const
Definition acir.hpp:5033
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:12195
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:5040
static Brillig bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:12202
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:12097
friend bool operator==(const OpcodeLocation &, const OpcodeLocation &)
Definition acir.hpp:12089
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:5085
static OpcodeLocation bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:12104
std::variant< Acir, Brillig > value
Definition acir.hpp:5049
void msgpack_pack(auto &packer) const
Definition acir.hpp:5055
void msgpack_pack(auto &packer) const
Definition acir.hpp:5221
std::vector< Acir::Circuit > functions
Definition acir.hpp:5214
friend bool operator==(const Program &, const Program &)
Definition acir.hpp:12236
static Program bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:12254
std::vector< Acir::BrilligBytecode > unconstrained_functions
Definition acir.hpp:5215
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:12247
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:5228
void msgpack_pack(auto &packer) const
Definition acir.hpp:5244
std::vector< Acir::Circuit > functions
Definition acir.hpp:5238
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:5250
static ProgramWithoutBrillig bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:12306
friend bool operator==(const ProgramWithoutBrillig &, const ProgramWithoutBrillig &)
Definition acir.hpp:12291
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:12299
friend bool operator==(const PublicInputs &, const PublicInputs &)
Definition acir.hpp:12341
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:12349
static PublicInputs bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:12356
std::vector< Acir::Witness > value
Definition acir.hpp:5134
void msgpack_pack(auto &packer) const
Definition acir.hpp:5140
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:5142
static HeapArray bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:12501
void msgpack_pack(auto &packer) const
Definition acir.hpp:1917
friend bool operator==(const HeapArray &, const HeapArray &)
Definition acir.hpp:12486
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1919
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:12494
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1939
void msgpack_pack(auto &packer) const
Definition acir.hpp:1937
friend bool operator==(const HeapVector &, const HeapVector &)
Definition acir.hpp:12533
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:12541
static HeapVector bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:12548
void msgpack_pack(auto &packer) const
Definition acir.hpp:1897
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:12447
static MemoryAddress bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:12454
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1899
friend bool operator==(const MemoryAddress &, const MemoryAddress &)
Definition acir.hpp:12439
Acir::MemoryAddress value
Definition acir.hpp:1891
void msgpack_pack(auto &packer) const
Definition acir.hpp:1956
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1990
std::variant< MemoryAddress, HeapArray, HeapVector > value
Definition acir.hpp:1950
static ValueOrArray bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:12405
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:12398
friend bool operator==(const ValueOrArray &, const ValueOrArray &)
Definition acir.hpp:12390
uint32_t value
Definition acir.hpp:2894
void msgpack_pack(auto &packer) const
Definition acir.hpp:2900
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2902
static Witness bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:12595
friend bool operator==(const Witness &, const Witness &)
Definition acir.hpp:12580
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:12588
static T deserialize(Deserializer &deserializer)
static void serialize(const T &value, Serializer &serializer)
void throw_or_abort(std::string const &err)