@@ -480,7 +480,7 @@ int curve_dependent_main(std::string bytecode_file_name,
480480
481481 ASSERT_MSG (!assigner_instance.assignments .empty () && !assigner_instance.circuits .empty (), " Not found any proxy for prover" );
482482
483- if (std::uint8_t ( gen_mode & nil::blueprint::generation_mode::SIZE_ESTIMATION )) {
483+ if (gen_mode. has_size_estimation ( )) {
484484 return 0 ;
485485 }
486486
@@ -508,7 +508,7 @@ int curve_dependent_main(std::string bytecode_file_name,
508508 ASSERT_MSG (assigner_instance.assignments .size () == assigner_instance.circuits .size (), " Missmatch assignments circuits size" );
509509 if (assigner_instance.assignments .size () == 1 && (target_prover == 0 || target_prover == invalid_target_prover)) {
510510 // print assignment table
511- if (std::uint8_t ( gen_mode & nil::blueprint::generation_mode::ASSIGNMENTS )) {
511+ if (gen_mode. has_assignments ( )) {
512512 std::ofstream otable;
513513 otable.open (assignment_table_file_name, std::ios_base::binary | std::ios_base::out);
514514 if (!otable) {
@@ -524,7 +524,7 @@ int curve_dependent_main(std::string bytecode_file_name,
524524 }
525525
526526 // print circuit
527- if (std::uint8_t ( gen_mode & nil::blueprint::generation_mode::CIRCUIT )) {
527+ if (gen_mode. has_circuit ( )) {
528528 std::ofstream ocircuit;
529529 ocircuit.open (circuit_file_name, std::ios_base::binary | std::ios_base::out);
530530 if (!ocircuit) {
@@ -542,7 +542,7 @@ int curve_dependent_main(std::string bytecode_file_name,
542542 std::uint32_t end_idx = (target_prover == invalid_target_prover) ? assigner_instance.assignments .size () : target_prover + 1 ;
543543 for (std::uint32_t idx = start_idx; idx < end_idx; idx++) {
544544 // print assignment table
545- if (std::uint8_t ( gen_mode & nil::blueprint::generation_mode::ASSIGNMENTS )) {
545+ if (gen_mode. has_assignments ( )) {
546546 std::ofstream otable;
547547 otable.open (assignment_table_file_name + std::to_string (idx),
548548 std::ios_base::binary | std::ios_base::out);
@@ -560,7 +560,7 @@ int curve_dependent_main(std::string bytecode_file_name,
560560 }
561561
562562 // print circuit
563- if (std::uint8_t ( gen_mode & nil::blueprint::generation_mode::CIRCUIT )) {
563+ if (gen_mode. has_circuit ( )) {
564564 std::ofstream ocircuit;
565565 ocircuit.open (circuit_file_name + std::to_string (idx), std::ios_base::binary | std::ios_base::out);
566566 if (!ocircuit) {
@@ -581,12 +581,12 @@ int curve_dependent_main(std::string bytecode_file_name,
581581 return 1 ;
582582 }
583583
584- if (check_validity && ( std::uint8_t ( gen_mode & nil::blueprint::generation_mode::ASSIGNMENTS ) && std::uint8_t ( gen_mode & nil::blueprint::generation_mode::CIRCUIT))) {
584+ if (check_validity && gen_mode. has_assignments ( ) && gen_mode. has_circuit ()) {
585585 if (assigner_instance.assignments .size () == 1 && (target_prover == 0 || target_prover == invalid_target_prover)) {
586586 ASSERT_MSG (nil::blueprint::is_satisfied (assigner_instance.circuits [0 ].get (), assigner_instance.assignments [0 ].get ()),
587587 " The circuit is not satisfied" );
588588 } else if (assigner_instance.assignments .size () > 1 &&
589- (target_prover < parser_instance .assignments .size () || target_prover == invalid_target_prover)) {
589+ (target_prover < assigner_instance .assignments .size () || target_prover == invalid_target_prover)) {
590590 // check only for target prover if set
591591 std::uint32_t start_idx = (target_prover == invalid_target_prover) ? 0 : target_prover;
592592 std::uint32_t end_idx = (target_prover == invalid_target_prover) ? assigner_instance.assignments .size () : target_prover + 1 ;
@@ -682,31 +682,31 @@ int main(int argc, char *argv[]) {
682682 return 1 ;
683683 }
684684
685- nil::blueprint::generation_mode gen_mode = nil::blueprint::generation_mode::ASSIGNMENTS | nil::blueprint::generation_mode::CIRCUIT ;
685+ nil::blueprint::generation_mode gen_mode = nil::blueprint::generation_mode::assignments () | nil::blueprint::generation_mode::circuit () ;
686686 if (vm.count (" generate-type" )) {
687687 const auto generate_type = vm[" generate-type" ].as <std::string>();
688688 if (generate_type == " circuit" ) {
689- gen_mode = nil::blueprint::generation_mode::CIRCUIT ;
689+ gen_mode = nil::blueprint::generation_mode::circuit () ;
690690 } else if (generate_type == " assignment" ) {
691- gen_mode = nil::blueprint::generation_mode::ASSIGNMENTS ;
691+ gen_mode = nil::blueprint::generation_mode::assignments () ;
692692 } else if (generate_type == " size_estimation" ) {
693- gen_mode = nil::blueprint::generation_mode::SIZE_ESTIMATION ;
693+ gen_mode = nil::blueprint::generation_mode::size_estimation () ;
694694 } else if (generate_type == " public-input-column" ) {
695- gen_mode = nil::blueprint::generation_mode::PUBLIC_INPUT_COLUMN ;
695+ gen_mode = nil::blueprint::generation_mode::public_input_column () ;
696696 } else if (generate_type != " circuit-assignment" ) {
697697 std::cerr << " Invalid command line argument - generate-type. " << generate_type << " is wrong value." << std::endl;
698698 std::cout << options_desc << std::endl;
699699 return 1 ;
700700 }
701701 }
702702
703- if (!vm.count (" public-input" ) && !vm.count (" private-input" ) && std::uint8_t ( gen_mode & nil::blueprint::generation_mode::ASSIGNMENTS )) {
703+ if (!vm.count (" public-input" ) && !vm.count (" private-input" ) && gen_mode. has_assignments ( )) {
704704 std::cerr << " Both public and private input file names are not specified" << std::endl;
705705 std::cout << options_desc << std::endl;
706706 return 1 ;
707707 }
708708
709- if (std::uint8_t ( gen_mode & nil::blueprint::generation_mode::PUBLIC_INPUT_COLUMN )) {
709+ if (gen_mode. has_public_input_column ( )) {
710710 if (vm.count (" input-column" )) {
711711 processed_public_input_file_name = vm[" input-column" ].as <std::string>();
712712 } else {
@@ -723,7 +723,7 @@ int main(int argc, char *argv[]) {
723723 public_input_file_name = vm[" public-input" ].as <std::string>();
724724 }
725725
726- if (std::uint8_t ( gen_mode & nil::blueprint::generation_mode::ASSIGNMENTS )) {
726+ if (gen_mode. has_assignments ( )) {
727727 if (vm.count (" assignment-table" )) {
728728 assignment_table_file_name = vm[" assignment-table" ].as <std::string>();
729729 } else {
@@ -733,7 +733,7 @@ int main(int argc, char *argv[]) {
733733 }
734734 }
735735
736- if (std::uint8_t ( gen_mode & nil::blueprint::generation_mode::CIRCUIT )) {
736+ if (gen_mode. has_circuit ( )) {
737737 if (vm.count (" circuit" )) {
738738 circuit_file_name = vm[" circuit" ].as <std::string>();
739739 } else {
0 commit comments