diff --git a/libs/blueprint b/libs/blueprint index 541f2d3..e623116 160000 --- a/libs/blueprint +++ b/libs/blueprint @@ -1 +1 @@ -Subproject commit 541f2d3857690aefc0c9295e848e89797009e3b3 +Subproject commit e62311622e1ead03fb053c01623dcf22431f4ab8 diff --git a/mlir-assigner/include/mlir-assigner/components/handle_component.hpp b/mlir-assigner/include/mlir-assigner/components/handle_component.hpp index 036c8d0..bc93c05 100644 --- a/mlir-assigner/include/mlir-assigner/components/handle_component.hpp +++ b/mlir-assigner/include/mlir-assigner/components/handle_component.hpp @@ -26,6 +26,7 @@ #ifndef CRYPTO3_ASSIGNER_HANDLE_COMPONENT_HPP #define CRYPTO3_ASSIGNER_HANDLE_COMPONENT_HPP +#include #include #include #include @@ -88,8 +89,7 @@ namespace nil { using var = crypto3::zk::snark::plonk_variable; - std::vector all_vars = instance_input.all_vars(); - std::vector> input(all_vars.begin(), all_vars.end()); + std::vector> input = instance_input.all_vars(); const auto &used_rows = assignment.get_used_rows(); for (auto &v : input) { diff --git a/mlir-assigner/src/main.cpp b/mlir-assigner/src/main.cpp index c751424..d631455 100644 --- a/mlir-assigner/src/main.cpp +++ b/mlir-assigner/src/main.cpp @@ -64,18 +64,6 @@ using namespace nil; using namespace nil::crypto3; using namespace nil::blueprint; -template -void print_hex_byteblob(std::ostream &os, TIter iter_begin, TIter iter_end, bool endl) { - os << "0x" << std::hex; - for (TIter it = iter_begin; it != iter_end; it++) { - os << std::setfill('0') << std::setw(2) << std::right << int(*it); - } - os << std::dec; - if (endl) { - os << std::endl; - } -} - template void print_circuit(const circuit_proxy &circuit_proxy, const assignment_proxy &table_proxy, bool rename_required, @@ -162,7 +150,7 @@ void print_circuit(const circuit_proxy &circuit_proxy, cv.resize(filled_val.length(), 0x00); auto write_iter = cv.begin(); nil::marshalling::status_type status = filled_val.write(write_iter, cv.size()); - print_hex_byteblob(out, cv.cbegin(), cv.cend(), false); + out.write(reinterpret_cast(cv.data()), cv.size()); } enum class print_table_kind { PRIVATE, SHARED, FULL }; @@ -346,7 +334,7 @@ void print_assignment_table(const assignment_proxy &table_p cv.resize(filled_val.length(), 0x00); auto write_iter = cv.begin(); nil::marshalling::status_type status = filled_val.write(write_iter, cv.size()); - print_hex_byteblob(out, cv.cbegin(), cv.cend(), false); + out.write(reinterpret_cast(cv.data()), cv.size()); } template @@ -443,7 +431,7 @@ int curve_dependent_main(std::string bytecode_file_name, std::string public_inpu // print full table if (parser_instance.assignments.size() == 1) { std::ofstream otable; - otable.open(assignment_table_file_name); + otable.open(assignment_table_file_name, std::ios_base::binary | std::ios_base::out); if (!otable) { std::cout << "Something wrong with output " << assignment_table_file_name << std::endl; return 1; @@ -457,7 +445,7 @@ int curve_dependent_main(std::string bytecode_file_name, std::string public_inpu } else if (parser_instance.assignments.size() > 1) { for (const auto &it : parser_instance.assignments) { std::ofstream otable; - otable.open(assignment_table_file_name + std::to_string(it.get_id())); + otable.open(assignment_table_file_name + std::to_string(it.get_id()), std::ios_base::binary | std::ios_base::out); if (!otable) { std::cout << "Something wrong with output " << assignment_table_file_name + std::to_string(it.get_id()) << std::endl; @@ -476,7 +464,7 @@ int curve_dependent_main(std::string bytecode_file_name, std::string public_inpu std::ofstream ocircuit; std::string file_name = parser_instance.circuits.size() > 1 ? circuit_file_name + std::to_string(it.get_id()) : circuit_file_name; - ocircuit.open(file_name); + ocircuit.open(file_name, std::ios_base::binary | std::ios_base::out); if (!ocircuit) { std::cout << "Something wrong with output " << file_name << std::endl; return 1;