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
1167
1168 friend bool operator==(const Poseidon2Permutation&, const Poseidon2Permutation&);
1169 std::vector<uint8_t> bincodeSerialize() const;
1170 static Poseidon2Permutation bincodeDeserialize(std::vector<uint8_t>);
1171
1172 void msgpack_pack(auto& packer) const
1173 {
1174 packer.pack_map(2);
1175 packer.pack(std::make_pair("message", message));
1176 packer.pack(std::make_pair("output", output));
1177 }
1178
1179 void msgpack_unpack(msgpack::object const& o)
1180 {
1181 auto name = "Poseidon2Permutation";
1182 auto kvmap = Helpers::make_kvmap(o, name);
1183 Helpers::conv_fld_from_kvmap(kvmap, name, "message", message, false);
1184 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
1185 }
1186 };
1187
1192
1193 friend bool operator==(const Sha256Compression&, const Sha256Compression&);
1194 std::vector<uint8_t> bincodeSerialize() const;
1195 static Sha256Compression bincodeDeserialize(std::vector<uint8_t>);
1196
1197 void msgpack_pack(auto& packer) const
1198 {
1199 packer.pack_map(3);
1200 packer.pack(std::make_pair("input", input));
1201 packer.pack(std::make_pair("hash_values", hash_values));
1202 packer.pack(std::make_pair("output", output));
1203 }
1204
1205 void msgpack_unpack(msgpack::object const& o)
1206 {
1207 auto name = "Sha256Compression";
1208 auto kvmap = Helpers::make_kvmap(o, name);
1209 Helpers::conv_fld_from_kvmap(kvmap, name, "input", input, false);
1210 Helpers::conv_fld_from_kvmap(kvmap, name, "hash_values", hash_values, false);
1211 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
1212 }
1213 };
1214
1215 struct ToRadix {
1221
1222 friend bool operator==(const ToRadix&, const ToRadix&);
1223 std::vector<uint8_t> bincodeSerialize() const;
1224 static ToRadix bincodeDeserialize(std::vector<uint8_t>);
1225
1226 void msgpack_pack(auto& packer) const
1227 {
1228 packer.pack_map(5);
1229 packer.pack(std::make_pair("input", input));
1230 packer.pack(std::make_pair("radix", radix));
1231 packer.pack(std::make_pair("output_pointer", output_pointer));
1232 packer.pack(std::make_pair("num_limbs", num_limbs));
1233 packer.pack(std::make_pair("output_bits", output_bits));
1234 }
1235
1236 void msgpack_unpack(msgpack::object const& o)
1237 {
1238 auto name = "ToRadix";
1239 auto kvmap = Helpers::make_kvmap(o, name);
1240 Helpers::conv_fld_from_kvmap(kvmap, name, "input", input, false);
1241 Helpers::conv_fld_from_kvmap(kvmap, name, "radix", radix, false);
1242 Helpers::conv_fld_from_kvmap(kvmap, name, "output_pointer", output_pointer, false);
1243 Helpers::conv_fld_from_kvmap(kvmap, name, "num_limbs", num_limbs, false);
1244 Helpers::conv_fld_from_kvmap(kvmap, name, "output_bits", output_bits, false);
1245 }
1246 };
1247
1248 std::variant<AES128Encrypt,
1249 Blake2s,
1250 Blake3,
1251 Keccakf1600,
1252 EcdsaSecp256k1,
1253 EcdsaSecp256r1,
1254 MultiScalarMul,
1255 EmbeddedCurveAdd,
1256 Poseidon2Permutation,
1257 Sha256Compression,
1258 ToRadix>
1260
1261 friend bool operator==(const BlackBoxOp&, const BlackBoxOp&);
1262 std::vector<uint8_t> bincodeSerialize() const;
1263 static BlackBoxOp bincodeDeserialize(std::vector<uint8_t>);
1264
1265 void msgpack_pack(auto& packer) const
1266 {
1267 std::string tag;
1268 bool is_unit;
1269 switch (value.index()) {
1270
1271 case 0:
1272 tag = "AES128Encrypt";
1273 is_unit = false;
1274 break;
1275 case 1:
1276 tag = "Blake2s";
1277 is_unit = false;
1278 break;
1279 case 2:
1280 tag = "Blake3";
1281 is_unit = false;
1282 break;
1283 case 3:
1284 tag = "Keccakf1600";
1285 is_unit = false;
1286 break;
1287 case 4:
1288 tag = "EcdsaSecp256k1";
1289 is_unit = false;
1290 break;
1291 case 5:
1292 tag = "EcdsaSecp256r1";
1293 is_unit = false;
1294 break;
1295 case 6:
1296 tag = "MultiScalarMul";
1297 is_unit = false;
1298 break;
1299 case 7:
1300 tag = "EmbeddedCurveAdd";
1301 is_unit = false;
1302 break;
1303 case 8:
1304 tag = "Poseidon2Permutation";
1305 is_unit = false;
1306 break;
1307 case 9:
1308 tag = "Sha256Compression";
1309 is_unit = false;
1310 break;
1311 case 10:
1312 tag = "ToRadix";
1313 is_unit = false;
1314 break;
1315 default:
1316 throw_or_abort("unknown enum 'BlackBoxOp' variant index: " + std::to_string(value.index()));
1317 }
1318 if (is_unit) {
1319 packer.pack(tag);
1320 } else {
1321 std::visit(
1322 [&packer, tag](const auto& arg) {
1324 data[tag] = msgpack::object(arg);
1325 packer.pack(data);
1326 },
1327 value);
1328 }
1329 }
1330
1331 void msgpack_unpack(msgpack::object const& o)
1332 {
1333
1334 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
1335 std::cerr << o << std::endl;
1336 throw_or_abort("expected MAP or STR for enum 'BlackBoxOp'; got type " + std::to_string(o.type));
1337 }
1338 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
1339 throw_or_abort("expected 1 entry for enum 'BlackBoxOp'; got " + std::to_string(o.via.map.size));
1340 }
1341 std::string tag;
1342 try {
1343 if (o.type == msgpack::type::object_type::MAP) {
1344 o.via.map.ptr[0].key.convert(tag);
1345 } else {
1346 o.convert(tag);
1347 }
1348 } catch (const msgpack::type_error&) {
1349 std::cerr << o << std::endl;
1350 throw_or_abort("error converting tag to string for enum 'BlackBoxOp'");
1351 }
1352 if (tag == "AES128Encrypt") {
1353 AES128Encrypt v;
1354 try {
1355 o.via.map.ptr[0].val.convert(v);
1356 } catch (const msgpack::type_error&) {
1357 std::cerr << o << std::endl;
1358 throw_or_abort("error converting into enum variant 'BlackBoxOp::AES128Encrypt'");
1359 }
1360
1361 value = v;
1362 } else if (tag == "Blake2s") {
1363 Blake2s v;
1364 try {
1365 o.via.map.ptr[0].val.convert(v);
1366 } catch (const msgpack::type_error&) {
1367 std::cerr << o << std::endl;
1368 throw_or_abort("error converting into enum variant 'BlackBoxOp::Blake2s'");
1369 }
1370
1371 value = v;
1372 } else if (tag == "Blake3") {
1373 Blake3 v;
1374 try {
1375 o.via.map.ptr[0].val.convert(v);
1376 } catch (const msgpack::type_error&) {
1377 std::cerr << o << std::endl;
1378 throw_or_abort("error converting into enum variant 'BlackBoxOp::Blake3'");
1379 }
1380
1381 value = v;
1382 } else if (tag == "Keccakf1600") {
1383 Keccakf1600 v;
1384 try {
1385 o.via.map.ptr[0].val.convert(v);
1386 } catch (const msgpack::type_error&) {
1387 std::cerr << o << std::endl;
1388 throw_or_abort("error converting into enum variant 'BlackBoxOp::Keccakf1600'");
1389 }
1390
1391 value = v;
1392 } else if (tag == "EcdsaSecp256k1") {
1394 try {
1395 o.via.map.ptr[0].val.convert(v);
1396 } catch (const msgpack::type_error&) {
1397 std::cerr << o << std::endl;
1398 throw_or_abort("error converting into enum variant 'BlackBoxOp::EcdsaSecp256k1'");
1399 }
1400
1401 value = v;
1402 } else if (tag == "EcdsaSecp256r1") {
1404 try {
1405 o.via.map.ptr[0].val.convert(v);
1406 } catch (const msgpack::type_error&) {
1407 std::cerr << o << std::endl;
1408 throw_or_abort("error converting into enum variant 'BlackBoxOp::EcdsaSecp256r1'");
1409 }
1410
1411 value = v;
1412 } else if (tag == "MultiScalarMul") {
1414 try {
1415 o.via.map.ptr[0].val.convert(v);
1416 } catch (const msgpack::type_error&) {
1417 std::cerr << o << std::endl;
1418 throw_or_abort("error converting into enum variant 'BlackBoxOp::MultiScalarMul'");
1419 }
1420
1421 value = v;
1422 } else if (tag == "EmbeddedCurveAdd") {
1424 try {
1425 o.via.map.ptr[0].val.convert(v);
1426 } catch (const msgpack::type_error&) {
1427 std::cerr << o << std::endl;
1428 throw_or_abort("error converting into enum variant 'BlackBoxOp::EmbeddedCurveAdd'");
1429 }
1430
1431 value = v;
1432 } else if (tag == "Poseidon2Permutation") {
1434 try {
1435 o.via.map.ptr[0].val.convert(v);
1436 } catch (const msgpack::type_error&) {
1437 std::cerr << o << std::endl;
1438 throw_or_abort("error converting into enum variant 'BlackBoxOp::Poseidon2Permutation'");
1439 }
1440
1441 value = v;
1442 } else if (tag == "Sha256Compression") {
1444 try {
1445 o.via.map.ptr[0].val.convert(v);
1446 } catch (const msgpack::type_error&) {
1447 std::cerr << o << std::endl;
1448 throw_or_abort("error converting into enum variant 'BlackBoxOp::Sha256Compression'");
1449 }
1450
1451 value = v;
1452 } else if (tag == "ToRadix") {
1453 ToRadix v;
1454 try {
1455 o.via.map.ptr[0].val.convert(v);
1456 } catch (const msgpack::type_error&) {
1457 std::cerr << o << std::endl;
1458 throw_or_abort("error converting into enum variant 'BlackBoxOp::ToRadix'");
1459 }
1460
1461 value = v;
1462 } else {
1463 std::cerr << o << std::endl;
1464 throw_or_abort("unknown 'BlackBoxOp' enum variant: " + tag);
1465 }
1466 }
1467};
1468
1469struct HeapValueType;
1470
1472
1473 struct Simple {
1475
1476 friend bool operator==(const Simple&, const Simple&);
1477 std::vector<uint8_t> bincodeSerialize() const;
1478 static Simple bincodeDeserialize(std::vector<uint8_t>);
1479
1480 void msgpack_pack(auto& packer) const { packer.pack(value); }
1481
1482 void msgpack_unpack(msgpack::object const& o)
1483 {
1484 try {
1485 o.convert(value);
1486 } catch (const msgpack::type_error&) {
1487 std::cerr << o << std::endl;
1488 throw_or_abort("error converting into newtype 'Simple'");
1489 }
1490 }
1491 };
1492
1493 struct Array {
1494 std::vector<Acir::HeapValueType> value_types;
1495 uint64_t size;
1496
1497 friend bool operator==(const Array&, const Array&);
1498 std::vector<uint8_t> bincodeSerialize() const;
1499 static Array bincodeDeserialize(std::vector<uint8_t>);
1500
1501 void msgpack_pack(auto& packer) const
1502 {
1503 packer.pack_map(2);
1504 packer.pack(std::make_pair("value_types", value_types));
1505 packer.pack(std::make_pair("size", size));
1506 }
1507
1508 void msgpack_unpack(msgpack::object const& o)
1509 {
1510 auto name = "Array";
1511 auto kvmap = Helpers::make_kvmap(o, name);
1512 Helpers::conv_fld_from_kvmap(kvmap, name, "value_types", value_types, false);
1513 Helpers::conv_fld_from_kvmap(kvmap, name, "size", size, false);
1514 }
1515 };
1516
1517 struct Vector {
1518 std::vector<Acir::HeapValueType> value_types;
1519
1520 friend bool operator==(const Vector&, const Vector&);
1521 std::vector<uint8_t> bincodeSerialize() const;
1522 static Vector bincodeDeserialize(std::vector<uint8_t>);
1523
1524 void msgpack_pack(auto& packer) const
1525 {
1526 packer.pack_map(1);
1527 packer.pack(std::make_pair("value_types", value_types));
1528 }
1529
1530 void msgpack_unpack(msgpack::object const& o)
1531 {
1532 auto name = "Vector";
1533 auto kvmap = Helpers::make_kvmap(o, name);
1534 Helpers::conv_fld_from_kvmap(kvmap, name, "value_types", value_types, false);
1535 }
1536 };
1537
1539
1540 friend bool operator==(const HeapValueType&, const HeapValueType&);
1541 std::vector<uint8_t> bincodeSerialize() const;
1542 static HeapValueType bincodeDeserialize(std::vector<uint8_t>);
1543
1544 void msgpack_pack(auto& packer) const
1545 {
1546 std::string tag;
1547 bool is_unit;
1548 switch (value.index()) {
1549
1550 case 0:
1551 tag = "Simple";
1552 is_unit = false;
1553 break;
1554 case 1:
1555 tag = "Array";
1556 is_unit = false;
1557 break;
1558 case 2:
1559 tag = "Vector";
1560 is_unit = false;
1561 break;
1562 default:
1563 throw_or_abort("unknown enum 'HeapValueType' variant index: " + std::to_string(value.index()));
1564 }
1565 if (is_unit) {
1566 packer.pack(tag);
1567 } else {
1568 std::visit(
1569 [&packer, tag](const auto& arg) {
1571 data[tag] = msgpack::object(arg);
1572 packer.pack(data);
1573 },
1574 value);
1575 }
1576 }
1577
1578 void msgpack_unpack(msgpack::object const& o)
1579 {
1580
1581 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
1582 std::cerr << o << std::endl;
1583 throw_or_abort("expected MAP or STR for enum 'HeapValueType'; got type " + std::to_string(o.type));
1584 }
1585 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
1586 throw_or_abort("expected 1 entry for enum 'HeapValueType'; got " + std::to_string(o.via.map.size));
1587 }
1588 std::string tag;
1589 try {
1590 if (o.type == msgpack::type::object_type::MAP) {
1591 o.via.map.ptr[0].key.convert(tag);
1592 } else {
1593 o.convert(tag);
1594 }
1595 } catch (const msgpack::type_error&) {
1596 std::cerr << o << std::endl;
1597 throw_or_abort("error converting tag to string for enum 'HeapValueType'");
1598 }
1599 if (tag == "Simple") {
1600 Simple v;
1601 try {
1602 o.via.map.ptr[0].val.convert(v);
1603 } catch (const msgpack::type_error&) {
1604 std::cerr << o << std::endl;
1605 throw_or_abort("error converting into enum variant 'HeapValueType::Simple'");
1606 }
1607
1608 value = v;
1609 } else if (tag == "Array") {
1610 Array v;
1611 try {
1612 o.via.map.ptr[0].val.convert(v);
1613 } catch (const msgpack::type_error&) {
1614 std::cerr << o << std::endl;
1615 throw_or_abort("error converting into enum variant 'HeapValueType::Array'");
1616 }
1617
1618 value = v;
1619 } else if (tag == "Vector") {
1620 Vector v;
1621 try {
1622 o.via.map.ptr[0].val.convert(v);
1623 } catch (const msgpack::type_error&) {
1624 std::cerr << o << std::endl;
1625 throw_or_abort("error converting into enum variant 'HeapValueType::Vector'");
1626 }
1627
1628 value = v;
1629 } else {
1630 std::cerr << o << std::endl;
1631 throw_or_abort("unknown 'HeapValueType' enum variant: " + tag);
1632 }
1633 }
1634};
1635
1637
1640
1641 friend bool operator==(const MemoryAddress&, const MemoryAddress&);
1642 std::vector<uint8_t> bincodeSerialize() const;
1643 static MemoryAddress bincodeDeserialize(std::vector<uint8_t>);
1644
1645 void msgpack_pack(auto& packer) const { packer.pack(value); }
1646
1647 void msgpack_unpack(msgpack::object const& o)
1648 {
1649 try {
1650 o.convert(value);
1651 } catch (const msgpack::type_error&) {
1652 std::cerr << o << std::endl;
1653 throw_or_abort("error converting into newtype 'MemoryAddress'");
1654 }
1655 }
1656 };
1657
1658 struct HeapArray {
1660
1661 friend bool operator==(const HeapArray&, const HeapArray&);
1662 std::vector<uint8_t> bincodeSerialize() const;
1663 static HeapArray bincodeDeserialize(std::vector<uint8_t>);
1664
1665 void msgpack_pack(auto& packer) const { packer.pack(value); }
1666
1667 void msgpack_unpack(msgpack::object const& o)
1668 {
1669 try {
1670 o.convert(value);
1671 } catch (const msgpack::type_error&) {
1672 std::cerr << o << std::endl;
1673 throw_or_abort("error converting into newtype 'HeapArray'");
1674 }
1675 }
1676 };
1677
1678 struct HeapVector {
1680
1681 friend bool operator==(const HeapVector&, const HeapVector&);
1682 std::vector<uint8_t> bincodeSerialize() const;
1683 static HeapVector bincodeDeserialize(std::vector<uint8_t>);
1684
1685 void msgpack_pack(auto& packer) const { packer.pack(value); }
1686
1687 void msgpack_unpack(msgpack::object const& o)
1688 {
1689 try {
1690 o.convert(value);
1691 } catch (const msgpack::type_error&) {
1692 std::cerr << o << std::endl;
1693 throw_or_abort("error converting into newtype 'HeapVector'");
1694 }
1695 }
1696 };
1697
1699
1700 friend bool operator==(const ValueOrArray&, const ValueOrArray&);
1701 std::vector<uint8_t> bincodeSerialize() const;
1702 static ValueOrArray bincodeDeserialize(std::vector<uint8_t>);
1703
1704 void msgpack_pack(auto& packer) const
1705 {
1706 std::string tag;
1707 bool is_unit;
1708 switch (value.index()) {
1709
1710 case 0:
1711 tag = "MemoryAddress";
1712 is_unit = false;
1713 break;
1714 case 1:
1715 tag = "HeapArray";
1716 is_unit = false;
1717 break;
1718 case 2:
1719 tag = "HeapVector";
1720 is_unit = false;
1721 break;
1722 default:
1723 throw_or_abort("unknown enum 'ValueOrArray' variant index: " + std::to_string(value.index()));
1724 }
1725 if (is_unit) {
1726 packer.pack(tag);
1727 } else {
1728 std::visit(
1729 [&packer, tag](const auto& arg) {
1731 data[tag] = msgpack::object(arg);
1732 packer.pack(data);
1733 },
1734 value);
1735 }
1736 }
1737
1738 void msgpack_unpack(msgpack::object const& o)
1739 {
1740
1741 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
1742 std::cerr << o << std::endl;
1743 throw_or_abort("expected MAP or STR for enum 'ValueOrArray'; got type " + std::to_string(o.type));
1744 }
1745 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
1746 throw_or_abort("expected 1 entry for enum 'ValueOrArray'; got " + std::to_string(o.via.map.size));
1747 }
1748 std::string tag;
1749 try {
1750 if (o.type == msgpack::type::object_type::MAP) {
1751 o.via.map.ptr[0].key.convert(tag);
1752 } else {
1753 o.convert(tag);
1754 }
1755 } catch (const msgpack::type_error&) {
1756 std::cerr << o << std::endl;
1757 throw_or_abort("error converting tag to string for enum 'ValueOrArray'");
1758 }
1759 if (tag == "MemoryAddress") {
1760 MemoryAddress v;
1761 try {
1762 o.via.map.ptr[0].val.convert(v);
1763 } catch (const msgpack::type_error&) {
1764 std::cerr << o << std::endl;
1765 throw_or_abort("error converting into enum variant 'ValueOrArray::MemoryAddress'");
1766 }
1767
1768 value = v;
1769 } else if (tag == "HeapArray") {
1770 HeapArray v;
1771 try {
1772 o.via.map.ptr[0].val.convert(v);
1773 } catch (const msgpack::type_error&) {
1774 std::cerr << o << std::endl;
1775 throw_or_abort("error converting into enum variant 'ValueOrArray::HeapArray'");
1776 }
1777
1778 value = v;
1779 } else if (tag == "HeapVector") {
1780 HeapVector v;
1781 try {
1782 o.via.map.ptr[0].val.convert(v);
1783 } catch (const msgpack::type_error&) {
1784 std::cerr << o << std::endl;
1785 throw_or_abort("error converting into enum variant 'ValueOrArray::HeapVector'");
1786 }
1787
1788 value = v;
1789 } else {
1790 std::cerr << o << std::endl;
1791 throw_or_abort("unknown 'ValueOrArray' enum variant: " + tag);
1792 }
1793 }
1794};
1795
1797
1803
1804 friend bool operator==(const BinaryFieldOp&, const BinaryFieldOp&);
1805 std::vector<uint8_t> bincodeSerialize() const;
1806 static BinaryFieldOp bincodeDeserialize(std::vector<uint8_t>);
1807
1808 void msgpack_pack(auto& packer) const
1809 {
1810 packer.pack_map(4);
1811 packer.pack(std::make_pair("destination", destination));
1812 packer.pack(std::make_pair("op", op));
1813 packer.pack(std::make_pair("lhs", lhs));
1814 packer.pack(std::make_pair("rhs", rhs));
1815 }
1816
1817 void msgpack_unpack(msgpack::object const& o)
1818 {
1819 auto name = "BinaryFieldOp";
1820 auto kvmap = Helpers::make_kvmap(o, name);
1821 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
1822 Helpers::conv_fld_from_kvmap(kvmap, name, "op", op, false);
1823 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
1824 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
1825 }
1826 };
1827
1834
1835 friend bool operator==(const BinaryIntOp&, const BinaryIntOp&);
1836 std::vector<uint8_t> bincodeSerialize() const;
1837 static BinaryIntOp bincodeDeserialize(std::vector<uint8_t>);
1838
1839 void msgpack_pack(auto& packer) const
1840 {
1841 packer.pack_map(5);
1842 packer.pack(std::make_pair("destination", destination));
1843 packer.pack(std::make_pair("op", op));
1844 packer.pack(std::make_pair("bit_size", bit_size));
1845 packer.pack(std::make_pair("lhs", lhs));
1846 packer.pack(std::make_pair("rhs", rhs));
1847 }
1848
1849 void msgpack_unpack(msgpack::object const& o)
1850 {
1851 auto name = "BinaryIntOp";
1852 auto kvmap = Helpers::make_kvmap(o, name);
1853 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
1854 Helpers::conv_fld_from_kvmap(kvmap, name, "op", op, false);
1855 Helpers::conv_fld_from_kvmap(kvmap, name, "bit_size", bit_size, false);
1856 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
1857 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
1858 }
1859 };
1860
1861 struct Not {
1865
1866 friend bool operator==(const Not&, const Not&);
1867 std::vector<uint8_t> bincodeSerialize() const;
1868 static Not bincodeDeserialize(std::vector<uint8_t>);
1869
1870 void msgpack_pack(auto& packer) const
1871 {
1872 packer.pack_map(3);
1873 packer.pack(std::make_pair("destination", destination));
1874 packer.pack(std::make_pair("source", source));
1875 packer.pack(std::make_pair("bit_size", bit_size));
1876 }
1877
1878 void msgpack_unpack(msgpack::object const& o)
1879 {
1880 auto name = "Not";
1881 auto kvmap = Helpers::make_kvmap(o, name);
1882 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
1883 Helpers::conv_fld_from_kvmap(kvmap, name, "source", source, false);
1884 Helpers::conv_fld_from_kvmap(kvmap, name, "bit_size", bit_size, false);
1885 }
1886 };
1887
1888 struct Cast {
1892
1893 friend bool operator==(const Cast&, const Cast&);
1894 std::vector<uint8_t> bincodeSerialize() const;
1895 static Cast bincodeDeserialize(std::vector<uint8_t>);
1896
1897 void msgpack_pack(auto& packer) const
1898 {
1899 packer.pack_map(3);
1900 packer.pack(std::make_pair("destination", destination));
1901 packer.pack(std::make_pair("source", source));
1902 packer.pack(std::make_pair("bit_size", bit_size));
1903 }
1904
1905 void msgpack_unpack(msgpack::object const& o)
1906 {
1907 auto name = "Cast";
1908 auto kvmap = Helpers::make_kvmap(o, name);
1909 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
1910 Helpers::conv_fld_from_kvmap(kvmap, name, "source", source, false);
1911 Helpers::conv_fld_from_kvmap(kvmap, name, "bit_size", bit_size, false);
1912 }
1913 };
1914
1915 struct JumpIf {
1917 uint64_t location;
1918
1919 friend bool operator==(const JumpIf&, const JumpIf&);
1920 std::vector<uint8_t> bincodeSerialize() const;
1921 static JumpIf bincodeDeserialize(std::vector<uint8_t>);
1922
1923 void msgpack_pack(auto& packer) const
1924 {
1925 packer.pack_map(2);
1926 packer.pack(std::make_pair("condition", condition));
1927 packer.pack(std::make_pair("location", location));
1928 }
1929
1930 void msgpack_unpack(msgpack::object const& o)
1931 {
1932 auto name = "JumpIf";
1933 auto kvmap = Helpers::make_kvmap(o, name);
1934 Helpers::conv_fld_from_kvmap(kvmap, name, "condition", condition, false);
1935 Helpers::conv_fld_from_kvmap(kvmap, name, "location", location, false);
1936 }
1937 };
1938
1939 struct Jump {
1940 uint64_t location;
1941
1942 friend bool operator==(const Jump&, const Jump&);
1943 std::vector<uint8_t> bincodeSerialize() const;
1944 static Jump bincodeDeserialize(std::vector<uint8_t>);
1945
1946 void msgpack_pack(auto& packer) const
1947 {
1948 packer.pack_map(1);
1949 packer.pack(std::make_pair("location", location));
1950 }
1951
1952 void msgpack_unpack(msgpack::object const& o)
1953 {
1954 auto name = "Jump";
1955 auto kvmap = Helpers::make_kvmap(o, name);
1956 Helpers::conv_fld_from_kvmap(kvmap, name, "location", location, false);
1957 }
1958 };
1959
1964
1965 friend bool operator==(const CalldataCopy&, const CalldataCopy&);
1966 std::vector<uint8_t> bincodeSerialize() const;
1967 static CalldataCopy bincodeDeserialize(std::vector<uint8_t>);
1968
1969 void msgpack_pack(auto& packer) const
1970 {
1971 packer.pack_map(3);
1972 packer.pack(std::make_pair("destination_address", destination_address));
1973 packer.pack(std::make_pair("size_address", size_address));
1974 packer.pack(std::make_pair("offset_address", offset_address));
1975 }
1976
1977 void msgpack_unpack(msgpack::object const& o)
1978 {
1979 auto name = "CalldataCopy";
1980 auto kvmap = Helpers::make_kvmap(o, name);
1981 Helpers::conv_fld_from_kvmap(kvmap, name, "destination_address", destination_address, false);
1982 Helpers::conv_fld_from_kvmap(kvmap, name, "size_address", size_address, false);
1983 Helpers::conv_fld_from_kvmap(kvmap, name, "offset_address", offset_address, false);
1984 }
1985 };
1986
1987 struct Call {
1988 uint64_t location;
1989
1990 friend bool operator==(const Call&, const Call&);
1991 std::vector<uint8_t> bincodeSerialize() const;
1992 static Call bincodeDeserialize(std::vector<uint8_t>);
1993
1994 void msgpack_pack(auto& packer) const
1995 {
1996 packer.pack_map(1);
1997 packer.pack(std::make_pair("location", location));
1998 }
1999
2000 void msgpack_unpack(msgpack::object const& o)
2001 {
2002 auto name = "Call";
2003 auto kvmap = Helpers::make_kvmap(o, name);
2004 Helpers::conv_fld_from_kvmap(kvmap, name, "location", location, false);
2005 }
2006 };
2007
2008 struct Const {
2011 std::vector<uint8_t> value;
2012
2013 friend bool operator==(const Const&, const Const&);
2014 std::vector<uint8_t> bincodeSerialize() const;
2015 static Const bincodeDeserialize(std::vector<uint8_t>);
2016
2017 void msgpack_pack(auto& packer) const
2018 {
2019 packer.pack_map(3);
2020 packer.pack(std::make_pair("destination", destination));
2021 packer.pack(std::make_pair("bit_size", bit_size));
2022 packer.pack(std::make_pair("value", value));
2023 }
2024
2025 void msgpack_unpack(msgpack::object const& o)
2026 {
2027 auto name = "Const";
2028 auto kvmap = Helpers::make_kvmap(o, name);
2029 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
2030 Helpers::conv_fld_from_kvmap(kvmap, name, "bit_size", bit_size, false);
2031 Helpers::conv_fld_from_kvmap(kvmap, name, "value", value, false);
2032 }
2033 };
2034
2038 std::vector<uint8_t> value;
2039
2040 friend bool operator==(const IndirectConst&, const IndirectConst&);
2041 std::vector<uint8_t> bincodeSerialize() const;
2042 static IndirectConst bincodeDeserialize(std::vector<uint8_t>);
2043
2044 void msgpack_pack(auto& packer) const
2045 {
2046 packer.pack_map(3);
2047 packer.pack(std::make_pair("destination_pointer", destination_pointer));
2048 packer.pack(std::make_pair("bit_size", bit_size));
2049 packer.pack(std::make_pair("value", value));
2050 }
2051
2052 void msgpack_unpack(msgpack::object const& o)
2053 {
2054 auto name = "IndirectConst";
2055 auto kvmap = Helpers::make_kvmap(o, name);
2056 Helpers::conv_fld_from_kvmap(kvmap, name, "destination_pointer", destination_pointer, false);
2057 Helpers::conv_fld_from_kvmap(kvmap, name, "bit_size", bit_size, false);
2058 Helpers::conv_fld_from_kvmap(kvmap, name, "value", value, false);
2059 }
2060 };
2061
2062 struct Return {
2063 friend bool operator==(const Return&, const Return&);
2064 std::vector<uint8_t> bincodeSerialize() const;
2065 static Return bincodeDeserialize(std::vector<uint8_t>);
2066
2067 void msgpack_pack(auto& packer) const {}
2068 void msgpack_unpack(msgpack::object const& o) {}
2069 };
2070
2072 std::string function;
2073 std::vector<Acir::ValueOrArray> destinations;
2074 std::vector<Acir::HeapValueType> destination_value_types;
2075 std::vector<Acir::ValueOrArray> inputs;
2076 std::vector<Acir::HeapValueType> input_value_types;
2077
2078 friend bool operator==(const ForeignCall&, const ForeignCall&);
2079 std::vector<uint8_t> bincodeSerialize() const;
2080 static ForeignCall bincodeDeserialize(std::vector<uint8_t>);
2081
2082 void msgpack_pack(auto& packer) const
2083 {
2084 packer.pack_map(5);
2085 packer.pack(std::make_pair("function", function));
2086 packer.pack(std::make_pair("destinations", destinations));
2087 packer.pack(std::make_pair("destination_value_types", destination_value_types));
2088 packer.pack(std::make_pair("inputs", inputs));
2089 packer.pack(std::make_pair("input_value_types", input_value_types));
2090 }
2091
2092 void msgpack_unpack(msgpack::object const& o)
2093 {
2094 auto name = "ForeignCall";
2095 auto kvmap = Helpers::make_kvmap(o, name);
2096 Helpers::conv_fld_from_kvmap(kvmap, name, "function", function, false);
2097 Helpers::conv_fld_from_kvmap(kvmap, name, "destinations", destinations, false);
2098 Helpers::conv_fld_from_kvmap(kvmap, name, "destination_value_types", destination_value_types, false);
2099 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
2100 Helpers::conv_fld_from_kvmap(kvmap, name, "input_value_types", input_value_types, false);
2101 }
2102 };
2103
2104 struct Mov {
2107
2108 friend bool operator==(const Mov&, const Mov&);
2109 std::vector<uint8_t> bincodeSerialize() const;
2110 static Mov bincodeDeserialize(std::vector<uint8_t>);
2111
2112 void msgpack_pack(auto& packer) const
2113 {
2114 packer.pack_map(2);
2115 packer.pack(std::make_pair("destination", destination));
2116 packer.pack(std::make_pair("source", source));
2117 }
2118
2119 void msgpack_unpack(msgpack::object const& o)
2120 {
2121 auto name = "Mov";
2122 auto kvmap = Helpers::make_kvmap(o, name);
2123 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
2124 Helpers::conv_fld_from_kvmap(kvmap, name, "source", source, false);
2125 }
2126 };
2127
2133
2134 friend bool operator==(const ConditionalMov&, const ConditionalMov&);
2135 std::vector<uint8_t> bincodeSerialize() const;
2136 static ConditionalMov bincodeDeserialize(std::vector<uint8_t>);
2137
2138 void msgpack_pack(auto& packer) const
2139 {
2140 packer.pack_map(4);
2141 packer.pack(std::make_pair("destination", destination));
2142 packer.pack(std::make_pair("source_a", source_a));
2143 packer.pack(std::make_pair("source_b", source_b));
2144 packer.pack(std::make_pair("condition", condition));
2145 }
2146
2147 void msgpack_unpack(msgpack::object const& o)
2148 {
2149 auto name = "ConditionalMov";
2150 auto kvmap = Helpers::make_kvmap(o, name);
2151 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
2152 Helpers::conv_fld_from_kvmap(kvmap, name, "source_a", source_a, false);
2153 Helpers::conv_fld_from_kvmap(kvmap, name, "source_b", source_b, false);
2154 Helpers::conv_fld_from_kvmap(kvmap, name, "condition", condition, false);
2155 }
2156 };
2157
2158 struct Load {
2161
2162 friend bool operator==(const Load&, const Load&);
2163 std::vector<uint8_t> bincodeSerialize() const;
2164 static Load bincodeDeserialize(std::vector<uint8_t>);
2165
2166 void msgpack_pack(auto& packer) const
2167 {
2168 packer.pack_map(2);
2169 packer.pack(std::make_pair("destination", destination));
2170 packer.pack(std::make_pair("source_pointer", source_pointer));
2171 }
2172
2173 void msgpack_unpack(msgpack::object const& o)
2174 {
2175 auto name = "Load";
2176 auto kvmap = Helpers::make_kvmap(o, name);
2177 Helpers::conv_fld_from_kvmap(kvmap, name, "destination", destination, false);
2178 Helpers::conv_fld_from_kvmap(kvmap, name, "source_pointer", source_pointer, false);
2179 }
2180 };
2181
2182 struct Store {
2185
2186 friend bool operator==(const Store&, const Store&);
2187 std::vector<uint8_t> bincodeSerialize() const;
2188 static Store bincodeDeserialize(std::vector<uint8_t>);
2189
2190 void msgpack_pack(auto& packer) const
2191 {
2192 packer.pack_map(2);
2193 packer.pack(std::make_pair("destination_pointer", destination_pointer));
2194 packer.pack(std::make_pair("source", source));
2195 }
2196
2197 void msgpack_unpack(msgpack::object const& o)
2198 {
2199 auto name = "Store";
2200 auto kvmap = Helpers::make_kvmap(o, name);
2201 Helpers::conv_fld_from_kvmap(kvmap, name, "destination_pointer", destination_pointer, false);
2202 Helpers::conv_fld_from_kvmap(kvmap, name, "source", source, false);
2203 }
2204 };
2205
2206 struct BlackBox {
2208
2209 friend bool operator==(const BlackBox&, const BlackBox&);
2210 std::vector<uint8_t> bincodeSerialize() const;
2211 static BlackBox bincodeDeserialize(std::vector<uint8_t>);
2212
2213 void msgpack_pack(auto& packer) const { packer.pack(value); }
2214
2215 void msgpack_unpack(msgpack::object const& o)
2216 {
2217 try {
2218 o.convert(value);
2219 } catch (const msgpack::type_error&) {
2220 std::cerr << o << std::endl;
2221 throw_or_abort("error converting into newtype 'BlackBox'");
2222 }
2223 }
2224 };
2225
2226 struct Trap {
2228
2229 friend bool operator==(const Trap&, const Trap&);
2230 std::vector<uint8_t> bincodeSerialize() const;
2231 static Trap bincodeDeserialize(std::vector<uint8_t>);
2232
2233 void msgpack_pack(auto& packer) const
2234 {
2235 packer.pack_map(1);
2236 packer.pack(std::make_pair("revert_data", revert_data));
2237 }
2238
2239 void msgpack_unpack(msgpack::object const& o)
2240 {
2241 auto name = "Trap";
2242 auto kvmap = Helpers::make_kvmap(o, name);
2243 Helpers::conv_fld_from_kvmap(kvmap, name, "revert_data", revert_data, false);
2244 }
2245 };
2246
2247 struct Stop {
2249
2250 friend bool operator==(const Stop&, const Stop&);
2251 std::vector<uint8_t> bincodeSerialize() const;
2252 static Stop bincodeDeserialize(std::vector<uint8_t>);
2253
2254 void msgpack_pack(auto& packer) const
2255 {
2256 packer.pack_map(1);
2257 packer.pack(std::make_pair("return_data", return_data));
2258 }
2259
2260 void msgpack_unpack(msgpack::object const& o)
2261 {
2262 auto name = "Stop";
2263 auto kvmap = Helpers::make_kvmap(o, name);
2264 Helpers::conv_fld_from_kvmap(kvmap, name, "return_data", return_data, false);
2265 }
2266 };
2267
2270 Not,
2271 Cast,
2272 JumpIf,
2273 Jump,
2274 CalldataCopy,
2275 Call,
2276 Const,
2277 IndirectConst,
2278 Return,
2279 ForeignCall,
2280 Mov,
2281 ConditionalMov,
2282 Load,
2283 Store,
2284 BlackBox,
2285 Trap,
2286 Stop>
2288
2289 friend bool operator==(const BrilligOpcode&, const BrilligOpcode&);
2290 std::vector<uint8_t> bincodeSerialize() const;
2291 static BrilligOpcode bincodeDeserialize(std::vector<uint8_t>);
2292
2293 void msgpack_pack(auto& packer) const
2294 {
2295 std::string tag;
2296 bool is_unit;
2297 switch (value.index()) {
2298
2299 case 0:
2300 tag = "BinaryFieldOp";
2301 is_unit = false;
2302 break;
2303 case 1:
2304 tag = "BinaryIntOp";
2305 is_unit = false;
2306 break;
2307 case 2:
2308 tag = "Not";
2309 is_unit = false;
2310 break;
2311 case 3:
2312 tag = "Cast";
2313 is_unit = false;
2314 break;
2315 case 4:
2316 tag = "JumpIf";
2317 is_unit = false;
2318 break;
2319 case 5:
2320 tag = "Jump";
2321 is_unit = false;
2322 break;
2323 case 6:
2324 tag = "CalldataCopy";
2325 is_unit = false;
2326 break;
2327 case 7:
2328 tag = "Call";
2329 is_unit = false;
2330 break;
2331 case 8:
2332 tag = "Const";
2333 is_unit = false;
2334 break;
2335 case 9:
2336 tag = "IndirectConst";
2337 is_unit = false;
2338 break;
2339 case 10:
2340 tag = "Return";
2341 is_unit = true;
2342 break;
2343 case 11:
2344 tag = "ForeignCall";
2345 is_unit = false;
2346 break;
2347 case 12:
2348 tag = "Mov";
2349 is_unit = false;
2350 break;
2351 case 13:
2352 tag = "ConditionalMov";
2353 is_unit = false;
2354 break;
2355 case 14:
2356 tag = "Load";
2357 is_unit = false;
2358 break;
2359 case 15:
2360 tag = "Store";
2361 is_unit = false;
2362 break;
2363 case 16:
2364 tag = "BlackBox";
2365 is_unit = false;
2366 break;
2367 case 17:
2368 tag = "Trap";
2369 is_unit = false;
2370 break;
2371 case 18:
2372 tag = "Stop";
2373 is_unit = false;
2374 break;
2375 default:
2376 throw_or_abort("unknown enum 'BrilligOpcode' variant index: " + std::to_string(value.index()));
2377 }
2378 if (is_unit) {
2379 packer.pack(tag);
2380 } else {
2381 std::visit(
2382 [&packer, tag](const auto& arg) {
2384 data[tag] = msgpack::object(arg);
2385 packer.pack(data);
2386 },
2387 value);
2388 }
2389 }
2390
2391 void msgpack_unpack(msgpack::object const& o)
2392 {
2393
2394 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
2395 std::cerr << o << std::endl;
2396 throw_or_abort("expected MAP or STR for enum 'BrilligOpcode'; got type " + std::to_string(o.type));
2397 }
2398 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
2399 throw_or_abort("expected 1 entry for enum 'BrilligOpcode'; got " + std::to_string(o.via.map.size));
2400 }
2401 std::string tag;
2402 try {
2403 if (o.type == msgpack::type::object_type::MAP) {
2404 o.via.map.ptr[0].key.convert(tag);
2405 } else {
2406 o.convert(tag);
2407 }
2408 } catch (const msgpack::type_error&) {
2409 std::cerr << o << std::endl;
2410 throw_or_abort("error converting tag to string for enum 'BrilligOpcode'");
2411 }
2412 if (tag == "BinaryFieldOp") {
2413 BinaryFieldOp v;
2414 try {
2415 o.via.map.ptr[0].val.convert(v);
2416 } catch (const msgpack::type_error&) {
2417 std::cerr << o << std::endl;
2418 throw_or_abort("error converting into enum variant 'BrilligOpcode::BinaryFieldOp'");
2419 }
2420
2421 value = v;
2422 } else if (tag == "BinaryIntOp") {
2423 BinaryIntOp v;
2424 try {
2425 o.via.map.ptr[0].val.convert(v);
2426 } catch (const msgpack::type_error&) {
2427 std::cerr << o << std::endl;
2428 throw_or_abort("error converting into enum variant 'BrilligOpcode::BinaryIntOp'");
2429 }
2430
2431 value = v;
2432 } else if (tag == "Not") {
2433 Not v;
2434 try {
2435 o.via.map.ptr[0].val.convert(v);
2436 } catch (const msgpack::type_error&) {
2437 std::cerr << o << std::endl;
2438 throw_or_abort("error converting into enum variant 'BrilligOpcode::Not'");
2439 }
2440
2441 value = v;
2442 } else if (tag == "Cast") {
2443 Cast v;
2444 try {
2445 o.via.map.ptr[0].val.convert(v);
2446 } catch (const msgpack::type_error&) {
2447 std::cerr << o << std::endl;
2448 throw_or_abort("error converting into enum variant 'BrilligOpcode::Cast'");
2449 }
2450
2451 value = v;
2452 } else if (tag == "JumpIf") {
2453 JumpIf v;
2454 try {
2455 o.via.map.ptr[0].val.convert(v);
2456 } catch (const msgpack::type_error&) {
2457 std::cerr << o << std::endl;
2458 throw_or_abort("error converting into enum variant 'BrilligOpcode::JumpIf'");
2459 }
2460
2461 value = v;
2462 } else if (tag == "Jump") {
2463 Jump v;
2464 try {
2465 o.via.map.ptr[0].val.convert(v);
2466 } catch (const msgpack::type_error&) {
2467 std::cerr << o << std::endl;
2468 throw_or_abort("error converting into enum variant 'BrilligOpcode::Jump'");
2469 }
2470
2471 value = v;
2472 } else if (tag == "CalldataCopy") {
2473 CalldataCopy v;
2474 try {
2475 o.via.map.ptr[0].val.convert(v);
2476 } catch (const msgpack::type_error&) {
2477 std::cerr << o << std::endl;
2478 throw_or_abort("error converting into enum variant 'BrilligOpcode::CalldataCopy'");
2479 }
2480
2481 value = v;
2482 } else if (tag == "Call") {
2483 Call v;
2484 try {
2485 o.via.map.ptr[0].val.convert(v);
2486 } catch (const msgpack::type_error&) {
2487 std::cerr << o << std::endl;
2488 throw_or_abort("error converting into enum variant 'BrilligOpcode::Call'");
2489 }
2490
2491 value = v;
2492 } else if (tag == "Const") {
2493 Const v;
2494 try {
2495 o.via.map.ptr[0].val.convert(v);
2496 } catch (const msgpack::type_error&) {
2497 std::cerr << o << std::endl;
2498 throw_or_abort("error converting into enum variant 'BrilligOpcode::Const'");
2499 }
2500
2501 value = v;
2502 } else if (tag == "IndirectConst") {
2503 IndirectConst v;
2504 try {
2505 o.via.map.ptr[0].val.convert(v);
2506 } catch (const msgpack::type_error&) {
2507 std::cerr << o << std::endl;
2508 throw_or_abort("error converting into enum variant 'BrilligOpcode::IndirectConst'");
2509 }
2510
2511 value = v;
2512 } else if (tag == "Return") {
2513 Return v;
2514 value = v;
2515 } else if (tag == "ForeignCall") {
2516 ForeignCall v;
2517 try {
2518 o.via.map.ptr[0].val.convert(v);
2519 } catch (const msgpack::type_error&) {
2520 std::cerr << o << std::endl;
2521 throw_or_abort("error converting into enum variant 'BrilligOpcode::ForeignCall'");
2522 }
2523
2524 value = v;
2525 } else if (tag == "Mov") {
2526 Mov v;
2527 try {
2528 o.via.map.ptr[0].val.convert(v);
2529 } catch (const msgpack::type_error&) {
2530 std::cerr << o << std::endl;
2531 throw_or_abort("error converting into enum variant 'BrilligOpcode::Mov'");
2532 }
2533
2534 value = v;
2535 } else if (tag == "ConditionalMov") {
2537 try {
2538 o.via.map.ptr[0].val.convert(v);
2539 } catch (const msgpack::type_error&) {
2540 std::cerr << o << std::endl;
2541 throw_or_abort("error converting into enum variant 'BrilligOpcode::ConditionalMov'");
2542 }
2543
2544 value = v;
2545 } else if (tag == "Load") {
2546 Load v;
2547 try {
2548 o.via.map.ptr[0].val.convert(v);
2549 } catch (const msgpack::type_error&) {
2550 std::cerr << o << std::endl;
2551 throw_or_abort("error converting into enum variant 'BrilligOpcode::Load'");
2552 }
2553
2554 value = v;
2555 } else if (tag == "Store") {
2556 Store v;
2557 try {
2558 o.via.map.ptr[0].val.convert(v);
2559 } catch (const msgpack::type_error&) {
2560 std::cerr << o << std::endl;
2561 throw_or_abort("error converting into enum variant 'BrilligOpcode::Store'");
2562 }
2563
2564 value = v;
2565 } else if (tag == "BlackBox") {
2566 BlackBox v;
2567 try {
2568 o.via.map.ptr[0].val.convert(v);
2569 } catch (const msgpack::type_error&) {
2570 std::cerr << o << std::endl;
2571 throw_or_abort("error converting into enum variant 'BrilligOpcode::BlackBox'");
2572 }
2573
2574 value = v;
2575 } else if (tag == "Trap") {
2576 Trap v;
2577 try {
2578 o.via.map.ptr[0].val.convert(v);
2579 } catch (const msgpack::type_error&) {
2580 std::cerr << o << std::endl;
2581 throw_or_abort("error converting into enum variant 'BrilligOpcode::Trap'");
2582 }
2583
2584 value = v;
2585 } else if (tag == "Stop") {
2586 Stop v;
2587 try {
2588 o.via.map.ptr[0].val.convert(v);
2589 } catch (const msgpack::type_error&) {
2590 std::cerr << o << std::endl;
2591 throw_or_abort("error converting into enum variant 'BrilligOpcode::Stop'");
2592 }
2593
2594 value = v;
2595 } else {
2596 std::cerr << o << std::endl;
2597 throw_or_abort("unknown 'BrilligOpcode' enum variant: " + tag);
2598 }
2599 }
2600};
2601
2602struct Witness {
2603 uint32_t value;
2604
2605 friend bool operator==(const Witness&, const Witness&);
2606 std::vector<uint8_t> bincodeSerialize() const;
2607 static Witness bincodeDeserialize(std::vector<uint8_t>);
2608
2609 void msgpack_pack(auto& packer) const { packer.pack(value); }
2610
2611 void msgpack_unpack(msgpack::object const& o)
2612 {
2613 try {
2614 o.convert(value);
2615 } catch (const msgpack::type_error&) {
2616 std::cerr << o << std::endl;
2617 throw_or_abort("error converting into newtype 'Witness'");
2618 }
2619 }
2620};
2621
2623
2624 struct Constant {
2625 std::vector<uint8_t> value;
2626
2627 friend bool operator==(const Constant&, const Constant&);
2628 std::vector<uint8_t> bincodeSerialize() const;
2629 static Constant bincodeDeserialize(std::vector<uint8_t>);
2630
2631 void msgpack_pack(auto& packer) const { packer.pack(value); }
2632
2633 void msgpack_unpack(msgpack::object const& o)
2634 {
2635 try {
2636 o.convert(value);
2637 } catch (const msgpack::type_error&) {
2638 std::cerr << o << std::endl;
2639 throw_or_abort("error converting into newtype 'Constant'");
2640 }
2641 }
2642 };
2643
2644 struct Witness {
2646
2647 friend bool operator==(const Witness&, const Witness&);
2648 std::vector<uint8_t> bincodeSerialize() const;
2649 static Witness bincodeDeserialize(std::vector<uint8_t>);
2650
2651 void msgpack_pack(auto& packer) const { packer.pack(value); }
2652
2653 void msgpack_unpack(msgpack::object const& o)
2654 {
2655 try {
2656 o.convert(value);
2657 } catch (const msgpack::type_error&) {
2658 std::cerr << o << std::endl;
2659 throw_or_abort("error converting into newtype 'Witness'");
2660 }
2661 }
2662 };
2663
2665
2666 friend bool operator==(const FunctionInput&, const FunctionInput&);
2667 std::vector<uint8_t> bincodeSerialize() const;
2668 static FunctionInput bincodeDeserialize(std::vector<uint8_t>);
2669
2670 void msgpack_pack(auto& packer) const
2671 {
2672 std::string tag;
2673 bool is_unit;
2674 switch (value.index()) {
2675
2676 case 0:
2677 tag = "Constant";
2678 is_unit = false;
2679 break;
2680 case 1:
2681 tag = "Witness";
2682 is_unit = false;
2683 break;
2684 default:
2685 throw_or_abort("unknown enum 'FunctionInput' variant index: " + std::to_string(value.index()));
2686 }
2687 if (is_unit) {
2688 packer.pack(tag);
2689 } else {
2690 std::visit(
2691 [&packer, tag](const auto& arg) {
2693 data[tag] = msgpack::object(arg);
2694 packer.pack(data);
2695 },
2696 value);
2697 }
2698 }
2699
2700 void msgpack_unpack(msgpack::object const& o)
2701 {
2702
2703 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
2704 std::cerr << o << std::endl;
2705 throw_or_abort("expected MAP or STR for enum 'FunctionInput'; got type " + std::to_string(o.type));
2706 }
2707 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
2708 throw_or_abort("expected 1 entry for enum 'FunctionInput'; got " + std::to_string(o.via.map.size));
2709 }
2710 std::string tag;
2711 try {
2712 if (o.type == msgpack::type::object_type::MAP) {
2713 o.via.map.ptr[0].key.convert(tag);
2714 } else {
2715 o.convert(tag);
2716 }
2717 } catch (const msgpack::type_error&) {
2718 std::cerr << o << std::endl;
2719 throw_or_abort("error converting tag to string for enum 'FunctionInput'");
2720 }
2721 if (tag == "Constant") {
2722 Constant v;
2723 try {
2724 o.via.map.ptr[0].val.convert(v);
2725 } catch (const msgpack::type_error&) {
2726 std::cerr << o << std::endl;
2727 throw_or_abort("error converting into enum variant 'FunctionInput::Constant'");
2728 }
2729
2730 value = v;
2731 } else if (tag == "Witness") {
2732 Witness v;
2733 try {
2734 o.via.map.ptr[0].val.convert(v);
2735 } catch (const msgpack::type_error&) {
2736 std::cerr << o << std::endl;
2737 throw_or_abort("error converting into enum variant 'FunctionInput::Witness'");
2738 }
2739
2740 value = v;
2741 } else {
2742 std::cerr << o << std::endl;
2743 throw_or_abort("unknown 'FunctionInput' enum variant: " + tag);
2744 }
2745 }
2746};
2747
2749
2751 std::vector<Acir::FunctionInput> inputs;
2754 std::vector<Acir::Witness> outputs;
2755
2756 friend bool operator==(const AES128Encrypt&, const AES128Encrypt&);
2757 std::vector<uint8_t> bincodeSerialize() const;
2758 static AES128Encrypt bincodeDeserialize(std::vector<uint8_t>);
2759
2760 void msgpack_pack(auto& packer) const
2761 {
2762 packer.pack_map(4);
2763 packer.pack(std::make_pair("inputs", inputs));
2764 packer.pack(std::make_pair("iv", iv));
2765 packer.pack(std::make_pair("key", key));
2766 packer.pack(std::make_pair("outputs", outputs));
2767 }
2768
2769 void msgpack_unpack(msgpack::object const& o)
2770 {
2771 auto name = "AES128Encrypt";
2772 auto kvmap = Helpers::make_kvmap(o, name);
2773 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
2774 Helpers::conv_fld_from_kvmap(kvmap, name, "iv", iv, false);
2775 Helpers::conv_fld_from_kvmap(kvmap, name, "key", key, false);
2776 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
2777 }
2778 };
2779
2780 struct AND {
2783 uint32_t num_bits;
2785
2786 friend bool operator==(const AND&, const AND&);
2787 std::vector<uint8_t> bincodeSerialize() const;
2788 static AND bincodeDeserialize(std::vector<uint8_t>);
2789
2790 void msgpack_pack(auto& packer) const
2791 {
2792 packer.pack_map(4);
2793 packer.pack(std::make_pair("lhs", lhs));
2794 packer.pack(std::make_pair("rhs", rhs));
2795 packer.pack(std::make_pair("num_bits", num_bits));
2796 packer.pack(std::make_pair("output", output));
2797 }
2798
2799 void msgpack_unpack(msgpack::object const& o)
2800 {
2801 auto name = "AND";
2802 auto kvmap = Helpers::make_kvmap(o, name);
2803 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
2804 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
2805 Helpers::conv_fld_from_kvmap(kvmap, name, "num_bits", num_bits, false);
2806 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
2807 }
2808 };
2809
2810 struct XOR {
2813 uint32_t num_bits;
2815
2816 friend bool operator==(const XOR&, const XOR&);
2817 std::vector<uint8_t> bincodeSerialize() const;
2818 static XOR bincodeDeserialize(std::vector<uint8_t>);
2819
2820 void msgpack_pack(auto& packer) const
2821 {
2822 packer.pack_map(4);
2823 packer.pack(std::make_pair("lhs", lhs));
2824 packer.pack(std::make_pair("rhs", rhs));
2825 packer.pack(std::make_pair("num_bits", num_bits));
2826 packer.pack(std::make_pair("output", output));
2827 }
2828
2829 void msgpack_unpack(msgpack::object const& o)
2830 {
2831 auto name = "XOR";
2832 auto kvmap = Helpers::make_kvmap(o, name);
2833 Helpers::conv_fld_from_kvmap(kvmap, name, "lhs", lhs, false);
2834 Helpers::conv_fld_from_kvmap(kvmap, name, "rhs", rhs, false);
2835 Helpers::conv_fld_from_kvmap(kvmap, name, "num_bits", num_bits, false);
2836 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
2837 }
2838 };
2839
2840 struct RANGE {
2842 uint32_t num_bits;
2843
2844 friend bool operator==(const RANGE&, const RANGE&);
2845 std::vector<uint8_t> bincodeSerialize() const;
2846 static RANGE bincodeDeserialize(std::vector<uint8_t>);
2847
2848 void msgpack_pack(auto& packer) const
2849 {
2850 packer.pack_map(2);
2851 packer.pack(std::make_pair("input", input));
2852 packer.pack(std::make_pair("num_bits", num_bits));
2853 }
2854
2855 void msgpack_unpack(msgpack::object const& o)
2856 {
2857 auto name = "RANGE";
2858 auto kvmap = Helpers::make_kvmap(o, name);
2859 Helpers::conv_fld_from_kvmap(kvmap, name, "input", input, false);
2860 Helpers::conv_fld_from_kvmap(kvmap, name, "num_bits", num_bits, false);
2861 }
2862 };
2863
2864 struct Blake2s {
2865 std::vector<Acir::FunctionInput> inputs;
2867
2868 friend bool operator==(const Blake2s&, const Blake2s&);
2869 std::vector<uint8_t> bincodeSerialize() const;
2870 static Blake2s bincodeDeserialize(std::vector<uint8_t>);
2871
2872 void msgpack_pack(auto& packer) const
2873 {
2874 packer.pack_map(2);
2875 packer.pack(std::make_pair("inputs", inputs));
2876 packer.pack(std::make_pair("outputs", outputs));
2877 }
2878
2879 void msgpack_unpack(msgpack::object const& o)
2880 {
2881 auto name = "Blake2s";
2882 auto kvmap = Helpers::make_kvmap(o, name);
2883 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
2884 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
2885 }
2886 };
2887
2888 struct Blake3 {
2889 std::vector<Acir::FunctionInput> inputs;
2891
2892 friend bool operator==(const Blake3&, const Blake3&);
2893 std::vector<uint8_t> bincodeSerialize() const;
2894 static Blake3 bincodeDeserialize(std::vector<uint8_t>);
2895
2896 void msgpack_pack(auto& packer) const
2897 {
2898 packer.pack_map(2);
2899 packer.pack(std::make_pair("inputs", inputs));
2900 packer.pack(std::make_pair("outputs", outputs));
2901 }
2902
2903 void msgpack_unpack(msgpack::object const& o)
2904 {
2905 auto name = "Blake3";
2906 auto kvmap = Helpers::make_kvmap(o, name);
2907 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
2908 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
2909 }
2910 };
2911
2919
2920 friend bool operator==(const EcdsaSecp256k1&, const EcdsaSecp256k1&);
2921 std::vector<uint8_t> bincodeSerialize() const;
2922 static EcdsaSecp256k1 bincodeDeserialize(std::vector<uint8_t>);
2923
2924 void msgpack_pack(auto& packer) const
2925 {
2926 packer.pack_map(6);
2927 packer.pack(std::make_pair("public_key_x", public_key_x));
2928 packer.pack(std::make_pair("public_key_y", public_key_y));
2929 packer.pack(std::make_pair("signature", signature));
2930 packer.pack(std::make_pair("hashed_message", hashed_message));
2931 packer.pack(std::make_pair("predicate", predicate));
2932 packer.pack(std::make_pair("output", output));
2933 }
2934
2935 void msgpack_unpack(msgpack::object const& o)
2936 {
2937 auto name = "EcdsaSecp256k1";
2938 auto kvmap = Helpers::make_kvmap(o, name);
2939 Helpers::conv_fld_from_kvmap(kvmap, name, "public_key_x", public_key_x, false);
2940 Helpers::conv_fld_from_kvmap(kvmap, name, "public_key_y", public_key_y, false);
2941 Helpers::conv_fld_from_kvmap(kvmap, name, "signature", signature, false);
2942 Helpers::conv_fld_from_kvmap(kvmap, name, "hashed_message", hashed_message, false);
2943 Helpers::conv_fld_from_kvmap(kvmap, name, "predicate", predicate, false);
2944 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
2945 }
2946 };
2947
2955
2956 friend bool operator==(const EcdsaSecp256r1&, const EcdsaSecp256r1&);
2957 std::vector<uint8_t> bincodeSerialize() const;
2958 static EcdsaSecp256r1 bincodeDeserialize(std::vector<uint8_t>);
2959
2960 void msgpack_pack(auto& packer) const
2961 {
2962 packer.pack_map(6);
2963 packer.pack(std::make_pair("public_key_x", public_key_x));
2964 packer.pack(std::make_pair("public_key_y", public_key_y));
2965 packer.pack(std::make_pair("signature", signature));
2966 packer.pack(std::make_pair("hashed_message", hashed_message));
2967 packer.pack(std::make_pair("predicate", predicate));
2968 packer.pack(std::make_pair("output", output));
2969 }
2970
2971 void msgpack_unpack(msgpack::object const& o)
2972 {
2973 auto name = "EcdsaSecp256r1";
2974 auto kvmap = Helpers::make_kvmap(o, name);
2975 Helpers::conv_fld_from_kvmap(kvmap, name, "public_key_x", public_key_x, false);
2976 Helpers::conv_fld_from_kvmap(kvmap, name, "public_key_y", public_key_y, false);
2977 Helpers::conv_fld_from_kvmap(kvmap, name, "signature", signature, false);
2978 Helpers::conv_fld_from_kvmap(kvmap, name, "hashed_message", hashed_message, false);
2979 Helpers::conv_fld_from_kvmap(kvmap, name, "predicate", predicate, false);
2980 Helpers::conv_fld_from_kvmap(kvmap, name, "output", output, false);
2981 }
2982 };
2983
2985 std::vector<Acir::FunctionInput> points;
2986 std::vector<Acir::FunctionInput> scalars;
2989
2990 friend bool operator==(const MultiScalarMul&, const MultiScalarMul&);
2991 std::vector<uint8_t> bincodeSerialize() const;
2992 static MultiScalarMul bincodeDeserialize(std::vector<uint8_t>);
2993
2994 void msgpack_pack(auto& packer) const
2995 {
2996 packer.pack_map(4);
2997 packer.pack(std::make_pair("points", points));
2998 packer.pack(std::make_pair("scalars", scalars));
2999 packer.pack(std::make_pair("predicate", predicate));
3000 packer.pack(std::make_pair("outputs", outputs));
3001 }
3002
3003 void msgpack_unpack(msgpack::object const& o)
3004 {
3005 auto name = "MultiScalarMul";
3006 auto kvmap = Helpers::make_kvmap(o, name);
3007 Helpers::conv_fld_from_kvmap(kvmap, name, "points", points, false);
3008 Helpers::conv_fld_from_kvmap(kvmap, name, "scalars", scalars, false);
3009 Helpers::conv_fld_from_kvmap(kvmap, name, "predicate", predicate, false);
3010 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
3011 }
3012 };
3013
3019
3020 friend bool operator==(const EmbeddedCurveAdd&, const EmbeddedCurveAdd&);
3021 std::vector<uint8_t> bincodeSerialize() const;
3022 static EmbeddedCurveAdd bincodeDeserialize(std::vector<uint8_t>);
3023
3024 void msgpack_pack(auto& packer) const
3025 {
3026 packer.pack_map(4);
3027 packer.pack(std::make_pair("input1", input1));
3028 packer.pack(std::make_pair("input2", input2));
3029 packer.pack(std::make_pair("predicate", predicate));
3030 packer.pack(std::make_pair("outputs", outputs));
3031 }
3032
3033 void msgpack_unpack(msgpack::object const& o)
3034 {
3035 auto name = "EmbeddedCurveAdd";
3036 auto kvmap = Helpers::make_kvmap(o, name);
3037 Helpers::conv_fld_from_kvmap(kvmap, name, "input1", input1, false);
3038 Helpers::conv_fld_from_kvmap(kvmap, name, "input2", input2, false);
3039 Helpers::conv_fld_from_kvmap(kvmap, name, "predicate", predicate, false);
3040 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
3041 }
3042 };
3043
3047
3048 friend bool operator==(const Keccakf1600&, const Keccakf1600&);
3049 std::vector<uint8_t> bincodeSerialize() const;
3050 static Keccakf1600 bincodeDeserialize(std::vector<uint8_t>);
3051
3052 void msgpack_pack(auto& packer) const
3053 {
3054 packer.pack_map(2);
3055 packer.pack(std::make_pair("inputs", inputs));
3056 packer.pack(std::make_pair("outputs", outputs));
3057 }
3058
3059 void msgpack_unpack(msgpack::object const& o)
3060 {
3061 auto name = "Keccakf1600";
3062 auto kvmap = Helpers::make_kvmap(o, name);
3063 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
3064 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
3065 }
3066 };
3067
3069 std::vector<Acir::FunctionInput> verification_key;
3070 std::vector<Acir::FunctionInput> proof;
3071 std::vector<Acir::FunctionInput> public_inputs;
3073 uint32_t proof_type;
3075
3076 friend bool operator==(const RecursiveAggregation&, const RecursiveAggregation&);
3077 std::vector<uint8_t> bincodeSerialize() const;
3078 static RecursiveAggregation bincodeDeserialize(std::vector<uint8_t>);
3079
3080 void msgpack_pack(auto& packer) const
3081 {
3082 packer.pack_map(6);
3083 packer.pack(std::make_pair("verification_key", verification_key));
3084 packer.pack(std::make_pair("proof", proof));
3085 packer.pack(std::make_pair("public_inputs", public_inputs));
3086 packer.pack(std::make_pair("key_hash", key_hash));
3087 packer.pack(std::make_pair("proof_type", proof_type));
3088 packer.pack(std::make_pair("predicate", predicate));
3089 }
3090
3091 void msgpack_unpack(msgpack::object const& o)
3092 {
3093 auto name = "RecursiveAggregation";
3094 auto kvmap = Helpers::make_kvmap(o, name);
3095 Helpers::conv_fld_from_kvmap(kvmap, name, "verification_key", verification_key, false);
3096 Helpers::conv_fld_from_kvmap(kvmap, name, "proof", proof, false);
3097 Helpers::conv_fld_from_kvmap(kvmap, name, "public_inputs", public_inputs, false);
3098 Helpers::conv_fld_from_kvmap(kvmap, name, "key_hash", key_hash, false);
3099 Helpers::conv_fld_from_kvmap(kvmap, name, "proof_type", proof_type, false);
3100 Helpers::conv_fld_from_kvmap(kvmap, name, "predicate", predicate, false);
3101 }
3102 };
3103
3105 std::vector<Acir::FunctionInput> inputs;
3106 std::vector<Acir::Witness> outputs;
3107
3108 friend bool operator==(const Poseidon2Permutation&, const Poseidon2Permutation&);
3109 std::vector<uint8_t> bincodeSerialize() const;
3110 static Poseidon2Permutation bincodeDeserialize(std::vector<uint8_t>);
3111
3112 void msgpack_pack(auto& packer) const
3113 {
3114 packer.pack_map(2);
3115 packer.pack(std::make_pair("inputs", inputs));
3116 packer.pack(std::make_pair("outputs", outputs));
3117 }
3118
3119 void msgpack_unpack(msgpack::object const& o)
3120 {
3121 auto name = "Poseidon2Permutation";
3122 auto kvmap = Helpers::make_kvmap(o, name);
3123 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
3124 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
3125 }
3126 };
3127
3132
3133 friend bool operator==(const Sha256Compression&, const Sha256Compression&);
3134 std::vector<uint8_t> bincodeSerialize() const;
3135 static Sha256Compression bincodeDeserialize(std::vector<uint8_t>);
3136
3137 void msgpack_pack(auto& packer) const
3138 {
3139 packer.pack_map(3);
3140 packer.pack(std::make_pair("inputs", inputs));
3141 packer.pack(std::make_pair("hash_values", hash_values));
3142 packer.pack(std::make_pair("outputs", outputs));
3143 }
3144
3145 void msgpack_unpack(msgpack::object const& o)
3146 {
3147 auto name = "Sha256Compression";
3148 auto kvmap = Helpers::make_kvmap(o, name);
3149 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
3150 Helpers::conv_fld_from_kvmap(kvmap, name, "hash_values", hash_values, false);
3151 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
3152 }
3153 };
3154
3155 std::variant<AES128Encrypt,
3156 AND,
3157 XOR,
3158 RANGE,
3159 Blake2s,
3160 Blake3,
3161 EcdsaSecp256k1,
3162 EcdsaSecp256r1,
3163 MultiScalarMul,
3164 EmbeddedCurveAdd,
3165 Keccakf1600,
3166 RecursiveAggregation,
3167 Poseidon2Permutation,
3168 Sha256Compression>
3170
3171 friend bool operator==(const BlackBoxFuncCall&, const BlackBoxFuncCall&);
3172 std::vector<uint8_t> bincodeSerialize() const;
3173 static BlackBoxFuncCall bincodeDeserialize(std::vector<uint8_t>);
3174
3175 void msgpack_pack(auto& packer) const
3176 {
3177 std::string tag;
3178 bool is_unit;
3179 switch (value.index()) {
3180
3181 case 0:
3182 tag = "AES128Encrypt";
3183 is_unit = false;
3184 break;
3185 case 1:
3186 tag = "AND";
3187 is_unit = false;
3188 break;
3189 case 2:
3190 tag = "XOR";
3191 is_unit = false;
3192 break;
3193 case 3:
3194 tag = "RANGE";
3195 is_unit = false;
3196 break;
3197 case 4:
3198 tag = "Blake2s";
3199 is_unit = false;
3200 break;
3201 case 5:
3202 tag = "Blake3";
3203 is_unit = false;
3204 break;
3205 case 6:
3206 tag = "EcdsaSecp256k1";
3207 is_unit = false;
3208 break;
3209 case 7:
3210 tag = "EcdsaSecp256r1";
3211 is_unit = false;
3212 break;
3213 case 8:
3214 tag = "MultiScalarMul";
3215 is_unit = false;
3216 break;
3217 case 9:
3218 tag = "EmbeddedCurveAdd";
3219 is_unit = false;
3220 break;
3221 case 10:
3222 tag = "Keccakf1600";
3223 is_unit = false;
3224 break;
3225 case 11:
3226 tag = "RecursiveAggregation";
3227 is_unit = false;
3228 break;
3229 case 12:
3230 tag = "Poseidon2Permutation";
3231 is_unit = false;
3232 break;
3233 case 13:
3234 tag = "Sha256Compression";
3235 is_unit = false;
3236 break;
3237 default:
3238 throw_or_abort("unknown enum 'BlackBoxFuncCall' variant index: " + std::to_string(value.index()));
3239 }
3240 if (is_unit) {
3241 packer.pack(tag);
3242 } else {
3243 std::visit(
3244 [&packer, tag](const auto& arg) {
3246 data[tag] = msgpack::object(arg);
3247 packer.pack(data);
3248 },
3249 value);
3250 }
3251 }
3252
3253 void msgpack_unpack(msgpack::object const& o)
3254 {
3255
3256 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
3257 std::cerr << o << std::endl;
3258 throw_or_abort("expected MAP or STR for enum 'BlackBoxFuncCall'; got type " + std::to_string(o.type));
3259 }
3260 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
3261 throw_or_abort("expected 1 entry for enum 'BlackBoxFuncCall'; got " + std::to_string(o.via.map.size));
3262 }
3263 std::string tag;
3264 try {
3265 if (o.type == msgpack::type::object_type::MAP) {
3266 o.via.map.ptr[0].key.convert(tag);
3267 } else {
3268 o.convert(tag);
3269 }
3270 } catch (const msgpack::type_error&) {
3271 std::cerr << o << std::endl;
3272 throw_or_abort("error converting tag to string for enum 'BlackBoxFuncCall'");
3273 }
3274 if (tag == "AES128Encrypt") {
3275 AES128Encrypt v;
3276 try {
3277 o.via.map.ptr[0].val.convert(v);
3278 } catch (const msgpack::type_error&) {
3279 std::cerr << o << std::endl;
3280 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::AES128Encrypt'");
3281 }
3282
3283 value = v;
3284 } else if (tag == "AND") {
3285 AND v;
3286 try {
3287 o.via.map.ptr[0].val.convert(v);
3288 } catch (const msgpack::type_error&) {
3289 std::cerr << o << std::endl;
3290 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::AND'");
3291 }
3292
3293 value = v;
3294 } else if (tag == "XOR") {
3295 XOR v;
3296 try {
3297 o.via.map.ptr[0].val.convert(v);
3298 } catch (const msgpack::type_error&) {
3299 std::cerr << o << std::endl;
3300 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::XOR'");
3301 }
3302
3303 value = v;
3304 } else if (tag == "RANGE") {
3305 RANGE v;
3306 try {
3307 o.via.map.ptr[0].val.convert(v);
3308 } catch (const msgpack::type_error&) {
3309 std::cerr << o << std::endl;
3310 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::RANGE'");
3311 }
3312
3313 value = v;
3314 } else if (tag == "Blake2s") {
3315 Blake2s v;
3316 try {
3317 o.via.map.ptr[0].val.convert(v);
3318 } catch (const msgpack::type_error&) {
3319 std::cerr << o << std::endl;
3320 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::Blake2s'");
3321 }
3322
3323 value = v;
3324 } else if (tag == "Blake3") {
3325 Blake3 v;
3326 try {
3327 o.via.map.ptr[0].val.convert(v);
3328 } catch (const msgpack::type_error&) {
3329 std::cerr << o << std::endl;
3330 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::Blake3'");
3331 }
3332
3333 value = v;
3334 } else if (tag == "EcdsaSecp256k1") {
3336 try {
3337 o.via.map.ptr[0].val.convert(v);
3338 } catch (const msgpack::type_error&) {
3339 std::cerr << o << std::endl;
3340 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::EcdsaSecp256k1'");
3341 }
3342
3343 value = v;
3344 } else if (tag == "EcdsaSecp256r1") {
3346 try {
3347 o.via.map.ptr[0].val.convert(v);
3348 } catch (const msgpack::type_error&) {
3349 std::cerr << o << std::endl;
3350 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::EcdsaSecp256r1'");
3351 }
3352
3353 value = v;
3354 } else if (tag == "MultiScalarMul") {
3356 try {
3357 o.via.map.ptr[0].val.convert(v);
3358 } catch (const msgpack::type_error&) {
3359 std::cerr << o << std::endl;
3360 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::MultiScalarMul'");
3361 }
3362
3363 value = v;
3364 } else if (tag == "EmbeddedCurveAdd") {
3366 try {
3367 o.via.map.ptr[0].val.convert(v);
3368 } catch (const msgpack::type_error&) {
3369 std::cerr << o << std::endl;
3370 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::EmbeddedCurveAdd'");
3371 }
3372
3373 value = v;
3374 } else if (tag == "Keccakf1600") {
3375 Keccakf1600 v;
3376 try {
3377 o.via.map.ptr[0].val.convert(v);
3378 } catch (const msgpack::type_error&) {
3379 std::cerr << o << std::endl;
3380 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::Keccakf1600'");
3381 }
3382
3383 value = v;
3384 } else if (tag == "RecursiveAggregation") {
3386 try {
3387 o.via.map.ptr[0].val.convert(v);
3388 } catch (const msgpack::type_error&) {
3389 std::cerr << o << std::endl;
3390 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::RecursiveAggregation'");
3391 }
3392
3393 value = v;
3394 } else if (tag == "Poseidon2Permutation") {
3396 try {
3397 o.via.map.ptr[0].val.convert(v);
3398 } catch (const msgpack::type_error&) {
3399 std::cerr << o << std::endl;
3400 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::Poseidon2Permutation'");
3401 }
3402
3403 value = v;
3404 } else if (tag == "Sha256Compression") {
3406 try {
3407 o.via.map.ptr[0].val.convert(v);
3408 } catch (const msgpack::type_error&) {
3409 std::cerr << o << std::endl;
3410 throw_or_abort("error converting into enum variant 'BlackBoxFuncCall::Sha256Compression'");
3411 }
3412
3413 value = v;
3414 } else {
3415 std::cerr << o << std::endl;
3416 throw_or_abort("unknown 'BlackBoxFuncCall' enum variant: " + tag);
3417 }
3418 }
3419};
3420
3421struct BlockId {
3422 uint32_t value;
3423
3424 friend bool operator==(const BlockId&, const BlockId&);
3425 std::vector<uint8_t> bincodeSerialize() const;
3426 static BlockId bincodeDeserialize(std::vector<uint8_t>);
3427
3428 void msgpack_pack(auto& packer) const { packer.pack(value); }
3429
3430 void msgpack_unpack(msgpack::object const& o)
3431 {
3432 try {
3433 o.convert(value);
3434 } catch (const msgpack::type_error&) {
3435 std::cerr << o << std::endl;
3436 throw_or_abort("error converting into newtype 'BlockId'");
3437 }
3438 }
3439};
3440
3442
3443 struct Memory {
3444 friend bool operator==(const Memory&, const Memory&);
3445 std::vector<uint8_t> bincodeSerialize() const;
3446 static Memory bincodeDeserialize(std::vector<uint8_t>);
3447
3448 void msgpack_pack(auto& packer) const {}
3449 void msgpack_unpack(msgpack::object const& o) {}
3450 };
3451
3452 struct CallData {
3453 uint32_t value;
3454
3455 friend bool operator==(const CallData&, const CallData&);
3456 std::vector<uint8_t> bincodeSerialize() const;
3457 static CallData bincodeDeserialize(std::vector<uint8_t>);
3458
3459 void msgpack_pack(auto& packer) const { packer.pack(value); }
3460
3461 void msgpack_unpack(msgpack::object const& o)
3462 {
3463 try {
3464 o.convert(value);
3465 } catch (const msgpack::type_error&) {
3466 std::cerr << o << std::endl;
3467 throw_or_abort("error converting into newtype 'CallData'");
3468 }
3469 }
3470 };
3471
3472 struct ReturnData {
3473 friend bool operator==(const ReturnData&, const ReturnData&);
3474 std::vector<uint8_t> bincodeSerialize() const;
3475 static ReturnData bincodeDeserialize(std::vector<uint8_t>);
3476
3477 void msgpack_pack(auto& packer) const {}
3478 void msgpack_unpack(msgpack::object const& o) {}
3479 };
3480
3482
3483 friend bool operator==(const BlockType&, const BlockType&);
3484 std::vector<uint8_t> bincodeSerialize() const;
3485 static BlockType bincodeDeserialize(std::vector<uint8_t>);
3486
3487 void msgpack_pack(auto& packer) const
3488 {
3489 std::string tag;
3490 bool is_unit;
3491 switch (value.index()) {
3492
3493 case 0:
3494 tag = "Memory";
3495 is_unit = true;
3496 break;
3497 case 1:
3498 tag = "CallData";
3499 is_unit = false;
3500 break;
3501 case 2:
3502 tag = "ReturnData";
3503 is_unit = true;
3504 break;
3505 default:
3506 throw_or_abort("unknown enum 'BlockType' variant index: " + std::to_string(value.index()));
3507 }
3508 if (is_unit) {
3509 packer.pack(tag);
3510 } else {
3511 std::visit(
3512 [&packer, tag](const auto& arg) {
3514 data[tag] = msgpack::object(arg);
3515 packer.pack(data);
3516 },
3517 value);
3518 }
3519 }
3520
3521 void msgpack_unpack(msgpack::object const& o)
3522 {
3523
3524 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
3525 std::cerr << o << std::endl;
3526 throw_or_abort("expected MAP or STR for enum 'BlockType'; got type " + std::to_string(o.type));
3527 }
3528 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
3529 throw_or_abort("expected 1 entry for enum 'BlockType'; got " + std::to_string(o.via.map.size));
3530 }
3531 std::string tag;
3532 try {
3533 if (o.type == msgpack::type::object_type::MAP) {
3534 o.via.map.ptr[0].key.convert(tag);
3535 } else {
3536 o.convert(tag);
3537 }
3538 } catch (const msgpack::type_error&) {
3539 std::cerr << o << std::endl;
3540 throw_or_abort("error converting tag to string for enum 'BlockType'");
3541 }
3542 if (tag == "Memory") {
3543 Memory v;
3544 value = v;
3545 } else if (tag == "CallData") {
3546 CallData v;
3547 try {
3548 o.via.map.ptr[0].val.convert(v);
3549 } catch (const msgpack::type_error&) {
3550 std::cerr << o << std::endl;
3551 throw_or_abort("error converting into enum variant 'BlockType::CallData'");
3552 }
3553
3554 value = v;
3555 } else if (tag == "ReturnData") {
3556 ReturnData v;
3557 value = v;
3558 } else {
3559 std::cerr << o << std::endl;
3560 throw_or_abort("unknown 'BlockType' enum variant: " + tag);
3561 }
3562 }
3563};
3564
3568 std::vector<uint8_t> q_c;
3569
3570 friend bool operator==(const Expression&, const Expression&);
3571 std::vector<uint8_t> bincodeSerialize() const;
3572 static Expression bincodeDeserialize(std::vector<uint8_t>);
3573
3574 void msgpack_pack(auto& packer) const
3575 {
3576 packer.pack_map(3);
3577 packer.pack(std::make_pair("mul_terms", mul_terms));
3578 packer.pack(std::make_pair("linear_combinations", linear_combinations));
3579 packer.pack(std::make_pair("q_c", q_c));
3580 }
3581
3582 void msgpack_unpack(msgpack::object const& o)
3583 {
3584 auto name = "Expression";
3585 auto kvmap = Helpers::make_kvmap(o, name);
3586 Helpers::conv_fld_from_kvmap(kvmap, name, "mul_terms", mul_terms, false);
3587 Helpers::conv_fld_from_kvmap(kvmap, name, "linear_combinations", linear_combinations, false);
3588 Helpers::conv_fld_from_kvmap(kvmap, name, "q_c", q_c, false);
3589 }
3590};
3591
3593
3594 struct Single {
3596
3597 friend bool operator==(const Single&, const Single&);
3598 std::vector<uint8_t> bincodeSerialize() const;
3599 static Single bincodeDeserialize(std::vector<uint8_t>);
3600
3601 void msgpack_pack(auto& packer) const { packer.pack(value); }
3602
3603 void msgpack_unpack(msgpack::object const& o)
3604 {
3605 try {
3606 o.convert(value);
3607 } catch (const msgpack::type_error&) {
3608 std::cerr << o << std::endl;
3609 throw_or_abort("error converting into newtype 'Single'");
3610 }
3611 }
3612 };
3613
3614 struct Array {
3615 std::vector<Acir::Expression> value;
3616
3617 friend bool operator==(const Array&, const Array&);
3618 std::vector<uint8_t> bincodeSerialize() const;
3619 static Array bincodeDeserialize(std::vector<uint8_t>);
3620
3621 void msgpack_pack(auto& packer) const { packer.pack(value); }
3622
3623 void msgpack_unpack(msgpack::object const& o)
3624 {
3625 try {
3626 o.convert(value);
3627 } catch (const msgpack::type_error&) {
3628 std::cerr << o << std::endl;
3629 throw_or_abort("error converting into newtype 'Array'");
3630 }
3631 }
3632 };
3633
3636
3637 friend bool operator==(const MemoryArray&, const MemoryArray&);
3638 std::vector<uint8_t> bincodeSerialize() const;
3639 static MemoryArray bincodeDeserialize(std::vector<uint8_t>);
3640
3641 void msgpack_pack(auto& packer) const { packer.pack(value); }
3642
3643 void msgpack_unpack(msgpack::object const& o)
3644 {
3645 try {
3646 o.convert(value);
3647 } catch (const msgpack::type_error&) {
3648 std::cerr << o << std::endl;
3649 throw_or_abort("error converting into newtype 'MemoryArray'");
3650 }
3651 }
3652 };
3653
3655
3656 friend bool operator==(const BrilligInputs&, const BrilligInputs&);
3657 std::vector<uint8_t> bincodeSerialize() const;
3658 static BrilligInputs bincodeDeserialize(std::vector<uint8_t>);
3659
3660 void msgpack_pack(auto& packer) const
3661 {
3662 std::string tag;
3663 bool is_unit;
3664 switch (value.index()) {
3665
3666 case 0:
3667 tag = "Single";
3668 is_unit = false;
3669 break;
3670 case 1:
3671 tag = "Array";
3672 is_unit = false;
3673 break;
3674 case 2:
3675 tag = "MemoryArray";
3676 is_unit = false;
3677 break;
3678 default:
3679 throw_or_abort("unknown enum 'BrilligInputs' variant index: " + std::to_string(value.index()));
3680 }
3681 if (is_unit) {
3682 packer.pack(tag);
3683 } else {
3684 std::visit(
3685 [&packer, tag](const auto& arg) {
3687 data[tag] = msgpack::object(arg);
3688 packer.pack(data);
3689 },
3690 value);
3691 }
3692 }
3693
3694 void msgpack_unpack(msgpack::object const& o)
3695 {
3696
3697 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
3698 std::cerr << o << std::endl;
3699 throw_or_abort("expected MAP or STR for enum 'BrilligInputs'; got type " + std::to_string(o.type));
3700 }
3701 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
3702 throw_or_abort("expected 1 entry for enum 'BrilligInputs'; got " + std::to_string(o.via.map.size));
3703 }
3704 std::string tag;
3705 try {
3706 if (o.type == msgpack::type::object_type::MAP) {
3707 o.via.map.ptr[0].key.convert(tag);
3708 } else {
3709 o.convert(tag);
3710 }
3711 } catch (const msgpack::type_error&) {
3712 std::cerr << o << std::endl;
3713 throw_or_abort("error converting tag to string for enum 'BrilligInputs'");
3714 }
3715 if (tag == "Single") {
3716 Single v;
3717 try {
3718 o.via.map.ptr[0].val.convert(v);
3719 } catch (const msgpack::type_error&) {
3720 std::cerr << o << std::endl;
3721 throw_or_abort("error converting into enum variant 'BrilligInputs::Single'");
3722 }
3723
3724 value = v;
3725 } else if (tag == "Array") {
3726 Array v;
3727 try {
3728 o.via.map.ptr[0].val.convert(v);
3729 } catch (const msgpack::type_error&) {
3730 std::cerr << o << std::endl;
3731 throw_or_abort("error converting into enum variant 'BrilligInputs::Array'");
3732 }
3733
3734 value = v;
3735 } else if (tag == "MemoryArray") {
3736 MemoryArray v;
3737 try {
3738 o.via.map.ptr[0].val.convert(v);
3739 } catch (const msgpack::type_error&) {
3740 std::cerr << o << std::endl;
3741 throw_or_abort("error converting into enum variant 'BrilligInputs::MemoryArray'");
3742 }
3743
3744 value = v;
3745 } else {
3746 std::cerr << o << std::endl;
3747 throw_or_abort("unknown 'BrilligInputs' enum variant: " + tag);
3748 }
3749 }
3750};
3751
3753
3754 struct Simple {
3756
3757 friend bool operator==(const Simple&, const Simple&);
3758 std::vector<uint8_t> bincodeSerialize() const;
3759 static Simple bincodeDeserialize(std::vector<uint8_t>);
3760
3761 void msgpack_pack(auto& packer) const { packer.pack(value); }
3762
3763 void msgpack_unpack(msgpack::object const& o)
3764 {
3765 try {
3766 o.convert(value);
3767 } catch (const msgpack::type_error&) {
3768 std::cerr << o << std::endl;
3769 throw_or_abort("error converting into newtype 'Simple'");
3770 }
3771 }
3772 };
3773
3774 struct Array {
3775 std::vector<Acir::Witness> value;
3776
3777 friend bool operator==(const Array&, const Array&);
3778 std::vector<uint8_t> bincodeSerialize() const;
3779 static Array bincodeDeserialize(std::vector<uint8_t>);
3780
3781 void msgpack_pack(auto& packer) const { packer.pack(value); }
3782
3783 void msgpack_unpack(msgpack::object const& o)
3784 {
3785 try {
3786 o.convert(value);
3787 } catch (const msgpack::type_error&) {
3788 std::cerr << o << std::endl;
3789 throw_or_abort("error converting into newtype 'Array'");
3790 }
3791 }
3792 };
3793
3795
3796 friend bool operator==(const BrilligOutputs&, const BrilligOutputs&);
3797 std::vector<uint8_t> bincodeSerialize() const;
3798 static BrilligOutputs bincodeDeserialize(std::vector<uint8_t>);
3799
3800 void msgpack_pack(auto& packer) const
3801 {
3802 std::string tag;
3803 bool is_unit;
3804 switch (value.index()) {
3805
3806 case 0:
3807 tag = "Simple";
3808 is_unit = false;
3809 break;
3810 case 1:
3811 tag = "Array";
3812 is_unit = false;
3813 break;
3814 default:
3815 throw_or_abort("unknown enum 'BrilligOutputs' variant index: " + std::to_string(value.index()));
3816 }
3817 if (is_unit) {
3818 packer.pack(tag);
3819 } else {
3820 std::visit(
3821 [&packer, tag](const auto& arg) {
3823 data[tag] = msgpack::object(arg);
3824 packer.pack(data);
3825 },
3826 value);
3827 }
3828 }
3829
3830 void msgpack_unpack(msgpack::object const& o)
3831 {
3832
3833 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
3834 std::cerr << o << std::endl;
3835 throw_or_abort("expected MAP or STR for enum 'BrilligOutputs'; got type " + std::to_string(o.type));
3836 }
3837 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
3838 throw_or_abort("expected 1 entry for enum 'BrilligOutputs'; got " + std::to_string(o.via.map.size));
3839 }
3840 std::string tag;
3841 try {
3842 if (o.type == msgpack::type::object_type::MAP) {
3843 o.via.map.ptr[0].key.convert(tag);
3844 } else {
3845 o.convert(tag);
3846 }
3847 } catch (const msgpack::type_error&) {
3848 std::cerr << o << std::endl;
3849 throw_or_abort("error converting tag to string for enum 'BrilligOutputs'");
3850 }
3851 if (tag == "Simple") {
3852 Simple v;
3853 try {
3854 o.via.map.ptr[0].val.convert(v);
3855 } catch (const msgpack::type_error&) {
3856 std::cerr << o << std::endl;
3857 throw_or_abort("error converting into enum variant 'BrilligOutputs::Simple'");
3858 }
3859
3860 value = v;
3861 } else if (tag == "Array") {
3862 Array v;
3863 try {
3864 o.via.map.ptr[0].val.convert(v);
3865 } catch (const msgpack::type_error&) {
3866 std::cerr << o << std::endl;
3867 throw_or_abort("error converting into enum variant 'BrilligOutputs::Array'");
3868 }
3869
3870 value = v;
3871 } else {
3872 std::cerr << o << std::endl;
3873 throw_or_abort("unknown 'BrilligOutputs' enum variant: " + tag);
3874 }
3875 }
3876};
3877
3878struct MemOp {
3882
3883 friend bool operator==(const MemOp&, const MemOp&);
3884 std::vector<uint8_t> bincodeSerialize() const;
3885 static MemOp bincodeDeserialize(std::vector<uint8_t>);
3886
3887 void msgpack_pack(auto& packer) const
3888 {
3889 packer.pack_map(3);
3890 packer.pack(std::make_pair("operation", operation));
3891 packer.pack(std::make_pair("index", index));
3892 packer.pack(std::make_pair("value", value));
3893 }
3894
3895 void msgpack_unpack(msgpack::object const& o)
3896 {
3897 auto name = "MemOp";
3898 auto kvmap = Helpers::make_kvmap(o, name);
3899 Helpers::conv_fld_from_kvmap(kvmap, name, "operation", operation, false);
3900 Helpers::conv_fld_from_kvmap(kvmap, name, "index", index, false);
3901 Helpers::conv_fld_from_kvmap(kvmap, name, "value", value, false);
3902 }
3903};
3904
3905struct Opcode {
3906
3907 struct AssertZero {
3909
3910 friend bool operator==(const AssertZero&, const AssertZero&);
3911 std::vector<uint8_t> bincodeSerialize() const;
3912 static AssertZero bincodeDeserialize(std::vector<uint8_t>);
3913
3914 void msgpack_pack(auto& packer) const { packer.pack(value); }
3915
3916 void msgpack_unpack(msgpack::object const& o)
3917 {
3918 try {
3919 o.convert(value);
3920 } catch (const msgpack::type_error&) {
3921 std::cerr << o << std::endl;
3922 throw_or_abort("error converting into newtype 'AssertZero'");
3923 }
3924 }
3925 };
3926
3929
3930 friend bool operator==(const BlackBoxFuncCall&, const BlackBoxFuncCall&);
3931 std::vector<uint8_t> bincodeSerialize() const;
3932 static BlackBoxFuncCall bincodeDeserialize(std::vector<uint8_t>);
3933
3934 void msgpack_pack(auto& packer) const { packer.pack(value); }
3935
3936 void msgpack_unpack(msgpack::object const& o)
3937 {
3938 try {
3939 o.convert(value);
3940 } catch (const msgpack::type_error&) {
3941 std::cerr << o << std::endl;
3942 throw_or_abort("error converting into newtype 'BlackBoxFuncCall'");
3943 }
3944 }
3945 };
3946
3947 struct MemoryOp {
3950
3951 friend bool operator==(const MemoryOp&, const MemoryOp&);
3952 std::vector<uint8_t> bincodeSerialize() const;
3953 static MemoryOp bincodeDeserialize(std::vector<uint8_t>);
3954
3955 void msgpack_pack(auto& packer) const
3956 {
3957 packer.pack_map(2);
3958 packer.pack(std::make_pair("block_id", block_id));
3959 packer.pack(std::make_pair("op", op));
3960 }
3961
3962 void msgpack_unpack(msgpack::object const& o)
3963 {
3964 auto name = "MemoryOp";
3965 auto kvmap = Helpers::make_kvmap(o, name);
3966 Helpers::conv_fld_from_kvmap(kvmap, name, "block_id", block_id, false);
3967 Helpers::conv_fld_from_kvmap(kvmap, name, "op", op, false);
3968 }
3969 };
3970
3971 struct MemoryInit {
3973 std::vector<Acir::Witness> init;
3975
3976 friend bool operator==(const MemoryInit&, const MemoryInit&);
3977 std::vector<uint8_t> bincodeSerialize() const;
3978 static MemoryInit bincodeDeserialize(std::vector<uint8_t>);
3979
3980 void msgpack_pack(auto& packer) const
3981 {
3982 packer.pack_map(3);
3983 packer.pack(std::make_pair("block_id", block_id));
3984 packer.pack(std::make_pair("init", init));
3985 packer.pack(std::make_pair("block_type", block_type));
3986 }
3987
3988 void msgpack_unpack(msgpack::object const& o)
3989 {
3990 auto name = "MemoryInit";
3991 auto kvmap = Helpers::make_kvmap(o, name);
3992 Helpers::conv_fld_from_kvmap(kvmap, name, "block_id", block_id, false);
3993 Helpers::conv_fld_from_kvmap(kvmap, name, "init", init, false);
3994 Helpers::conv_fld_from_kvmap(kvmap, name, "block_type", block_type, false);
3995 }
3996 };
3997
3999 uint32_t id;
4000 std::vector<Acir::BrilligInputs> inputs;
4001 std::vector<Acir::BrilligOutputs> outputs;
4003
4004 friend bool operator==(const BrilligCall&, const BrilligCall&);
4005 std::vector<uint8_t> bincodeSerialize() const;
4006 static BrilligCall bincodeDeserialize(std::vector<uint8_t>);
4007
4008 void msgpack_pack(auto& packer) const
4009 {
4010 packer.pack_map(4);
4011 packer.pack(std::make_pair("id", id));
4012 packer.pack(std::make_pair("inputs", inputs));
4013 packer.pack(std::make_pair("outputs", outputs));
4014 packer.pack(std::make_pair("predicate", predicate));
4015 }
4016
4017 void msgpack_unpack(msgpack::object const& o)
4018 {
4019 auto name = "BrilligCall";
4020 auto kvmap = Helpers::make_kvmap(o, name);
4021 Helpers::conv_fld_from_kvmap(kvmap, name, "id", id, false);
4022 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
4023 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
4024 Helpers::conv_fld_from_kvmap(kvmap, name, "predicate", predicate, true);
4025 }
4026 };
4027
4028 struct Call {
4029 uint32_t id;
4030 std::vector<Acir::Witness> inputs;
4031 std::vector<Acir::Witness> outputs;
4033
4034 friend bool operator==(const Call&, const Call&);
4035 std::vector<uint8_t> bincodeSerialize() const;
4036 static Call bincodeDeserialize(std::vector<uint8_t>);
4037
4038 void msgpack_pack(auto& packer) const
4039 {
4040 packer.pack_map(4);
4041 packer.pack(std::make_pair("id", id));
4042 packer.pack(std::make_pair("inputs", inputs));
4043 packer.pack(std::make_pair("outputs", outputs));
4044 packer.pack(std::make_pair("predicate", predicate));
4045 }
4046
4047 void msgpack_unpack(msgpack::object const& o)
4048 {
4049 auto name = "Call";
4050 auto kvmap = Helpers::make_kvmap(o, name);
4051 Helpers::conv_fld_from_kvmap(kvmap, name, "id", id, false);
4052 Helpers::conv_fld_from_kvmap(kvmap, name, "inputs", inputs, false);
4053 Helpers::conv_fld_from_kvmap(kvmap, name, "outputs", outputs, false);
4054 Helpers::conv_fld_from_kvmap(kvmap, name, "predicate", predicate, true);
4055 }
4056 };
4057
4059
4060 friend bool operator==(const Opcode&, const Opcode&);
4061 std::vector<uint8_t> bincodeSerialize() const;
4062 static Opcode bincodeDeserialize(std::vector<uint8_t>);
4063
4064 void msgpack_pack(auto& packer) const
4065 {
4066 std::string tag;
4067 bool is_unit;
4068 switch (value.index()) {
4069
4070 case 0:
4071 tag = "AssertZero";
4072 is_unit = false;
4073 break;
4074 case 1:
4075 tag = "BlackBoxFuncCall";
4076 is_unit = false;
4077 break;
4078 case 2:
4079 tag = "MemoryOp";
4080 is_unit = false;
4081 break;
4082 case 3:
4083 tag = "MemoryInit";
4084 is_unit = false;
4085 break;
4086 case 4:
4087 tag = "BrilligCall";
4088 is_unit = false;
4089 break;
4090 case 5:
4091 tag = "Call";
4092 is_unit = false;
4093 break;
4094 default:
4095 throw_or_abort("unknown enum 'Opcode' variant index: " + std::to_string(value.index()));
4096 }
4097 if (is_unit) {
4098 packer.pack(tag);
4099 } else {
4100 std::visit(
4101 [&packer, tag](const auto& arg) {
4103 data[tag] = msgpack::object(arg);
4104 packer.pack(data);
4105 },
4106 value);
4107 }
4108 }
4109
4110 void msgpack_unpack(msgpack::object const& o)
4111 {
4112
4113 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
4114 std::cerr << o << std::endl;
4115 throw_or_abort("expected MAP or STR for enum 'Opcode'; got type " + std::to_string(o.type));
4116 }
4117 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
4118 throw_or_abort("expected 1 entry for enum 'Opcode'; got " + std::to_string(o.via.map.size));
4119 }
4120 std::string tag;
4121 try {
4122 if (o.type == msgpack::type::object_type::MAP) {
4123 o.via.map.ptr[0].key.convert(tag);
4124 } else {
4125 o.convert(tag);
4126 }
4127 } catch (const msgpack::type_error&) {
4128 std::cerr << o << std::endl;
4129 throw_or_abort("error converting tag to string for enum 'Opcode'");
4130 }
4131 if (tag == "AssertZero") {
4132 AssertZero v;
4133 try {
4134 o.via.map.ptr[0].val.convert(v);
4135 } catch (const msgpack::type_error&) {
4136 std::cerr << o << std::endl;
4137 throw_or_abort("error converting into enum variant 'Opcode::AssertZero'");
4138 }
4139
4140 value = v;
4141 } else if (tag == "BlackBoxFuncCall") {
4143 try {
4144 o.via.map.ptr[0].val.convert(v);
4145 } catch (const msgpack::type_error&) {
4146 std::cerr << o << std::endl;
4147 throw_or_abort("error converting into enum variant 'Opcode::BlackBoxFuncCall'");
4148 }
4149
4150 value = v;
4151 } else if (tag == "MemoryOp") {
4152 MemoryOp v;
4153 try {
4154 o.via.map.ptr[0].val.convert(v);
4155 } catch (const msgpack::type_error&) {
4156 std::cerr << o << std::endl;
4157 throw_or_abort("error converting into enum variant 'Opcode::MemoryOp'");
4158 }
4159
4160 value = v;
4161 } else if (tag == "MemoryInit") {
4162 MemoryInit v;
4163 try {
4164 o.via.map.ptr[0].val.convert(v);
4165 } catch (const msgpack::type_error&) {
4166 std::cerr << o << std::endl;
4167 throw_or_abort("error converting into enum variant 'Opcode::MemoryInit'");
4168 }
4169
4170 value = v;
4171 } else if (tag == "BrilligCall") {
4172 BrilligCall v;
4173 try {
4174 o.via.map.ptr[0].val.convert(v);
4175 } catch (const msgpack::type_error&) {
4176 std::cerr << o << std::endl;
4177 throw_or_abort("error converting into enum variant 'Opcode::BrilligCall'");
4178 }
4179
4180 value = v;
4181 } else if (tag == "Call") {
4182 Call v;
4183 try {
4184 o.via.map.ptr[0].val.convert(v);
4185 } catch (const msgpack::type_error&) {
4186 std::cerr << o << std::endl;
4187 throw_or_abort("error converting into enum variant 'Opcode::Call'");
4188 }
4189
4190 value = v;
4191 } else {
4192 std::cerr << o << std::endl;
4193 throw_or_abort("unknown 'Opcode' enum variant: " + tag);
4194 }
4195 }
4196};
4197
4199
4200 struct Expression {
4202
4203 friend bool operator==(const Expression&, const Expression&);
4204 std::vector<uint8_t> bincodeSerialize() const;
4205 static Expression bincodeDeserialize(std::vector<uint8_t>);
4206
4207 void msgpack_pack(auto& packer) const { packer.pack(value); }
4208
4209 void msgpack_unpack(msgpack::object const& o)
4210 {
4211 try {
4212 o.convert(value);
4213 } catch (const msgpack::type_error&) {
4214 std::cerr << o << std::endl;
4215 throw_or_abort("error converting into newtype 'Expression'");
4216 }
4217 }
4218 };
4219
4220 struct Memory {
4222
4223 friend bool operator==(const Memory&, const Memory&);
4224 std::vector<uint8_t> bincodeSerialize() const;
4225 static Memory bincodeDeserialize(std::vector<uint8_t>);
4226
4227 void msgpack_pack(auto& packer) const { packer.pack(value); }
4228
4229 void msgpack_unpack(msgpack::object const& o)
4230 {
4231 try {
4232 o.convert(value);
4233 } catch (const msgpack::type_error&) {
4234 std::cerr << o << std::endl;
4235 throw_or_abort("error converting into newtype 'Memory'");
4236 }
4237 }
4238 };
4239
4241
4242 friend bool operator==(const ExpressionOrMemory&, const ExpressionOrMemory&);
4243 std::vector<uint8_t> bincodeSerialize() const;
4244 static ExpressionOrMemory bincodeDeserialize(std::vector<uint8_t>);
4245
4246 void msgpack_pack(auto& packer) const
4247 {
4248 std::string tag;
4249 bool is_unit;
4250 switch (value.index()) {
4251
4252 case 0:
4253 tag = "Expression";
4254 is_unit = false;
4255 break;
4256 case 1:
4257 tag = "Memory";
4258 is_unit = false;
4259 break;
4260 default:
4261 throw_or_abort("unknown enum 'ExpressionOrMemory' variant index: " + std::to_string(value.index()));
4262 }
4263 if (is_unit) {
4264 packer.pack(tag);
4265 } else {
4266 std::visit(
4267 [&packer, tag](const auto& arg) {
4269 data[tag] = msgpack::object(arg);
4270 packer.pack(data);
4271 },
4272 value);
4273 }
4274 }
4275
4276 void msgpack_unpack(msgpack::object const& o)
4277 {
4278
4279 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
4280 std::cerr << o << std::endl;
4281 throw_or_abort("expected MAP or STR for enum 'ExpressionOrMemory'; got type " + std::to_string(o.type));
4282 }
4283 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
4284 throw_or_abort("expected 1 entry for enum 'ExpressionOrMemory'; got " + std::to_string(o.via.map.size));
4285 }
4286 std::string tag;
4287 try {
4288 if (o.type == msgpack::type::object_type::MAP) {
4289 o.via.map.ptr[0].key.convert(tag);
4290 } else {
4291 o.convert(tag);
4292 }
4293 } catch (const msgpack::type_error&) {
4294 std::cerr << o << std::endl;
4295 throw_or_abort("error converting tag to string for enum 'ExpressionOrMemory'");
4296 }
4297 if (tag == "Expression") {
4298 Expression v;
4299 try {
4300 o.via.map.ptr[0].val.convert(v);
4301 } catch (const msgpack::type_error&) {
4302 std::cerr << o << std::endl;
4303 throw_or_abort("error converting into enum variant 'ExpressionOrMemory::Expression'");
4304 }
4305
4306 value = v;
4307 } else if (tag == "Memory") {
4308 Memory v;
4309 try {
4310 o.via.map.ptr[0].val.convert(v);
4311 } catch (const msgpack::type_error&) {
4312 std::cerr << o << std::endl;
4313 throw_or_abort("error converting into enum variant 'ExpressionOrMemory::Memory'");
4314 }
4315
4316 value = v;
4317 } else {
4318 std::cerr << o << std::endl;
4319 throw_or_abort("unknown 'ExpressionOrMemory' enum variant: " + tag);
4320 }
4321 }
4322};
4323
4326 std::vector<Acir::ExpressionOrMemory> payload;
4327
4328 friend bool operator==(const AssertionPayload&, const AssertionPayload&);
4329 std::vector<uint8_t> bincodeSerialize() const;
4330 static AssertionPayload bincodeDeserialize(std::vector<uint8_t>);
4331
4332 void msgpack_pack(auto& packer) const
4333 {
4334 packer.pack_map(2);
4335 packer.pack(std::make_pair("error_selector", error_selector));
4336 packer.pack(std::make_pair("payload", payload));
4337 }
4338
4339 void msgpack_unpack(msgpack::object const& o)
4340 {
4341 auto name = "AssertionPayload";
4342 auto kvmap = Helpers::make_kvmap(o, name);
4343 Helpers::conv_fld_from_kvmap(kvmap, name, "error_selector", error_selector, false);
4344 Helpers::conv_fld_from_kvmap(kvmap, name, "payload", payload, false);
4345 }
4346};
4347
4349
4350 struct Acir {
4351 uint64_t value;
4352
4353 friend bool operator==(const Acir&, const Acir&);
4354 std::vector<uint8_t> bincodeSerialize() const;
4355 static Acir bincodeDeserialize(std::vector<uint8_t>);
4356
4357 void msgpack_pack(auto& packer) const { packer.pack(value); }
4358
4359 void msgpack_unpack(msgpack::object const& o)
4360 {
4361 try {
4362 o.convert(value);
4363 } catch (const msgpack::type_error&) {
4364 std::cerr << o << std::endl;
4365 throw_or_abort("error converting into newtype 'Acir'");
4366 }
4367 }
4368 };
4369
4370 struct Brillig {
4371 uint64_t acir_index;
4373
4374 friend bool operator==(const Brillig&, const Brillig&);
4375 std::vector<uint8_t> bincodeSerialize() const;
4376 static Brillig bincodeDeserialize(std::vector<uint8_t>);
4377
4378 void msgpack_pack(auto& packer) const
4379 {
4380 packer.pack_map(2);
4381 packer.pack(std::make_pair("acir_index", acir_index));
4382 packer.pack(std::make_pair("brillig_index", brillig_index));
4383 }
4384
4385 void msgpack_unpack(msgpack::object const& o)
4386 {
4387 auto name = "Brillig";
4388 auto kvmap = Helpers::make_kvmap(o, name);
4389 Helpers::conv_fld_from_kvmap(kvmap, name, "acir_index", acir_index, false);
4390 Helpers::conv_fld_from_kvmap(kvmap, name, "brillig_index", brillig_index, false);
4391 }
4392 };
4393
4395
4396 friend bool operator==(const OpcodeLocation&, const OpcodeLocation&);
4397 std::vector<uint8_t> bincodeSerialize() const;
4398 static OpcodeLocation bincodeDeserialize(std::vector<uint8_t>);
4399
4400 void msgpack_pack(auto& packer) const
4401 {
4402 std::string tag;
4403 bool is_unit;
4404 switch (value.index()) {
4405
4406 case 0:
4407 tag = "Acir";
4408 is_unit = false;
4409 break;
4410 case 1:
4411 tag = "Brillig";
4412 is_unit = false;
4413 break;
4414 default:
4415 throw_or_abort("unknown enum 'OpcodeLocation' variant index: " + std::to_string(value.index()));
4416 }
4417 if (is_unit) {
4418 packer.pack(tag);
4419 } else {
4420 std::visit(
4421 [&packer, tag](const auto& arg) {
4423 data[tag] = msgpack::object(arg);
4424 packer.pack(data);
4425 },
4426 value);
4427 }
4428 }
4429
4430 void msgpack_unpack(msgpack::object const& o)
4431 {
4432
4433 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
4434 std::cerr << o << std::endl;
4435 throw_or_abort("expected MAP or STR for enum 'OpcodeLocation'; got type " + std::to_string(o.type));
4436 }
4437 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
4438 throw_or_abort("expected 1 entry for enum 'OpcodeLocation'; got " + std::to_string(o.via.map.size));
4439 }
4440 std::string tag;
4441 try {
4442 if (o.type == msgpack::type::object_type::MAP) {
4443 o.via.map.ptr[0].key.convert(tag);
4444 } else {
4445 o.convert(tag);
4446 }
4447 } catch (const msgpack::type_error&) {
4448 std::cerr << o << std::endl;
4449 throw_or_abort("error converting tag to string for enum 'OpcodeLocation'");
4450 }
4451 if (tag == "Acir") {
4452 Acir v;
4453 try {
4454 o.via.map.ptr[0].val.convert(v);
4455 } catch (const msgpack::type_error&) {
4456 std::cerr << o << std::endl;
4457 throw_or_abort("error converting into enum variant 'OpcodeLocation::Acir'");
4458 }
4459
4460 value = v;
4461 } else if (tag == "Brillig") {
4462 Brillig v;
4463 try {
4464 o.via.map.ptr[0].val.convert(v);
4465 } catch (const msgpack::type_error&) {
4466 std::cerr << o << std::endl;
4467 throw_or_abort("error converting into enum variant 'OpcodeLocation::Brillig'");
4468 }
4469
4470 value = v;
4471 } else {
4472 std::cerr << o << std::endl;
4473 throw_or_abort("unknown 'OpcodeLocation' enum variant: " + tag);
4474 }
4475 }
4476};
4477
4479 std::vector<Acir::Witness> value;
4480
4481 friend bool operator==(const PublicInputs&, const PublicInputs&);
4482 std::vector<uint8_t> bincodeSerialize() const;
4483 static PublicInputs bincodeDeserialize(std::vector<uint8_t>);
4484
4485 void msgpack_pack(auto& packer) const { packer.pack(value); }
4486
4487 void msgpack_unpack(msgpack::object const& o)
4488 {
4489 try {
4490 o.convert(value);
4491 } catch (const msgpack::type_error&) {
4492 std::cerr << o << std::endl;
4493 throw_or_abort("error converting into newtype 'PublicInputs'");
4494 }
4495 }
4496};
4497
4498struct Circuit {
4499 std::string function_name;
4501 std::vector<Acir::Opcode> opcodes;
4502 std::vector<Acir::Witness> private_parameters;
4506
4507 friend bool operator==(const Circuit&, const Circuit&);
4508 std::vector<uint8_t> bincodeSerialize() const;
4509 static Circuit bincodeDeserialize(std::vector<uint8_t>);
4510
4511 void msgpack_pack(auto& packer) const
4512 {
4513 packer.pack_map(7);
4514 packer.pack(std::make_pair("function_name", function_name));
4515 packer.pack(std::make_pair("current_witness_index", current_witness_index));
4516 packer.pack(std::make_pair("opcodes", opcodes));
4517 packer.pack(std::make_pair("private_parameters", private_parameters));
4518 packer.pack(std::make_pair("public_parameters", public_parameters));
4519 packer.pack(std::make_pair("return_values", return_values));
4520 packer.pack(std::make_pair("assert_messages", assert_messages));
4521 }
4522
4523 void msgpack_unpack(msgpack::object const& o)
4524 {
4525 auto name = "Circuit";
4526 auto kvmap = Helpers::make_kvmap(o, name);
4527 Helpers::conv_fld_from_kvmap(kvmap, name, "function_name", function_name, false);
4528 Helpers::conv_fld_from_kvmap(kvmap, name, "current_witness_index", current_witness_index, false);
4529 Helpers::conv_fld_from_kvmap(kvmap, name, "opcodes", opcodes, false);
4530 Helpers::conv_fld_from_kvmap(kvmap, name, "private_parameters", private_parameters, false);
4531 Helpers::conv_fld_from_kvmap(kvmap, name, "public_parameters", public_parameters, false);
4532 Helpers::conv_fld_from_kvmap(kvmap, name, "return_values", return_values, false);
4533 Helpers::conv_fld_from_kvmap(kvmap, name, "assert_messages", assert_messages, false);
4534 }
4535};
4536
4538 std::string function_name;
4539 std::vector<Acir::BrilligOpcode> bytecode;
4540
4541 friend bool operator==(const BrilligBytecode&, const BrilligBytecode&);
4542 std::vector<uint8_t> bincodeSerialize() const;
4543 static BrilligBytecode bincodeDeserialize(std::vector<uint8_t>);
4544
4545 void msgpack_pack(auto& packer) const
4546 {
4547 packer.pack_map(2);
4548 packer.pack(std::make_pair("function_name", function_name));
4549 packer.pack(std::make_pair("bytecode", bytecode));
4550 }
4551
4552 void msgpack_unpack(msgpack::object const& o)
4553 {
4554 auto name = "BrilligBytecode";
4555 auto kvmap = Helpers::make_kvmap(o, name);
4556 Helpers::conv_fld_from_kvmap(kvmap, name, "function_name", function_name, false);
4557 Helpers::conv_fld_from_kvmap(kvmap, name, "bytecode", bytecode, false);
4558 }
4559};
4560
4561struct Program {
4562 std::vector<Acir::Circuit> functions;
4563 std::vector<Acir::BrilligBytecode> unconstrained_functions;
4564
4565 friend bool operator==(const Program&, const Program&);
4566 std::vector<uint8_t> bincodeSerialize() const;
4567 static Program bincodeDeserialize(std::vector<uint8_t>);
4568
4569 void msgpack_pack(auto& packer) const
4570 {
4571 packer.pack_map(2);
4572 packer.pack(std::make_pair("functions", functions));
4573 packer.pack(std::make_pair("unconstrained_functions", unconstrained_functions));
4574 }
4575
4576 void msgpack_unpack(msgpack::object const& o)
4577 {
4578 auto name = "Program";
4579 auto kvmap = Helpers::make_kvmap(o, name);
4580 Helpers::conv_fld_from_kvmap(kvmap, name, "functions", functions, false);
4581 Helpers::conv_fld_from_kvmap(kvmap, name, "unconstrained_functions", unconstrained_functions, false);
4582 }
4583};
4584
4586 std::vector<Acir::Circuit> functions;
4587
4588 friend bool operator==(const ProgramWithoutBrillig&, const ProgramWithoutBrillig&);
4589 std::vector<uint8_t> bincodeSerialize() const;
4590 static ProgramWithoutBrillig bincodeDeserialize(std::vector<uint8_t>);
4591
4592 void msgpack_pack(auto& packer) const
4593 {
4594 packer.pack_map(1);
4595 packer.pack(std::make_pair("functions", functions));
4596 }
4597
4598 void msgpack_unpack(msgpack::object const& o)
4599 {
4600 auto name = "ProgramWithoutBrillig";
4601 auto kvmap = Helpers::make_kvmap(o, name);
4602 Helpers::conv_fld_from_kvmap(kvmap, name, "functions", functions, false);
4603 }
4604};
4605
4607
4608 struct Unbounded {
4609 friend bool operator==(const Unbounded&, const Unbounded&);
4610 std::vector<uint8_t> bincodeSerialize() const;
4611 static Unbounded bincodeDeserialize(std::vector<uint8_t>);
4612
4613 void msgpack_pack(auto& packer) const {}
4614 void msgpack_unpack(msgpack::object const& o) {}
4615 };
4616
4617 struct Bounded {
4618 uint64_t width;
4619
4620 friend bool operator==(const Bounded&, const Bounded&);
4621 std::vector<uint8_t> bincodeSerialize() const;
4622 static Bounded bincodeDeserialize(std::vector<uint8_t>);
4623
4624 void msgpack_pack(auto& packer) const
4625 {
4626 packer.pack_map(1);
4627 packer.pack(std::make_pair("width", width));
4628 }
4629
4630 void msgpack_unpack(msgpack::object const& o)
4631 {
4632 auto name = "Bounded";
4633 auto kvmap = Helpers::make_kvmap(o, name);
4634 Helpers::conv_fld_from_kvmap(kvmap, name, "width", width, false);
4635 }
4636 };
4637
4639
4640 friend bool operator==(const ExpressionWidth&, const ExpressionWidth&);
4641 std::vector<uint8_t> bincodeSerialize() const;
4642 static ExpressionWidth bincodeDeserialize(std::vector<uint8_t>);
4643
4644 void msgpack_pack(auto& packer) const
4645 {
4646 std::string tag;
4647 bool is_unit;
4648 switch (value.index()) {
4649
4650 case 0:
4651 tag = "Unbounded";
4652 is_unit = true;
4653 break;
4654 case 1:
4655 tag = "Bounded";
4656 is_unit = false;
4657 break;
4658 default:
4659 throw_or_abort("unknown enum 'ExpressionWidth' variant index: " + std::to_string(value.index()));
4660 }
4661 if (is_unit) {
4662 packer.pack(tag);
4663 } else {
4664 std::visit(
4665 [&packer, tag](const auto& arg) {
4667 data[tag] = msgpack::object(arg);
4668 packer.pack(data);
4669 },
4670 value);
4671 }
4672 }
4673
4674 void msgpack_unpack(msgpack::object const& o)
4675 {
4676
4677 if (o.type != msgpack::type::object_type::MAP && o.type != msgpack::type::object_type::STR) {
4678 std::cerr << o << std::endl;
4679 throw_or_abort("expected MAP or STR for enum 'ExpressionWidth'; got type " + std::to_string(o.type));
4680 }
4681 if (o.type == msgpack::type::object_type::MAP && o.via.map.size != 1) {
4682 throw_or_abort("expected 1 entry for enum 'ExpressionWidth'; got " + std::to_string(o.via.map.size));
4683 }
4684 std::string tag;
4685 try {
4686 if (o.type == msgpack::type::object_type::MAP) {
4687 o.via.map.ptr[0].key.convert(tag);
4688 } else {
4689 o.convert(tag);
4690 }
4691 } catch (const msgpack::type_error&) {
4692 std::cerr << o << std::endl;
4693 throw_or_abort("error converting tag to string for enum 'ExpressionWidth'");
4694 }
4695 if (tag == "Unbounded") {
4696 Unbounded v;
4697 value = v;
4698 } else if (tag == "Bounded") {
4699 Bounded v;
4700 try {
4701 o.via.map.ptr[0].val.convert(v);
4702 } catch (const msgpack::type_error&) {
4703 std::cerr << o << std::endl;
4704 throw_or_abort("error converting into enum variant 'ExpressionWidth::Bounded'");
4705 }
4706
4707 value = v;
4708 } else {
4709 std::cerr << o << std::endl;
4710 throw_or_abort("unknown 'ExpressionWidth' enum variant: " + tag);
4711 }
4712 }
4713};
4714
4715} // end of namespace Acir
4716
4717namespace Acir {
4718
4719inline bool operator==(const AssertionPayload& lhs, const AssertionPayload& rhs)
4720{
4721 if (!(lhs.error_selector == rhs.error_selector)) {
4722 return false;
4723 }
4724 if (!(lhs.payload == rhs.payload)) {
4725 return false;
4726 }
4727 return true;
4728}
4729
4730inline std::vector<uint8_t> AssertionPayload::bincodeSerialize() const
4731{
4732 auto serializer = serde::BincodeSerializer();
4734 return std::move(serializer).bytes();
4735}
4736
4738{
4739 auto deserializer = serde::BincodeDeserializer(input);
4741 if (deserializer.get_buffer_offset() < input.size()) {
4742 throw_or_abort("Some input bytes were not read");
4743 }
4744 return value;
4745}
4746
4747} // end of namespace Acir
4748
4749template <>
4750template <typename Serializer>
4752{
4753 serializer.increase_container_depth();
4754 serde::Serializable<decltype(obj.error_selector)>::serialize(obj.error_selector, serializer);
4755 serde::Serializable<decltype(obj.payload)>::serialize(obj.payload, serializer);
4756 serializer.decrease_container_depth();
4757}
4758
4759template <>
4760template <typename Deserializer>
4762{
4763 deserializer.increase_container_depth();
4765 obj.error_selector = serde::Deserializable<decltype(obj.error_selector)>::deserialize(deserializer);
4766 obj.payload = serde::Deserializable<decltype(obj.payload)>::deserialize(deserializer);
4767 deserializer.decrease_container_depth();
4768 return obj;
4769}
4770
4771namespace Acir {
4772
4773inline bool operator==(const BinaryFieldOp& lhs, const BinaryFieldOp& rhs)
4774{
4775 if (!(lhs.value == rhs.value)) {
4776 return false;
4777 }
4778 return true;
4779}
4780
4781inline std::vector<uint8_t> BinaryFieldOp::bincodeSerialize() const
4782{
4783 auto serializer = serde::BincodeSerializer();
4785 return std::move(serializer).bytes();
4786}
4787
4788inline BinaryFieldOp BinaryFieldOp::bincodeDeserialize(std::vector<uint8_t> input)
4789{
4790 auto deserializer = serde::BincodeDeserializer(input);
4792 if (deserializer.get_buffer_offset() < input.size()) {
4793 throw_or_abort("Some input bytes were not read");
4794 }
4795 return value;
4796}
4797
4798} // end of namespace Acir
4799
4800template <>
4801template <typename Serializer>
4803{
4804 serializer.increase_container_depth();
4805 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
4806 serializer.decrease_container_depth();
4807}
4808
4809template <>
4810template <typename Deserializer>
4812{
4813 deserializer.increase_container_depth();
4815 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
4816 deserializer.decrease_container_depth();
4817 return obj;
4818}
4819
4820namespace Acir {
4821
4822inline bool operator==(const BinaryFieldOp::Add& lhs, const BinaryFieldOp::Add& rhs)
4823{
4824 return true;
4825}
4826
4827inline std::vector<uint8_t> BinaryFieldOp::Add::bincodeSerialize() const
4828{
4829 auto serializer = serde::BincodeSerializer();
4831 return std::move(serializer).bytes();
4832}
4833
4835{
4836 auto deserializer = serde::BincodeDeserializer(input);
4838 if (deserializer.get_buffer_offset() < input.size()) {
4839 throw_or_abort("Some input bytes were not read");
4840 }
4841 return value;
4842}
4843
4844} // end of namespace Acir
4845
4846template <>
4847template <typename Serializer>
4851
4852template <>
4853template <typename Deserializer>
4859
4860namespace Acir {
4861
4862inline bool operator==(const BinaryFieldOp::Sub& lhs, const BinaryFieldOp::Sub& rhs)
4863{
4864 return true;
4865}
4866
4867inline std::vector<uint8_t> BinaryFieldOp::Sub::bincodeSerialize() const
4868{
4869 auto serializer = serde::BincodeSerializer();
4871 return std::move(serializer).bytes();
4872}
4873
4875{
4876 auto deserializer = serde::BincodeDeserializer(input);
4878 if (deserializer.get_buffer_offset() < input.size()) {
4879 throw_or_abort("Some input bytes were not read");
4880 }
4881 return value;
4882}
4883
4884} // end of namespace Acir
4885
4886template <>
4887template <typename Serializer>
4891
4892template <>
4893template <typename Deserializer>
4899
4900namespace Acir {
4901
4902inline bool operator==(const BinaryFieldOp::Mul& lhs, const BinaryFieldOp::Mul& rhs)
4903{
4904 return true;
4905}
4906
4907inline std::vector<uint8_t> BinaryFieldOp::Mul::bincodeSerialize() const
4908{
4909 auto serializer = serde::BincodeSerializer();
4911 return std::move(serializer).bytes();
4912}
4913
4915{
4916 auto deserializer = serde::BincodeDeserializer(input);
4918 if (deserializer.get_buffer_offset() < input.size()) {
4919 throw_or_abort("Some input bytes were not read");
4920 }
4921 return value;
4922}
4923
4924} // end of namespace Acir
4925
4926template <>
4927template <typename Serializer>
4931
4932template <>
4933template <typename Deserializer>
4939
4940namespace Acir {
4941
4942inline bool operator==(const BinaryFieldOp::Div& lhs, const BinaryFieldOp::Div& rhs)
4943{
4944 return true;
4945}
4946
4947inline std::vector<uint8_t> BinaryFieldOp::Div::bincodeSerialize() const
4948{
4949 auto serializer = serde::BincodeSerializer();
4951 return std::move(serializer).bytes();
4952}
4953
4955{
4956 auto deserializer = serde::BincodeDeserializer(input);
4958 if (deserializer.get_buffer_offset() < input.size()) {
4959 throw_or_abort("Some input bytes were not read");
4960 }
4961 return value;
4962}
4963
4964} // end of namespace Acir
4965
4966template <>
4967template <typename Serializer>
4971
4972template <>
4973template <typename Deserializer>
4979
4980namespace Acir {
4981
4983{
4984 return true;
4985}
4986
4987inline std::vector<uint8_t> BinaryFieldOp::IntegerDiv::bincodeSerialize() const
4988{
4989 auto serializer = serde::BincodeSerializer();
4991 return std::move(serializer).bytes();
4992}
4993
4995{
4996 auto deserializer = serde::BincodeDeserializer(input);
4998 if (deserializer.get_buffer_offset() < input.size()) {
4999 throw_or_abort("Some input bytes were not read");
5000 }
5001 return value;
5002}
5003
5004} // end of namespace Acir
5005
5006template <>
5007template <typename Serializer>
5011
5012template <>
5013template <typename Deserializer>
5020
5021namespace Acir {
5022
5023inline bool operator==(const BinaryFieldOp::Equals& lhs, const BinaryFieldOp::Equals& rhs)
5024{
5025 return true;
5026}
5027
5028inline std::vector<uint8_t> BinaryFieldOp::Equals::bincodeSerialize() const
5029{
5030 auto serializer = serde::BincodeSerializer();
5032 return std::move(serializer).bytes();
5033}
5034
5036{
5037 auto deserializer = serde::BincodeDeserializer(input);
5039 if (deserializer.get_buffer_offset() < input.size()) {
5040 throw_or_abort("Some input bytes were not read");
5041 }
5042 return value;
5043}
5044
5045} // end of namespace Acir
5046
5047template <>
5048template <typename Serializer>
5052
5053template <>
5054template <typename Deserializer>
5060
5061namespace Acir {
5062
5064{
5065 return true;
5066}
5067
5068inline std::vector<uint8_t> BinaryFieldOp::LessThan::bincodeSerialize() const
5069{
5070 auto serializer = serde::BincodeSerializer();
5072 return std::move(serializer).bytes();
5073}
5074
5076{
5077 auto deserializer = serde::BincodeDeserializer(input);
5079 if (deserializer.get_buffer_offset() < input.size()) {
5080 throw_or_abort("Some input bytes were not read");
5081 }
5082 return value;
5083}
5084
5085} // end of namespace Acir
5086
5087template <>
5088template <typename Serializer>
5092
5093template <>
5094template <typename Deserializer>
5101
5102namespace Acir {
5103
5105{
5106 return true;
5107}
5108
5109inline std::vector<uint8_t> BinaryFieldOp::LessThanEquals::bincodeSerialize() const
5110{
5111 auto serializer = serde::BincodeSerializer();
5113 return std::move(serializer).bytes();
5114}
5115
5117{
5118 auto deserializer = serde::BincodeDeserializer(input);
5120 if (deserializer.get_buffer_offset() < input.size()) {
5121 throw_or_abort("Some input bytes were not read");
5122 }
5123 return value;
5124}
5125
5126} // end of namespace Acir
5127
5128template <>
5129template <typename Serializer>
5133
5134template <>
5135template <typename Deserializer>
5142
5143namespace Acir {
5144
5145inline bool operator==(const BinaryIntOp& lhs, const BinaryIntOp& rhs)
5146{
5147 if (!(lhs.value == rhs.value)) {
5148 return false;
5149 }
5150 return true;
5151}
5152
5153inline std::vector<uint8_t> BinaryIntOp::bincodeSerialize() const
5154{
5155 auto serializer = serde::BincodeSerializer();
5157 return std::move(serializer).bytes();
5158}
5159
5160inline BinaryIntOp BinaryIntOp::bincodeDeserialize(std::vector<uint8_t> input)
5161{
5162 auto deserializer = serde::BincodeDeserializer(input);
5164 if (deserializer.get_buffer_offset() < input.size()) {
5165 throw_or_abort("Some input bytes were not read");
5166 }
5167 return value;
5168}
5169
5170} // end of namespace Acir
5171
5172template <>
5173template <typename Serializer>
5175{
5176 serializer.increase_container_depth();
5177 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
5178 serializer.decrease_container_depth();
5179}
5180
5181template <>
5182template <typename Deserializer>
5184{
5185 deserializer.increase_container_depth();
5187 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
5188 deserializer.decrease_container_depth();
5189 return obj;
5190}
5191
5192namespace Acir {
5193
5194inline bool operator==(const BinaryIntOp::Add& lhs, const BinaryIntOp::Add& rhs)
5195{
5196 return true;
5197}
5198
5199inline std::vector<uint8_t> BinaryIntOp::Add::bincodeSerialize() const
5200{
5201 auto serializer = serde::BincodeSerializer();
5203 return std::move(serializer).bytes();
5204}
5205
5207{
5208 auto deserializer = serde::BincodeDeserializer(input);
5210 if (deserializer.get_buffer_offset() < input.size()) {
5211 throw_or_abort("Some input bytes were not read");
5212 }
5213 return value;
5214}
5215
5216} // end of namespace Acir
5217
5218template <>
5219template <typename Serializer>
5222
5223template <>
5224template <typename Deserializer>
5230
5231namespace Acir {
5232
5233inline bool operator==(const BinaryIntOp::Sub& lhs, const BinaryIntOp::Sub& rhs)
5234{
5235 return true;
5236}
5237
5238inline std::vector<uint8_t> BinaryIntOp::Sub::bincodeSerialize() const
5239{
5240 auto serializer = serde::BincodeSerializer();
5242 return std::move(serializer).bytes();
5243}
5244
5246{
5247 auto deserializer = serde::BincodeDeserializer(input);
5249 if (deserializer.get_buffer_offset() < input.size()) {
5250 throw_or_abort("Some input bytes were not read");
5251 }
5252 return value;
5253}
5254
5255} // end of namespace Acir
5256
5257template <>
5258template <typename Serializer>
5261
5262template <>
5263template <typename Deserializer>
5269
5270namespace Acir {
5271
5272inline bool operator==(const BinaryIntOp::Mul& lhs, const BinaryIntOp::Mul& rhs)
5273{
5274 return true;
5275}
5276
5277inline std::vector<uint8_t> BinaryIntOp::Mul::bincodeSerialize() const
5278{
5279 auto serializer = serde::BincodeSerializer();
5281 return std::move(serializer).bytes();
5282}
5283
5285{
5286 auto deserializer = serde::BincodeDeserializer(input);
5288 if (deserializer.get_buffer_offset() < input.size()) {
5289 throw_or_abort("Some input bytes were not read");
5290 }
5291 return value;
5292}
5293
5294} // end of namespace Acir
5295
5296template <>
5297template <typename Serializer>
5300
5301template <>
5302template <typename Deserializer>
5308
5309namespace Acir {
5310
5311inline bool operator==(const BinaryIntOp::Div& lhs, const BinaryIntOp::Div& rhs)
5312{
5313 return true;
5314}
5315
5316inline std::vector<uint8_t> BinaryIntOp::Div::bincodeSerialize() const
5317{
5318 auto serializer = serde::BincodeSerializer();
5320 return std::move(serializer).bytes();
5321}
5322
5324{
5325 auto deserializer = serde::BincodeDeserializer(input);
5327 if (deserializer.get_buffer_offset() < input.size()) {
5328 throw_or_abort("Some input bytes were not read");
5329 }
5330 return value;
5331}
5332
5333} // end of namespace Acir
5334
5335template <>
5336template <typename Serializer>
5339
5340template <>
5341template <typename Deserializer>
5347
5348namespace Acir {
5349
5350inline bool operator==(const BinaryIntOp::Equals& lhs, const BinaryIntOp::Equals& rhs)
5351{
5352 return true;
5353}
5354
5355inline std::vector<uint8_t> BinaryIntOp::Equals::bincodeSerialize() const
5356{
5357 auto serializer = serde::BincodeSerializer();
5359 return std::move(serializer).bytes();
5360}
5361
5363{
5364 auto deserializer = serde::BincodeDeserializer(input);
5366 if (deserializer.get_buffer_offset() < input.size()) {
5367 throw_or_abort("Some input bytes were not read");
5368 }
5369 return value;
5370}
5371
5372} // end of namespace Acir
5373
5374template <>
5375template <typename Serializer>
5379
5380template <>
5381template <typename Deserializer>
5387
5388namespace Acir {
5389
5390inline bool operator==(const BinaryIntOp::LessThan& lhs, const BinaryIntOp::LessThan& rhs)
5391{
5392 return true;
5393}
5394
5395inline std::vector<uint8_t> BinaryIntOp::LessThan::bincodeSerialize() const
5396{
5397 auto serializer = serde::BincodeSerializer();
5399 return std::move(serializer).bytes();
5400}
5401
5403{
5404 auto deserializer = serde::BincodeDeserializer(input);
5406 if (deserializer.get_buffer_offset() < input.size()) {
5407 throw_or_abort("Some input bytes were not read");
5408 }
5409 return value;
5410}
5411
5412} // end of namespace Acir
5413
5414template <>
5415template <typename Serializer>
5419
5420template <>
5421template <typename Deserializer>
5427
5428namespace Acir {
5429
5431{
5432 return true;
5433}
5434
5435inline std::vector<uint8_t> BinaryIntOp::LessThanEquals::bincodeSerialize() const
5436{
5437 auto serializer = serde::BincodeSerializer();
5439 return std::move(serializer).bytes();
5440}
5441
5443{
5444 auto deserializer = serde::BincodeDeserializer(input);
5446 if (deserializer.get_buffer_offset() < input.size()) {
5447 throw_or_abort("Some input bytes were not read");
5448 }
5449 return value;
5450}
5451
5452} // end of namespace Acir
5453
5454template <>
5455template <typename Serializer>
5459
5460template <>
5461template <typename Deserializer>
5468
5469namespace Acir {
5470
5471inline bool operator==(const BinaryIntOp::And& lhs, const BinaryIntOp::And& rhs)
5472{
5473 return true;
5474}
5475
5476inline std::vector<uint8_t> BinaryIntOp::And::bincodeSerialize() const
5477{
5478 auto serializer = serde::BincodeSerializer();
5480 return std::move(serializer).bytes();
5481}
5482
5484{
5485 auto deserializer = serde::BincodeDeserializer(input);
5487 if (deserializer.get_buffer_offset() < input.size()) {
5488 throw_or_abort("Some input bytes were not read");
5489 }
5490 return value;
5491}
5492
5493} // end of namespace Acir
5494
5495template <>
5496template <typename Serializer>
5499
5500template <>
5501template <typename Deserializer>
5507
5508namespace Acir {
5509
5510inline bool operator==(const BinaryIntOp::Or& lhs, const BinaryIntOp::Or& rhs)
5511{
5512 return true;
5513}
5514
5515inline std::vector<uint8_t> BinaryIntOp::Or::bincodeSerialize() const
5516{
5517 auto serializer = serde::BincodeSerializer();
5519 return std::move(serializer).bytes();
5520}
5521
5523{
5524 auto deserializer = serde::BincodeDeserializer(input);
5526 if (deserializer.get_buffer_offset() < input.size()) {
5527 throw_or_abort("Some input bytes were not read");
5528 }
5529 return value;
5530}
5531
5532} // end of namespace Acir
5533
5534template <>
5535template <typename Serializer>
5538
5539template <>
5540template <typename Deserializer>
5542{
5544 return obj;
5545}
5546
5547namespace Acir {
5548
5549inline bool operator==(const BinaryIntOp::Xor& lhs, const BinaryIntOp::Xor& rhs)
5550{
5551 return true;
5552}
5553
5554inline std::vector<uint8_t> BinaryIntOp::Xor::bincodeSerialize() const
5555{
5556 auto serializer = serde::BincodeSerializer();
5558 return std::move(serializer).bytes();
5559}
5560
5562{
5563 auto deserializer = serde::BincodeDeserializer(input);
5565 if (deserializer.get_buffer_offset() < input.size()) {
5566 throw_or_abort("Some input bytes were not read");
5567 }
5568 return value;
5569}
5570
5571} // end of namespace Acir
5572
5573template <>
5574template <typename Serializer>
5577
5578template <>
5579template <typename Deserializer>
5585
5586namespace Acir {
5587
5588inline bool operator==(const BinaryIntOp::Shl& lhs, const BinaryIntOp::Shl& rhs)
5589{
5590 return true;
5591}
5592
5593inline std::vector<uint8_t> BinaryIntOp::Shl::bincodeSerialize() const
5594{
5595 auto serializer = serde::BincodeSerializer();
5597 return std::move(serializer).bytes();
5598}
5599
5601{
5602 auto deserializer = serde::BincodeDeserializer(input);
5604 if (deserializer.get_buffer_offset() < input.size()) {
5605 throw_or_abort("Some input bytes were not read");
5606 }
5607 return value;
5608}
5609
5610} // end of namespace Acir
5611
5612template <>
5613template <typename Serializer>
5616
5617template <>
5618template <typename Deserializer>
5624
5625namespace Acir {
5626
5627inline bool operator==(const BinaryIntOp::Shr& lhs, const BinaryIntOp::Shr& rhs)
5628{
5629 return true;
5630}
5631
5632inline std::vector<uint8_t> BinaryIntOp::Shr::bincodeSerialize() const
5633{
5634 auto serializer = serde::BincodeSerializer();
5636 return std::move(serializer).bytes();
5637}
5638
5640{
5641 auto deserializer = serde::BincodeDeserializer(input);
5643 if (deserializer.get_buffer_offset() < input.size()) {
5644 throw_or_abort("Some input bytes were not read");
5645 }
5646 return value;
5647}
5648
5649} // end of namespace Acir
5650
5651template <>
5652template <typename Serializer>
5655
5656template <>
5657template <typename Deserializer>
5663
5664namespace Acir {
5665
5666inline bool operator==(const BitSize& lhs, const BitSize& rhs)
5667{
5668 if (!(lhs.value == rhs.value)) {
5669 return false;
5670 }
5671 return true;
5672}
5673
5674inline std::vector<uint8_t> BitSize::bincodeSerialize() const
5675{
5676 auto serializer = serde::BincodeSerializer();
5677 serde::Serializable<BitSize>::serialize(*this, serializer);
5678 return std::move(serializer).bytes();
5679}
5680
5681inline BitSize BitSize::bincodeDeserialize(std::vector<uint8_t> input)
5682{
5683 auto deserializer = serde::BincodeDeserializer(input);
5685 if (deserializer.get_buffer_offset() < input.size()) {
5686 throw_or_abort("Some input bytes were not read");
5687 }
5688 return value;
5689}
5690
5691} // end of namespace Acir
5692
5693template <>
5694template <typename Serializer>
5695void serde::Serializable<Acir::BitSize>::serialize(const Acir::BitSize& obj, Serializer& serializer)
5696{
5697 serializer.increase_container_depth();
5698 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
5699 serializer.decrease_container_depth();
5700}
5701
5702template <>
5703template <typename Deserializer>
5705{
5706 deserializer.increase_container_depth();
5707 Acir::BitSize obj;
5708 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
5709 deserializer.decrease_container_depth();
5710 return obj;
5711}
5712
5713namespace Acir {
5714
5715inline bool operator==(const BitSize::Field& lhs, const BitSize::Field& rhs)
5716{
5717 return true;
5718}
5719
5720inline std::vector<uint8_t> BitSize::Field::bincodeSerialize() const
5721{
5722 auto serializer = serde::BincodeSerializer();
5724 return std::move(serializer).bytes();
5725}
5726
5727inline BitSize::Field BitSize::Field::bincodeDeserialize(std::vector<uint8_t> input)
5728{
5729 auto deserializer = serde::BincodeDeserializer(input);
5731 if (deserializer.get_buffer_offset() < input.size()) {
5732 throw_or_abort("Some input bytes were not read");
5733 }
5734 return value;
5735}
5736
5737} // end of namespace Acir
5738
5739template <>
5740template <typename Serializer>
5743
5744template <>
5745template <typename Deserializer>
5747{
5749 return obj;
5750}
5751
5752namespace Acir {
5753
5754inline bool operator==(const BitSize::Integer& lhs, const BitSize::Integer& rhs)
5755{
5756 if (!(lhs.value == rhs.value)) {
5757 return false;
5758 }
5759 return true;
5760}
5761
5762inline std::vector<uint8_t> BitSize::Integer::bincodeSerialize() const
5763{
5764 auto serializer = serde::BincodeSerializer();
5766 return std::move(serializer).bytes();
5767}
5768
5770{
5771 auto deserializer = serde::BincodeDeserializer(input);
5773 if (deserializer.get_buffer_offset() < input.size()) {
5774 throw_or_abort("Some input bytes were not read");
5775 }
5776 return value;
5777}
5778
5779} // end of namespace Acir
5780
5781template <>
5782template <typename Serializer>
5784{
5785 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
5786}
5787
5788template <>
5789template <typename Deserializer>
5791{
5793 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
5794 return obj;
5795}
5796
5797namespace Acir {
5798
5799inline bool operator==(const BlackBoxFuncCall& lhs, const BlackBoxFuncCall& rhs)
5800{
5801 if (!(lhs.value == rhs.value)) {
5802 return false;
5803 }
5804 return true;
5805}
5806
5807inline std::vector<uint8_t> BlackBoxFuncCall::bincodeSerialize() const
5808{
5809 auto serializer = serde::BincodeSerializer();
5811 return std::move(serializer).bytes();
5812}
5813
5815{
5816 auto deserializer = serde::BincodeDeserializer(input);
5818 if (deserializer.get_buffer_offset() < input.size()) {
5819 throw_or_abort("Some input bytes were not read");
5820 }
5821 return value;
5822}
5823
5824} // end of namespace Acir
5825
5826template <>
5827template <typename Serializer>
5829{
5830 serializer.increase_container_depth();
5831 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
5832 serializer.decrease_container_depth();
5833}
5834
5835template <>
5836template <typename Deserializer>
5838{
5839 deserializer.increase_container_depth();
5841 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
5842 deserializer.decrease_container_depth();
5843 return obj;
5844}
5845
5846namespace Acir {
5847
5849{
5850 if (!(lhs.inputs == rhs.inputs)) {
5851 return false;
5852 }
5853 if (!(lhs.iv == rhs.iv)) {
5854 return false;
5855 }
5856 if (!(lhs.key == rhs.key)) {
5857 return false;
5858 }
5859 if (!(lhs.outputs == rhs.outputs)) {
5860 return false;
5861 }
5862 return true;
5863}
5864
5865inline std::vector<uint8_t> BlackBoxFuncCall::AES128Encrypt::bincodeSerialize() const
5866{
5867 auto serializer = serde::BincodeSerializer();
5869 return std::move(serializer).bytes();
5870}
5871
5873{
5874 auto deserializer = serde::BincodeDeserializer(input);
5876 if (deserializer.get_buffer_offset() < input.size()) {
5877 throw_or_abort("Some input bytes were not read");
5878 }
5879 return value;
5880}
5881
5882} // end of namespace Acir
5883
5884template <>
5885template <typename Serializer>
5887 const Acir::BlackBoxFuncCall::AES128Encrypt& obj, Serializer& serializer)
5888{
5889 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
5890 serde::Serializable<decltype(obj.iv)>::serialize(obj.iv, serializer);
5891 serde::Serializable<decltype(obj.key)>::serialize(obj.key, serializer);
5892 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
5893}
5894
5895template <>
5896template <typename Deserializer>
5898 Deserializer& deserializer)
5899{
5901 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
5902 obj.iv = serde::Deserializable<decltype(obj.iv)>::deserialize(deserializer);
5903 obj.key = serde::Deserializable<decltype(obj.key)>::deserialize(deserializer);
5904 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
5905 return obj;
5906}
5907
5908namespace Acir {
5909
5910inline bool operator==(const BlackBoxFuncCall::AND& lhs, const BlackBoxFuncCall::AND& rhs)
5911{
5912 if (!(lhs.lhs == rhs.lhs)) {
5913 return false;
5914 }
5915 if (!(lhs.rhs == rhs.rhs)) {
5916 return false;
5917 }
5918 if (!(lhs.num_bits == rhs.num_bits)) {
5919 return false;
5920 }
5921 if (!(lhs.output == rhs.output)) {
5922 return false;
5923 }
5924 return true;
5925}
5926
5927inline std::vector<uint8_t> BlackBoxFuncCall::AND::bincodeSerialize() const
5928{
5929 auto serializer = serde::BincodeSerializer();
5931 return std::move(serializer).bytes();
5932}
5933
5935{
5936 auto deserializer = serde::BincodeDeserializer(input);
5938 if (deserializer.get_buffer_offset() < input.size()) {
5939 throw_or_abort("Some input bytes were not read");
5940 }
5941 return value;
5942}
5943
5944} // end of namespace Acir
5945
5946template <>
5947template <typename Serializer>
5949 Serializer& serializer)
5950{
5951 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
5952 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
5953 serde::Serializable<decltype(obj.num_bits)>::serialize(obj.num_bits, serializer);
5954 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
5955}
5956
5957template <>
5958template <typename Deserializer>
5960{
5962 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
5963 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
5964 obj.num_bits = serde::Deserializable<decltype(obj.num_bits)>::deserialize(deserializer);
5965 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
5966 return obj;
5967}
5968
5969namespace Acir {
5970
5971inline bool operator==(const BlackBoxFuncCall::XOR& lhs, const BlackBoxFuncCall::XOR& rhs)
5972{
5973 if (!(lhs.lhs == rhs.lhs)) {
5974 return false;
5975 }
5976 if (!(lhs.rhs == rhs.rhs)) {
5977 return false;
5978 }
5979 if (!(lhs.num_bits == rhs.num_bits)) {
5980 return false;
5981 }
5982 if (!(lhs.output == rhs.output)) {
5983 return false;
5984 }
5985 return true;
5986}
5987
5988inline std::vector<uint8_t> BlackBoxFuncCall::XOR::bincodeSerialize() const
5989{
5990 auto serializer = serde::BincodeSerializer();
5992 return std::move(serializer).bytes();
5993}
5994
5996{
5997 auto deserializer = serde::BincodeDeserializer(input);
5999 if (deserializer.get_buffer_offset() < input.size()) {
6000 throw_or_abort("Some input bytes were not read");
6001 }
6002 return value;
6003}
6004
6005} // end of namespace Acir
6006
6007template <>
6008template <typename Serializer>
6010 Serializer& serializer)
6011{
6012 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
6013 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
6014 serde::Serializable<decltype(obj.num_bits)>::serialize(obj.num_bits, serializer);
6015 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
6016}
6017
6018template <>
6019template <typename Deserializer>
6021{
6023 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
6024 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
6025 obj.num_bits = serde::Deserializable<decltype(obj.num_bits)>::deserialize(deserializer);
6026 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
6027 return obj;
6028}
6029
6030namespace Acir {
6031
6033{
6034 if (!(lhs.input == rhs.input)) {
6035 return false;
6036 }
6037 if (!(lhs.num_bits == rhs.num_bits)) {
6038 return false;
6039 }
6040 return true;
6041}
6042
6043inline std::vector<uint8_t> BlackBoxFuncCall::RANGE::bincodeSerialize() const
6044{
6045 auto serializer = serde::BincodeSerializer();
6047 return std::move(serializer).bytes();
6048}
6049
6051{
6052 auto deserializer = serde::BincodeDeserializer(input);
6054 if (deserializer.get_buffer_offset() < input.size()) {
6055 throw_or_abort("Some input bytes were not read");
6056 }
6057 return value;
6058}
6059
6060} // end of namespace Acir
6061
6062template <>
6063template <typename Serializer>
6065 Serializer& serializer)
6066{
6067 serde::Serializable<decltype(obj.input)>::serialize(obj.input, serializer);
6068 serde::Serializable<decltype(obj.num_bits)>::serialize(obj.num_bits, serializer);
6069}
6070
6071template <>
6072template <typename Deserializer>
6074 Deserializer& deserializer)
6075{
6077 obj.input = serde::Deserializable<decltype(obj.input)>::deserialize(deserializer);
6078 obj.num_bits = serde::Deserializable<decltype(obj.num_bits)>::deserialize(deserializer);
6079 return obj;
6080}
6081
6082namespace Acir {
6083
6085{
6086 if (!(lhs.inputs == rhs.inputs)) {
6087 return false;
6088 }
6089 if (!(lhs.outputs == rhs.outputs)) {
6090 return false;
6091 }
6092 return true;
6093}
6094
6095inline std::vector<uint8_t> BlackBoxFuncCall::Blake2s::bincodeSerialize() const
6096{
6097 auto serializer = serde::BincodeSerializer();
6099 return std::move(serializer).bytes();
6100}
6101
6103{
6104 auto deserializer = serde::BincodeDeserializer(input);
6106 if (deserializer.get_buffer_offset() < input.size()) {
6107 throw_or_abort("Some input bytes were not read");
6108 }
6109 return value;
6110}
6111
6112} // end of namespace Acir
6113
6114template <>
6115template <typename Serializer>
6117 Serializer& serializer)
6118{
6119 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
6120 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
6121}
6122
6123template <>
6124template <typename Deserializer>
6126 Deserializer& deserializer)
6127{
6129 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
6130 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
6131 return obj;
6132}
6133
6134namespace Acir {
6135
6137{
6138 if (!(lhs.inputs == rhs.inputs)) {
6139 return false;
6140 }
6141 if (!(lhs.outputs == rhs.outputs)) {
6142 return false;
6143 }
6144 return true;
6145}
6146
6147inline std::vector<uint8_t> BlackBoxFuncCall::Blake3::bincodeSerialize() const
6148{
6149 auto serializer = serde::BincodeSerializer();
6151 return std::move(serializer).bytes();
6152}
6153
6155{
6156 auto deserializer = serde::BincodeDeserializer(input);
6158 if (deserializer.get_buffer_offset() < input.size()) {
6159 throw_or_abort("Some input bytes were not read");
6160 }
6161 return value;
6162}
6163
6164} // end of namespace Acir
6165
6166template <>
6167template <typename Serializer>
6169 Serializer& serializer)
6170{
6171 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
6172 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
6173}
6174
6175template <>
6176template <typename Deserializer>
6178 Deserializer& deserializer)
6179{
6181 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
6182 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
6183 return obj;
6184}
6185
6186namespace Acir {
6187
6189{
6190 if (!(lhs.public_key_x == rhs.public_key_x)) {
6191 return false;
6192 }
6193 if (!(lhs.public_key_y == rhs.public_key_y)) {
6194 return false;
6195 }
6196 if (!(lhs.signature == rhs.signature)) {
6197 return false;
6198 }
6199 if (!(lhs.hashed_message == rhs.hashed_message)) {
6200 return false;
6201 }
6202 if (!(lhs.predicate == rhs.predicate)) {
6203 return false;
6204 }
6205 if (!(lhs.output == rhs.output)) {
6206 return false;
6207 }
6208 return true;
6209}
6210
6212{
6213 auto serializer = serde::BincodeSerializer();
6215 return std::move(serializer).bytes();
6216}
6217
6219{
6220 auto deserializer = serde::BincodeDeserializer(input);
6222 if (deserializer.get_buffer_offset() < input.size()) {
6223 throw_or_abort("Some input bytes were not read");
6224 }
6225 return value;
6226}
6227
6228} // end of namespace Acir
6229
6230template <>
6231template <typename Serializer>
6233 const Acir::BlackBoxFuncCall::EcdsaSecp256k1& obj, Serializer& serializer)
6234{
6235 serde::Serializable<decltype(obj.public_key_x)>::serialize(obj.public_key_x, serializer);
6236 serde::Serializable<decltype(obj.public_key_y)>::serialize(obj.public_key_y, serializer);
6237 serde::Serializable<decltype(obj.signature)>::serialize(obj.signature, serializer);
6238 serde::Serializable<decltype(obj.hashed_message)>::serialize(obj.hashed_message, serializer);
6239 serde::Serializable<decltype(obj.predicate)>::serialize(obj.predicate, serializer);
6240 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
6241}
6242
6243template <>
6244template <typename Deserializer>
6246 Deserializer& deserializer)
6247{
6249 obj.public_key_x = serde::Deserializable<decltype(obj.public_key_x)>::deserialize(deserializer);
6250 obj.public_key_y = serde::Deserializable<decltype(obj.public_key_y)>::deserialize(deserializer);
6251 obj.signature = serde::Deserializable<decltype(obj.signature)>::deserialize(deserializer);
6252 obj.hashed_message = serde::Deserializable<decltype(obj.hashed_message)>::deserialize(deserializer);
6253 obj.predicate = serde::Deserializable<decltype(obj.predicate)>::deserialize(deserializer);
6254 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
6255 return obj;
6256}
6257
6258namespace Acir {
6259
6261{
6262 if (!(lhs.public_key_x == rhs.public_key_x)) {
6263 return false;
6264 }
6265 if (!(lhs.public_key_y == rhs.public_key_y)) {
6266 return false;
6267 }
6268 if (!(lhs.signature == rhs.signature)) {
6269 return false;
6270 }
6271 if (!(lhs.hashed_message == rhs.hashed_message)) {
6272 return false;
6273 }
6274 if (!(lhs.predicate == rhs.predicate)) {
6275 return false;
6276 }
6277 if (!(lhs.output == rhs.output)) {
6278 return false;
6279 }
6280 return true;
6281}
6282
6284{
6285 auto serializer = serde::BincodeSerializer();
6287 return std::move(serializer).bytes();
6288}
6289
6291{
6292 auto deserializer = serde::BincodeDeserializer(input);
6294 if (deserializer.get_buffer_offset() < input.size()) {
6295 throw_or_abort("Some input bytes were not read");
6296 }
6297 return value;
6298}
6299
6300} // end of namespace Acir
6301
6302template <>
6303template <typename Serializer>
6305 const Acir::BlackBoxFuncCall::EcdsaSecp256r1& obj, Serializer& serializer)
6306{
6307 serde::Serializable<decltype(obj.public_key_x)>::serialize(obj.public_key_x, serializer);
6308 serde::Serializable<decltype(obj.public_key_y)>::serialize(obj.public_key_y, serializer);
6309 serde::Serializable<decltype(obj.signature)>::serialize(obj.signature, serializer);
6310 serde::Serializable<decltype(obj.hashed_message)>::serialize(obj.hashed_message, serializer);
6311 serde::Serializable<decltype(obj.predicate)>::serialize(obj.predicate, serializer);
6312 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
6313}
6314
6315template <>
6316template <typename Deserializer>
6318 Deserializer& deserializer)
6319{
6321 obj.public_key_x = serde::Deserializable<decltype(obj.public_key_x)>::deserialize(deserializer);
6322 obj.public_key_y = serde::Deserializable<decltype(obj.public_key_y)>::deserialize(deserializer);
6323 obj.signature = serde::Deserializable<decltype(obj.signature)>::deserialize(deserializer);
6324 obj.hashed_message = serde::Deserializable<decltype(obj.hashed_message)>::deserialize(deserializer);
6325 obj.predicate = serde::Deserializable<decltype(obj.predicate)>::deserialize(deserializer);
6326 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
6327 return obj;
6328}
6329
6330namespace Acir {
6331
6333{
6334 if (!(lhs.points == rhs.points)) {
6335 return false;
6336 }
6337 if (!(lhs.scalars == rhs.scalars)) {
6338 return false;
6339 }
6340 if (!(lhs.predicate == rhs.predicate)) {
6341 return false;
6342 }
6343 if (!(lhs.outputs == rhs.outputs)) {
6344 return false;
6345 }
6346 return true;
6347}
6348
6350{
6351 auto serializer = serde::BincodeSerializer();
6353 return std::move(serializer).bytes();
6354}
6355
6357{
6358 auto deserializer = serde::BincodeDeserializer(input);
6360 if (deserializer.get_buffer_offset() < input.size()) {
6361 throw_or_abort("Some input bytes were not read");
6362 }
6363 return value;
6364}
6365
6366} // end of namespace Acir
6367
6368template <>
6369template <typename Serializer>
6371 const Acir::BlackBoxFuncCall::MultiScalarMul& obj, Serializer& serializer)
6372{
6373 serde::Serializable<decltype(obj.points)>::serialize(obj.points, serializer);
6374 serde::Serializable<decltype(obj.scalars)>::serialize(obj.scalars, serializer);
6375 serde::Serializable<decltype(obj.predicate)>::serialize(obj.predicate, serializer);
6376 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
6377}
6378
6379template <>
6380template <typename Deserializer>
6382 Deserializer& deserializer)
6383{
6385 obj.points = serde::Deserializable<decltype(obj.points)>::deserialize(deserializer);
6386 obj.scalars = serde::Deserializable<decltype(obj.scalars)>::deserialize(deserializer);
6387 obj.predicate = serde::Deserializable<decltype(obj.predicate)>::deserialize(deserializer);
6388 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
6389 return obj;
6390}
6391
6392namespace Acir {
6393
6395{
6396 if (!(lhs.input1 == rhs.input1)) {
6397 return false;
6398 }
6399 if (!(lhs.input2 == rhs.input2)) {
6400 return false;
6401 }
6402 if (!(lhs.predicate == rhs.predicate)) {
6403 return false;
6404 }
6405 if (!(lhs.outputs == rhs.outputs)) {
6406 return false;
6407 }
6408 return true;
6409}
6410
6412{
6413 auto serializer = serde::BincodeSerializer();
6415 return std::move(serializer).bytes();
6416}
6417
6419 std::vector<uint8_t> input)
6420{
6421 auto deserializer = serde::BincodeDeserializer(input);
6423 if (deserializer.get_buffer_offset() < input.size()) {
6424 throw_or_abort("Some input bytes were not read");
6425 }
6426 return value;
6427}
6428
6429} // end of namespace Acir
6430
6431template <>
6432template <typename Serializer>
6434 const Acir::BlackBoxFuncCall::EmbeddedCurveAdd& obj, Serializer& serializer)
6435{
6436 serde::Serializable<decltype(obj.input1)>::serialize(obj.input1, serializer);
6437 serde::Serializable<decltype(obj.input2)>::serialize(obj.input2, serializer);
6438 serde::Serializable<decltype(obj.predicate)>::serialize(obj.predicate, serializer);
6439 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
6440}
6441
6442template <>
6443template <typename Deserializer>
6445 Deserializer& deserializer)
6446{
6448 obj.input1 = serde::Deserializable<decltype(obj.input1)>::deserialize(deserializer);
6449 obj.input2 = serde::Deserializable<decltype(obj.input2)>::deserialize(deserializer);
6450 obj.predicate = serde::Deserializable<decltype(obj.predicate)>::deserialize(deserializer);
6451 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
6452 return obj;
6453}
6454
6455namespace Acir {
6456
6458{
6459 if (!(lhs.inputs == rhs.inputs)) {
6460 return false;
6461 }
6462 if (!(lhs.outputs == rhs.outputs)) {
6463 return false;
6464 }
6465 return true;
6466}
6467
6468inline std::vector<uint8_t> BlackBoxFuncCall::Keccakf1600::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.inputs)>::serialize(obj.inputs, serializer);
6493 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
6494}
6495
6496template <>
6497template <typename Deserializer>
6499 Deserializer& deserializer)
6500{
6502 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
6503 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
6504 return obj;
6505}
6506
6507namespace Acir {
6508
6511{
6512 if (!(lhs.verification_key == rhs.verification_key)) {
6513 return false;
6514 }
6515 if (!(lhs.proof == rhs.proof)) {
6516 return false;
6517 }
6518 if (!(lhs.public_inputs == rhs.public_inputs)) {
6519 return false;
6520 }
6521 if (!(lhs.key_hash == rhs.key_hash)) {
6522 return false;
6523 }
6524 if (!(lhs.proof_type == rhs.proof_type)) {
6525 return false;
6526 }
6527 if (!(lhs.predicate == rhs.predicate)) {
6528 return false;
6529 }
6530 return true;
6531}
6532
6534{
6535 auto serializer = serde::BincodeSerializer();
6537 return std::move(serializer).bytes();
6538}
6539
6541 std::vector<uint8_t> input)
6542{
6543 auto deserializer = serde::BincodeDeserializer(input);
6545 if (deserializer.get_buffer_offset() < input.size()) {
6546 throw_or_abort("Some input bytes were not read");
6547 }
6548 return value;
6549}
6550
6551} // end of namespace Acir
6552
6553template <>
6554template <typename Serializer>
6556 const Acir::BlackBoxFuncCall::RecursiveAggregation& obj, Serializer& serializer)
6557{
6558 serde::Serializable<decltype(obj.verification_key)>::serialize(obj.verification_key, serializer);
6559 serde::Serializable<decltype(obj.proof)>::serialize(obj.proof, serializer);
6560 serde::Serializable<decltype(obj.public_inputs)>::serialize(obj.public_inputs, serializer);
6561 serde::Serializable<decltype(obj.key_hash)>::serialize(obj.key_hash, serializer);
6562 serde::Serializable<decltype(obj.proof_type)>::serialize(obj.proof_type, serializer);
6563 serde::Serializable<decltype(obj.predicate)>::serialize(obj.predicate, serializer);
6564}
6565
6566template <>
6567template <typename Deserializer>
6569 Acir::BlackBoxFuncCall::RecursiveAggregation>::deserialize(Deserializer& deserializer)
6570{
6572 obj.verification_key = serde::Deserializable<decltype(obj.verification_key)>::deserialize(deserializer);
6573 obj.proof = serde::Deserializable<decltype(obj.proof)>::deserialize(deserializer);
6574 obj.public_inputs = serde::Deserializable<decltype(obj.public_inputs)>::deserialize(deserializer);
6575 obj.key_hash = serde::Deserializable<decltype(obj.key_hash)>::deserialize(deserializer);
6576 obj.proof_type = serde::Deserializable<decltype(obj.proof_type)>::deserialize(deserializer);
6577 obj.predicate = serde::Deserializable<decltype(obj.predicate)>::deserialize(deserializer);
6578 return obj;
6579}
6580
6581namespace Acir {
6582
6585{
6586 if (!(lhs.inputs == rhs.inputs)) {
6587 return false;
6588 }
6589 if (!(lhs.outputs == rhs.outputs)) {
6590 return false;
6591 }
6592 return true;
6593}
6594
6596{
6597 auto serializer = serde::BincodeSerializer();
6599 return std::move(serializer).bytes();
6600}
6601
6603 std::vector<uint8_t> input)
6604{
6605 auto deserializer = serde::BincodeDeserializer(input);
6607 if (deserializer.get_buffer_offset() < input.size()) {
6608 throw_or_abort("Some input bytes were not read");
6609 }
6610 return value;
6611}
6612
6613} // end of namespace Acir
6614
6615template <>
6616template <typename Serializer>
6618 const Acir::BlackBoxFuncCall::Poseidon2Permutation& obj, Serializer& serializer)
6619{
6620 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
6621 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
6622}
6623
6624template <>
6625template <typename Deserializer>
6627 Acir::BlackBoxFuncCall::Poseidon2Permutation>::deserialize(Deserializer& deserializer)
6628{
6630 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
6631 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
6632 return obj;
6633}
6634
6635namespace Acir {
6636
6638{
6639 if (!(lhs.inputs == rhs.inputs)) {
6640 return false;
6641 }
6642 if (!(lhs.hash_values == rhs.hash_values)) {
6643 return false;
6644 }
6645 if (!(lhs.outputs == rhs.outputs)) {
6646 return false;
6647 }
6648 return true;
6649}
6650
6652{
6653 auto serializer = serde::BincodeSerializer();
6655 return std::move(serializer).bytes();
6656}
6657
6659 std::vector<uint8_t> input)
6660{
6661 auto deserializer = serde::BincodeDeserializer(input);
6663 if (deserializer.get_buffer_offset() < input.size()) {
6664 throw_or_abort("Some input bytes were not read");
6665 }
6666 return value;
6667}
6668
6669} // end of namespace Acir
6670
6671template <>
6672template <typename Serializer>
6674 const Acir::BlackBoxFuncCall::Sha256Compression& obj, Serializer& serializer)
6675{
6676 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
6677 serde::Serializable<decltype(obj.hash_values)>::serialize(obj.hash_values, serializer);
6678 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
6679}
6680
6681template <>
6682template <typename Deserializer>
6684 Deserializer& deserializer)
6685{
6687 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
6688 obj.hash_values = serde::Deserializable<decltype(obj.hash_values)>::deserialize(deserializer);
6689 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
6690 return obj;
6691}
6692
6693namespace Acir {
6694
6695inline bool operator==(const BlackBoxOp& lhs, const BlackBoxOp& rhs)
6696{
6697 if (!(lhs.value == rhs.value)) {
6698 return false;
6699 }
6700 return true;
6701}
6702
6703inline std::vector<uint8_t> BlackBoxOp::bincodeSerialize() const
6704{
6705 auto serializer = serde::BincodeSerializer();
6707 return std::move(serializer).bytes();
6708}
6709
6710inline BlackBoxOp BlackBoxOp::bincodeDeserialize(std::vector<uint8_t> input)
6711{
6712 auto deserializer = serde::BincodeDeserializer(input);
6714 if (deserializer.get_buffer_offset() < input.size()) {
6715 throw_or_abort("Some input bytes were not read");
6716 }
6717 return value;
6718}
6719
6720} // end of namespace Acir
6721
6722template <>
6723template <typename Serializer>
6725{
6726 serializer.increase_container_depth();
6727 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
6728 serializer.decrease_container_depth();
6729}
6730
6731template <>
6732template <typename Deserializer>
6734{
6735 deserializer.increase_container_depth();
6736 Acir::BlackBoxOp obj;
6737 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
6738 deserializer.decrease_container_depth();
6739 return obj;
6740}
6741
6742namespace Acir {
6743
6745{
6746 if (!(lhs.inputs == rhs.inputs)) {
6747 return false;
6748 }
6749 if (!(lhs.iv == rhs.iv)) {
6750 return false;
6751 }
6752 if (!(lhs.key == rhs.key)) {
6753 return false;
6754 }
6755 if (!(lhs.outputs == rhs.outputs)) {
6756 return false;
6757 }
6758 return true;
6759}
6760
6761inline std::vector<uint8_t> BlackBoxOp::AES128Encrypt::bincodeSerialize() const
6762{
6763 auto serializer = serde::BincodeSerializer();
6765 return std::move(serializer).bytes();
6766}
6767
6769{
6770 auto deserializer = serde::BincodeDeserializer(input);
6772 if (deserializer.get_buffer_offset() < input.size()) {
6773 throw_or_abort("Some input bytes were not read");
6774 }
6775 return value;
6776}
6777
6778} // end of namespace Acir
6779
6780template <>
6781template <typename Serializer>
6783 Serializer& serializer)
6784{
6785 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
6786 serde::Serializable<decltype(obj.iv)>::serialize(obj.iv, serializer);
6787 serde::Serializable<decltype(obj.key)>::serialize(obj.key, serializer);
6788 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
6789}
6790
6791template <>
6792template <typename Deserializer>
6794 Deserializer& deserializer)
6795{
6797 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
6798 obj.iv = serde::Deserializable<decltype(obj.iv)>::deserialize(deserializer);
6799 obj.key = serde::Deserializable<decltype(obj.key)>::deserialize(deserializer);
6800 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
6801 return obj;
6802}
6803
6804namespace Acir {
6805
6806inline bool operator==(const BlackBoxOp::Blake2s& lhs, const BlackBoxOp::Blake2s& rhs)
6807{
6808 if (!(lhs.message == rhs.message)) {
6809 return false;
6810 }
6811 if (!(lhs.output == rhs.output)) {
6812 return false;
6813 }
6814 return true;
6815}
6816
6817inline std::vector<uint8_t> BlackBoxOp::Blake2s::bincodeSerialize() const
6818{
6819 auto serializer = serde::BincodeSerializer();
6821 return std::move(serializer).bytes();
6822}
6823
6825{
6826 auto deserializer = serde::BincodeDeserializer(input);
6828 if (deserializer.get_buffer_offset() < input.size()) {
6829 throw_or_abort("Some input bytes were not read");
6830 }
6831 return value;
6832}
6833
6834} // end of namespace Acir
6835
6836template <>
6837template <typename Serializer>
6839 Serializer& serializer)
6840{
6841 serde::Serializable<decltype(obj.message)>::serialize(obj.message, serializer);
6842 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
6843}
6844
6845template <>
6846template <typename Deserializer>
6848{
6850 obj.message = serde::Deserializable<decltype(obj.message)>::deserialize(deserializer);
6851 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
6852 return obj;
6853}
6854
6855namespace Acir {
6856
6857inline bool operator==(const BlackBoxOp::Blake3& lhs, const BlackBoxOp::Blake3& rhs)
6858{
6859 if (!(lhs.message == rhs.message)) {
6860 return false;
6861 }
6862 if (!(lhs.output == rhs.output)) {
6863 return false;
6864 }
6865 return true;
6866}
6867
6868inline std::vector<uint8_t> BlackBoxOp::Blake3::bincodeSerialize() const
6869{
6870 auto serializer = serde::BincodeSerializer();
6872 return std::move(serializer).bytes();
6873}
6874
6876{
6877 auto deserializer = serde::BincodeDeserializer(input);
6879 if (deserializer.get_buffer_offset() < input.size()) {
6880 throw_or_abort("Some input bytes were not read");
6881 }
6882 return value;
6883}
6884
6885} // end of namespace Acir
6886
6887template <>
6888template <typename Serializer>
6890 Serializer& serializer)
6891{
6892 serde::Serializable<decltype(obj.message)>::serialize(obj.message, serializer);
6893 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
6894}
6895
6896template <>
6897template <typename Deserializer>
6899{
6901 obj.message = serde::Deserializable<decltype(obj.message)>::deserialize(deserializer);
6902 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
6903 return obj;
6904}
6905
6906namespace Acir {
6907
6909{
6910 if (!(lhs.input == rhs.input)) {
6911 return false;
6912 }
6913 if (!(lhs.output == rhs.output)) {
6914 return false;
6915 }
6916 return true;
6917}
6918
6919inline std::vector<uint8_t> BlackBoxOp::Keccakf1600::bincodeSerialize() const
6920{
6921 auto serializer = serde::BincodeSerializer();
6923 return std::move(serializer).bytes();
6924}
6925
6927{
6928 auto deserializer = serde::BincodeDeserializer(input);
6930 if (deserializer.get_buffer_offset() < input.size()) {
6931 throw_or_abort("Some input bytes were not read");
6932 }
6933 return value;
6934}
6935
6936} // end of namespace Acir
6937
6938template <>
6939template <typename Serializer>
6941 Serializer& serializer)
6942{
6943 serde::Serializable<decltype(obj.input)>::serialize(obj.input, serializer);
6944 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
6945}
6946
6947template <>
6948template <typename Deserializer>
6950 Deserializer& deserializer)
6951{
6953 obj.input = serde::Deserializable<decltype(obj.input)>::deserialize(deserializer);
6954 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
6955 return obj;
6956}
6957
6958namespace Acir {
6959
6961{
6962 if (!(lhs.hashed_msg == rhs.hashed_msg)) {
6963 return false;
6964 }
6965 if (!(lhs.public_key_x == rhs.public_key_x)) {
6966 return false;
6967 }
6968 if (!(lhs.public_key_y == rhs.public_key_y)) {
6969 return false;
6970 }
6971 if (!(lhs.signature == rhs.signature)) {
6972 return false;
6973 }
6974 if (!(lhs.result == rhs.result)) {
6975 return false;
6976 }
6977 return true;
6978}
6979
6980inline std::vector<uint8_t> BlackBoxOp::EcdsaSecp256k1::bincodeSerialize() const
6981{
6982 auto serializer = serde::BincodeSerializer();
6984 return std::move(serializer).bytes();
6985}
6986
6988{
6989 auto deserializer = serde::BincodeDeserializer(input);
6991 if (deserializer.get_buffer_offset() < input.size()) {
6992 throw_or_abort("Some input bytes were not read");
6993 }
6994 return value;
6995}
6996
6997} // end of namespace Acir
6998
6999template <>
7000template <typename Serializer>
7002 Serializer& serializer)
7003{
7004 serde::Serializable<decltype(obj.hashed_msg)>::serialize(obj.hashed_msg, serializer);
7005 serde::Serializable<decltype(obj.public_key_x)>::serialize(obj.public_key_x, serializer);
7006 serde::Serializable<decltype(obj.public_key_y)>::serialize(obj.public_key_y, serializer);
7007 serde::Serializable<decltype(obj.signature)>::serialize(obj.signature, serializer);
7008 serde::Serializable<decltype(obj.result)>::serialize(obj.result, serializer);
7009}
7010
7011template <>
7012template <typename Deserializer>
7014 Deserializer& deserializer)
7015{
7017 obj.hashed_msg = serde::Deserializable<decltype(obj.hashed_msg)>::deserialize(deserializer);
7018 obj.public_key_x = serde::Deserializable<decltype(obj.public_key_x)>::deserialize(deserializer);
7019 obj.public_key_y = serde::Deserializable<decltype(obj.public_key_y)>::deserialize(deserializer);
7020 obj.signature = serde::Deserializable<decltype(obj.signature)>::deserialize(deserializer);
7021 obj.result = serde::Deserializable<decltype(obj.result)>::deserialize(deserializer);
7022 return obj;
7023}
7024
7025namespace Acir {
7026
7028{
7029 if (!(lhs.hashed_msg == rhs.hashed_msg)) {
7030 return false;
7031 }
7032 if (!(lhs.public_key_x == rhs.public_key_x)) {
7033 return false;
7034 }
7035 if (!(lhs.public_key_y == rhs.public_key_y)) {
7036 return false;
7037 }
7038 if (!(lhs.signature == rhs.signature)) {
7039 return false;
7040 }
7041 if (!(lhs.result == rhs.result)) {
7042 return false;
7043 }
7044 return true;
7045}
7046
7047inline std::vector<uint8_t> BlackBoxOp::EcdsaSecp256r1::bincodeSerialize() const
7048{
7049 auto serializer = serde::BincodeSerializer();
7051 return std::move(serializer).bytes();
7052}
7053
7055{
7056 auto deserializer = serde::BincodeDeserializer(input);
7058 if (deserializer.get_buffer_offset() < input.size()) {
7059 throw_or_abort("Some input bytes were not read");
7060 }
7061 return value;
7062}
7063
7064} // end of namespace Acir
7065
7066template <>
7067template <typename Serializer>
7069 Serializer& serializer)
7070{
7071 serde::Serializable<decltype(obj.hashed_msg)>::serialize(obj.hashed_msg, serializer);
7072 serde::Serializable<decltype(obj.public_key_x)>::serialize(obj.public_key_x, serializer);
7073 serde::Serializable<decltype(obj.public_key_y)>::serialize(obj.public_key_y, serializer);
7074 serde::Serializable<decltype(obj.signature)>::serialize(obj.signature, serializer);
7075 serde::Serializable<decltype(obj.result)>::serialize(obj.result, serializer);
7076}
7077
7078template <>
7079template <typename Deserializer>
7081 Deserializer& deserializer)
7082{
7084 obj.hashed_msg = serde::Deserializable<decltype(obj.hashed_msg)>::deserialize(deserializer);
7085 obj.public_key_x = serde::Deserializable<decltype(obj.public_key_x)>::deserialize(deserializer);
7086 obj.public_key_y = serde::Deserializable<decltype(obj.public_key_y)>::deserialize(deserializer);
7087 obj.signature = serde::Deserializable<decltype(obj.signature)>::deserialize(deserializer);
7088 obj.result = serde::Deserializable<decltype(obj.result)>::deserialize(deserializer);
7089 return obj;
7090}
7091
7092namespace Acir {
7093
7095{
7096 if (!(lhs.points == rhs.points)) {
7097 return false;
7098 }
7099 if (!(lhs.scalars == rhs.scalars)) {
7100 return false;
7101 }
7102 if (!(lhs.outputs == rhs.outputs)) {
7103 return false;
7104 }
7105 return true;
7106}
7107
7108inline std::vector<uint8_t> BlackBoxOp::MultiScalarMul::bincodeSerialize() const
7109{
7110 auto serializer = serde::BincodeSerializer();
7112 return std::move(serializer).bytes();
7113}
7114
7116{
7117 auto deserializer = serde::BincodeDeserializer(input);
7119 if (deserializer.get_buffer_offset() < input.size()) {
7120 throw_or_abort("Some input bytes were not read");
7121 }
7122 return value;
7123}
7124
7125} // end of namespace Acir
7126
7127template <>
7128template <typename Serializer>
7130 Serializer& serializer)
7131{
7132 serde::Serializable<decltype(obj.points)>::serialize(obj.points, serializer);
7133 serde::Serializable<decltype(obj.scalars)>::serialize(obj.scalars, serializer);
7134 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
7135}
7136
7137template <>
7138template <typename Deserializer>
7140 Deserializer& deserializer)
7141{
7143 obj.points = serde::Deserializable<decltype(obj.points)>::deserialize(deserializer);
7144 obj.scalars = serde::Deserializable<decltype(obj.scalars)>::deserialize(deserializer);
7145 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
7146 return obj;
7147}
7148
7149namespace Acir {
7150
7152{
7153 if (!(lhs.input1_x == rhs.input1_x)) {
7154 return false;
7155 }
7156 if (!(lhs.input1_y == rhs.input1_y)) {
7157 return false;
7158 }
7159 if (!(lhs.input1_infinite == rhs.input1_infinite)) {
7160 return false;
7161 }
7162 if (!(lhs.input2_x == rhs.input2_x)) {
7163 return false;
7164 }
7165 if (!(lhs.input2_y == rhs.input2_y)) {
7166 return false;
7167 }
7168 if (!(lhs.input2_infinite == rhs.input2_infinite)) {
7169 return false;
7170 }
7171 if (!(lhs.result == rhs.result)) {
7172 return false;
7173 }
7174 return true;
7175}
7176
7177inline std::vector<uint8_t> BlackBoxOp::EmbeddedCurveAdd::bincodeSerialize() const
7178{
7179 auto serializer = serde::BincodeSerializer();
7181 return std::move(serializer).bytes();
7182}
7183
7185{
7186 auto deserializer = serde::BincodeDeserializer(input);
7188 if (deserializer.get_buffer_offset() < input.size()) {
7189 throw_or_abort("Some input bytes were not read");
7190 }
7191 return value;
7192}
7193
7194} // end of namespace Acir
7195
7196template <>
7197template <typename Serializer>
7199 Serializer& serializer)
7200{
7201 serde::Serializable<decltype(obj.input1_x)>::serialize(obj.input1_x, serializer);
7202 serde::Serializable<decltype(obj.input1_y)>::serialize(obj.input1_y, serializer);
7203 serde::Serializable<decltype(obj.input1_infinite)>::serialize(obj.input1_infinite, serializer);
7204 serde::Serializable<decltype(obj.input2_x)>::serialize(obj.input2_x, serializer);
7205 serde::Serializable<decltype(obj.input2_y)>::serialize(obj.input2_y, serializer);
7206 serde::Serializable<decltype(obj.input2_infinite)>::serialize(obj.input2_infinite, serializer);
7207 serde::Serializable<decltype(obj.result)>::serialize(obj.result, serializer);
7208}
7209
7210template <>
7211template <typename Deserializer>
7213 Deserializer& deserializer)
7214{
7216 obj.input1_x = serde::Deserializable<decltype(obj.input1_x)>::deserialize(deserializer);
7217 obj.input1_y = serde::Deserializable<decltype(obj.input1_y)>::deserialize(deserializer);
7218 obj.input1_infinite = serde::Deserializable<decltype(obj.input1_infinite)>::deserialize(deserializer);
7219 obj.input2_x = serde::Deserializable<decltype(obj.input2_x)>::deserialize(deserializer);
7220 obj.input2_y = serde::Deserializable<decltype(obj.input2_y)>::deserialize(deserializer);
7221 obj.input2_infinite = serde::Deserializable<decltype(obj.input2_infinite)>::deserialize(deserializer);
7222 obj.result = serde::Deserializable<decltype(obj.result)>::deserialize(deserializer);
7223 return obj;
7224}
7225
7226namespace Acir {
7227
7229{
7230 if (!(lhs.message == rhs.message)) {
7231 return false;
7232 }
7233 if (!(lhs.output == rhs.output)) {
7234 return false;
7235 }
7236 return true;
7237}
7238
7240{
7241 auto serializer = serde::BincodeSerializer();
7243 return std::move(serializer).bytes();
7244}
7245
7247{
7248 auto deserializer = serde::BincodeDeserializer(input);
7250 if (deserializer.get_buffer_offset() < input.size()) {
7251 throw_or_abort("Some input bytes were not read");
7252 }
7253 return value;
7254}
7255
7256} // end of namespace Acir
7257
7258template <>
7259template <typename Serializer>
7261 const Acir::BlackBoxOp::Poseidon2Permutation& obj, Serializer& serializer)
7262{
7263 serde::Serializable<decltype(obj.message)>::serialize(obj.message, serializer);
7264 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
7265}
7266
7267template <>
7268template <typename Deserializer>
7270 Deserializer& deserializer)
7271{
7273 obj.message = serde::Deserializable<decltype(obj.message)>::deserialize(deserializer);
7274 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
7275 return obj;
7276}
7277
7278namespace Acir {
7279
7281{
7282 if (!(lhs.input == rhs.input)) {
7283 return false;
7284 }
7285 if (!(lhs.hash_values == rhs.hash_values)) {
7286 return false;
7287 }
7288 if (!(lhs.output == rhs.output)) {
7289 return false;
7290 }
7291 return true;
7292}
7293
7294inline std::vector<uint8_t> BlackBoxOp::Sha256Compression::bincodeSerialize() const
7295{
7296 auto serializer = serde::BincodeSerializer();
7298 return std::move(serializer).bytes();
7299}
7300
7302{
7303 auto deserializer = serde::BincodeDeserializer(input);
7305 if (deserializer.get_buffer_offset() < input.size()) {
7306 throw_or_abort("Some input bytes were not read");
7307 }
7308 return value;
7309}
7310
7311} // end of namespace Acir
7312
7313template <>
7314template <typename Serializer>
7316 Serializer& serializer)
7317{
7318 serde::Serializable<decltype(obj.input)>::serialize(obj.input, serializer);
7319 serde::Serializable<decltype(obj.hash_values)>::serialize(obj.hash_values, serializer);
7320 serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
7321}
7322
7323template <>
7324template <typename Deserializer>
7326 Deserializer& deserializer)
7327{
7329 obj.input = serde::Deserializable<decltype(obj.input)>::deserialize(deserializer);
7330 obj.hash_values = serde::Deserializable<decltype(obj.hash_values)>::deserialize(deserializer);
7331 obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
7332 return obj;
7333}
7334
7335namespace Acir {
7336
7337inline bool operator==(const BlackBoxOp::ToRadix& lhs, const BlackBoxOp::ToRadix& rhs)
7338{
7339 if (!(lhs.input == rhs.input)) {
7340 return false;
7341 }
7342 if (!(lhs.radix == rhs.radix)) {
7343 return false;
7344 }
7345 if (!(lhs.output_pointer == rhs.output_pointer)) {
7346 return false;
7347 }
7348 if (!(lhs.num_limbs == rhs.num_limbs)) {
7349 return false;
7350 }
7351 if (!(lhs.output_bits == rhs.output_bits)) {
7352 return false;
7353 }
7354 return true;
7355}
7356
7357inline std::vector<uint8_t> BlackBoxOp::ToRadix::bincodeSerialize() const
7358{
7359 auto serializer = serde::BincodeSerializer();
7361 return std::move(serializer).bytes();
7362}
7363
7365{
7366 auto deserializer = serde::BincodeDeserializer(input);
7368 if (deserializer.get_buffer_offset() < input.size()) {
7369 throw_or_abort("Some input bytes were not read");
7370 }
7371 return value;
7372}
7373
7374} // end of namespace Acir
7375
7376template <>
7377template <typename Serializer>
7379 Serializer& serializer)
7380{
7381 serde::Serializable<decltype(obj.input)>::serialize(obj.input, serializer);
7382 serde::Serializable<decltype(obj.radix)>::serialize(obj.radix, serializer);
7383 serde::Serializable<decltype(obj.output_pointer)>::serialize(obj.output_pointer, serializer);
7384 serde::Serializable<decltype(obj.num_limbs)>::serialize(obj.num_limbs, serializer);
7385 serde::Serializable<decltype(obj.output_bits)>::serialize(obj.output_bits, serializer);
7386}
7387
7388template <>
7389template <typename Deserializer>
7391{
7393 obj.input = serde::Deserializable<decltype(obj.input)>::deserialize(deserializer);
7394 obj.radix = serde::Deserializable<decltype(obj.radix)>::deserialize(deserializer);
7395 obj.output_pointer = serde::Deserializable<decltype(obj.output_pointer)>::deserialize(deserializer);
7396 obj.num_limbs = serde::Deserializable<decltype(obj.num_limbs)>::deserialize(deserializer);
7397 obj.output_bits = serde::Deserializable<decltype(obj.output_bits)>::deserialize(deserializer);
7398 return obj;
7399}
7400
7401namespace Acir {
7402
7403inline bool operator==(const BlockId& lhs, const BlockId& rhs)
7404{
7405 if (!(lhs.value == rhs.value)) {
7406 return false;
7407 }
7408 return true;
7409}
7410
7411inline std::vector<uint8_t> BlockId::bincodeSerialize() const
7412{
7413 auto serializer = serde::BincodeSerializer();
7414 serde::Serializable<BlockId>::serialize(*this, serializer);
7415 return std::move(serializer).bytes();
7416}
7417
7418inline BlockId BlockId::bincodeDeserialize(std::vector<uint8_t> input)
7419{
7420 auto deserializer = serde::BincodeDeserializer(input);
7422 if (deserializer.get_buffer_offset() < input.size()) {
7423 throw_or_abort("Some input bytes were not read");
7424 }
7425 return value;
7426}
7427
7428} // end of namespace Acir
7429
7430template <>
7431template <typename Serializer>
7432void serde::Serializable<Acir::BlockId>::serialize(const Acir::BlockId& obj, Serializer& serializer)
7433{
7434 serializer.increase_container_depth();
7435 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
7436 serializer.decrease_container_depth();
7437}
7438
7439template <>
7440template <typename Deserializer>
7442{
7443 deserializer.increase_container_depth();
7444 Acir::BlockId obj;
7445 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
7446 deserializer.decrease_container_depth();
7447 return obj;
7448}
7449
7450namespace Acir {
7451
7452inline bool operator==(const BlockType& lhs, const BlockType& rhs)
7453{
7454 if (!(lhs.value == rhs.value)) {
7455 return false;
7456 }
7457 return true;
7458}
7459
7460inline std::vector<uint8_t> BlockType::bincodeSerialize() const
7461{
7462 auto serializer = serde::BincodeSerializer();
7464 return std::move(serializer).bytes();
7465}
7466
7467inline BlockType BlockType::bincodeDeserialize(std::vector<uint8_t> input)
7468{
7469 auto deserializer = serde::BincodeDeserializer(input);
7471 if (deserializer.get_buffer_offset() < input.size()) {
7472 throw_or_abort("Some input bytes were not read");
7473 }
7474 return value;
7475}
7476
7477} // end of namespace Acir
7478
7479template <>
7480template <typename Serializer>
7482{
7483 serializer.increase_container_depth();
7484 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
7485 serializer.decrease_container_depth();
7486}
7487
7488template <>
7489template <typename Deserializer>
7491{
7492 deserializer.increase_container_depth();
7493 Acir::BlockType obj;
7494 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
7495 deserializer.decrease_container_depth();
7496 return obj;
7497}
7498
7499namespace Acir {
7500
7501inline bool operator==(const BlockType::Memory& lhs, const BlockType::Memory& rhs)
7502{
7503 return true;
7504}
7505
7506inline std::vector<uint8_t> BlockType::Memory::bincodeSerialize() const
7507{
7508 auto serializer = serde::BincodeSerializer();
7510 return std::move(serializer).bytes();
7511}
7512
7514{
7515 auto deserializer = serde::BincodeDeserializer(input);
7517 if (deserializer.get_buffer_offset() < input.size()) {
7518 throw_or_abort("Some input bytes were not read");
7519 }
7520 return value;
7521}
7522
7523} // end of namespace Acir
7524
7525template <>
7526template <typename Serializer>
7529
7530template <>
7531template <typename Deserializer>
7537
7538namespace Acir {
7539
7540inline bool operator==(const BlockType::CallData& lhs, const BlockType::CallData& rhs)
7541{
7542 if (!(lhs.value == rhs.value)) {
7543 return false;
7544 }
7545 return true;
7546}
7547
7548inline std::vector<uint8_t> BlockType::CallData::bincodeSerialize() const
7549{
7550 auto serializer = serde::BincodeSerializer();
7552 return std::move(serializer).bytes();
7553}
7554
7556{
7557 auto deserializer = serde::BincodeDeserializer(input);
7559 if (deserializer.get_buffer_offset() < input.size()) {
7560 throw_or_abort("Some input bytes were not read");
7561 }
7562 return value;
7563}
7564
7565} // end of namespace Acir
7566
7567template <>
7568template <typename Serializer>
7570 Serializer& serializer)
7571{
7572 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
7573}
7574
7575template <>
7576template <typename Deserializer>
7578{
7580 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
7581 return obj;
7582}
7583
7584namespace Acir {
7585
7586inline bool operator==(const BlockType::ReturnData& lhs, const BlockType::ReturnData& rhs)
7587{
7588 return true;
7589}
7590
7591inline std::vector<uint8_t> BlockType::ReturnData::bincodeSerialize() const
7592{
7593 auto serializer = serde::BincodeSerializer();
7595 return std::move(serializer).bytes();
7596}
7597
7599{
7600 auto deserializer = serde::BincodeDeserializer(input);
7602 if (deserializer.get_buffer_offset() < input.size()) {
7603 throw_or_abort("Some input bytes were not read");
7604 }
7605 return value;
7606}
7607
7608} // end of namespace Acir
7609
7610template <>
7611template <typename Serializer>
7615
7616template <>
7617template <typename Deserializer>
7623
7624namespace Acir {
7625
7626inline bool operator==(const BrilligBytecode& lhs, const BrilligBytecode& rhs)
7627{
7628 if (!(lhs.function_name == rhs.function_name)) {
7629 return false;
7630 }
7631 if (!(lhs.bytecode == rhs.bytecode)) {
7632 return false;
7633 }
7634 return true;
7635}
7636
7637inline std::vector<uint8_t> BrilligBytecode::bincodeSerialize() const
7638{
7639 auto serializer = serde::BincodeSerializer();
7641 return std::move(serializer).bytes();
7642}
7643
7645{
7646 auto deserializer = serde::BincodeDeserializer(input);
7648 if (deserializer.get_buffer_offset() < input.size()) {
7649 throw_or_abort("Some input bytes were not read");
7650 }
7651 return value;
7652}
7653
7654} // end of namespace Acir
7655
7656template <>
7657template <typename Serializer>
7659{
7660 serializer.increase_container_depth();
7661 serde::Serializable<decltype(obj.function_name)>::serialize(obj.function_name, serializer);
7662 serde::Serializable<decltype(obj.bytecode)>::serialize(obj.bytecode, serializer);
7663 serializer.decrease_container_depth();
7664}
7665
7666template <>
7667template <typename Deserializer>
7669{
7670 deserializer.increase_container_depth();
7672 obj.function_name = serde::Deserializable<decltype(obj.function_name)>::deserialize(deserializer);
7673 obj.bytecode = serde::Deserializable<decltype(obj.bytecode)>::deserialize(deserializer);
7674 deserializer.decrease_container_depth();
7675 return obj;
7676}
7677
7678namespace Acir {
7679
7680inline bool operator==(const BrilligInputs& lhs, const BrilligInputs& rhs)
7681{
7682 if (!(lhs.value == rhs.value)) {
7683 return false;
7684 }
7685 return true;
7686}
7687
7688inline std::vector<uint8_t> BrilligInputs::bincodeSerialize() const
7689{
7690 auto serializer = serde::BincodeSerializer();
7692 return std::move(serializer).bytes();
7693}
7694
7695inline BrilligInputs BrilligInputs::bincodeDeserialize(std::vector<uint8_t> input)
7696{
7697 auto deserializer = serde::BincodeDeserializer(input);
7699 if (deserializer.get_buffer_offset() < input.size()) {
7700 throw_or_abort("Some input bytes were not read");
7701 }
7702 return value;
7703}
7704
7705} // end of namespace Acir
7706
7707template <>
7708template <typename Serializer>
7710{
7711 serializer.increase_container_depth();
7712 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
7713 serializer.decrease_container_depth();
7714}
7715
7716template <>
7717template <typename Deserializer>
7719{
7720 deserializer.increase_container_depth();
7722 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
7723 deserializer.decrease_container_depth();
7724 return obj;
7725}
7726
7727namespace Acir {
7728
7729inline bool operator==(const BrilligInputs::Single& lhs, const BrilligInputs::Single& rhs)
7730{
7731 if (!(lhs.value == rhs.value)) {
7732 return false;
7733 }
7734 return true;
7735}
7736
7737inline std::vector<uint8_t> BrilligInputs::Single::bincodeSerialize() const
7738{
7739 auto serializer = serde::BincodeSerializer();
7741 return std::move(serializer).bytes();
7742}
7743
7745{
7746 auto deserializer = serde::BincodeDeserializer(input);
7748 if (deserializer.get_buffer_offset() < input.size()) {
7749 throw_or_abort("Some input bytes were not read");
7750 }
7751 return value;
7752}
7753
7754} // end of namespace Acir
7755
7756template <>
7757template <typename Serializer>
7759 Serializer& serializer)
7760{
7761 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
7762}
7763
7764template <>
7765template <typename Deserializer>
7767{
7769 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
7770 return obj;
7771}
7772
7773namespace Acir {
7774
7775inline bool operator==(const BrilligInputs::Array& lhs, const BrilligInputs::Array& rhs)
7776{
7777 if (!(lhs.value == rhs.value)) {
7778 return false;
7779 }
7780 return true;
7781}
7782
7783inline std::vector<uint8_t> BrilligInputs::Array::bincodeSerialize() const
7784{
7785 auto serializer = serde::BincodeSerializer();
7787 return std::move(serializer).bytes();
7788}
7789
7791{
7792 auto deserializer = serde::BincodeDeserializer(input);
7794 if (deserializer.get_buffer_offset() < input.size()) {
7795 throw_or_abort("Some input bytes were not read");
7796 }
7797 return value;
7798}
7799
7800} // end of namespace Acir
7801
7802template <>
7803template <typename Serializer>
7805 Serializer& serializer)
7806{
7807 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
7808}
7809
7810template <>
7811template <typename Deserializer>
7813{
7815 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
7816 return obj;
7817}
7818
7819namespace Acir {
7820
7822{
7823 if (!(lhs.value == rhs.value)) {
7824 return false;
7825 }
7826 return true;
7827}
7828
7829inline std::vector<uint8_t> BrilligInputs::MemoryArray::bincodeSerialize() const
7830{
7831 auto serializer = serde::BincodeSerializer();
7833 return std::move(serializer).bytes();
7834}
7835
7837{
7838 auto deserializer = serde::BincodeDeserializer(input);
7840 if (deserializer.get_buffer_offset() < input.size()) {
7841 throw_or_abort("Some input bytes were not read");
7842 }
7843 return value;
7844}
7845
7846} // end of namespace Acir
7847
7848template <>
7849template <typename Serializer>
7851 Serializer& serializer)
7852{
7853 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
7854}
7855
7856template <>
7857template <typename Deserializer>
7859 Deserializer& deserializer)
7860{
7862 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
7863 return obj;
7864}
7865
7866namespace Acir {
7867
7868inline bool operator==(const BrilligOpcode& lhs, const BrilligOpcode& rhs)
7869{
7870 if (!(lhs.value == rhs.value)) {
7871 return false;
7872 }
7873 return true;
7874}
7875
7876inline std::vector<uint8_t> BrilligOpcode::bincodeSerialize() const
7877{
7878 auto serializer = serde::BincodeSerializer();
7880 return std::move(serializer).bytes();
7881}
7882
7883inline BrilligOpcode BrilligOpcode::bincodeDeserialize(std::vector<uint8_t> input)
7884{
7885 auto deserializer = serde::BincodeDeserializer(input);
7887 if (deserializer.get_buffer_offset() < input.size()) {
7888 throw_or_abort("Some input bytes were not read");
7889 }
7890 return value;
7891}
7892
7893} // end of namespace Acir
7894
7895template <>
7896template <typename Serializer>
7898{
7899 serializer.increase_container_depth();
7900 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
7901 serializer.decrease_container_depth();
7902}
7903
7904template <>
7905template <typename Deserializer>
7907{
7908 deserializer.increase_container_depth();
7910 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
7911 deserializer.decrease_container_depth();
7912 return obj;
7913}
7914
7915namespace Acir {
7916
7918{
7919 if (!(lhs.destination == rhs.destination)) {
7920 return false;
7921 }
7922 if (!(lhs.op == rhs.op)) {
7923 return false;
7924 }
7925 if (!(lhs.lhs == rhs.lhs)) {
7926 return false;
7927 }
7928 if (!(lhs.rhs == rhs.rhs)) {
7929 return false;
7930 }
7931 return true;
7932}
7933
7934inline std::vector<uint8_t> BrilligOpcode::BinaryFieldOp::bincodeSerialize() const
7935{
7936 auto serializer = serde::BincodeSerializer();
7938 return std::move(serializer).bytes();
7939}
7940
7942{
7943 auto deserializer = serde::BincodeDeserializer(input);
7945 if (deserializer.get_buffer_offset() < input.size()) {
7946 throw_or_abort("Some input bytes were not read");
7947 }
7948 return value;
7949}
7950
7951} // end of namespace Acir
7952
7953template <>
7954template <typename Serializer>
7956 Serializer& serializer)
7957{
7958 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
7959 serde::Serializable<decltype(obj.op)>::serialize(obj.op, serializer);
7960 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
7961 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
7962}
7963
7964template <>
7965template <typename Deserializer>
7967 Deserializer& deserializer)
7968{
7970 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
7971 obj.op = serde::Deserializable<decltype(obj.op)>::deserialize(deserializer);
7972 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
7973 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
7974 return obj;
7975}
7976
7977namespace Acir {
7978
7980{
7981 if (!(lhs.destination == rhs.destination)) {
7982 return false;
7983 }
7984 if (!(lhs.op == rhs.op)) {
7985 return false;
7986 }
7987 if (!(lhs.bit_size == rhs.bit_size)) {
7988 return false;
7989 }
7990 if (!(lhs.lhs == rhs.lhs)) {
7991 return false;
7992 }
7993 if (!(lhs.rhs == rhs.rhs)) {
7994 return false;
7995 }
7996 return true;
7997}
7998
7999inline std::vector<uint8_t> BrilligOpcode::BinaryIntOp::bincodeSerialize() const
8000{
8001 auto serializer = serde::BincodeSerializer();
8003 return std::move(serializer).bytes();
8004}
8005
8007{
8008 auto deserializer = serde::BincodeDeserializer(input);
8010 if (deserializer.get_buffer_offset() < input.size()) {
8011 throw_or_abort("Some input bytes were not read");
8012 }
8013 return value;
8014}
8015
8016} // end of namespace Acir
8017
8018template <>
8019template <typename Serializer>
8021 Serializer& serializer)
8022{
8023 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
8024 serde::Serializable<decltype(obj.op)>::serialize(obj.op, serializer);
8025 serde::Serializable<decltype(obj.bit_size)>::serialize(obj.bit_size, serializer);
8026 serde::Serializable<decltype(obj.lhs)>::serialize(obj.lhs, serializer);
8027 serde::Serializable<decltype(obj.rhs)>::serialize(obj.rhs, serializer);
8028}
8029
8030template <>
8031template <typename Deserializer>
8033 Deserializer& deserializer)
8034{
8036 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
8037 obj.op = serde::Deserializable<decltype(obj.op)>::deserialize(deserializer);
8038 obj.bit_size = serde::Deserializable<decltype(obj.bit_size)>::deserialize(deserializer);
8039 obj.lhs = serde::Deserializable<decltype(obj.lhs)>::deserialize(deserializer);
8040 obj.rhs = serde::Deserializable<decltype(obj.rhs)>::deserialize(deserializer);
8041 return obj;
8042}
8043
8044namespace Acir {
8045
8046inline bool operator==(const BrilligOpcode::Not& lhs, const BrilligOpcode::Not& rhs)
8047{
8048 if (!(lhs.destination == rhs.destination)) {
8049 return false;
8050 }
8051 if (!(lhs.source == rhs.source)) {
8052 return false;
8053 }
8054 if (!(lhs.bit_size == rhs.bit_size)) {
8055 return false;
8056 }
8057 return true;
8058}
8059
8060inline std::vector<uint8_t> BrilligOpcode::Not::bincodeSerialize() const
8061{
8062 auto serializer = serde::BincodeSerializer();
8064 return std::move(serializer).bytes();
8065}
8066
8068{
8069 auto deserializer = serde::BincodeDeserializer(input);
8071 if (deserializer.get_buffer_offset() < input.size()) {
8072 throw_or_abort("Some input bytes were not read");
8073 }
8074 return value;
8075}
8076
8077} // end of namespace Acir
8078
8079template <>
8080template <typename Serializer>
8082 Serializer& serializer)
8083{
8084 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
8085 serde::Serializable<decltype(obj.source)>::serialize(obj.source, serializer);
8086 serde::Serializable<decltype(obj.bit_size)>::serialize(obj.bit_size, serializer);
8087}
8088
8089template <>
8090template <typename Deserializer>
8092{
8094 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
8095 obj.source = serde::Deserializable<decltype(obj.source)>::deserialize(deserializer);
8096 obj.bit_size = serde::Deserializable<decltype(obj.bit_size)>::deserialize(deserializer);
8097 return obj;
8098}
8099
8100namespace Acir {
8101
8102inline bool operator==(const BrilligOpcode::Cast& lhs, const BrilligOpcode::Cast& rhs)
8103{
8104 if (!(lhs.destination == rhs.destination)) {
8105 return false;
8106 }
8107 if (!(lhs.source == rhs.source)) {
8108 return false;
8109 }
8110 if (!(lhs.bit_size == rhs.bit_size)) {
8111 return false;
8112 }
8113 return true;
8114}
8115
8116inline std::vector<uint8_t> BrilligOpcode::Cast::bincodeSerialize() const
8117{
8118 auto serializer = serde::BincodeSerializer();
8120 return std::move(serializer).bytes();
8121}
8122
8124{
8125 auto deserializer = serde::BincodeDeserializer(input);
8127 if (deserializer.get_buffer_offset() < input.size()) {
8128 throw_or_abort("Some input bytes were not read");
8129 }
8130 return value;
8131}
8132
8133} // end of namespace Acir
8134
8135template <>
8136template <typename Serializer>
8138 Serializer& serializer)
8139{
8140 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
8141 serde::Serializable<decltype(obj.source)>::serialize(obj.source, serializer);
8142 serde::Serializable<decltype(obj.bit_size)>::serialize(obj.bit_size, serializer);
8143}
8144
8145template <>
8146template <typename Deserializer>
8148{
8150 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
8151 obj.source = serde::Deserializable<decltype(obj.source)>::deserialize(deserializer);
8152 obj.bit_size = serde::Deserializable<decltype(obj.bit_size)>::deserialize(deserializer);
8153 return obj;
8154}
8155
8156namespace Acir {
8157
8158inline bool operator==(const BrilligOpcode::JumpIf& lhs, const BrilligOpcode::JumpIf& rhs)
8159{
8160 if (!(lhs.condition == rhs.condition)) {
8161 return false;
8162 }
8163 if (!(lhs.location == rhs.location)) {
8164 return false;
8165 }
8166 return true;
8167}
8168
8169inline std::vector<uint8_t> BrilligOpcode::JumpIf::bincodeSerialize() const
8170{
8171 auto serializer = serde::BincodeSerializer();
8173 return std::move(serializer).bytes();
8174}
8175
8177{
8178 auto deserializer = serde::BincodeDeserializer(input);
8180 if (deserializer.get_buffer_offset() < input.size()) {
8181 throw_or_abort("Some input bytes were not read");
8182 }
8183 return value;
8184}
8185
8186} // end of namespace Acir
8187
8188template <>
8189template <typename Serializer>
8191 Serializer& serializer)
8192{
8193 serde::Serializable<decltype(obj.condition)>::serialize(obj.condition, serializer);
8194 serde::Serializable<decltype(obj.location)>::serialize(obj.location, serializer);
8195}
8196
8197template <>
8198template <typename Deserializer>
8200{
8202 obj.condition = serde::Deserializable<decltype(obj.condition)>::deserialize(deserializer);
8203 obj.location = serde::Deserializable<decltype(obj.location)>::deserialize(deserializer);
8204 return obj;
8205}
8206
8207namespace Acir {
8208
8209inline bool operator==(const BrilligOpcode::Jump& lhs, const BrilligOpcode::Jump& rhs)
8210{
8211 if (!(lhs.location == rhs.location)) {
8212 return false;
8213 }
8214 return true;
8215}
8216
8217inline std::vector<uint8_t> BrilligOpcode::Jump::bincodeSerialize() const
8218{
8219 auto serializer = serde::BincodeSerializer();
8221 return std::move(serializer).bytes();
8222}
8223
8225{
8226 auto deserializer = serde::BincodeDeserializer(input);
8228 if (deserializer.get_buffer_offset() < input.size()) {
8229 throw_or_abort("Some input bytes were not read");
8230 }
8231 return value;
8232}
8233
8234} // end of namespace Acir
8235
8236template <>
8237template <typename Serializer>
8239 Serializer& serializer)
8240{
8241 serde::Serializable<decltype(obj.location)>::serialize(obj.location, serializer);
8242}
8243
8244template <>
8245template <typename Deserializer>
8247{
8249 obj.location = serde::Deserializable<decltype(obj.location)>::deserialize(deserializer);
8250 return obj;
8251}
8252
8253namespace Acir {
8254
8256{
8257 if (!(lhs.destination_address == rhs.destination_address)) {
8258 return false;
8259 }
8260 if (!(lhs.size_address == rhs.size_address)) {
8261 return false;
8262 }
8263 if (!(lhs.offset_address == rhs.offset_address)) {
8264 return false;
8265 }
8266 return true;
8267}
8268
8269inline std::vector<uint8_t> BrilligOpcode::CalldataCopy::bincodeSerialize() const
8270{
8271 auto serializer = serde::BincodeSerializer();
8273 return std::move(serializer).bytes();
8274}
8275
8277{
8278 auto deserializer = serde::BincodeDeserializer(input);
8280 if (deserializer.get_buffer_offset() < input.size()) {
8281 throw_or_abort("Some input bytes were not read");
8282 }
8283 return value;
8284}
8285
8286} // end of namespace Acir
8287
8288template <>
8289template <typename Serializer>
8291 Serializer& serializer)
8292{
8293 serde::Serializable<decltype(obj.destination_address)>::serialize(obj.destination_address, serializer);
8294 serde::Serializable<decltype(obj.size_address)>::serialize(obj.size_address, serializer);
8295 serde::Serializable<decltype(obj.offset_address)>::serialize(obj.offset_address, serializer);
8296}
8297
8298template <>
8299template <typename Deserializer>
8301 Deserializer& deserializer)
8302{
8304 obj.destination_address = serde::Deserializable<decltype(obj.destination_address)>::deserialize(deserializer);
8305 obj.size_address = serde::Deserializable<decltype(obj.size_address)>::deserialize(deserializer);
8306 obj.offset_address = serde::Deserializable<decltype(obj.offset_address)>::deserialize(deserializer);
8307 return obj;
8308}
8309
8310namespace Acir {
8311
8312inline bool operator==(const BrilligOpcode::Call& lhs, const BrilligOpcode::Call& rhs)
8313{
8314 if (!(lhs.location == rhs.location)) {
8315 return false;
8316 }
8317 return true;
8318}
8319
8320inline std::vector<uint8_t> BrilligOpcode::Call::bincodeSerialize() const
8321{
8322 auto serializer = serde::BincodeSerializer();
8324 return std::move(serializer).bytes();
8325}
8326
8328{
8329 auto deserializer = serde::BincodeDeserializer(input);
8331 if (deserializer.get_buffer_offset() < input.size()) {
8332 throw_or_abort("Some input bytes were not read");
8333 }
8334 return value;
8335}
8336
8337} // end of namespace Acir
8338
8339template <>
8340template <typename Serializer>
8342 Serializer& serializer)
8343{
8344 serde::Serializable<decltype(obj.location)>::serialize(obj.location, serializer);
8345}
8346
8347template <>
8348template <typename Deserializer>
8350{
8352 obj.location = serde::Deserializable<decltype(obj.location)>::deserialize(deserializer);
8353 return obj;
8354}
8355
8356namespace Acir {
8357
8358inline bool operator==(const BrilligOpcode::Const& lhs, const BrilligOpcode::Const& rhs)
8359{
8360 if (!(lhs.destination == rhs.destination)) {
8361 return false;
8362 }
8363 if (!(lhs.bit_size == rhs.bit_size)) {
8364 return false;
8365 }
8366 if (!(lhs.value == rhs.value)) {
8367 return false;
8368 }
8369 return true;
8370}
8371
8372inline std::vector<uint8_t> BrilligOpcode::Const::bincodeSerialize() const
8373{
8374 auto serializer = serde::BincodeSerializer();
8376 return std::move(serializer).bytes();
8377}
8378
8380{
8381 auto deserializer = serde::BincodeDeserializer(input);
8383 if (deserializer.get_buffer_offset() < input.size()) {
8384 throw_or_abort("Some input bytes were not read");
8385 }
8386 return value;
8387}
8388
8389} // end of namespace Acir
8390
8391template <>
8392template <typename Serializer>
8394 Serializer& serializer)
8395{
8396 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
8397 serde::Serializable<decltype(obj.bit_size)>::serialize(obj.bit_size, serializer);
8398 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
8399}
8400
8401template <>
8402template <typename Deserializer>
8404{
8406 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
8407 obj.bit_size = serde::Deserializable<decltype(obj.bit_size)>::deserialize(deserializer);
8408 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
8409 return obj;
8410}
8411
8412namespace Acir {
8413
8415{
8416 if (!(lhs.destination_pointer == rhs.destination_pointer)) {
8417 return false;
8418 }
8419 if (!(lhs.bit_size == rhs.bit_size)) {
8420 return false;
8421 }
8422 if (!(lhs.value == rhs.value)) {
8423 return false;
8424 }
8425 return true;
8426}
8427
8428inline std::vector<uint8_t> BrilligOpcode::IndirectConst::bincodeSerialize() const
8429{
8430 auto serializer = serde::BincodeSerializer();
8432 return std::move(serializer).bytes();
8433}
8434
8436{
8437 auto deserializer = serde::BincodeDeserializer(input);
8439 if (deserializer.get_buffer_offset() < input.size()) {
8440 throw_or_abort("Some input bytes were not read");
8441 }
8442 return value;
8443}
8444
8445} // end of namespace Acir
8446
8447template <>
8448template <typename Serializer>
8450 Serializer& serializer)
8451{
8452 serde::Serializable<decltype(obj.destination_pointer)>::serialize(obj.destination_pointer, serializer);
8453 serde::Serializable<decltype(obj.bit_size)>::serialize(obj.bit_size, serializer);
8454 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
8455}
8456
8457template <>
8458template <typename Deserializer>
8460 Deserializer& deserializer)
8461{
8463 obj.destination_pointer = serde::Deserializable<decltype(obj.destination_pointer)>::deserialize(deserializer);
8464 obj.bit_size = serde::Deserializable<decltype(obj.bit_size)>::deserialize(deserializer);
8465 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
8466 return obj;
8467}
8468
8469namespace Acir {
8470
8471inline bool operator==(const BrilligOpcode::Return& lhs, const BrilligOpcode::Return& rhs)
8472{
8473 return true;
8474}
8475
8476inline std::vector<uint8_t> BrilligOpcode::Return::bincodeSerialize() const
8477{
8478 auto serializer = serde::BincodeSerializer();
8480 return std::move(serializer).bytes();
8481}
8482
8484{
8485 auto deserializer = serde::BincodeDeserializer(input);
8487 if (deserializer.get_buffer_offset() < input.size()) {
8488 throw_or_abort("Some input bytes were not read");
8489 }
8490 return value;
8491}
8492
8493} // end of namespace Acir
8494
8495template <>
8496template <typename Serializer>
8500
8501template <>
8502template <typename Deserializer>
8508
8509namespace Acir {
8510
8512{
8513 if (!(lhs.function == rhs.function)) {
8514 return false;
8515 }
8516 if (!(lhs.destinations == rhs.destinations)) {
8517 return false;
8518 }
8520 return false;
8521 }
8522 if (!(lhs.inputs == rhs.inputs)) {
8523 return false;
8524 }
8525 if (!(lhs.input_value_types == rhs.input_value_types)) {
8526 return false;
8527 }
8528 return true;
8529}
8530
8531inline std::vector<uint8_t> BrilligOpcode::ForeignCall::bincodeSerialize() const
8532{
8533 auto serializer = serde::BincodeSerializer();
8535 return std::move(serializer).bytes();
8536}
8537
8539{
8540 auto deserializer = serde::BincodeDeserializer(input);
8542 if (deserializer.get_buffer_offset() < input.size()) {
8543 throw_or_abort("Some input bytes were not read");
8544 }
8545 return value;
8546}
8547
8548} // end of namespace Acir
8549
8550template <>
8551template <typename Serializer>
8553 Serializer& serializer)
8554{
8555 serde::Serializable<decltype(obj.function)>::serialize(obj.function, serializer);
8556 serde::Serializable<decltype(obj.destinations)>::serialize(obj.destinations, serializer);
8557 serde::Serializable<decltype(obj.destination_value_types)>::serialize(obj.destination_value_types, serializer);
8558 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
8559 serde::Serializable<decltype(obj.input_value_types)>::serialize(obj.input_value_types, serializer);
8560}
8561
8562template <>
8563template <typename Deserializer>
8565 Deserializer& deserializer)
8566{
8568 obj.function = serde::Deserializable<decltype(obj.function)>::deserialize(deserializer);
8569 obj.destinations = serde::Deserializable<decltype(obj.destinations)>::deserialize(deserializer);
8571 serde::Deserializable<decltype(obj.destination_value_types)>::deserialize(deserializer);
8572 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
8573 obj.input_value_types = serde::Deserializable<decltype(obj.input_value_types)>::deserialize(deserializer);
8574 return obj;
8575}
8576
8577namespace Acir {
8578
8579inline bool operator==(const BrilligOpcode::Mov& lhs, const BrilligOpcode::Mov& rhs)
8580{
8581 if (!(lhs.destination == rhs.destination)) {
8582 return false;
8583 }
8584 if (!(lhs.source == rhs.source)) {
8585 return false;
8586 }
8587 return true;
8588}
8589
8590inline std::vector<uint8_t> BrilligOpcode::Mov::bincodeSerialize() const
8591{
8592 auto serializer = serde::BincodeSerializer();
8594 return std::move(serializer).bytes();
8595}
8596
8598{
8599 auto deserializer = serde::BincodeDeserializer(input);
8601 if (deserializer.get_buffer_offset() < input.size()) {
8602 throw_or_abort("Some input bytes were not read");
8603 }
8604 return value;
8605}
8606
8607} // end of namespace Acir
8608
8609template <>
8610template <typename Serializer>
8612 Serializer& serializer)
8613{
8614 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
8615 serde::Serializable<decltype(obj.source)>::serialize(obj.source, serializer);
8616}
8617
8618template <>
8619template <typename Deserializer>
8621{
8623 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
8624 obj.source = serde::Deserializable<decltype(obj.source)>::deserialize(deserializer);
8625 return obj;
8626}
8627
8628namespace Acir {
8629
8631{
8632 if (!(lhs.destination == rhs.destination)) {
8633 return false;
8634 }
8635 if (!(lhs.source_a == rhs.source_a)) {
8636 return false;
8637 }
8638 if (!(lhs.source_b == rhs.source_b)) {
8639 return false;
8640 }
8641 if (!(lhs.condition == rhs.condition)) {
8642 return false;
8643 }
8644 return true;
8645}
8646
8647inline std::vector<uint8_t> BrilligOpcode::ConditionalMov::bincodeSerialize() const
8648{
8649 auto serializer = serde::BincodeSerializer();
8651 return std::move(serializer).bytes();
8652}
8653
8655{
8656 auto deserializer = serde::BincodeDeserializer(input);
8658 if (deserializer.get_buffer_offset() < input.size()) {
8659 throw_or_abort("Some input bytes were not read");
8660 }
8661 return value;
8662}
8663
8664} // end of namespace Acir
8665
8666template <>
8667template <typename Serializer>
8669 Serializer& serializer)
8670{
8671 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
8672 serde::Serializable<decltype(obj.source_a)>::serialize(obj.source_a, serializer);
8673 serde::Serializable<decltype(obj.source_b)>::serialize(obj.source_b, serializer);
8674 serde::Serializable<decltype(obj.condition)>::serialize(obj.condition, serializer);
8675}
8676
8677template <>
8678template <typename Deserializer>
8680 Deserializer& deserializer)
8681{
8683 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
8684 obj.source_a = serde::Deserializable<decltype(obj.source_a)>::deserialize(deserializer);
8685 obj.source_b = serde::Deserializable<decltype(obj.source_b)>::deserialize(deserializer);
8686 obj.condition = serde::Deserializable<decltype(obj.condition)>::deserialize(deserializer);
8687 return obj;
8688}
8689
8690namespace Acir {
8691
8692inline bool operator==(const BrilligOpcode::Load& lhs, const BrilligOpcode::Load& rhs)
8693{
8694 if (!(lhs.destination == rhs.destination)) {
8695 return false;
8696 }
8697 if (!(lhs.source_pointer == rhs.source_pointer)) {
8698 return false;
8699 }
8700 return true;
8701}
8702
8703inline std::vector<uint8_t> BrilligOpcode::Load::bincodeSerialize() const
8704{
8705 auto serializer = serde::BincodeSerializer();
8707 return std::move(serializer).bytes();
8708}
8709
8711{
8712 auto deserializer = serde::BincodeDeserializer(input);
8714 if (deserializer.get_buffer_offset() < input.size()) {
8715 throw_or_abort("Some input bytes were not read");
8716 }
8717 return value;
8718}
8719
8720} // end of namespace Acir
8721
8722template <>
8723template <typename Serializer>
8725 Serializer& serializer)
8726{
8727 serde::Serializable<decltype(obj.destination)>::serialize(obj.destination, serializer);
8728 serde::Serializable<decltype(obj.source_pointer)>::serialize(obj.source_pointer, serializer);
8729}
8730
8731template <>
8732template <typename Deserializer>
8734{
8736 obj.destination = serde::Deserializable<decltype(obj.destination)>::deserialize(deserializer);
8737 obj.source_pointer = serde::Deserializable<decltype(obj.source_pointer)>::deserialize(deserializer);
8738 return obj;
8739}
8740
8741namespace Acir {
8742
8743inline bool operator==(const BrilligOpcode::Store& lhs, const BrilligOpcode::Store& rhs)
8744{
8745 if (!(lhs.destination_pointer == rhs.destination_pointer)) {
8746 return false;
8747 }
8748 if (!(lhs.source == rhs.source)) {
8749 return false;
8750 }
8751 return true;
8752}
8753
8754inline std::vector<uint8_t> BrilligOpcode::Store::bincodeSerialize() const
8755{
8756 auto serializer = serde::BincodeSerializer();
8758 return std::move(serializer).bytes();
8759}
8760
8761inline BrilligOpcode::Store BrilligOpcode::Store::bincodeDeserialize(std::vector<uint8_t> input)
8762{
8763 auto deserializer = serde::BincodeDeserializer(input);
8765 if (deserializer.get_buffer_offset() < input.size()) {
8766 throw_or_abort("Some input bytes were not read");
8767 }
8768 return value;
8769}
8770
8771} // end of namespace Acir
8772
8773template <>
8774template <typename Serializer>
8776 Serializer& serializer)
8777{
8778 serde::Serializable<decltype(obj.destination_pointer)>::serialize(obj.destination_pointer, serializer);
8779 serde::Serializable<decltype(obj.source)>::serialize(obj.source, serializer);
8780}
8781
8782template <>
8783template <typename Deserializer>
8785{
8787 obj.destination_pointer = serde::Deserializable<decltype(obj.destination_pointer)>::deserialize(deserializer);
8788 obj.source = serde::Deserializable<decltype(obj.source)>::deserialize(deserializer);
8789 return obj;
8790}
8791
8792namespace Acir {
8793
8795{
8796 if (!(lhs.value == rhs.value)) {
8797 return false;
8798 }
8799 return true;
8800}
8801
8802inline std::vector<uint8_t> BrilligOpcode::BlackBox::bincodeSerialize() const
8803{
8804 auto serializer = serde::BincodeSerializer();
8806 return std::move(serializer).bytes();
8807}
8808
8810{
8811 auto deserializer = serde::BincodeDeserializer(input);
8813 if (deserializer.get_buffer_offset() < input.size()) {
8814 throw_or_abort("Some input bytes were not read");
8815 }
8816 return value;
8817}
8818
8819} // end of namespace Acir
8820
8821template <>
8822template <typename Serializer>
8824 Serializer& serializer)
8825{
8826 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
8827}
8828
8829template <>
8830template <typename Deserializer>
8832 Deserializer& deserializer)
8833{
8835 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
8836 return obj;
8837}
8838
8839namespace Acir {
8840
8841inline bool operator==(const BrilligOpcode::Trap& lhs, const BrilligOpcode::Trap& rhs)
8842{
8843 if (!(lhs.revert_data == rhs.revert_data)) {
8844 return false;
8845 }
8846 return true;
8847}
8848
8849inline std::vector<uint8_t> BrilligOpcode::Trap::bincodeSerialize() const
8850{
8851 auto serializer = serde::BincodeSerializer();
8853 return std::move(serializer).bytes();
8854}
8855
8857{
8858 auto deserializer = serde::BincodeDeserializer(input);
8860 if (deserializer.get_buffer_offset() < input.size()) {
8861 throw_or_abort("Some input bytes were not read");
8862 }
8863 return value;
8864}
8865
8866} // end of namespace Acir
8867
8868template <>
8869template <typename Serializer>
8871 Serializer& serializer)
8872{
8873 serde::Serializable<decltype(obj.revert_data)>::serialize(obj.revert_data, serializer);
8874}
8875
8876template <>
8877template <typename Deserializer>
8879{
8881 obj.revert_data = serde::Deserializable<decltype(obj.revert_data)>::deserialize(deserializer);
8882 return obj;
8883}
8884
8885namespace Acir {
8886
8887inline bool operator==(const BrilligOpcode::Stop& lhs, const BrilligOpcode::Stop& rhs)
8888{
8889 if (!(lhs.return_data == rhs.return_data)) {
8890 return false;
8891 }
8892 return true;
8893}
8894
8895inline std::vector<uint8_t> BrilligOpcode::Stop::bincodeSerialize() const
8896{
8897 auto serializer = serde::BincodeSerializer();
8899 return std::move(serializer).bytes();
8900}
8901
8903{
8904 auto deserializer = serde::BincodeDeserializer(input);
8906 if (deserializer.get_buffer_offset() < input.size()) {
8907 throw_or_abort("Some input bytes were not read");
8908 }
8909 return value;
8910}
8911
8912} // end of namespace Acir
8913
8914template <>
8915template <typename Serializer>
8917 Serializer& serializer)
8918{
8919 serde::Serializable<decltype(obj.return_data)>::serialize(obj.return_data, serializer);
8920}
8921
8922template <>
8923template <typename Deserializer>
8925{
8927 obj.return_data = serde::Deserializable<decltype(obj.return_data)>::deserialize(deserializer);
8928 return obj;
8929}
8930
8931namespace Acir {
8932
8933inline bool operator==(const BrilligOutputs& lhs, const BrilligOutputs& rhs)
8934{
8935 if (!(lhs.value == rhs.value)) {
8936 return false;
8937 }
8938 return true;
8939}
8940
8941inline std::vector<uint8_t> BrilligOutputs::bincodeSerialize() const
8942{
8943 auto serializer = serde::BincodeSerializer();
8945 return std::move(serializer).bytes();
8946}
8947
8948inline BrilligOutputs BrilligOutputs::bincodeDeserialize(std::vector<uint8_t> input)
8949{
8950 auto deserializer = serde::BincodeDeserializer(input);
8952 if (deserializer.get_buffer_offset() < input.size()) {
8953 throw_or_abort("Some input bytes were not read");
8954 }
8955 return value;
8956}
8957
8958} // end of namespace Acir
8959
8960template <>
8961template <typename Serializer>
8963{
8964 serializer.increase_container_depth();
8965 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
8966 serializer.decrease_container_depth();
8967}
8968
8969template <>
8970template <typename Deserializer>
8972{
8973 deserializer.increase_container_depth();
8975 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
8976 deserializer.decrease_container_depth();
8977 return obj;
8978}
8979
8980namespace Acir {
8981
8983{
8984 if (!(lhs.value == rhs.value)) {
8985 return false;
8986 }
8987 return true;
8988}
8989
8990inline std::vector<uint8_t> BrilligOutputs::Simple::bincodeSerialize() const
8991{
8992 auto serializer = serde::BincodeSerializer();
8994 return std::move(serializer).bytes();
8995}
8996
8998{
8999 auto deserializer = serde::BincodeDeserializer(input);
9001 if (deserializer.get_buffer_offset() < input.size()) {
9002 throw_or_abort("Some input bytes were not read");
9003 }
9004 return value;
9005}
9006
9007} // end of namespace Acir
9008
9009template <>
9010template <typename Serializer>
9012 Serializer& serializer)
9013{
9014 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9015}
9016
9017template <>
9018template <typename Deserializer>
9020 Deserializer& deserializer)
9021{
9023 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9024 return obj;
9025}
9026
9027namespace Acir {
9028
9029inline bool operator==(const BrilligOutputs::Array& lhs, const BrilligOutputs::Array& rhs)
9030{
9031 if (!(lhs.value == rhs.value)) {
9032 return false;
9033 }
9034 return true;
9035}
9036
9037inline std::vector<uint8_t> BrilligOutputs::Array::bincodeSerialize() const
9038{
9039 auto serializer = serde::BincodeSerializer();
9041 return std::move(serializer).bytes();
9042}
9043
9045{
9046 auto deserializer = serde::BincodeDeserializer(input);
9048 if (deserializer.get_buffer_offset() < input.size()) {
9049 throw_or_abort("Some input bytes were not read");
9050 }
9051 return value;
9052}
9053
9054} // end of namespace Acir
9055
9056template <>
9057template <typename Serializer>
9059 Serializer& serializer)
9060{
9061 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9062}
9063
9064template <>
9065template <typename Deserializer>
9067{
9069 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9070 return obj;
9071}
9072
9073namespace Acir {
9074
9075inline bool operator==(const Circuit& lhs, const Circuit& rhs)
9076{
9077 if (!(lhs.function_name == rhs.function_name)) {
9078 return false;
9079 }
9080 if (!(lhs.current_witness_index == rhs.current_witness_index)) {
9081 return false;
9082 }
9083 if (!(lhs.opcodes == rhs.opcodes)) {
9084 return false;
9085 }
9086 if (!(lhs.private_parameters == rhs.private_parameters)) {
9087 return false;
9088 }
9089 if (!(lhs.public_parameters == rhs.public_parameters)) {
9090 return false;
9091 }
9092 if (!(lhs.return_values == rhs.return_values)) {
9093 return false;
9094 }
9095 if (!(lhs.assert_messages == rhs.assert_messages)) {
9096 return false;
9097 }
9098 return true;
9099}
9100
9101inline std::vector<uint8_t> Circuit::bincodeSerialize() const
9102{
9103 auto serializer = serde::BincodeSerializer();
9104 serde::Serializable<Circuit>::serialize(*this, serializer);
9105 return std::move(serializer).bytes();
9106}
9107
9108inline Circuit Circuit::bincodeDeserialize(std::vector<uint8_t> input)
9109{
9110 auto deserializer = serde::BincodeDeserializer(input);
9112 if (deserializer.get_buffer_offset() < input.size()) {
9113 throw_or_abort("Some input bytes were not read");
9114 }
9115 return value;
9116}
9117
9118} // end of namespace Acir
9119
9120template <>
9121template <typename Serializer>
9122void serde::Serializable<Acir::Circuit>::serialize(const Acir::Circuit& obj, Serializer& serializer)
9123{
9124 serializer.increase_container_depth();
9125 serde::Serializable<decltype(obj.function_name)>::serialize(obj.function_name, serializer);
9126 serde::Serializable<decltype(obj.current_witness_index)>::serialize(obj.current_witness_index, serializer);
9127 serde::Serializable<decltype(obj.opcodes)>::serialize(obj.opcodes, serializer);
9128 serde::Serializable<decltype(obj.private_parameters)>::serialize(obj.private_parameters, serializer);
9129 serde::Serializable<decltype(obj.public_parameters)>::serialize(obj.public_parameters, serializer);
9130 serde::Serializable<decltype(obj.return_values)>::serialize(obj.return_values, serializer);
9131 serde::Serializable<decltype(obj.assert_messages)>::serialize(obj.assert_messages, serializer);
9132 serializer.decrease_container_depth();
9133}
9134
9135template <>
9136template <typename Deserializer>
9138{
9139 deserializer.increase_container_depth();
9140 Acir::Circuit obj;
9141 obj.function_name = serde::Deserializable<decltype(obj.function_name)>::deserialize(deserializer);
9142 obj.current_witness_index = serde::Deserializable<decltype(obj.current_witness_index)>::deserialize(deserializer);
9143 obj.opcodes = serde::Deserializable<decltype(obj.opcodes)>::deserialize(deserializer);
9144 obj.private_parameters = serde::Deserializable<decltype(obj.private_parameters)>::deserialize(deserializer);
9145 obj.public_parameters = serde::Deserializable<decltype(obj.public_parameters)>::deserialize(deserializer);
9146 obj.return_values = serde::Deserializable<decltype(obj.return_values)>::deserialize(deserializer);
9147 obj.assert_messages = serde::Deserializable<decltype(obj.assert_messages)>::deserialize(deserializer);
9148 deserializer.decrease_container_depth();
9149 return obj;
9150}
9151
9152namespace Acir {
9153
9154inline bool operator==(const Expression& lhs, const Expression& rhs)
9155{
9156 if (!(lhs.mul_terms == rhs.mul_terms)) {
9157 return false;
9158 }
9159 if (!(lhs.linear_combinations == rhs.linear_combinations)) {
9160 return false;
9161 }
9162 if (!(lhs.q_c == rhs.q_c)) {
9163 return false;
9164 }
9165 return true;
9166}
9167
9168inline std::vector<uint8_t> Expression::bincodeSerialize() const
9169{
9170 auto serializer = serde::BincodeSerializer();
9172 return std::move(serializer).bytes();
9173}
9174
9175inline Expression Expression::bincodeDeserialize(std::vector<uint8_t> input)
9176{
9177 auto deserializer = serde::BincodeDeserializer(input);
9179 if (deserializer.get_buffer_offset() < input.size()) {
9180 throw_or_abort("Some input bytes were not read");
9181 }
9182 return value;
9183}
9184
9185} // end of namespace Acir
9186
9187template <>
9188template <typename Serializer>
9190{
9191 serializer.increase_container_depth();
9192 serde::Serializable<decltype(obj.mul_terms)>::serialize(obj.mul_terms, serializer);
9193 serde::Serializable<decltype(obj.linear_combinations)>::serialize(obj.linear_combinations, serializer);
9194 serde::Serializable<decltype(obj.q_c)>::serialize(obj.q_c, serializer);
9195 serializer.decrease_container_depth();
9196}
9197
9198template <>
9199template <typename Deserializer>
9201{
9202 deserializer.increase_container_depth();
9203 Acir::Expression obj;
9204 obj.mul_terms = serde::Deserializable<decltype(obj.mul_terms)>::deserialize(deserializer);
9205 obj.linear_combinations = serde::Deserializable<decltype(obj.linear_combinations)>::deserialize(deserializer);
9206 obj.q_c = serde::Deserializable<decltype(obj.q_c)>::deserialize(deserializer);
9207 deserializer.decrease_container_depth();
9208 return obj;
9209}
9210
9211namespace Acir {
9212
9213inline bool operator==(const ExpressionOrMemory& lhs, const ExpressionOrMemory& rhs)
9214{
9215 if (!(lhs.value == rhs.value)) {
9216 return false;
9217 }
9218 return true;
9219}
9220
9221inline std::vector<uint8_t> ExpressionOrMemory::bincodeSerialize() const
9222{
9223 auto serializer = serde::BincodeSerializer();
9225 return std::move(serializer).bytes();
9226}
9227
9229{
9230 auto deserializer = serde::BincodeDeserializer(input);
9232 if (deserializer.get_buffer_offset() < input.size()) {
9233 throw_or_abort("Some input bytes were not read");
9234 }
9235 return value;
9236}
9237
9238} // end of namespace Acir
9239
9240template <>
9241template <typename Serializer>
9243 Serializer& serializer)
9244{
9245 serializer.increase_container_depth();
9246 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9247 serializer.decrease_container_depth();
9248}
9249
9250template <>
9251template <typename Deserializer>
9253{
9254 deserializer.increase_container_depth();
9256 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9257 deserializer.decrease_container_depth();
9258 return obj;
9259}
9260
9261namespace Acir {
9262
9264{
9265 if (!(lhs.value == rhs.value)) {
9266 return false;
9267 }
9268 return true;
9269}
9270
9271inline std::vector<uint8_t> ExpressionOrMemory::Expression::bincodeSerialize() const
9272{
9273 auto serializer = serde::BincodeSerializer();
9275 return std::move(serializer).bytes();
9276}
9277
9279{
9280 auto deserializer = serde::BincodeDeserializer(input);
9282 if (deserializer.get_buffer_offset() < input.size()) {
9283 throw_or_abort("Some input bytes were not read");
9284 }
9285 return value;
9286}
9287
9288} // end of namespace Acir
9289
9290template <>
9291template <typename Serializer>
9293 const Acir::ExpressionOrMemory::Expression& obj, Serializer& serializer)
9294{
9295 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9296}
9297
9298template <>
9299template <typename Deserializer>
9301 Deserializer& deserializer)
9302{
9304 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9305 return obj;
9306}
9307
9308namespace Acir {
9309
9311{
9312 if (!(lhs.value == rhs.value)) {
9313 return false;
9314 }
9315 return true;
9316}
9317
9318inline std::vector<uint8_t> ExpressionOrMemory::Memory::bincodeSerialize() const
9319{
9320 auto serializer = serde::BincodeSerializer();
9322 return std::move(serializer).bytes();
9323}
9324
9326{
9327 auto deserializer = serde::BincodeDeserializer(input);
9329 if (deserializer.get_buffer_offset() < input.size()) {
9330 throw_or_abort("Some input bytes were not read");
9331 }
9332 return value;
9333}
9334
9335} // end of namespace Acir
9336
9337template <>
9338template <typename Serializer>
9340 Serializer& serializer)
9341{
9342 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9343}
9344
9345template <>
9346template <typename Deserializer>
9348 Deserializer& deserializer)
9349{
9351 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9352 return obj;
9353}
9354
9355namespace Acir {
9356
9357inline bool operator==(const ExpressionWidth& lhs, const ExpressionWidth& rhs)
9358{
9359 if (!(lhs.value == rhs.value)) {
9360 return false;
9361 }
9362 return true;
9363}
9364
9365inline std::vector<uint8_t> ExpressionWidth::bincodeSerialize() const
9366{
9367 auto serializer = serde::BincodeSerializer();
9369 return std::move(serializer).bytes();
9370}
9371
9373{
9374 auto deserializer = serde::BincodeDeserializer(input);
9376 if (deserializer.get_buffer_offset() < input.size()) {
9377 throw_or_abort("Some input bytes were not read");
9378 }
9379 return value;
9380}
9381
9382} // end of namespace Acir
9383
9384template <>
9385template <typename Serializer>
9387{
9388 serializer.increase_container_depth();
9389 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9390 serializer.decrease_container_depth();
9391}
9392
9393template <>
9394template <typename Deserializer>
9396{
9397 deserializer.increase_container_depth();
9399 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9400 deserializer.decrease_container_depth();
9401 return obj;
9402}
9403
9404namespace Acir {
9405
9407{
9408 return true;
9409}
9410
9411inline std::vector<uint8_t> ExpressionWidth::Unbounded::bincodeSerialize() const
9412{
9413 auto serializer = serde::BincodeSerializer();
9415 return std::move(serializer).bytes();
9416}
9417
9419{
9420 auto deserializer = serde::BincodeDeserializer(input);
9422 if (deserializer.get_buffer_offset() < input.size()) {
9423 throw_or_abort("Some input bytes were not read");
9424 }
9425 return value;
9426}
9427
9428} // end of namespace Acir
9429
9430template <>
9431template <typename Serializer>
9435
9436template <>
9437template <typename Deserializer>
9444
9445namespace Acir {
9446
9448{
9449 if (!(lhs.width == rhs.width)) {
9450 return false;
9451 }
9452 return true;
9453}
9454
9455inline std::vector<uint8_t> ExpressionWidth::Bounded::bincodeSerialize() const
9456{
9457 auto serializer = serde::BincodeSerializer();
9459 return std::move(serializer).bytes();
9460}
9461
9463{
9464 auto deserializer = serde::BincodeDeserializer(input);
9466 if (deserializer.get_buffer_offset() < input.size()) {
9467 throw_or_abort("Some input bytes were not read");
9468 }
9469 return value;
9470}
9471
9472} // end of namespace Acir
9473
9474template <>
9475template <typename Serializer>
9477 Serializer& serializer)
9478{
9479 serde::Serializable<decltype(obj.width)>::serialize(obj.width, serializer);
9480}
9481
9482template <>
9483template <typename Deserializer>
9485 Deserializer& deserializer)
9486{
9488 obj.width = serde::Deserializable<decltype(obj.width)>::deserialize(deserializer);
9489 return obj;
9490}
9491
9492namespace Acir {
9493
9494inline bool operator==(const FunctionInput& lhs, const FunctionInput& rhs)
9495{
9496 if (!(lhs.value == rhs.value)) {
9497 return false;
9498 }
9499 return true;
9500}
9501
9502inline std::vector<uint8_t> FunctionInput::bincodeSerialize() const
9503{
9504 auto serializer = serde::BincodeSerializer();
9506 return std::move(serializer).bytes();
9507}
9508
9509inline FunctionInput FunctionInput::bincodeDeserialize(std::vector<uint8_t> input)
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{
9525 serializer.increase_container_depth();
9526 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9527 serializer.decrease_container_depth();
9528}
9529
9530template <>
9531template <typename Deserializer>
9533{
9534 deserializer.increase_container_depth();
9536 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9537 deserializer.decrease_container_depth();
9538 return obj;
9539}
9540
9541namespace Acir {
9542
9544{
9545 if (!(lhs.value == rhs.value)) {
9546 return false;
9547 }
9548 return true;
9549}
9550
9551inline std::vector<uint8_t> FunctionInput::Constant::bincodeSerialize() const
9552{
9553 auto serializer = serde::BincodeSerializer();
9555 return std::move(serializer).bytes();
9556}
9557
9559{
9560 auto deserializer = serde::BincodeDeserializer(input);
9562 if (deserializer.get_buffer_offset() < input.size()) {
9563 throw_or_abort("Some input bytes were not read");
9564 }
9565 return value;
9566}
9567
9568} // end of namespace Acir
9569
9570template <>
9571template <typename Serializer>
9573 Serializer& serializer)
9574{
9575 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9576}
9577
9578template <>
9579template <typename Deserializer>
9581 Deserializer& deserializer)
9582{
9584 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9585 return obj;
9586}
9587
9588namespace Acir {
9589
9591{
9592 if (!(lhs.value == rhs.value)) {
9593 return false;
9594 }
9595 return true;
9596}
9597
9598inline std::vector<uint8_t> FunctionInput::Witness::bincodeSerialize() const
9599{
9600 auto serializer = serde::BincodeSerializer();
9602 return std::move(serializer).bytes();
9603}
9604
9606{
9607 auto deserializer = serde::BincodeDeserializer(input);
9609 if (deserializer.get_buffer_offset() < input.size()) {
9610 throw_or_abort("Some input bytes were not read");
9611 }
9612 return value;
9613}
9614
9615} // end of namespace Acir
9616
9617template <>
9618template <typename Serializer>
9620 Serializer& serializer)
9621{
9622 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9623}
9624
9625template <>
9626template <typename Deserializer>
9628 Deserializer& deserializer)
9629{
9631 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9632 return obj;
9633}
9634
9635namespace Acir {
9636
9637inline bool operator==(const HeapArray& lhs, const HeapArray& rhs)
9638{
9639 if (!(lhs.pointer == rhs.pointer)) {
9640 return false;
9641 }
9642 if (!(lhs.size == rhs.size)) {
9643 return false;
9644 }
9645 return true;
9646}
9647
9648inline std::vector<uint8_t> HeapArray::bincodeSerialize() const
9649{
9650 auto serializer = serde::BincodeSerializer();
9652 return std::move(serializer).bytes();
9653}
9654
9655inline HeapArray HeapArray::bincodeDeserialize(std::vector<uint8_t> input)
9656{
9657 auto deserializer = serde::BincodeDeserializer(input);
9659 if (deserializer.get_buffer_offset() < input.size()) {
9660 throw_or_abort("Some input bytes were not read");
9661 }
9662 return value;
9663}
9664
9665} // end of namespace Acir
9666
9667template <>
9668template <typename Serializer>
9670{
9671 serializer.increase_container_depth();
9672 serde::Serializable<decltype(obj.pointer)>::serialize(obj.pointer, serializer);
9673 serde::Serializable<decltype(obj.size)>::serialize(obj.size, serializer);
9674 serializer.decrease_container_depth();
9675}
9676
9677template <>
9678template <typename Deserializer>
9680{
9681 deserializer.increase_container_depth();
9682 Acir::HeapArray obj;
9683 obj.pointer = serde::Deserializable<decltype(obj.pointer)>::deserialize(deserializer);
9684 obj.size = serde::Deserializable<decltype(obj.size)>::deserialize(deserializer);
9685 deserializer.decrease_container_depth();
9686 return obj;
9687}
9688
9689namespace Acir {
9690
9691inline bool operator==(const HeapValueType& lhs, const HeapValueType& rhs)
9692{
9693 if (!(lhs.value == rhs.value)) {
9694 return false;
9695 }
9696 return true;
9697}
9698
9699inline std::vector<uint8_t> HeapValueType::bincodeSerialize() const
9700{
9701 auto serializer = serde::BincodeSerializer();
9703 return std::move(serializer).bytes();
9704}
9705
9706inline HeapValueType HeapValueType::bincodeDeserialize(std::vector<uint8_t> input)
9707{
9708 auto deserializer = serde::BincodeDeserializer(input);
9710 if (deserializer.get_buffer_offset() < input.size()) {
9711 throw_or_abort("Some input bytes were not read");
9712 }
9713 return value;
9714}
9715
9716} // end of namespace Acir
9717
9718template <>
9719template <typename Serializer>
9721{
9722 serializer.increase_container_depth();
9723 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9724 serializer.decrease_container_depth();
9725}
9726
9727template <>
9728template <typename Deserializer>
9730{
9731 deserializer.increase_container_depth();
9733 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9734 deserializer.decrease_container_depth();
9735 return obj;
9736}
9737
9738namespace Acir {
9739
9740inline bool operator==(const HeapValueType::Simple& lhs, const HeapValueType::Simple& rhs)
9741{
9742 if (!(lhs.value == rhs.value)) {
9743 return false;
9744 }
9745 return true;
9746}
9747
9748inline std::vector<uint8_t> HeapValueType::Simple::bincodeSerialize() const
9749{
9750 auto serializer = serde::BincodeSerializer();
9752 return std::move(serializer).bytes();
9753}
9754
9756{
9757 auto deserializer = serde::BincodeDeserializer(input);
9759 if (deserializer.get_buffer_offset() < input.size()) {
9760 throw_or_abort("Some input bytes were not read");
9761 }
9762 return value;
9763}
9764
9765} // end of namespace Acir
9766
9767template <>
9768template <typename Serializer>
9770 Serializer& serializer)
9771{
9772 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9773}
9774
9775template <>
9776template <typename Deserializer>
9778{
9780 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9781 return obj;
9782}
9783
9784namespace Acir {
9785
9786inline bool operator==(const HeapValueType::Array& lhs, const HeapValueType::Array& rhs)
9787{
9788 if (!(lhs.value_types == rhs.value_types)) {
9789 return false;
9790 }
9791 if (!(lhs.size == rhs.size)) {
9792 return false;
9793 }
9794 return true;
9795}
9796
9797inline std::vector<uint8_t> HeapValueType::Array::bincodeSerialize() const
9798{
9799 auto serializer = serde::BincodeSerializer();
9801 return std::move(serializer).bytes();
9802}
9803
9805{
9806 auto deserializer = serde::BincodeDeserializer(input);
9808 if (deserializer.get_buffer_offset() < input.size()) {
9809 throw_or_abort("Some input bytes were not read");
9810 }
9811 return value;
9812}
9813
9814} // end of namespace Acir
9815
9816template <>
9817template <typename Serializer>
9819 Serializer& serializer)
9820{
9821 serde::Serializable<decltype(obj.value_types)>::serialize(obj.value_types, serializer);
9822 serde::Serializable<decltype(obj.size)>::serialize(obj.size, serializer);
9823}
9824
9825template <>
9826template <typename Deserializer>
9828{
9830 obj.value_types = serde::Deserializable<decltype(obj.value_types)>::deserialize(deserializer);
9831 obj.size = serde::Deserializable<decltype(obj.size)>::deserialize(deserializer);
9832 return obj;
9833}
9834
9835namespace Acir {
9836
9837inline bool operator==(const HeapValueType::Vector& lhs, const HeapValueType::Vector& rhs)
9838{
9839 if (!(lhs.value_types == rhs.value_types)) {
9840 return false;
9841 }
9842 return true;
9843}
9844
9845inline std::vector<uint8_t> HeapValueType::Vector::bincodeSerialize() const
9846{
9847 auto serializer = serde::BincodeSerializer();
9849 return std::move(serializer).bytes();
9850}
9851
9853{
9854 auto deserializer = serde::BincodeDeserializer(input);
9856 if (deserializer.get_buffer_offset() < input.size()) {
9857 throw_or_abort("Some input bytes were not read");
9858 }
9859 return value;
9860}
9861
9862} // end of namespace Acir
9863
9864template <>
9865template <typename Serializer>
9867 Serializer& serializer)
9868{
9869 serde::Serializable<decltype(obj.value_types)>::serialize(obj.value_types, serializer);
9870}
9871
9872template <>
9873template <typename Deserializer>
9875{
9877 obj.value_types = serde::Deserializable<decltype(obj.value_types)>::deserialize(deserializer);
9878 return obj;
9879}
9880
9881namespace Acir {
9882
9883inline bool operator==(const HeapVector& lhs, const HeapVector& rhs)
9884{
9885 if (!(lhs.pointer == rhs.pointer)) {
9886 return false;
9887 }
9888 if (!(lhs.size == rhs.size)) {
9889 return false;
9890 }
9891 return true;
9892}
9893
9894inline std::vector<uint8_t> HeapVector::bincodeSerialize() const
9895{
9896 auto serializer = serde::BincodeSerializer();
9898 return std::move(serializer).bytes();
9899}
9900
9901inline HeapVector HeapVector::bincodeDeserialize(std::vector<uint8_t> input)
9902{
9903 auto deserializer = serde::BincodeDeserializer(input);
9905 if (deserializer.get_buffer_offset() < input.size()) {
9906 throw_or_abort("Some input bytes were not read");
9907 }
9908 return value;
9909}
9910
9911} // end of namespace Acir
9912
9913template <>
9914template <typename Serializer>
9916{
9917 serializer.increase_container_depth();
9918 serde::Serializable<decltype(obj.pointer)>::serialize(obj.pointer, serializer);
9919 serde::Serializable<decltype(obj.size)>::serialize(obj.size, serializer);
9920 serializer.decrease_container_depth();
9921}
9922
9923template <>
9924template <typename Deserializer>
9926{
9927 deserializer.increase_container_depth();
9928 Acir::HeapVector obj;
9929 obj.pointer = serde::Deserializable<decltype(obj.pointer)>::deserialize(deserializer);
9930 obj.size = serde::Deserializable<decltype(obj.size)>::deserialize(deserializer);
9931 deserializer.decrease_container_depth();
9932 return obj;
9933}
9934
9935namespace Acir {
9936
9937inline bool operator==(const IntegerBitSize& lhs, const IntegerBitSize& rhs)
9938{
9939 if (!(lhs.value == rhs.value)) {
9940 return false;
9941 }
9942 return true;
9943}
9944
9945inline std::vector<uint8_t> IntegerBitSize::bincodeSerialize() const
9946{
9947 auto serializer = serde::BincodeSerializer();
9949 return std::move(serializer).bytes();
9950}
9951
9952inline IntegerBitSize IntegerBitSize::bincodeDeserialize(std::vector<uint8_t> input)
9953{
9954 auto deserializer = serde::BincodeDeserializer(input);
9956 if (deserializer.get_buffer_offset() < input.size()) {
9957 throw_or_abort("Some input bytes were not read");
9958 }
9959 return value;
9960}
9961
9962} // end of namespace Acir
9963
9964template <>
9965template <typename Serializer>
9967{
9968 serializer.increase_container_depth();
9969 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
9970 serializer.decrease_container_depth();
9971}
9972
9973template <>
9974template <typename Deserializer>
9976{
9977 deserializer.increase_container_depth();
9979 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
9980 deserializer.decrease_container_depth();
9981 return obj;
9982}
9983
9984namespace Acir {
9985
9986inline bool operator==(const IntegerBitSize::U1& lhs, const IntegerBitSize::U1& rhs)
9987{
9988 return true;
9989}
9990
9991inline std::vector<uint8_t> IntegerBitSize::U1::bincodeSerialize() const
9992{
9993 auto serializer = serde::BincodeSerializer();
9995 return std::move(serializer).bytes();
9996}
9997
9999{
10000 auto deserializer = serde::BincodeDeserializer(input);
10002 if (deserializer.get_buffer_offset() < input.size()) {
10003 throw_or_abort("Some input bytes were not read");
10004 }
10005 return value;
10006}
10007
10008} // end of namespace Acir
10009
10010template <>
10011template <typename Serializer>
10013 Serializer& serializer)
10014{}
10015
10016template <>
10017template <typename Deserializer>
10023
10024namespace Acir {
10025
10026inline bool operator==(const IntegerBitSize::U8& lhs, const IntegerBitSize::U8& rhs)
10027{
10028 return true;
10029}
10030
10031inline std::vector<uint8_t> IntegerBitSize::U8::bincodeSerialize() const
10032{
10033 auto serializer = serde::BincodeSerializer();
10035 return std::move(serializer).bytes();
10036}
10037
10039{
10040 auto deserializer = serde::BincodeDeserializer(input);
10042 if (deserializer.get_buffer_offset() < input.size()) {
10043 throw_or_abort("Some input bytes were not read");
10044 }
10045 return value;
10046}
10047
10048} // end of namespace Acir
10049
10050template <>
10051template <typename Serializer>
10053 Serializer& serializer)
10054{}
10055
10056template <>
10057template <typename Deserializer>
10063
10064namespace Acir {
10065
10066inline bool operator==(const IntegerBitSize::U16& lhs, const IntegerBitSize::U16& rhs)
10067{
10068 return true;
10069}
10070
10071inline std::vector<uint8_t> IntegerBitSize::U16::bincodeSerialize() const
10072{
10073 auto serializer = serde::BincodeSerializer();
10075 return std::move(serializer).bytes();
10076}
10077
10079{
10080 auto deserializer = serde::BincodeDeserializer(input);
10082 if (deserializer.get_buffer_offset() < input.size()) {
10083 throw_or_abort("Some input bytes were not read");
10084 }
10085 return value;
10086}
10087
10088} // end of namespace Acir
10089
10090template <>
10091template <typename Serializer>
10093 Serializer& serializer)
10094{}
10095
10096template <>
10097template <typename Deserializer>
10103
10104namespace Acir {
10105
10106inline bool operator==(const IntegerBitSize::U32& lhs, const IntegerBitSize::U32& rhs)
10107{
10108 return true;
10109}
10110
10111inline std::vector<uint8_t> IntegerBitSize::U32::bincodeSerialize() const
10112{
10113 auto serializer = serde::BincodeSerializer();
10115 return std::move(serializer).bytes();
10116}
10117
10119{
10120 auto deserializer = serde::BincodeDeserializer(input);
10122 if (deserializer.get_buffer_offset() < input.size()) {
10123 throw_or_abort("Some input bytes were not read");
10124 }
10125 return value;
10126}
10127
10128} // end of namespace Acir
10129
10130template <>
10131template <typename Serializer>
10133 Serializer& serializer)
10134{}
10135
10136template <>
10137template <typename Deserializer>
10143
10144namespace Acir {
10145
10146inline bool operator==(const IntegerBitSize::U64& lhs, const IntegerBitSize::U64& rhs)
10147{
10148 return true;
10149}
10150
10151inline std::vector<uint8_t> IntegerBitSize::U64::bincodeSerialize() const
10152{
10153 auto serializer = serde::BincodeSerializer();
10155 return std::move(serializer).bytes();
10156}
10157
10159{
10160 auto deserializer = serde::BincodeDeserializer(input);
10162 if (deserializer.get_buffer_offset() < input.size()) {
10163 throw_or_abort("Some input bytes were not read");
10164 }
10165 return value;
10166}
10167
10168} // end of namespace Acir
10169
10170template <>
10171template <typename Serializer>
10173 Serializer& serializer)
10174{}
10175
10176template <>
10177template <typename Deserializer>
10183
10184namespace Acir {
10185
10186inline bool operator==(const IntegerBitSize::U128& lhs, const IntegerBitSize::U128& rhs)
10187{
10188 return true;
10189}
10190
10191inline std::vector<uint8_t> IntegerBitSize::U128::bincodeSerialize() const
10192{
10193 auto serializer = serde::BincodeSerializer();
10195 return std::move(serializer).bytes();
10196}
10197
10199{
10200 auto deserializer = serde::BincodeDeserializer(input);
10202 if (deserializer.get_buffer_offset() < input.size()) {
10203 throw_or_abort("Some input bytes were not read");
10204 }
10205 return value;
10206}
10207
10208} // end of namespace Acir
10209
10210template <>
10211template <typename Serializer>
10215
10216template <>
10217template <typename Deserializer>
10223
10224namespace Acir {
10225
10226inline bool operator==(const MemOp& lhs, const MemOp& rhs)
10227{
10228 if (!(lhs.operation == rhs.operation)) {
10229 return false;
10230 }
10231 if (!(lhs.index == rhs.index)) {
10232 return false;
10233 }
10234 if (!(lhs.value == rhs.value)) {
10235 return false;
10236 }
10237 return true;
10238}
10239
10240inline std::vector<uint8_t> MemOp::bincodeSerialize() const
10241{
10242 auto serializer = serde::BincodeSerializer();
10243 serde::Serializable<MemOp>::serialize(*this, serializer);
10244 return std::move(serializer).bytes();
10245}
10246
10247inline MemOp MemOp::bincodeDeserialize(std::vector<uint8_t> input)
10248{
10249 auto deserializer = serde::BincodeDeserializer(input);
10251 if (deserializer.get_buffer_offset() < input.size()) {
10252 throw_or_abort("Some input bytes were not read");
10253 }
10254 return value;
10255}
10256
10257} // end of namespace Acir
10258
10259template <>
10260template <typename Serializer>
10261void serde::Serializable<Acir::MemOp>::serialize(const Acir::MemOp& obj, Serializer& serializer)
10262{
10263 serializer.increase_container_depth();
10264 serde::Serializable<decltype(obj.operation)>::serialize(obj.operation, serializer);
10265 serde::Serializable<decltype(obj.index)>::serialize(obj.index, serializer);
10266 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10267 serializer.decrease_container_depth();
10268}
10269
10270template <>
10271template <typename Deserializer>
10273{
10274 deserializer.increase_container_depth();
10275 Acir::MemOp obj;
10276 obj.operation = serde::Deserializable<decltype(obj.operation)>::deserialize(deserializer);
10277 obj.index = serde::Deserializable<decltype(obj.index)>::deserialize(deserializer);
10278 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10279 deserializer.decrease_container_depth();
10280 return obj;
10281}
10282
10283namespace Acir {
10284
10285inline bool operator==(const MemoryAddress& lhs, const MemoryAddress& rhs)
10286{
10287 if (!(lhs.value == rhs.value)) {
10288 return false;
10289 }
10290 return true;
10291}
10292
10293inline std::vector<uint8_t> MemoryAddress::bincodeSerialize() const
10294{
10295 auto serializer = serde::BincodeSerializer();
10297 return std::move(serializer).bytes();
10298}
10299
10300inline MemoryAddress MemoryAddress::bincodeDeserialize(std::vector<uint8_t> input)
10301{
10302 auto deserializer = serde::BincodeDeserializer(input);
10304 if (deserializer.get_buffer_offset() < input.size()) {
10305 throw_or_abort("Some input bytes were not read");
10306 }
10307 return value;
10308}
10309
10310} // end of namespace Acir
10311
10312template <>
10313template <typename Serializer>
10315{
10316 serializer.increase_container_depth();
10317 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10318 serializer.decrease_container_depth();
10319}
10320
10321template <>
10322template <typename Deserializer>
10324{
10325 deserializer.increase_container_depth();
10327 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10328 deserializer.decrease_container_depth();
10329 return obj;
10330}
10331
10332namespace Acir {
10333
10334inline bool operator==(const MemoryAddress::Direct& lhs, const MemoryAddress::Direct& rhs)
10335{
10336 if (!(lhs.value == rhs.value)) {
10337 return false;
10338 }
10339 return true;
10340}
10341
10342inline std::vector<uint8_t> MemoryAddress::Direct::bincodeSerialize() const
10343{
10344 auto serializer = serde::BincodeSerializer();
10346 return std::move(serializer).bytes();
10347}
10348
10350{
10351 auto deserializer = serde::BincodeDeserializer(input);
10353 if (deserializer.get_buffer_offset() < input.size()) {
10354 throw_or_abort("Some input bytes were not read");
10355 }
10356 return value;
10357}
10358
10359} // end of namespace Acir
10360
10361template <>
10362template <typename Serializer>
10364 Serializer& serializer)
10365{
10366 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10367}
10368
10369template <>
10370template <typename Deserializer>
10372{
10374 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10375 return obj;
10376}
10377
10378namespace Acir {
10379
10381{
10382 if (!(lhs.value == rhs.value)) {
10383 return false;
10384 }
10385 return true;
10386}
10387
10388inline std::vector<uint8_t> MemoryAddress::Relative::bincodeSerialize() const
10389{
10390 auto serializer = serde::BincodeSerializer();
10392 return std::move(serializer).bytes();
10393}
10394
10396{
10397 auto deserializer = serde::BincodeDeserializer(input);
10399 if (deserializer.get_buffer_offset() < input.size()) {
10400 throw_or_abort("Some input bytes were not read");
10401 }
10402 return value;
10403}
10404
10405} // end of namespace Acir
10406
10407template <>
10408template <typename Serializer>
10410 Serializer& serializer)
10411{
10412 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10413}
10414
10415template <>
10416template <typename Deserializer>
10418 Deserializer& deserializer)
10419{
10421 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10422 return obj;
10423}
10424
10425namespace Acir {
10426
10427inline bool operator==(const Opcode& lhs, const Opcode& rhs)
10428{
10429 if (!(lhs.value == rhs.value)) {
10430 return false;
10431 }
10432 return true;
10433}
10434
10435inline std::vector<uint8_t> Opcode::bincodeSerialize() const
10436{
10437 auto serializer = serde::BincodeSerializer();
10438 serde::Serializable<Opcode>::serialize(*this, serializer);
10439 return std::move(serializer).bytes();
10440}
10441
10442inline Opcode Opcode::bincodeDeserialize(std::vector<uint8_t> input)
10443{
10444 auto deserializer = serde::BincodeDeserializer(input);
10446 if (deserializer.get_buffer_offset() < input.size()) {
10447 throw_or_abort("Some input bytes were not read");
10448 }
10449 return value;
10450}
10451
10452} // end of namespace Acir
10453
10454template <>
10455template <typename Serializer>
10456void serde::Serializable<Acir::Opcode>::serialize(const Acir::Opcode& obj, Serializer& serializer)
10457{
10458 serializer.increase_container_depth();
10459 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10460 serializer.decrease_container_depth();
10461}
10462
10463template <>
10464template <typename Deserializer>
10466{
10467 deserializer.increase_container_depth();
10468 Acir::Opcode obj;
10469 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10470 deserializer.decrease_container_depth();
10471 return obj;
10472}
10473
10474namespace Acir {
10475
10476inline bool operator==(const Opcode::AssertZero& lhs, const Opcode::AssertZero& rhs)
10477{
10478 if (!(lhs.value == rhs.value)) {
10479 return false;
10480 }
10481 return true;
10482}
10483
10484inline std::vector<uint8_t> Opcode::AssertZero::bincodeSerialize() const
10485{
10486 auto serializer = serde::BincodeSerializer();
10488 return std::move(serializer).bytes();
10489}
10490
10492{
10493 auto deserializer = serde::BincodeDeserializer(input);
10495 if (deserializer.get_buffer_offset() < input.size()) {
10496 throw_or_abort("Some input bytes were not read");
10497 }
10498 return value;
10499}
10500
10501} // end of namespace Acir
10502
10503template <>
10504template <typename Serializer>
10506 Serializer& serializer)
10507{
10508 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10509}
10510
10511template <>
10512template <typename Deserializer>
10514{
10516 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10517 return obj;
10518}
10519
10520namespace Acir {
10521
10523{
10524 if (!(lhs.value == rhs.value)) {
10525 return false;
10526 }
10527 return true;
10528}
10529
10530inline std::vector<uint8_t> Opcode::BlackBoxFuncCall::bincodeSerialize() const
10531{
10532 auto serializer = serde::BincodeSerializer();
10534 return std::move(serializer).bytes();
10535}
10536
10538{
10539 auto deserializer = serde::BincodeDeserializer(input);
10541 if (deserializer.get_buffer_offset() < input.size()) {
10542 throw_or_abort("Some input bytes were not read");
10543 }
10544 return value;
10545}
10546
10547} // end of namespace Acir
10548
10549template <>
10550template <typename Serializer>
10552 Serializer& serializer)
10553{
10554 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10555}
10556
10557template <>
10558template <typename Deserializer>
10560 Deserializer& deserializer)
10561{
10563 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10564 return obj;
10565}
10566
10567namespace Acir {
10568
10569inline bool operator==(const Opcode::MemoryOp& lhs, const Opcode::MemoryOp& rhs)
10570{
10571 if (!(lhs.block_id == rhs.block_id)) {
10572 return false;
10573 }
10574 if (!(lhs.op == rhs.op)) {
10575 return false;
10576 }
10577 return true;
10578}
10579
10580inline std::vector<uint8_t> Opcode::MemoryOp::bincodeSerialize() const
10581{
10582 auto serializer = serde::BincodeSerializer();
10584 return std::move(serializer).bytes();
10585}
10586
10588{
10589 auto deserializer = serde::BincodeDeserializer(input);
10591 if (deserializer.get_buffer_offset() < input.size()) {
10592 throw_or_abort("Some input bytes were not read");
10593 }
10594 return value;
10595}
10596
10597} // end of namespace Acir
10598
10599template <>
10600template <typename Serializer>
10602{
10603 serde::Serializable<decltype(obj.block_id)>::serialize(obj.block_id, serializer);
10604 serde::Serializable<decltype(obj.op)>::serialize(obj.op, serializer);
10605}
10606
10607template <>
10608template <typename Deserializer>
10610{
10612 obj.block_id = serde::Deserializable<decltype(obj.block_id)>::deserialize(deserializer);
10613 obj.op = serde::Deserializable<decltype(obj.op)>::deserialize(deserializer);
10614 return obj;
10615}
10616
10617namespace Acir {
10618
10619inline bool operator==(const Opcode::MemoryInit& lhs, const Opcode::MemoryInit& rhs)
10620{
10621 if (!(lhs.block_id == rhs.block_id)) {
10622 return false;
10623 }
10624 if (!(lhs.init == rhs.init)) {
10625 return false;
10626 }
10627 if (!(lhs.block_type == rhs.block_type)) {
10628 return false;
10629 }
10630 return true;
10631}
10632
10633inline std::vector<uint8_t> Opcode::MemoryInit::bincodeSerialize() const
10634{
10635 auto serializer = serde::BincodeSerializer();
10637 return std::move(serializer).bytes();
10638}
10639
10641{
10642 auto deserializer = serde::BincodeDeserializer(input);
10644 if (deserializer.get_buffer_offset() < input.size()) {
10645 throw_or_abort("Some input bytes were not read");
10646 }
10647 return value;
10648}
10649
10650} // end of namespace Acir
10651
10652template <>
10653template <typename Serializer>
10655 Serializer& serializer)
10656{
10657 serde::Serializable<decltype(obj.block_id)>::serialize(obj.block_id, serializer);
10658 serde::Serializable<decltype(obj.init)>::serialize(obj.init, serializer);
10659 serde::Serializable<decltype(obj.block_type)>::serialize(obj.block_type, serializer);
10660}
10661
10662template <>
10663template <typename Deserializer>
10665{
10667 obj.block_id = serde::Deserializable<decltype(obj.block_id)>::deserialize(deserializer);
10668 obj.init = serde::Deserializable<decltype(obj.init)>::deserialize(deserializer);
10669 obj.block_type = serde::Deserializable<decltype(obj.block_type)>::deserialize(deserializer);
10670 return obj;
10671}
10672
10673namespace Acir {
10674
10675inline bool operator==(const Opcode::BrilligCall& lhs, const Opcode::BrilligCall& rhs)
10676{
10677 if (!(lhs.id == rhs.id)) {
10678 return false;
10679 }
10680 if (!(lhs.inputs == rhs.inputs)) {
10681 return false;
10682 }
10683 if (!(lhs.outputs == rhs.outputs)) {
10684 return false;
10685 }
10686 if (!(lhs.predicate == rhs.predicate)) {
10687 return false;
10688 }
10689 return true;
10690}
10691
10692inline std::vector<uint8_t> Opcode::BrilligCall::bincodeSerialize() const
10693{
10694 auto serializer = serde::BincodeSerializer();
10696 return std::move(serializer).bytes();
10697}
10698
10700{
10701 auto deserializer = serde::BincodeDeserializer(input);
10703 if (deserializer.get_buffer_offset() < input.size()) {
10704 throw_or_abort("Some input bytes were not read");
10705 }
10706 return value;
10707}
10708
10709} // end of namespace Acir
10710
10711template <>
10712template <typename Serializer>
10714 Serializer& serializer)
10715{
10716 serde::Serializable<decltype(obj.id)>::serialize(obj.id, serializer);
10717 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
10718 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
10719 serde::Serializable<decltype(obj.predicate)>::serialize(obj.predicate, serializer);
10720}
10721
10722template <>
10723template <typename Deserializer>
10725{
10727 obj.id = serde::Deserializable<decltype(obj.id)>::deserialize(deserializer);
10728 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
10729 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
10730 obj.predicate = serde::Deserializable<decltype(obj.predicate)>::deserialize(deserializer);
10731 return obj;
10732}
10733
10734namespace Acir {
10735
10736inline bool operator==(const Opcode::Call& lhs, const Opcode::Call& rhs)
10737{
10738 if (!(lhs.id == rhs.id)) {
10739 return false;
10740 }
10741 if (!(lhs.inputs == rhs.inputs)) {
10742 return false;
10743 }
10744 if (!(lhs.outputs == rhs.outputs)) {
10745 return false;
10746 }
10747 if (!(lhs.predicate == rhs.predicate)) {
10748 return false;
10749 }
10750 return true;
10751}
10752
10753inline std::vector<uint8_t> Opcode::Call::bincodeSerialize() const
10754{
10755 auto serializer = serde::BincodeSerializer();
10757 return std::move(serializer).bytes();
10758}
10759
10760inline Opcode::Call Opcode::Call::bincodeDeserialize(std::vector<uint8_t> input)
10761{
10762 auto deserializer = serde::BincodeDeserializer(input);
10764 if (deserializer.get_buffer_offset() < input.size()) {
10765 throw_or_abort("Some input bytes were not read");
10766 }
10767 return value;
10768}
10769
10770} // end of namespace Acir
10771
10772template <>
10773template <typename Serializer>
10775{
10776 serde::Serializable<decltype(obj.id)>::serialize(obj.id, serializer);
10777 serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
10778 serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
10779 serde::Serializable<decltype(obj.predicate)>::serialize(obj.predicate, serializer);
10780}
10781
10782template <>
10783template <typename Deserializer>
10785{
10787 obj.id = serde::Deserializable<decltype(obj.id)>::deserialize(deserializer);
10788 obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
10789 obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
10790 obj.predicate = serde::Deserializable<decltype(obj.predicate)>::deserialize(deserializer);
10791 return obj;
10792}
10793
10794namespace Acir {
10795
10796inline bool operator==(const OpcodeLocation& lhs, const OpcodeLocation& rhs)
10797{
10798 if (!(lhs.value == rhs.value)) {
10799 return false;
10800 }
10801 return true;
10802}
10803
10804inline std::vector<uint8_t> OpcodeLocation::bincodeSerialize() const
10805{
10806 auto serializer = serde::BincodeSerializer();
10808 return std::move(serializer).bytes();
10809}
10810
10811inline OpcodeLocation OpcodeLocation::bincodeDeserialize(std::vector<uint8_t> input)
10812{
10813 auto deserializer = serde::BincodeDeserializer(input);
10815 if (deserializer.get_buffer_offset() < input.size()) {
10816 throw_or_abort("Some input bytes were not read");
10817 }
10818 return value;
10819}
10820
10821} // end of namespace Acir
10822
10823template <>
10824template <typename Serializer>
10826{
10827 serializer.increase_container_depth();
10828 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10829 serializer.decrease_container_depth();
10830}
10831
10832template <>
10833template <typename Deserializer>
10835{
10836 deserializer.increase_container_depth();
10838 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10839 deserializer.decrease_container_depth();
10840 return obj;
10841}
10842
10843namespace Acir {
10844
10845inline bool operator==(const OpcodeLocation::Acir& lhs, const OpcodeLocation::Acir& rhs)
10846{
10847 if (!(lhs.value == rhs.value)) {
10848 return false;
10849 }
10850 return true;
10851}
10852
10853inline std::vector<uint8_t> OpcodeLocation::Acir::bincodeSerialize() const
10854{
10855 auto serializer = serde::BincodeSerializer();
10857 return std::move(serializer).bytes();
10858}
10859
10861{
10862 auto deserializer = serde::BincodeDeserializer(input);
10864 if (deserializer.get_buffer_offset() < input.size()) {
10865 throw_or_abort("Some input bytes were not read");
10866 }
10867 return value;
10868}
10869
10870} // end of namespace Acir
10871
10872template <>
10873template <typename Serializer>
10875 Serializer& serializer)
10876{
10877 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
10878}
10879
10880template <>
10881template <typename Deserializer>
10883{
10885 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
10886 return obj;
10887}
10888
10889namespace Acir {
10890
10892{
10893 if (!(lhs.acir_index == rhs.acir_index)) {
10894 return false;
10895 }
10896 if (!(lhs.brillig_index == rhs.brillig_index)) {
10897 return false;
10898 }
10899 return true;
10900}
10901
10902inline std::vector<uint8_t> OpcodeLocation::Brillig::bincodeSerialize() const
10903{
10904 auto serializer = serde::BincodeSerializer();
10906 return std::move(serializer).bytes();
10907}
10908
10910{
10911 auto deserializer = serde::BincodeDeserializer(input);
10913 if (deserializer.get_buffer_offset() < input.size()) {
10914 throw_or_abort("Some input bytes were not read");
10915 }
10916 return value;
10917}
10918
10919} // end of namespace Acir
10920
10921template <>
10922template <typename Serializer>
10924 Serializer& serializer)
10925{
10926 serde::Serializable<decltype(obj.acir_index)>::serialize(obj.acir_index, serializer);
10927 serde::Serializable<decltype(obj.brillig_index)>::serialize(obj.brillig_index, serializer);
10928}
10929
10930template <>
10931template <typename Deserializer>
10933 Deserializer& deserializer)
10934{
10936 obj.acir_index = serde::Deserializable<decltype(obj.acir_index)>::deserialize(deserializer);
10937 obj.brillig_index = serde::Deserializable<decltype(obj.brillig_index)>::deserialize(deserializer);
10938 return obj;
10939}
10940
10941namespace Acir {
10942
10943inline bool operator==(const Program& lhs, const Program& rhs)
10944{
10945 if (!(lhs.functions == rhs.functions)) {
10946 return false;
10947 }
10949 return false;
10950 }
10951 return true;
10952}
10953
10954inline std::vector<uint8_t> Program::bincodeSerialize() const
10955{
10956 auto serializer = serde::BincodeSerializer();
10957 serde::Serializable<Program>::serialize(*this, serializer);
10958 return std::move(serializer).bytes();
10959}
10960
10961inline Program Program::bincodeDeserialize(std::vector<uint8_t> input)
10962{
10963 auto deserializer = serde::BincodeDeserializer(input);
10965 if (deserializer.get_buffer_offset() < input.size()) {
10966 throw_or_abort("Some input bytes were not read");
10967 }
10968 return value;
10969}
10970
10971} // end of namespace Acir
10972
10973template <>
10974template <typename Serializer>
10975void serde::Serializable<Acir::Program>::serialize(const Acir::Program& obj, Serializer& serializer)
10976{
10977 serializer.increase_container_depth();
10978 serde::Serializable<decltype(obj.functions)>::serialize(obj.functions, serializer);
10979 serde::Serializable<decltype(obj.unconstrained_functions)>::serialize(obj.unconstrained_functions, serializer);
10980 serializer.decrease_container_depth();
10981}
10982
10983template <>
10984template <typename Deserializer>
10986{
10987 deserializer.increase_container_depth();
10988 Acir::Program obj;
10989 obj.functions = serde::Deserializable<decltype(obj.functions)>::deserialize(deserializer);
10991 serde::Deserializable<decltype(obj.unconstrained_functions)>::deserialize(deserializer);
10992 deserializer.decrease_container_depth();
10993 return obj;
10994}
10995
10996namespace Acir {
10997
10998inline bool operator==(const ProgramWithoutBrillig& lhs, const ProgramWithoutBrillig& rhs)
10999{
11000 if (!(lhs.functions == rhs.functions)) {
11001 return false;
11002 }
11003 return true;
11004}
11005
11006inline std::vector<uint8_t> ProgramWithoutBrillig::bincodeSerialize() const
11007{
11008 auto serializer = serde::BincodeSerializer();
11010 return std::move(serializer).bytes();
11011}
11012
11014{
11015 auto deserializer = serde::BincodeDeserializer(input);
11017 if (deserializer.get_buffer_offset() < input.size()) {
11018 throw_or_abort("Some input bytes were not read");
11019 }
11020 return value;
11021}
11022
11023} // end of namespace Acir
11024
11025template <>
11026template <typename Serializer>
11028 Serializer& serializer)
11029{
11030 serializer.increase_container_depth();
11031 serde::Serializable<decltype(obj.functions)>::serialize(obj.functions, serializer);
11032 serializer.decrease_container_depth();
11033}
11034
11035template <>
11036template <typename Deserializer>
11038{
11039 deserializer.increase_container_depth();
11041 obj.functions = serde::Deserializable<decltype(obj.functions)>::deserialize(deserializer);
11042 deserializer.decrease_container_depth();
11043 return obj;
11044}
11045
11046namespace Acir {
11047
11048inline bool operator==(const PublicInputs& lhs, const PublicInputs& rhs)
11049{
11050 if (!(lhs.value == rhs.value)) {
11051 return false;
11052 }
11053 return true;
11054}
11055
11056inline std::vector<uint8_t> PublicInputs::bincodeSerialize() const
11057{
11058 auto serializer = serde::BincodeSerializer();
11060 return std::move(serializer).bytes();
11061}
11062
11063inline PublicInputs PublicInputs::bincodeDeserialize(std::vector<uint8_t> input)
11064{
11065 auto deserializer = serde::BincodeDeserializer(input);
11067 if (deserializer.get_buffer_offset() < input.size()) {
11068 throw_or_abort("Some input bytes were not read");
11069 }
11070 return value;
11071}
11072
11073} // end of namespace Acir
11074
11075template <>
11076template <typename Serializer>
11078{
11079 serializer.increase_container_depth();
11080 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11081 serializer.decrease_container_depth();
11082}
11083
11084template <>
11085template <typename Deserializer>
11087{
11088 deserializer.increase_container_depth();
11090 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11091 deserializer.decrease_container_depth();
11092 return obj;
11093}
11094
11095namespace Acir {
11096
11097inline bool operator==(const ValueOrArray& lhs, const ValueOrArray& rhs)
11098{
11099 if (!(lhs.value == rhs.value)) {
11100 return false;
11101 }
11102 return true;
11103}
11104
11105inline std::vector<uint8_t> ValueOrArray::bincodeSerialize() const
11106{
11107 auto serializer = serde::BincodeSerializer();
11109 return std::move(serializer).bytes();
11110}
11111
11112inline ValueOrArray ValueOrArray::bincodeDeserialize(std::vector<uint8_t> input)
11113{
11114 auto deserializer = serde::BincodeDeserializer(input);
11116 if (deserializer.get_buffer_offset() < input.size()) {
11117 throw_or_abort("Some input bytes were not read");
11118 }
11119 return value;
11120}
11121
11122} // end of namespace Acir
11123
11124template <>
11125template <typename Serializer>
11127{
11128 serializer.increase_container_depth();
11129 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11130 serializer.decrease_container_depth();
11131}
11132
11133template <>
11134template <typename Deserializer>
11136{
11137 deserializer.increase_container_depth();
11139 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11140 deserializer.decrease_container_depth();
11141 return obj;
11142}
11143
11144namespace Acir {
11145
11147{
11148 if (!(lhs.value == rhs.value)) {
11149 return false;
11150 }
11151 return true;
11152}
11153
11154inline std::vector<uint8_t> ValueOrArray::MemoryAddress::bincodeSerialize() const
11155{
11156 auto serializer = serde::BincodeSerializer();
11158 return std::move(serializer).bytes();
11159}
11160
11162{
11163 auto deserializer = serde::BincodeDeserializer(input);
11165 if (deserializer.get_buffer_offset() < input.size()) {
11166 throw_or_abort("Some input bytes were not read");
11167 }
11168 return value;
11169}
11170
11171} // end of namespace Acir
11172
11173template <>
11174template <typename Serializer>
11176 Serializer& serializer)
11177{
11178 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11179}
11180
11181template <>
11182template <typename Deserializer>
11184 Deserializer& deserializer)
11185{
11187 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11188 return obj;
11189}
11190
11191namespace Acir {
11192
11194{
11195 if (!(lhs.value == rhs.value)) {
11196 return false;
11197 }
11198 return true;
11199}
11200
11201inline std::vector<uint8_t> ValueOrArray::HeapArray::bincodeSerialize() const
11202{
11203 auto serializer = serde::BincodeSerializer();
11205 return std::move(serializer).bytes();
11206}
11207
11209{
11210 auto deserializer = serde::BincodeDeserializer(input);
11212 if (deserializer.get_buffer_offset() < input.size()) {
11213 throw_or_abort("Some input bytes were not read");
11214 }
11215 return value;
11216}
11217
11218} // end of namespace Acir
11219
11220template <>
11221template <typename Serializer>
11223 Serializer& serializer)
11224{
11225 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11226}
11227
11228template <>
11229template <typename Deserializer>
11231 Deserializer& deserializer)
11232{
11234 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11235 return obj;
11236}
11237
11238namespace Acir {
11239
11241{
11242 if (!(lhs.value == rhs.value)) {
11243 return false;
11244 }
11245 return true;
11246}
11247
11248inline std::vector<uint8_t> ValueOrArray::HeapVector::bincodeSerialize() const
11249{
11250 auto serializer = serde::BincodeSerializer();
11252 return std::move(serializer).bytes();
11253}
11254
11256{
11257 auto deserializer = serde::BincodeDeserializer(input);
11259 if (deserializer.get_buffer_offset() < input.size()) {
11260 throw_or_abort("Some input bytes were not read");
11261 }
11262 return value;
11263}
11264
11265} // end of namespace Acir
11266
11267template <>
11268template <typename Serializer>
11270 Serializer& serializer)
11271{
11272 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11273}
11274
11275template <>
11276template <typename Deserializer>
11278 Deserializer& deserializer)
11279{
11281 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11282 return obj;
11283}
11284
11285namespace Acir {
11286
11287inline bool operator==(const Witness& lhs, const Witness& rhs)
11288{
11289 if (!(lhs.value == rhs.value)) {
11290 return false;
11291 }
11292 return true;
11293}
11294
11295inline std::vector<uint8_t> Witness::bincodeSerialize() const
11296{
11297 auto serializer = serde::BincodeSerializer();
11298 serde::Serializable<Witness>::serialize(*this, serializer);
11299 return std::move(serializer).bytes();
11300}
11301
11302inline Witness Witness::bincodeDeserialize(std::vector<uint8_t> input)
11303{
11304 auto deserializer = serde::BincodeDeserializer(input);
11306 if (deserializer.get_buffer_offset() < input.size()) {
11307 throw_or_abort("Some input bytes were not read");
11308 }
11309 return value;
11310}
11311
11312} // end of namespace Acir
11313
11314template <>
11315template <typename Serializer>
11316void serde::Serializable<Acir::Witness>::serialize(const Acir::Witness& obj, Serializer& serializer)
11317{
11318 serializer.increase_container_depth();
11319 serde::Serializable<decltype(obj.value)>::serialize(obj.value, serializer);
11320 serializer.decrease_container_depth();
11321}
11322
11323template <>
11324template <typename Deserializer>
11326{
11327 deserializer.increase_container_depth();
11328 Acir::Witness obj;
11329 obj.value = serde::Deserializable<decltype(obj.value)>::deserialize(deserializer);
11330 deserializer.decrease_container_depth();
11331 return obj;
11332}
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:4719
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:4737
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:4730
uint64_t error_selector
Definition acir.hpp:4325
std::vector< Acir::ExpressionOrMemory > payload
Definition acir.hpp:4326
friend bool operator==(const AssertionPayload &, const AssertionPayload &)
Definition acir.hpp:4719
void msgpack_pack(auto &packer) const
Definition acir.hpp:4332
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4339
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:64
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:4827
void msgpack_pack(auto &packer) const
Definition acir.hpp:63
static Add bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:4834
friend bool operator==(const Add &, const Add &)
Definition acir.hpp:4822
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:4942
static Div bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:4954
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:4947
void msgpack_pack(auto &packer) const
Definition acir.hpp:108
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5028
static Equals bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5035
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:109
friend bool operator==(const Equals &, const Equals &)
Definition acir.hpp:5023
static IntegerDiv bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:4994
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:4987
friend bool operator==(const IntegerDiv &, const IntegerDiv &)
Definition acir.hpp:4982
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:5109
friend bool operator==(const LessThanEquals &, const LessThanEquals &)
Definition acir.hpp:5104
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:5116
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:118
static LessThan bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5075
void msgpack_pack(auto &packer) const
Definition acir.hpp:117
friend bool operator==(const LessThan &, const LessThan &)
Definition acir.hpp:5063
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5068
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:4907
friend bool operator==(const Mul &, const Mul &)
Definition acir.hpp:4902
static Mul bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:4914
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:4867
friend bool operator==(const Sub &, const Sub &)
Definition acir.hpp:4862
static Sub bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:4874
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:4788
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:190
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:4781
friend bool operator==(const BinaryFieldOp &, const BinaryFieldOp &)
Definition acir.hpp:4773
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5199
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:250
static Add bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5206
friend bool operator==(const Add &, const Add &)
Definition acir.hpp:5194
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:5483
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5476
friend bool operator==(const And &, const And &)
Definition acir.hpp:5471
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:5316
static Div bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5323
friend bool operator==(const Div &, const Div &)
Definition acir.hpp:5311
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:5362
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5355
friend bool operator==(const Equals &, const Equals &)
Definition acir.hpp:5350
friend bool operator==(const LessThanEquals &, const LessThanEquals &)
Definition acir.hpp:5430
static LessThanEquals bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5442
void msgpack_pack(auto &packer) const
Definition acir.hpp:303
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5435
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:304
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5395
static LessThan bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5402
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:295
friend bool operator==(const LessThan &, const LessThan &)
Definition acir.hpp:5390
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:5272
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5277
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:268
static Mul bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5284
static Or bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5522
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5515
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:5510
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5593
friend bool operator==(const Shl &, const Shl &)
Definition acir.hpp:5588
static Shl bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5600
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:5627
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5632
static Shr bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5639
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:5238
static Sub bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5245
friend bool operator==(const Sub &, const Sub &)
Definition acir.hpp:5233
friend bool operator==(const Xor &, const Xor &)
Definition acir.hpp:5549
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:5561
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5554
void msgpack_pack(auto &packer) const
Definition acir.hpp:358
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5153
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:428
static BinaryIntOp bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5160
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:5145
static Field bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5727
friend bool operator==(const Field &, const Field &)
Definition acir.hpp:5715
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:5720
Acir::IntegerBitSize value
Definition acir.hpp:658
static Integer bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5769
friend bool operator==(const Integer &, const Integer &)
Definition acir.hpp:5754
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5762
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:5674
std::variant< Field, Integer > value
Definition acir.hpp:677
static BitSize bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5681
friend bool operator==(const BitSize &, const BitSize &)
Definition acir.hpp:5666
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:2760
std::shared_ptr< std::array< Acir::FunctionInput, 16 > > key
Definition acir.hpp:2753
std::vector< Acir::Witness > outputs
Definition acir.hpp:2754
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5865
std::vector< Acir::FunctionInput > inputs
Definition acir.hpp:2751
friend bool operator==(const AES128Encrypt &, const AES128Encrypt &)
Definition acir.hpp:5848
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2769
static AES128Encrypt bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5872
std::shared_ptr< std::array< Acir::FunctionInput, 16 > > iv
Definition acir.hpp:2752
friend bool operator==(const AND &, const AND &)
Definition acir.hpp:5910
static AND bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5934
Acir::FunctionInput lhs
Definition acir.hpp:2781
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2799
Acir::FunctionInput rhs
Definition acir.hpp:2782
void msgpack_pack(auto &packer) const
Definition acir.hpp:2790
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5927
std::shared_ptr< std::array< Acir::Witness, 32 > > outputs
Definition acir.hpp:2866
static Blake2s bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6102
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6095
void msgpack_pack(auto &packer) const
Definition acir.hpp:2872
friend bool operator==(const Blake2s &, const Blake2s &)
Definition acir.hpp:6084
std::vector< Acir::FunctionInput > inputs
Definition acir.hpp:2865
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2879
void msgpack_pack(auto &packer) const
Definition acir.hpp:2896
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2903
static Blake3 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6154
std::shared_ptr< std::array< Acir::Witness, 32 > > outputs
Definition acir.hpp:2890
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6147
std::vector< Acir::FunctionInput > inputs
Definition acir.hpp:2889
friend bool operator==(const Blake3 &, const Blake3 &)
Definition acir.hpp:6136
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6211
static EcdsaSecp256k1 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6218
std::shared_ptr< std::array< Acir::FunctionInput, 32 > > public_key_x
Definition acir.hpp:2913
std::shared_ptr< std::array< Acir::FunctionInput, 32 > > hashed_message
Definition acir.hpp:2916
void msgpack_pack(auto &packer) const
Definition acir.hpp:2924
friend bool operator==(const EcdsaSecp256k1 &, const EcdsaSecp256k1 &)
Definition acir.hpp:6188
std::shared_ptr< std::array< Acir::FunctionInput, 32 > > public_key_y
Definition acir.hpp:2914
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2935
std::shared_ptr< std::array< Acir::FunctionInput, 64 > > signature
Definition acir.hpp:2915
std::shared_ptr< std::array< Acir::FunctionInput, 32 > > public_key_x
Definition acir.hpp:2949
static EcdsaSecp256r1 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6290
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6283
friend bool operator==(const EcdsaSecp256r1 &, const EcdsaSecp256r1 &)
Definition acir.hpp:6260
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2971
std::shared_ptr< std::array< Acir::FunctionInput, 32 > > hashed_message
Definition acir.hpp:2952
void msgpack_pack(auto &packer) const
Definition acir.hpp:2960
std::shared_ptr< std::array< Acir::FunctionInput, 32 > > public_key_y
Definition acir.hpp:2950
std::shared_ptr< std::array< Acir::FunctionInput, 64 > > signature
Definition acir.hpp:2951
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6411
std::shared_ptr< std::array< Acir::Witness, 3 > > outputs
Definition acir.hpp:3018
friend bool operator==(const EmbeddedCurveAdd &, const EmbeddedCurveAdd &)
Definition acir.hpp:6394
void msgpack_pack(auto &packer) const
Definition acir.hpp:3024
std::shared_ptr< std::array< Acir::FunctionInput, 3 > > input2
Definition acir.hpp:3016
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3033
std::shared_ptr< std::array< Acir::FunctionInput, 3 > > input1
Definition acir.hpp:3015
static EmbeddedCurveAdd bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6418
std::shared_ptr< std::array< Acir::FunctionInput, 25 > > inputs
Definition acir.hpp:3045
friend bool operator==(const Keccakf1600 &, const Keccakf1600 &)
Definition acir.hpp:6457
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3059
static Keccakf1600 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6475
void msgpack_pack(auto &packer) const
Definition acir.hpp:3052
std::shared_ptr< std::array< Acir::Witness, 25 > > outputs
Definition acir.hpp:3046
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6468
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6349
std::vector< Acir::FunctionInput > scalars
Definition acir.hpp:2986
std::vector< Acir::FunctionInput > points
Definition acir.hpp:2985
std::shared_ptr< std::array< Acir::Witness, 3 > > outputs
Definition acir.hpp:2988
static MultiScalarMul bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6356
friend bool operator==(const MultiScalarMul &, const MultiScalarMul &)
Definition acir.hpp:6332
void msgpack_pack(auto &packer) const
Definition acir.hpp:2994
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3003
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6595
std::vector< Acir::Witness > outputs
Definition acir.hpp:3106
std::vector< Acir::FunctionInput > inputs
Definition acir.hpp:3105
static Poseidon2Permutation bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6602
void msgpack_pack(auto &packer) const
Definition acir.hpp:3112
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3119
friend bool operator==(const Poseidon2Permutation &, const Poseidon2Permutation &)
Definition acir.hpp:6583
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2855
friend bool operator==(const RANGE &, const RANGE &)
Definition acir.hpp:6032
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6043
void msgpack_pack(auto &packer) const
Definition acir.hpp:2848
static RANGE bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6050
Acir::FunctionInput input
Definition acir.hpp:2841
std::vector< Acir::FunctionInput > verification_key
Definition acir.hpp:3069
std::vector< Acir::FunctionInput > proof
Definition acir.hpp:3070
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6533
void msgpack_pack(auto &packer) const
Definition acir.hpp:3080
std::vector< Acir::FunctionInput > public_inputs
Definition acir.hpp:3071
static RecursiveAggregation bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6540
friend bool operator==(const RecursiveAggregation &, const RecursiveAggregation &)
Definition acir.hpp:6509
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3091
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3145
static Sha256Compression bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6658
std::shared_ptr< std::array< Acir::FunctionInput, 8 > > hash_values
Definition acir.hpp:3130
friend bool operator==(const Sha256Compression &, const Sha256Compression &)
Definition acir.hpp:6637
std::shared_ptr< std::array< Acir::FunctionInput, 16 > > inputs
Definition acir.hpp:3129
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6651
std::shared_ptr< std::array< Acir::Witness, 8 > > outputs
Definition acir.hpp:3131
void msgpack_pack(auto &packer) const
Definition acir.hpp:3137
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2829
Acir::FunctionInput rhs
Definition acir.hpp:2812
Acir::FunctionInput lhs
Definition acir.hpp:2811
static XOR bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5995
void msgpack_pack(auto &packer) const
Definition acir.hpp:2820
friend bool operator==(const XOR &, const XOR &)
Definition acir.hpp:5971
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5988
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:5807
void msgpack_pack(auto &packer) const
Definition acir.hpp:3175
friend bool operator==(const BlackBoxFuncCall &, const BlackBoxFuncCall &)
Definition acir.hpp:5799
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3253
std::variant< AES128Encrypt, AND, XOR, RANGE, Blake2s, Blake3, EcdsaSecp256k1, EcdsaSecp256r1, MultiScalarMul, EmbeddedCurveAdd, Keccakf1600, RecursiveAggregation, Poseidon2Permutation, Sha256Compression > value
Definition acir.hpp:3169
static BlackBoxFuncCall bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:5814
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:6744
Acir::HeapVector inputs
Definition acir.hpp:931
static AES128Encrypt bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6768
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6761
Acir::HeapVector message
Definition acir.hpp:961
static Blake2s bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6824
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6817
Acir::HeapArray output
Definition acir.hpp:962
friend bool operator==(const Blake2s &, const Blake2s &)
Definition acir.hpp:6806
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:6868
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:6875
friend bool operator==(const Blake3 &, const Blake3 &)
Definition acir.hpp:6857
Acir::MemoryAddress result
Definition acir.hpp:1037
static EcdsaSecp256k1 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6987
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6980
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:6960
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:7027
void msgpack_pack(auto &packer) const
Definition acir.hpp:1076
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7047
static EcdsaSecp256r1 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7054
static EmbeddedCurveAdd bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7184
Acir::MemoryAddress input1_x
Definition acir.hpp:1126
friend bool operator==(const EmbeddedCurveAdd &, const EmbeddedCurveAdd &)
Definition acir.hpp:7151
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:7177
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:6926
friend bool operator==(const Keccakf1600 &, const Keccakf1600 &)
Definition acir.hpp:6908
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6919
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:7108
friend bool operator==(const MultiScalarMul &, const MultiScalarMul &)
Definition acir.hpp:7094
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:7115
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7239
static Poseidon2Permutation bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7246
void msgpack_pack(auto &packer) const
Definition acir.hpp:1172
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1179
friend bool operator==(const Poseidon2Permutation &, const Poseidon2Permutation &)
Definition acir.hpp:7228
friend bool operator==(const Sha256Compression &, const Sha256Compression &)
Definition acir.hpp:7280
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7294
void msgpack_pack(auto &packer) const
Definition acir.hpp:1197
static Sha256Compression bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7301
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1205
friend bool operator==(const ToRadix &, const ToRadix &)
Definition acir.hpp:7337
Acir::MemoryAddress output_pointer
Definition acir.hpp:1218
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7357
static ToRadix bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7364
Acir::MemoryAddress radix
Definition acir.hpp:1217
Acir::MemoryAddress output_bits
Definition acir.hpp:1220
Acir::MemoryAddress input
Definition acir.hpp:1216
Acir::MemoryAddress num_limbs
Definition acir.hpp:1219
void msgpack_pack(auto &packer) const
Definition acir.hpp:1226
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1236
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1331
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:6703
void msgpack_pack(auto &packer) const
Definition acir.hpp:1265
friend bool operator==(const BlackBoxOp &, const BlackBoxOp &)
Definition acir.hpp:6695
std::variant< AES128Encrypt, Blake2s, Blake3, Keccakf1600, EcdsaSecp256k1, EcdsaSecp256r1, MultiScalarMul, EmbeddedCurveAdd, Poseidon2Permutation, Sha256Compression, ToRadix > value
Definition acir.hpp:1259
static BlackBoxOp bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:6710
void msgpack_pack(auto &packer) const
Definition acir.hpp:3428
friend bool operator==(const BlockId &, const BlockId &)
Definition acir.hpp:7403
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3430
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7411
static BlockId bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7418
uint32_t value
Definition acir.hpp:3422
static CallData bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7555
friend bool operator==(const CallData &, const CallData &)
Definition acir.hpp:7540
void msgpack_pack(auto &packer) const
Definition acir.hpp:3459
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7548
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3461
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3449
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7506
friend bool operator==(const Memory &, const Memory &)
Definition acir.hpp:7501
void msgpack_pack(auto &packer) const
Definition acir.hpp:3448
static Memory bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7513
static ReturnData bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7598
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3478
friend bool operator==(const ReturnData &, const ReturnData &)
Definition acir.hpp:7586
void msgpack_pack(auto &packer) const
Definition acir.hpp:3477
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7591
void msgpack_pack(auto &packer) const
Definition acir.hpp:3487
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7460
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3521
static BlockType bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7467
std::variant< Memory, CallData, ReturnData > value
Definition acir.hpp:3481
friend bool operator==(const BlockType &, const BlockType &)
Definition acir.hpp:7452
void msgpack_pack(auto &packer) const
Definition acir.hpp:4545
static BrilligBytecode bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7644
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7637
friend bool operator==(const BrilligBytecode &, const BrilligBytecode &)
Definition acir.hpp:7626
std::vector< Acir::BrilligOpcode > bytecode
Definition acir.hpp:4539
std::string function_name
Definition acir.hpp:4538
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4552
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3623
void msgpack_pack(auto &packer) const
Definition acir.hpp:3621
std::vector< Acir::Expression > value
Definition acir.hpp:3615
static Array bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7790
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7783
friend bool operator==(const Array &, const Array &)
Definition acir.hpp:7775
static MemoryArray bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7836
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7829
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3643
void msgpack_pack(auto &packer) const
Definition acir.hpp:3641
friend bool operator==(const MemoryArray &, const MemoryArray &)
Definition acir.hpp:7821
Acir::Expression value
Definition acir.hpp:3595
static Single bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7744
friend bool operator==(const Single &, const Single &)
Definition acir.hpp:7729
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3603
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7737
void msgpack_pack(auto &packer) const
Definition acir.hpp:3601
static BrilligInputs bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7695
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3694
std::variant< Single, Array, MemoryArray > value
Definition acir.hpp:3654
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7688
void msgpack_pack(auto &packer) const
Definition acir.hpp:3660
friend bool operator==(const BrilligInputs &, const BrilligInputs &)
Definition acir.hpp:7680
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7934
static BinaryFieldOp bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7941
void msgpack_pack(auto &packer) const
Definition acir.hpp:1808
friend bool operator==(const BinaryFieldOp &, const BinaryFieldOp &)
Definition acir.hpp:7917
Acir::MemoryAddress destination
Definition acir.hpp:1799
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1817
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1849
Acir::MemoryAddress destination
Definition acir.hpp:1829
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7999
Acir::MemoryAddress rhs
Definition acir.hpp:1833
static BinaryIntOp bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8006
void msgpack_pack(auto &packer) const
Definition acir.hpp:1839
friend bool operator==(const BinaryIntOp &, const BinaryIntOp &)
Definition acir.hpp:7979
Acir::IntegerBitSize bit_size
Definition acir.hpp:1831
Acir::MemoryAddress lhs
Definition acir.hpp:1832
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2215
static BlackBox bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8809
Acir::BlackBoxOp value
Definition acir.hpp:2207
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8802
friend bool operator==(const BlackBox &, const BlackBox &)
Definition acir.hpp:8794
void msgpack_pack(auto &packer) const
Definition acir.hpp:2213
void msgpack_pack(auto &packer) const
Definition acir.hpp:1994
static Call bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8327
friend bool operator==(const Call &, const Call &)
Definition acir.hpp:8312
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8320
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2000
Acir::MemoryAddress offset_address
Definition acir.hpp:1963
static CalldataCopy bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8276
friend bool operator==(const CalldataCopy &, const CalldataCopy &)
Definition acir.hpp:8255
Acir::MemoryAddress destination_address
Definition acir.hpp:1961
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8269
void msgpack_pack(auto &packer) const
Definition acir.hpp:1969
Acir::MemoryAddress size_address
Definition acir.hpp:1962
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1977
Acir::MemoryAddress source
Definition acir.hpp:1890
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1905
void msgpack_pack(auto &packer) const
Definition acir.hpp:1897
Acir::MemoryAddress destination
Definition acir.hpp:1889
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8116
static Cast bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8123
Acir::BitSize bit_size
Definition acir.hpp:1891
friend bool operator==(const Cast &, const Cast &)
Definition acir.hpp:8102
Acir::MemoryAddress source_b
Definition acir.hpp:2131
static ConditionalMov bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8654
friend bool operator==(const ConditionalMov &, const ConditionalMov &)
Definition acir.hpp:8630
Acir::MemoryAddress source_a
Definition acir.hpp:2130
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2147
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8647
void msgpack_pack(auto &packer) const
Definition acir.hpp:2138
Acir::MemoryAddress destination
Definition acir.hpp:2129
Acir::MemoryAddress condition
Definition acir.hpp:2132
static Const bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8379
Acir::BitSize bit_size
Definition acir.hpp:2010
friend bool operator==(const Const &, const Const &)
Definition acir.hpp:8358
std::vector< uint8_t > value
Definition acir.hpp:2011
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2025
void msgpack_pack(auto &packer) const
Definition acir.hpp:2017
Acir::MemoryAddress destination
Definition acir.hpp:2009
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8372
std::vector< Acir::HeapValueType > input_value_types
Definition acir.hpp:2076
std::vector< Acir::HeapValueType > destination_value_types
Definition acir.hpp:2074
static ForeignCall bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8538
std::vector< Acir::ValueOrArray > destinations
Definition acir.hpp:2073
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8531
friend bool operator==(const ForeignCall &, const ForeignCall &)
Definition acir.hpp:8511
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2092
void msgpack_pack(auto &packer) const
Definition acir.hpp:2082
std::vector< Acir::ValueOrArray > inputs
Definition acir.hpp:2075
std::vector< uint8_t > value
Definition acir.hpp:2038
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8428
void msgpack_pack(auto &packer) const
Definition acir.hpp:2044
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2052
static IndirectConst bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8435
friend bool operator==(const IndirectConst &, const IndirectConst &)
Definition acir.hpp:8414
Acir::MemoryAddress destination_pointer
Definition acir.hpp:2036
void msgpack_pack(auto &packer) const
Definition acir.hpp:1946
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8217
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1952
friend bool operator==(const Jump &, const Jump &)
Definition acir.hpp:8209
static Jump bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8224
void msgpack_pack(auto &packer) const
Definition acir.hpp:1923
Acir::MemoryAddress condition
Definition acir.hpp:1916
static JumpIf bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8176
friend bool operator==(const JumpIf &, const JumpIf &)
Definition acir.hpp:8158
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8169
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1930
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2173
static Load bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8710
Acir::MemoryAddress destination
Definition acir.hpp:2159
Acir::MemoryAddress source_pointer
Definition acir.hpp:2160
friend bool operator==(const Load &, const Load &)
Definition acir.hpp:8692
void msgpack_pack(auto &packer) const
Definition acir.hpp:2166
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8703
Acir::MemoryAddress destination
Definition acir.hpp:2105
friend bool operator==(const Mov &, const Mov &)
Definition acir.hpp:8579
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2119
static Mov bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8597
Acir::MemoryAddress source
Definition acir.hpp:2106
void msgpack_pack(auto &packer) const
Definition acir.hpp:2112
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8590
friend bool operator==(const Not &, const Not &)
Definition acir.hpp:8046
Acir::MemoryAddress source
Definition acir.hpp:1863
void msgpack_pack(auto &packer) const
Definition acir.hpp:1870
static Not bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8067
Acir::IntegerBitSize bit_size
Definition acir.hpp:1864
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8060
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1878
Acir::MemoryAddress destination
Definition acir.hpp:1862
friend bool operator==(const Return &, const Return &)
Definition acir.hpp:8471
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2068
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8476
void msgpack_pack(auto &packer) const
Definition acir.hpp:2067
static Return bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8483
friend bool operator==(const Stop &, const Stop &)
Definition acir.hpp:8887
static Stop bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8902
void msgpack_pack(auto &packer) const
Definition acir.hpp:2254
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8895
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2260
Acir::HeapVector return_data
Definition acir.hpp:2248
static Store bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8761
friend bool operator==(const Store &, const Store &)
Definition acir.hpp:8743
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2197
Acir::MemoryAddress source
Definition acir.hpp:2184
Acir::MemoryAddress destination_pointer
Definition acir.hpp:2183
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8754
void msgpack_pack(auto &packer) const
Definition acir.hpp:2190
friend bool operator==(const Trap &, const Trap &)
Definition acir.hpp:8841
void msgpack_pack(auto &packer) const
Definition acir.hpp:2233
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2239
Acir::HeapVector revert_data
Definition acir.hpp:2227
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8849
static Trap bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8856
static BrilligOpcode bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:7883
std::variant< BinaryFieldOp, BinaryIntOp, Not, Cast, JumpIf, Jump, CalldataCopy, Call, Const, IndirectConst, Return, ForeignCall, Mov, ConditionalMov, Load, Store, BlackBox, Trap, Stop > value
Definition acir.hpp:2287
friend bool operator==(const BrilligOpcode &, const BrilligOpcode &)
Definition acir.hpp:7868
void msgpack_pack(auto &packer) const
Definition acir.hpp:2293
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:7876
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2391
static Array bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9044
void msgpack_pack(auto &packer) const
Definition acir.hpp:3781
std::vector< Acir::Witness > value
Definition acir.hpp:3775
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9037
friend bool operator==(const Array &, const Array &)
Definition acir.hpp:9029
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3783
void msgpack_pack(auto &packer) const
Definition acir.hpp:3761
friend bool operator==(const Simple &, const Simple &)
Definition acir.hpp:8982
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3763
static Simple bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8997
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8990
friend bool operator==(const BrilligOutputs &, const BrilligOutputs &)
Definition acir.hpp:8933
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:8941
void msgpack_pack(auto &packer) const
Definition acir.hpp:3800
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3830
static BrilligOutputs bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:8948
std::variant< Simple, Array > value
Definition acir.hpp:3794
Acir::PublicInputs return_values
Definition acir.hpp:4504
static Circuit bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9108
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9101
void msgpack_pack(auto &packer) const
Definition acir.hpp:4511
std::vector< Acir::Opcode > opcodes
Definition acir.hpp:4501
friend bool operator==(const Circuit &, const Circuit &)
Definition acir.hpp:9075
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4523
uint32_t current_witness_index
Definition acir.hpp:4500
std::vector< Acir::Witness > private_parameters
Definition acir.hpp:4502
Acir::PublicInputs public_parameters
Definition acir.hpp:4503
std::string function_name
Definition acir.hpp:4499
std::vector< std::tuple< Acir::OpcodeLocation, Acir::AssertionPayload > > assert_messages
Definition acir.hpp:4505
static Expression bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9175
std::vector< std::tuple< std::vector< uint8_t >, Acir::Witness > > linear_combinations
Definition acir.hpp:3567
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9168
std::vector< uint8_t > q_c
Definition acir.hpp:3568
std::vector< std::tuple< std::vector< uint8_t >, Acir::Witness, Acir::Witness > > mul_terms
Definition acir.hpp:3566
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3582
void msgpack_pack(auto &packer) const
Definition acir.hpp:3574
friend bool operator==(const Expression &, const Expression &)
Definition acir.hpp:9154
void msgpack_pack(auto &packer) const
Definition acir.hpp:4207
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4209
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9271
static Expression bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9278
friend bool operator==(const Expression &, const Expression &)
Definition acir.hpp:9263
void msgpack_pack(auto &packer) const
Definition acir.hpp:4227
friend bool operator==(const Memory &, const Memory &)
Definition acir.hpp:9310
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9318
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4229
static Memory bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9325
std::variant< Expression, Memory > value
Definition acir.hpp:4240
void msgpack_pack(auto &packer) const
Definition acir.hpp:4246
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9221
static ExpressionOrMemory bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9228
friend bool operator==(const ExpressionOrMemory &, const ExpressionOrMemory &)
Definition acir.hpp:9213
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4276
void msgpack_pack(auto &packer) const
Definition acir.hpp:4624
friend bool operator==(const Bounded &, const Bounded &)
Definition acir.hpp:9447
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4630
static Bounded bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9462
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9455
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9411
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4614
static Unbounded bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9418
friend bool operator==(const Unbounded &, const Unbounded &)
Definition acir.hpp:9406
void msgpack_pack(auto &packer) const
Definition acir.hpp:4613
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9365
std::variant< Unbounded, Bounded > value
Definition acir.hpp:4638
void msgpack_pack(auto &packer) const
Definition acir.hpp:4644
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4674
friend bool operator==(const ExpressionWidth &, const ExpressionWidth &)
Definition acir.hpp:9357
static ExpressionWidth bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9372
std::vector< uint8_t > value
Definition acir.hpp:2625
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2633
static Constant bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9558
friend bool operator==(const Constant &, const Constant &)
Definition acir.hpp:9543
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9551
void msgpack_pack(auto &packer) const
Definition acir.hpp:2631
static Witness bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9605
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9598
void msgpack_pack(auto &packer) const
Definition acir.hpp:2651
friend bool operator==(const Witness &, const Witness &)
Definition acir.hpp:9590
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2653
static FunctionInput bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9509
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2700
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9502
void msgpack_pack(auto &packer) const
Definition acir.hpp:2670
std::variant< Constant, Witness > value
Definition acir.hpp:2664
friend bool operator==(const FunctionInput &, const FunctionInput &)
Definition acir.hpp:9494
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9648
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:9655
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:895
friend bool operator==(const HeapArray &, const HeapArray &)
Definition acir.hpp:9637
Acir::MemoryAddress pointer
Definition acir.hpp:881
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9797
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1508
static Array bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9804
void msgpack_pack(auto &packer) const
Definition acir.hpp:1501
friend bool operator==(const Array &, const Array &)
Definition acir.hpp:9786
std::vector< Acir::HeapValueType > value_types
Definition acir.hpp:1494
void msgpack_pack(auto &packer) const
Definition acir.hpp:1480
friend bool operator==(const Simple &, const Simple &)
Definition acir.hpp:9740
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9748
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1482
static Simple bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9755
static Vector bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9852
friend bool operator==(const Vector &, const Vector &)
Definition acir.hpp:9837
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1530
void msgpack_pack(auto &packer) const
Definition acir.hpp:1524
std::vector< Acir::HeapValueType > value_types
Definition acir.hpp:1518
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9845
static HeapValueType bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9706
void msgpack_pack(auto &packer) const
Definition acir.hpp:1544
friend bool operator==(const HeapValueType &, const HeapValueType &)
Definition acir.hpp:9691
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9699
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1578
std::variant< Simple, Array, Vector > value
Definition acir.hpp:1538
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:9901
friend bool operator==(const HeapVector &, const HeapVector &)
Definition acir.hpp:9883
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9894
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:10191
friend bool operator==(const U128 &, const U128 &)
Definition acir.hpp:10186
static U128 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10198
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:10071
friend bool operator==(const U16 &, const U16 &)
Definition acir.hpp:10066
static U16 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10078
void msgpack_pack(auto &packer) const
Definition acir.hpp:517
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:9991
static U1 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9998
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:9986
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10111
void msgpack_pack(auto &packer) const
Definition acir.hpp:526
friend bool operator==(const U32 &, const U32 &)
Definition acir.hpp:10106
static U32 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10118
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:527
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10151
static U64 bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10158
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:10146
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10031
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:10038
friend bool operator==(const U8 &, const U8 &)
Definition acir.hpp:10026
static IntegerBitSize bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:9952
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:600
friend bool operator==(const IntegerBitSize &, const IntegerBitSize &)
Definition acir.hpp:9937
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:9945
Acir::Expression value
Definition acir.hpp:3881
friend bool operator==(const MemOp &, const MemOp &)
Definition acir.hpp:10226
void msgpack_pack(auto &packer) const
Definition acir.hpp:3887
static MemOp bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10247
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3895
Acir::Expression operation
Definition acir.hpp:3879
Acir::Expression index
Definition acir.hpp:3880
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10240
static Direct bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10349
void msgpack_pack(auto &packer) const
Definition acir.hpp:763
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10342
friend bool operator==(const Direct &, const Direct &)
Definition acir.hpp:10334
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:10388
static Relative bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10395
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:785
friend bool operator==(const Relative &, const Relative &)
Definition acir.hpp:10380
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10293
static MemoryAddress bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10300
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:832
friend bool operator==(const MemoryAddress &, const MemoryAddress &)
Definition acir.hpp:10285
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:3914
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3916
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10484
Acir::Expression value
Definition acir.hpp:3908
static AssertZero bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10491
friend bool operator==(const AssertZero &, const AssertZero &)
Definition acir.hpp:10476
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10530
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3936
Acir::BlackBoxFuncCall value
Definition acir.hpp:3928
static BlackBoxFuncCall bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10537
friend bool operator==(const BlackBoxFuncCall &, const BlackBoxFuncCall &)
Definition acir.hpp:10522
void msgpack_pack(auto &packer) const
Definition acir.hpp:3934
std::optional< Acir::Expression > predicate
Definition acir.hpp:4002
friend bool operator==(const BrilligCall &, const BrilligCall &)
Definition acir.hpp:10675
static BrilligCall bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10699
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10692
std::vector< Acir::BrilligInputs > inputs
Definition acir.hpp:4000
void msgpack_pack(auto &packer) const
Definition acir.hpp:4008
std::vector< Acir::BrilligOutputs > outputs
Definition acir.hpp:4001
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4017
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4047
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10753
friend bool operator==(const Call &, const Call &)
Definition acir.hpp:10736
void msgpack_pack(auto &packer) const
Definition acir.hpp:4038
std::vector< Acir::Witness > outputs
Definition acir.hpp:4031
std::optional< Acir::Expression > predicate
Definition acir.hpp:4032
std::vector< Acir::Witness > inputs
Definition acir.hpp:4030
static Call bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10760
Acir::BlockId block_id
Definition acir.hpp:3972
static MemoryInit bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10640
std::vector< Acir::Witness > init
Definition acir.hpp:3973
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10633
Acir::BlockType block_type
Definition acir.hpp:3974
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3988
void msgpack_pack(auto &packer) const
Definition acir.hpp:3980
friend bool operator==(const MemoryInit &, const MemoryInit &)
Definition acir.hpp:10619
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10580
friend bool operator==(const MemoryOp &, const MemoryOp &)
Definition acir.hpp:10569
static MemoryOp bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10587
void msgpack_pack(auto &packer) const
Definition acir.hpp:3955
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:3962
Acir::BlockId block_id
Definition acir.hpp:3948
static Opcode bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10442
std::variant< AssertZero, BlackBoxFuncCall, MemoryOp, MemoryInit, BrilligCall, Call > value
Definition acir.hpp:4058
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4110
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10435
friend bool operator==(const Opcode &, const Opcode &)
Definition acir.hpp:10427
void msgpack_pack(auto &packer) const
Definition acir.hpp:4064
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4359
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10853
static Acir bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10860
friend bool operator==(const Acir &, const Acir &)
Definition acir.hpp:10845
void msgpack_pack(auto &packer) const
Definition acir.hpp:4357
friend bool operator==(const Brillig &, const Brillig &)
Definition acir.hpp:10891
void msgpack_pack(auto &packer) const
Definition acir.hpp:4378
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10902
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4385
static Brillig bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10909
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10804
friend bool operator==(const OpcodeLocation &, const OpcodeLocation &)
Definition acir.hpp:10796
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4430
static OpcodeLocation bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10811
std::variant< Acir, Brillig > value
Definition acir.hpp:4394
void msgpack_pack(auto &packer) const
Definition acir.hpp:4400
void msgpack_pack(auto &packer) const
Definition acir.hpp:4569
std::vector< Acir::Circuit > functions
Definition acir.hpp:4562
friend bool operator==(const Program &, const Program &)
Definition acir.hpp:10943
static Program bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:10961
std::vector< Acir::BrilligBytecode > unconstrained_functions
Definition acir.hpp:4563
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:10954
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4576
void msgpack_pack(auto &packer) const
Definition acir.hpp:4592
std::vector< Acir::Circuit > functions
Definition acir.hpp:4586
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4598
static ProgramWithoutBrillig bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11013
friend bool operator==(const ProgramWithoutBrillig &, const ProgramWithoutBrillig &)
Definition acir.hpp:10998
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11006
friend bool operator==(const PublicInputs &, const PublicInputs &)
Definition acir.hpp:11048
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11056
static PublicInputs bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11063
std::vector< Acir::Witness > value
Definition acir.hpp:4479
void msgpack_pack(auto &packer) const
Definition acir.hpp:4485
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:4487
static HeapArray bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11208
void msgpack_pack(auto &packer) const
Definition acir.hpp:1665
friend bool operator==(const HeapArray &, const HeapArray &)
Definition acir.hpp:11193
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1667
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11201
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1687
void msgpack_pack(auto &packer) const
Definition acir.hpp:1685
friend bool operator==(const HeapVector &, const HeapVector &)
Definition acir.hpp:11240
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11248
static HeapVector bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11255
void msgpack_pack(auto &packer) const
Definition acir.hpp:1645
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11154
static MemoryAddress bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11161
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1647
friend bool operator==(const MemoryAddress &, const MemoryAddress &)
Definition acir.hpp:11146
Acir::MemoryAddress value
Definition acir.hpp:1639
void msgpack_pack(auto &packer) const
Definition acir.hpp:1704
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:1738
std::variant< MemoryAddress, HeapArray, HeapVector > value
Definition acir.hpp:1698
static ValueOrArray bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11112
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11105
friend bool operator==(const ValueOrArray &, const ValueOrArray &)
Definition acir.hpp:11097
uint32_t value
Definition acir.hpp:2603
void msgpack_pack(auto &packer) const
Definition acir.hpp:2609
void msgpack_unpack(msgpack::object const &o)
Definition acir.hpp:2611
static Witness bincodeDeserialize(std::vector< uint8_t >)
Definition acir.hpp:11302
friend bool operator==(const Witness &, const Witness &)
Definition acir.hpp:11287
std::vector< uint8_t > bincodeSerialize() const
Definition acir.hpp:11295
static T deserialize(Deserializer &deserializer)
static void serialize(const T &value, Serializer &serializer)
void throw_or_abort(std::string const &err)