diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index a4566c3fd..ea8897443 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -327,11 +327,11 @@ jobs: always() && !cancelled() && (needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') && needs.build-and-test-linux.result == 'success' - uses: NilFoundation/proof-producer/.github/workflows/reusable-generate-proofs-linux.yml@ef8cd9152b4bec871e7efdc1d6b606e445bad274 + uses: NilFoundation/proof-producer/.github/workflows/reusable-generate-proofs-linux.yml@f450e9219b0b77fa32ce27c5e9a9d9144cc577dd with: artifact-name: ${{ needs.build-and-test-linux.outputs.examples-artifact-name }} # Update next line if you need new version of proof producer - proof-producer-ref: ef8cd9152b4bec871e7efdc1d6b606e445bad274 + proof-producer-ref: f450e9219b0b77fa32ce27c5e9a9d9144cc577dd refs: ${{ needs.handle-syncwith.outputs.prs-refs }} targets: ${{ needs.build-and-test-linux.outputs.prover-targets }} diff --git a/bin/assigner/src/main.cpp b/bin/assigner/src/main.cpp index 07e423603..1d8a1e180 100644 --- a/bin/assigner/src/main.cpp +++ b/bin/assigner/src/main.cpp @@ -65,6 +65,9 @@ #include #include #include +#include + +#include "../../table_packing.hpp" using namespace nil; using namespace nil::crypto3; @@ -228,113 +231,36 @@ void print_vector_value( } } - template -void print_assignment_table(const assignment_proxy &table_proxy, +void print_selectors(const assignment_proxy &table_proxy, print_table_kind print_kind, - std::uint32_t ComponentConstantColumns, std::uint32_t ComponentSelectorColumns, + std::size_t padded_rows_amount, + std::uint32_t ComponentSelectorColumns, std::ostream &out = std::cout) { - using AssignmentTableType = assignment_proxy; - std::uint32_t usable_rows_amount; - std::uint32_t total_columns; - std::uint32_t total_size; - std::uint32_t shared_size = (print_kind == print_table_kind::MULTI_PROVER) ? 1 : 0; - std::uint32_t public_input_size = table_proxy.public_inputs_amount(); - std::uint32_t witness_size = table_proxy.witnesses_amount(); - std::uint32_t constant_size = table_proxy.constants_amount(); std::uint32_t selector_size = table_proxy.selectors_amount(); - const auto lookup_constant_cols = table_proxy.get_lookup_constant_cols(); - const auto lookup_selector_cols = table_proxy.get_lookup_selector_cols(); - - std::uint32_t max_public_inputs_size = 0; - std::uint32_t max_constant_size = 0; - std::uint32_t max_selector_size = 0; - - for (std::uint32_t i = 0; i < public_input_size; i++) { - max_public_inputs_size = std::max(max_public_inputs_size, table_proxy.public_input_column_size(i)); - } - - if (print_kind == print_table_kind::MULTI_PROVER) { - total_columns = witness_size + shared_size + public_input_size + constant_size + selector_size; - std::uint32_t max_shared_size = 0; - for (std::uint32_t i = 0; i < shared_size; i++) { - max_shared_size = std::max(max_shared_size, table_proxy.shared_column_size(i)); - } - for (const auto &i : lookup_constant_cols) { - max_constant_size = std::max(max_constant_size, table_proxy.constant_column_size(i)); - } - for (const auto &i : lookup_selector_cols) { - max_selector_size = std::max(max_selector_size, table_proxy.selector_column_size(i)); - } - usable_rows_amount = table_proxy.get_used_rows().size(); - usable_rows_amount = std::max({usable_rows_amount, max_shared_size, max_public_inputs_size, max_constant_size, max_selector_size}); - } else { // SINGLE_PROVER - total_columns = witness_size + shared_size + public_input_size + constant_size + selector_size; - std::uint32_t max_witness_size = 0; - for (std::uint32_t i = 0; i < witness_size; i++) { - max_witness_size = std::max(max_witness_size, table_proxy.witness_column_size(i)); - } - for (std::uint32_t i = 0; i < constant_size; i++) { - max_constant_size = std::max(max_constant_size, table_proxy.constant_column_size(i)); - } - for (std::uint32_t i = 0; i < selector_size; i++) { - max_selector_size = std::max(max_selector_size, table_proxy.selector_column_size(i)); - } - usable_rows_amount = std::max({max_witness_size, max_public_inputs_size, max_constant_size, max_selector_size}); - } - - std::uint32_t padded_rows_amount = std::pow(2, std::ceil(std::log2(usable_rows_amount))); - if (padded_rows_amount == usable_rows_amount) { - padded_rows_amount *= 2; - } - if (padded_rows_amount < 8) { - padded_rows_amount = 8; - } - total_size = padded_rows_amount * total_columns; - - using TTypeBase = nil::marshalling::field_type; - using table_value_marshalling_type = - nil::crypto3::marshalling::types::plonk_assignment_table; using column_type = typename crypto3::zk::snark::plonk_column; - print_size_t(witness_size, out); - print_size_t(public_input_size + shared_size, out); - print_size_t(constant_size, out); - print_size_t(selector_size, out); - print_size_t(usable_rows_amount, out); - print_size_t(padded_rows_amount, out); - - if (print_kind == print_table_kind::SINGLE_PROVER) { - print_size_t(witness_size * padded_rows_amount, out); - for (std::uint32_t i = 0; i < witness_size; i++) { - print_vector_value(padded_rows_amount, table_proxy.witness(i), out); - } - print_size_t((public_input_size + shared_size) * padded_rows_amount, out); - for (std::uint32_t i = 0; i < public_input_size; i++) { - print_vector_value(padded_rows_amount, table_proxy.public_input(i), out); - } - print_size_t(constant_size * padded_rows_amount, out); - for (std::uint32_t i = 0; i < constant_size; i++) { - print_vector_value(padded_rows_amount, table_proxy.constant(i), out); - } print_size_t(selector_size * padded_rows_amount, out); + if (print_kind == print_table_kind::SINGLE_PROVER) { for (std::uint32_t i = 0; i < selector_size; i++) { print_vector_value(padded_rows_amount, table_proxy.selector(i), out); } } else { const auto& rows = table_proxy.get_used_rows(); const auto& selector_rows = table_proxy.get_used_selector_rows(); - std::uint32_t witness_idx = 0; - // witness - print_size_t(witness_size * padded_rows_amount, out); - for( std::size_t i = 0; i < witness_size; i++ ){ - const auto column_size = table_proxy.witness_column_size(i); + std::uint32_t selector_idx = 0; + for (std::uint32_t i = 0; i < ComponentSelectorColumns; i++) { + const auto column_size = table_proxy.selector_column_size(i); std::uint32_t offset = 0; for(const auto& j : rows){ if (j < column_size) { - print_field(table_proxy.witness(i, j), out); + if (selector_rows.find(j) != selector_rows.end()) { + print_field(table_proxy.selector(i, j), out); + } else { + print_zero_field(out); + } offset++; } } @@ -343,21 +269,34 @@ void print_assignment_table(const assignment_proxy &table_p print_zero_field(out); offset++; } - witness_idx += padded_rows_amount; + + selector_idx += padded_rows_amount; } - // public input - std::uint32_t pub_inp_idx = 0; - print_size_t((public_input_size + shared_size) * padded_rows_amount, out); - for (std::uint32_t i = 0; i < public_input_size; i++) { - print_vector_value(padded_rows_amount, table_proxy.public_input(i), out); - pub_inp_idx += padded_rows_amount; + + for (std::uint32_t i = ComponentSelectorColumns; i < selector_size; i++) { + print_vector_value(padded_rows_amount, table_proxy.selector(i), out); + selector_idx += padded_rows_amount; } - for (std::uint32_t i = 0; i < shared_size; i++) { - print_vector_value(padded_rows_amount, table_proxy.shared(i), out); - pub_inp_idx += padded_rows_amount; + } +} + +template +void print_constants(const assignment_proxy &table_proxy, + print_table_kind print_kind, + std::size_t padded_rows_amount, + std::uint32_t ComponentConstantColumns, + std::ostream &out = std::cout) { + std::uint32_t constant_size = table_proxy.constants_amount(); + + using column_type = typename crypto3::zk::snark::plonk_column; + + print_size_t(constant_size * padded_rows_amount, out); + if (print_kind == print_table_kind::SINGLE_PROVER) { + for (std::uint32_t i = 0; i < constant_size; i++) { + print_vector_value(padded_rows_amount, table_proxy.constant(i), out); } - // constant - print_size_t(constant_size * padded_rows_amount, out); + } else { + const auto& rows = table_proxy.get_used_rows(); std::uint32_t constant_idx = 0; for (std::uint32_t i = 0; i < ComponentConstantColumns; i++) { const auto column_size = table_proxy.constant_column_size(i); @@ -381,20 +320,61 @@ void print_assignment_table(const assignment_proxy &table_p print_vector_value(padded_rows_amount, table_proxy.constant(i), out); constant_idx += padded_rows_amount; } + } +} - // selector - print_size_t(selector_size * padded_rows_amount, out); - std::uint32_t selector_idx = 0; - for (std::uint32_t i = 0; i < ComponentSelectorColumns; i++) { - const auto column_size = table_proxy.selector_column_size(i); +template +void print_pub_inp(const assignment_proxy &table_proxy, + print_table_kind print_kind, + std::size_t padded_rows_amount, + std::ostream &out = std::cout) { + std::uint32_t shared_size = (print_kind == print_table_kind::MULTI_PROVER) ? 1 : 0; + std::uint32_t public_input_size = table_proxy.public_inputs_amount(); + + using column_type = typename crypto3::zk::snark::plonk_column; + + print_size_t((public_input_size + shared_size) * padded_rows_amount, out); + if (print_kind == print_table_kind::SINGLE_PROVER) { + for (std::uint32_t i = 0; i < public_input_size; i++) { + print_vector_value(padded_rows_amount, table_proxy.public_input(i), out); + } + } else { + + std::uint32_t pub_inp_idx = 0; + for (std::uint32_t i = 0; i < public_input_size; i++) { + print_vector_value(padded_rows_amount, table_proxy.public_input(i), out); + pub_inp_idx += padded_rows_amount; + } + for (std::uint32_t i = 0; i < shared_size; i++) { + print_vector_value(padded_rows_amount, table_proxy.shared(i), out); + pub_inp_idx += padded_rows_amount; + } + } +} + +template +void print_witness(const assignment_proxy &table_proxy, + print_table_kind print_kind, + std::size_t padded_rows_amount, + std::ostream &out = std::cout) { + std::uint32_t witness_size = table_proxy.witnesses_amount(); + + using column_type = typename crypto3::zk::snark::plonk_column; + + print_size_t(witness_size * padded_rows_amount, out); + if (print_kind == print_table_kind::SINGLE_PROVER) { + for (std::uint32_t i = 0; i < witness_size; i++) { + print_vector_value(padded_rows_amount, table_proxy.witness(i), out); + } + } else { + const auto& rows = table_proxy.get_used_rows(); + std::uint32_t witness_idx = 0; + for( std::size_t i = 0; i < witness_size; i++ ){ + const auto column_size = table_proxy.witness_column_size(i); std::uint32_t offset = 0; for(const auto& j : rows){ if (j < column_size) { - if (selector_rows.find(j) != selector_rows.end()) { - print_field(table_proxy.selector(i, j), out); - } else { - print_zero_field(out); - } + print_field(table_proxy.witness(i, j), out); offset++; } } @@ -403,18 +383,192 @@ void print_assignment_table(const assignment_proxy &table_p print_zero_field(out); offset++; } - - selector_idx += padded_rows_amount; + witness_idx += padded_rows_amount; } + } +} - for (std::uint32_t i = ComponentSelectorColumns; i < selector_size; i++) { - print_vector_value(padded_rows_amount, table_proxy.selector(i), out); - selector_idx += padded_rows_amount; + + +template +std::uint32_t padded_rows_from_table_header( + const assignment_proxy &table_proxy, + print_table_kind print_kind, + std::string assignment_table_file_name, + std::uint32_t idx +) { + if (print_kind == print_table_kind::MULTI_PROVER) { + assignment_table_file_name = assignment_table_file_name + std::to_string(idx); + } + + using TTypeBase = nil::marshalling::field_type; + using table_header_marshalling_type = nil::crypto3::marshalling::types::table_header_type; + + table_header_marshalling_type marshalled_table_header; + extract_from_binary_file(marshalled_table_header, "header_", assignment_table_file_name); + + std::uint32_t padded_rows_amount = std::get<5>(marshalled_table_header.value()).value(); + return padded_rows_amount; +} + +template +void print_assignment_table_dynamic( + std::uint32_t padded_rows_amount, + const assignment_proxy &table_proxy, + print_table_kind print_kind, + std::string assignment_table_file_name, + std::uint32_t idx +) { + + if (print_kind == print_table_kind::MULTI_PROVER) { + assignment_table_file_name = assignment_table_file_name + std::to_string(idx); + } + + std::ofstream otable_witness; + std::ofstream otable_pub_inp; + + otable_witness.open(add_filename_prefix("witness_", assignment_table_file_name), std::ios_base::binary | std::ios_base::out); + if (!otable_witness) { + throw std::runtime_error("Something wrong with output " + add_filename_prefix("witness_", assignment_table_file_name)); + } + otable_pub_inp.open(add_filename_prefix("pub_inp_", assignment_table_file_name), std::ios_base::binary | std::ios_base::out); + if (!otable_pub_inp) { + throw std::runtime_error("Something wrong with output " + add_filename_prefix("pub_inp_", assignment_table_file_name)); + } + + print_witness(table_proxy, print_kind, padded_rows_amount, otable_witness); + print_pub_inp(table_proxy, print_kind, padded_rows_amount, otable_pub_inp); +} + +struct table_parameters_struct { + std::uint32_t witness_size; + std::uint32_t public_input_size; + std::uint32_t shared_size; + std::uint32_t constant_size; + std::uint32_t selector_size; + std::uint32_t usable_rows_amount; + std::uint32_t padded_rows_amount; +}; + + +template +table_parameters_struct extract_table_parameters_from_table( + const assignment_proxy &table_proxy, + print_table_kind print_kind +) { + + std::uint32_t usable_rows_amount; + std::uint32_t total_columns; + std::uint32_t total_size; + std::uint32_t shared_size = (print_kind == print_table_kind::MULTI_PROVER) ? 1 : 0; + std::uint32_t public_input_size = table_proxy.public_inputs_amount(); + std::uint32_t witness_size = table_proxy.witnesses_amount(); + std::uint32_t constant_size = table_proxy.constants_amount(); + std::uint32_t selector_size = table_proxy.selectors_amount(); + const auto lookup_constant_cols = table_proxy.get_lookup_constant_cols(); + const auto lookup_selector_cols = table_proxy.get_lookup_selector_cols(); + + std::uint32_t max_public_inputs_size = 0; + std::uint32_t max_constant_size = 0; + std::uint32_t max_selector_size = 0; + + for (std::uint32_t i = 0; i < public_input_size; i++) { + max_public_inputs_size = std::max(max_public_inputs_size, table_proxy.public_input_column_size(i)); + } + + if (print_kind == print_table_kind::MULTI_PROVER) { + total_columns = witness_size + shared_size + public_input_size + constant_size + selector_size; + std::uint32_t max_shared_size = 0; + for (std::uint32_t i = 0; i < shared_size; i++) { + max_shared_size = std::max(max_shared_size, table_proxy.shared_column_size(i)); + } + for (const auto &i : lookup_constant_cols) { + max_constant_size = std::max(max_constant_size, table_proxy.constant_column_size(i)); + } + for (const auto &i : lookup_selector_cols) { + max_selector_size = std::max(max_selector_size, table_proxy.selector_column_size(i)); } - ASSERT_MSG(witness_idx + pub_inp_idx + constant_idx + selector_idx == total_size, "Printed index not equal required assignment size" ); + usable_rows_amount = table_proxy.get_used_rows().size(); + usable_rows_amount = std::max({usable_rows_amount, max_shared_size, max_public_inputs_size, max_constant_size, max_selector_size}); + } else { // SINGLE_PROVER + total_columns = witness_size + shared_size + public_input_size + constant_size + selector_size; + std::uint32_t max_witness_size = 0; + for (std::uint32_t i = 0; i < witness_size; i++) { + max_witness_size = std::max(max_witness_size, table_proxy.witness_column_size(i)); + } + for (std::uint32_t i = 0; i < constant_size; i++) { + max_constant_size = std::max(max_constant_size, table_proxy.constant_column_size(i)); + } + for (std::uint32_t i = 0; i < selector_size; i++) { + max_selector_size = std::max(max_selector_size, table_proxy.selector_column_size(i)); + } + usable_rows_amount = std::max({max_witness_size, max_public_inputs_size, max_constant_size, max_selector_size}); + } + + std::uint32_t padded_rows_amount = std::pow(2, std::ceil(std::log2(usable_rows_amount))); + if (padded_rows_amount == usable_rows_amount) { + padded_rows_amount *= 2; + } + if (padded_rows_amount < 8) { + padded_rows_amount = 8; } + + return { + witness_size, + public_input_size, + shared_size, + constant_size, + selector_size, + usable_rows_amount, + padded_rows_amount + }; } + +template +void print_assignment_table_static( + table_parameters_struct table_parameters, + const assignment_proxy &table_proxy, + print_table_kind print_kind, + std::uint32_t ComponentConstantColumns, std::uint32_t ComponentSelectorColumns, + std::string assignment_table_file_name, + std::string circuit_file_name, + std::uint32_t idx + ) { + + if (print_kind == print_table_kind::MULTI_PROVER) { + assignment_table_file_name = assignment_table_file_name + std::to_string(idx); + } + + std::ofstream otable_header; + std::ofstream otable_constants; + std::ofstream otable_selectors; + + otable_header.open(add_filename_prefix("header_", assignment_table_file_name), std::ios_base::binary | std::ios_base::out); + if (!otable_header) + throw std::runtime_error("Something wrong with output " + add_filename_prefix("header_", assignment_table_file_name)); + otable_constants.open(add_filename_prefix("constants_", circuit_file_name), std::ios_base::binary | std::ios_base::out); + if (!otable_constants) + throw std::runtime_error("Something wrong with output " + add_filename_prefix("constants_", circuit_file_name)); + otable_selectors.open(add_filename_prefix("selectors_", circuit_file_name), std::ios_base::binary | std::ios_base::out); + if (!otable_selectors) + throw std::runtime_error("Something wrong with output " + add_filename_prefix("selectors_", circuit_file_name)); + + + using AssignmentTableType = assignment_proxy; + + print_size_t(table_parameters.witness_size, otable_header); + print_size_t(table_parameters.public_input_size + table_parameters.shared_size, otable_header); + print_size_t(table_parameters.constant_size, otable_header); + print_size_t(table_parameters.selector_size, otable_header); + print_size_t(table_parameters.usable_rows_amount, otable_header); + print_size_t(table_parameters.padded_rows_amount, otable_header); + + print_constants(table_proxy, print_kind, table_parameters.padded_rows_amount, ComponentConstantColumns, otable_constants); + print_selectors(table_proxy, print_kind, table_parameters.padded_rows_amount, ComponentSelectorColumns, otable_selectors); + } + + bool read_json( std::string input_file_name, boost::json::value &input_json_value @@ -461,24 +615,19 @@ struct ParametersPolicy { template void assignment_table_printer( + std::uint32_t padded_rows_amount, std::string assignment_table_file_name, std::uint32_t idx, - nil::blueprint::assigner &assigner_instance, - const std::size_t &ComponentConstantColumns, - const std::size_t &ComponentSelectorColumns + nil::blueprint::assigner &assigner_instance ) { - std::ofstream otable; - otable.open(assignment_table_file_name + std::to_string(idx), - std::ios_base::binary | std::ios_base::out); - if (!otable) { - throw std::runtime_error("Failed to open file: " + assignment_table_file_name + std::to_string(idx)); - } - - print_assignment_table( - assigner_instance.assignments[idx], print_table_kind::MULTI_PROVER, ComponentConstantColumns, - ComponentSelectorColumns, otable); - otable.close(); + print_assignment_table_dynamic( + padded_rows_amount, + assigner_instance.assignments[idx], + print_table_kind::MULTI_PROVER, + assignment_table_file_name, + idx + ); } template @@ -500,6 +649,8 @@ int curve_dependent_main(std::string bytecode_file_name, std::array column_sizes ) { + ASSERT_MSG(!(check_validity && gen_mode.has_fast_tbl()), "validity check does not work in fast table generation mode!"); + const std::size_t ComponentConstantColumns = column_sizes[2]; const std::size_t LookupConstantColumns = column_sizes[3]; const std::size_t ComponentSelectorColumns = column_sizes[4]; @@ -520,6 +671,11 @@ int curve_dependent_main(std::string bytecode_file_name, crypto3::zk::snark::plonk_constraint_system; using AssignmentTableType = zk::snark::plonk_table>; + using Endianness = nil::marshalling::option::big_endian; + using TTypeBase = nil::marshalling::field_type; + using constants_marshalling_type = nil::crypto3::marshalling::types::one_column_type_marshalling_type; + using table_header_marshalling_type = nil::crypto3::marshalling::types::table_header_type; + boost::json::value public_input_json_value; if(public_input_file_name.empty()) { public_input_json_value = boost::json::array(); @@ -534,6 +690,52 @@ int curve_dependent_main(std::string bytecode_file_name, return 1; } + using var = crypto3::zk::snark::plonk_variable; + + std::vector> table_pieces = {}; // we create table pieces in any case and pass into assigner by reference + std::vector> all_used_rows; + int provers_amount; + std::vector> to_be_shared; + + if (gen_mode.has_fast_tbl()) { // if we are generating tables in a fast way then need to parse table_pieces from file + + std::ifstream inp_json(add_filename_prefix("table_pieces_", circuit_file_name)); + + if (!inp_json.is_open()) { + std::cerr << "unable to open table_pieces file" << std::endl; + return 1; + } + + std::string str((std::istreambuf_iterator(inp_json)), + std::istreambuf_iterator()); + auto parsed = boost::json::parse(str); + boost::json::object obj = parsed.as_object(); + + boost::json::array arr = obj["table_pieces"].as_array(); + for (const auto& item : arr) { + table_pieces.emplace_back(item.as_object()); + } + + provers_amount = obj["provers_amount"].as_int64(); + + boost::json::array used_rows_json = obj["used_rows"].as_array(); + for (const auto& row : used_rows_json) { + std::vector current_used_rows = {}; + for (const auto& elem : row.as_array()) { + current_used_rows.push_back(elem.as_int64()); + } + all_used_rows.push_back(current_used_rows); + } + + boost::json::array to_be_shared_json = obj["to_be_shared"].as_array(); + for (const auto& pair_json : to_be_shared_json) { + boost::json::object pair_obj = pair_json.as_object(); + std::uint32_t first = pair_obj["first"].as_int64(); + var second = var(pair_obj["second"].as_object()); + to_be_shared.emplace_back(first, second); + } + } + auto assigner_instance_creation_start = std::chrono::high_resolution_clock::now(); nil::blueprint::assigner assigner_instance( desc, @@ -562,8 +764,50 @@ int curve_dependent_main(std::string bytecode_file_name, auto parse_ir_file_duration = std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - parse_ir_file_start); BOOST_LOG_TRIVIAL(debug) << "parse_ir_file_duration: " << parse_ir_file_duration.count() << "ms"; + + std::vector>> all_constant_columns; + + if (gen_mode.has_fast_tbl()) { + // parse constant columns + + for (std::size_t i = 0; i < provers_amount; i++) { + + std::string table_file_name = provers_amount == 1 ? assignment_table_file_name : assignment_table_file_name + std::to_string(i); + + + constants_marshalling_type marshalled_constant_column_data; + extract_from_binary_file(marshalled_constant_column_data, "constants_", circuit_file_name); + + table_header_marshalling_type marshalled_table_header; + extract_from_binary_file(marshalled_table_header, "header_", table_file_name); + + + std::uint32_t constant_columns_amount = std::get<2>(marshalled_table_header.value()).value(); + std::uint32_t columns_rows_amount = std::get<5>(marshalled_table_header.value()).value(); + + all_constant_columns.emplace_back( + nil::crypto3::marshalling::types::make_field_element_columns_vector + ( + marshalled_constant_column_data, + constant_columns_amount, + columns_rows_amount + ) + ); + } + } + + auto parser_evaluation_start = std::chrono::high_resolution_clock::now(); - if (!assigner_instance.evaluate(public_input_json_value.as_array(), private_input_json_value.as_array())) { + if ( + !assigner_instance.evaluate( + public_input_json_value.as_array(), + private_input_json_value.as_array(), + all_constant_columns, + all_used_rows, + to_be_shared, + table_pieces + ) + ) { return 1; } auto parser_evaluation_duration = std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - parser_evaluation_start); @@ -575,6 +819,45 @@ int curve_dependent_main(std::string bytecode_file_name, return 0; } + if (gen_mode.has_circuit()) { + + boost::json::object top_level_json; + top_level_json["provers_amount"] = assigner_instance.assignments.size(); + + boost::json::array pieces_json; + for (const auto& piece : assigner_instance.get_table_pieces()) { + pieces_json.push_back(piece.to_json()); + } + top_level_json["table_pieces"] = pieces_json; + + boost::json::array used_rows_json; + for (std::size_t i = 0; i < assigner_instance.assignments.size(); i++) { + boost::json::array current_row; + for (const auto& r : assigner_instance.assignments[i].get_used_rows()) { + current_row.push_back(r); + } + used_rows_json.push_back(current_row); + } + top_level_json["used_rows"] = used_rows_json; + + boost::json::array to_be_shared_json; + + for (const auto& pair : assigner_instance.get_to_be_shared()) { + boost::json::object pair_json; + pair_json["first"] = pair.first; + pair_json["second"] = pair.second.to_json(); + to_be_shared_json.push_back(pair_json); + } + top_level_json["to_be_shared"] = to_be_shared_json; + + std::string serialized = boost::json::serialize(top_level_json); + + std::ofstream file(add_filename_prefix("table_pieces_", circuit_file_name)); + file << serialized; + file.close(); + } + + if (!gen_mode.has_fast_tbl()) { auto pack_lookup_start = std::chrono::high_resolution_clock::now(); // pack lookup tables if (assigner_instance.circuits[0].get_reserved_tables().size() > 0) { @@ -606,30 +889,51 @@ int curve_dependent_main(std::string bytecode_file_name, } auto pack_lookup_duration = std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - pack_lookup_start); BOOST_LOG_TRIVIAL(debug) << "pack_lookup_duration: " << pack_lookup_duration.count() << "ms"; + } auto overall_table_printing_start = std::chrono::high_resolution_clock::now(); constexpr std::uint32_t invalid_target_prover = std::numeric_limits::max(); // print assignment tables and circuits - ASSERT_MSG(assigner_instance.assignments.size() == assigner_instance.circuits.size(), "Missmatch assignments circuits size"); + ASSERT_MSG(gen_mode.has_fast_tbl() || (assigner_instance.assignments.size() == assigner_instance.circuits.size()), "Missmatch assignments circuits size"); if (assigner_instance.assignments.size() == 1 && (target_prover == 0 || target_prover == invalid_target_prover)) { auto single_table_print_start = std::chrono::high_resolution_clock::now(); // print assignment table - if (gen_mode.has_assignments()) { - std::ofstream otable; - 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; - } - - print_assignment_table( - assigner_instance.assignments[0], print_table_kind::SINGLE_PROVER, ComponentConstantColumns, - ComponentSelectorColumns, otable); - - otable.close(); + if (gen_mode.has_slow_tbl()) { + + table_parameters_struct table_parameters = extract_table_parameters_from_table( + assigner_instance.assignments[0], + print_table_kind::SINGLE_PROVER + ); + + print_assignment_table_dynamic( + table_parameters.padded_rows_amount, + assigner_instance.assignments[0], + print_table_kind::SINGLE_PROVER, + assignment_table_file_name, + 0 + ); auto single_table_print_duration = std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - single_table_print_start); BOOST_LOG_TRIVIAL(debug) << "single_table_print_duration: " << single_table_print_duration.count() << "ms"; } + if (gen_mode.has_fast_tbl()) { + auto fast_tbl_print_start = std::chrono::high_resolution_clock::now(); + + std::uint32_t padded_rows_amount = padded_rows_from_table_header( + assigner_instance.assignments[0], + print_table_kind::SINGLE_PROVER, + assignment_table_file_name, + 0); + + print_assignment_table_dynamic( + padded_rows_amount, + assigner_instance.assignments[0], + print_table_kind::SINGLE_PROVER, + assignment_table_file_name, + 0); + + auto fast_tbl_print_duration = std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - fast_tbl_print_start); + BOOST_LOG_TRIVIAL(debug) << "fast_tbl_print_duration: " << fast_tbl_print_duration.count() << "ms"; + } // print circuit if (gen_mode.has_circuit()) { @@ -643,6 +947,25 @@ int curve_dependent_main(std::string bytecode_file_name, print_circuit( assigner_instance.circuits[0], assigner_instance.assignments[0], false, 0, ocircuit); ocircuit.close(); + + table_parameters_struct table_parameters = extract_table_parameters_from_table( + assigner_instance.assignments[0], + print_table_kind::SINGLE_PROVER + ); + + print_assignment_table_static( + table_parameters, + assigner_instance.assignments[0], + print_table_kind::SINGLE_PROVER, + ComponentConstantColumns, + ComponentSelectorColumns, + assignment_table_file_name, + circuit_file_name, + 0 + ); + + + } } else if (assigner_instance.assignments.size() > 1 && (target_prover < assigner_instance.assignments.size() || target_prover == invalid_target_prover)) { @@ -653,21 +976,46 @@ int curve_dependent_main(std::string bytecode_file_name, for (std::uint32_t idx = start_idx; idx < end_idx; idx++) { // print assignment table - if (gen_mode.has_assignments()) { + if (gen_mode.has_slow_tbl()) { + + table_parameters_struct table_parameters = extract_table_parameters_from_table( + assigner_instance.assignments[idx], + print_table_kind::MULTI_PROVER + ); + + auto future = std::async( + std::launch::async, + assignment_table_printer, + table_parameters.padded_rows_amount, + assignment_table_file_name, + idx, + std::ref(assigner_instance) + ); + + futures.push_back(std::move(future)); + } + if (gen_mode.has_fast_tbl()) { + std::uint32_t padded_rows_amount = padded_rows_from_table_header( + assigner_instance.assignments[idx], + print_table_kind::MULTI_PROVER, + assignment_table_file_name, + idx); auto future = std::async( std::launch::async, assignment_table_printer, + padded_rows_amount, assignment_table_file_name, idx, - std::ref(assigner_instance), - std::ref(ComponentConstantColumns), - std::ref(ComponentSelectorColumns) + std::ref(assigner_instance) ); futures.push_back(std::move(future)); } + } + + for (std::uint32_t idx = start_idx; idx < end_idx; idx++) { // print circuit if (gen_mode.has_circuit()) { std::ofstream ocircuit; @@ -682,6 +1030,22 @@ int curve_dependent_main(std::string bytecode_file_name, assigner_instance.circuits[idx], assigner_instance.assignments[idx], true, idx, ocircuit); ocircuit.close(); + + table_parameters_struct table_parameters = extract_table_parameters_from_table( + assigner_instance.assignments[idx], + print_table_kind::MULTI_PROVER + ); + + print_assignment_table_static( + table_parameters, + assigner_instance.assignments[idx], + print_table_kind::MULTI_PROVER, + ComponentConstantColumns, + ComponentSelectorColumns, + assignment_table_file_name, + circuit_file_name, + idx + ); } } @@ -752,7 +1116,7 @@ int main(int argc, char *argv[]) { ("print_circuit_output", "deprecated, use \"-f\" instead") ("print-circuit-output-format,f", boost::program_options::value(), "print output of the circuit (dec, hex)") ("policy", boost::program_options::value(), "Policy for creating circuits. Possible values: default") - ("generate-type", boost::program_options::value(), "Define generated output. Possible values: circuit, assignment, circuit-assignment, public-input-column, size_estimation(does not generate anything, just evaluates circuit size). Default value is circuit-assignment") + ("generate-type", boost::program_options::value(), "Define generated output. Possible values: circuit, assignment, assignment-fast, circuit-assignment, public-input-column, size_estimation(does not generate anything, just evaluates circuit size). Default value is circuit-assignment") ("max-num-provers", boost::program_options::value(), "Maximum number of provers. Possible values >= 1") ("max-lookup-rows", boost::program_options::value(), "Maximum number of lookup rows") ("target-prover", boost::program_options::value(), "Assignment table and circuit will be generated only for defined prover. Possible values [0, max-num-provers)") @@ -808,15 +1172,17 @@ int main(int argc, char *argv[]) { return 1; } - nil::blueprint::generation_mode gen_mode = nil::blueprint::generation_mode::assignments() | nil::blueprint::generation_mode::circuit(); + nil::blueprint::generation_mode gen_mode = nil::blueprint::generation_mode::slow_tbl() | nil::blueprint::generation_mode::circuit(); if (vm.count("generate-type")) { const auto generate_type = vm["generate-type"].as(); if (generate_type == "circuit") { gen_mode = nil::blueprint::generation_mode::circuit(); } else if (generate_type == "assignment") { - gen_mode = nil::blueprint::generation_mode::assignments(); + gen_mode = nil::blueprint::generation_mode::slow_tbl(); + } else if (generate_type == "assignment-fast") { + gen_mode = nil::blueprint::generation_mode::fast_tbl(); } else if (generate_type == "size_estimation") { - gen_mode = nil::blueprint::generation_mode::size_estimation(); + gen_mode = nil::blueprint::generation_mode::size_estimation() | nil::blueprint::generation_mode::circuit(); } else if (generate_type == "public-input-column") { gen_mode = nil::blueprint::generation_mode::public_input_column(); } else if (generate_type != "circuit-assignment") { @@ -825,8 +1191,9 @@ int main(int argc, char *argv[]) { return 1; } } + gen_mode = gen_mode | nil::blueprint::generation_mode::assignments(); // for now in any case we generate assignment table to determine used_rows - if (!vm.count("public-input") && !vm.count("private-input") && gen_mode.has_assignments()) { + if (!vm.count("public-input") && !vm.count("private-input") && (gen_mode.has_fast_tbl() || gen_mode.has_slow_tbl())) { std::cerr << "Both public and private input file names are not specified" << std::endl; std::cout << options_desc << std::endl; return 1; @@ -849,25 +1216,30 @@ int main(int argc, char *argv[]) { public_input_file_name = vm["public-input"].as(); } - if (gen_mode.has_assignments()) { + if (gen_mode.has_circuit() || gen_mode.has_fast_tbl() || gen_mode.has_slow_tbl()) { if (vm.count("assignment-table")) { assignment_table_file_name = vm["assignment-table"].as(); } else { - std::cerr << "Invalid command line argument - assignment table file name is not specified" << std::endl; - std::cout << options_desc << std::endl; - return 1; + if (!gen_mode.has_size_estimation()) { + std::cerr << "Invalid command line argument - assignment table file name is not specified" << std::endl; + std::cout << options_desc << std::endl; + return 1; + } } } - if (gen_mode.has_circuit()) { + // if (gen_mode.has_circuit()) { if (vm.count("circuit")) { circuit_file_name = vm["circuit"].as(); - } else { - std::cerr << "Invalid command line argument - circuit file name is not specified" << std::endl; - std::cout << options_desc << std::endl; - return 1; } - } + // else { + // if (!gen_mode.has_size_estimation()) { + // std::cerr << "Invalid command line argument - circuit file name is not specified" << std::endl; + // std::cout << options_desc << std::endl; + // return 1; + // } + // } + // } if (vm.count("elliptic-curve-type")) { elliptic_curve = vm["elliptic-curve-type"].as(); diff --git a/bin/recursive_gen/src/main.cpp b/bin/recursive_gen/src/main.cpp index 645f0066c..eb131a40d 100644 --- a/bin/recursive_gen/src/main.cpp +++ b/bin/recursive_gen/src/main.cpp @@ -53,6 +53,8 @@ #include #include +#include "../../table_packing.hpp" + template std::optional open_file(const std::string& path, std::ios_base::openmode mode) { StreamType file(path, mode); @@ -106,6 +108,7 @@ std::optional decode_marshalling_from_file( return marshalled_data; } + template struct ParametersPolicy { constexpr static const std::size_t WitnessColumns = WITNESS_COLUMNS; @@ -414,13 +417,21 @@ int curve_dependent_main( public_input_sizes = (*constraint_system).public_input_sizes(); if( vm.count("assignment-table") ){ - auto marshalled_value = decode_marshalling_from_file(assignment_table_file_name); - if (!marshalled_value) { - return false; - } - auto [description, table] = nil::crypto3::marshalling::types::make_assignment_table( - *marshalled_value - ); + + AssignmentTableType table; + zk::snark::plonk_table_description description ( + WitnessColumns, PublicInputColumns, ConstantColumns, SelectorColumns); + + assignment_table_marshalling_type marshalled_table_data = + extract_table_from_binary_file + (assignment_table_file_name, circuit_file_name); + + std::tie(description, table) = + nil::crypto3::marshalling::types::make_assignment_table( + marshalled_table_data + ); + + assignment_table.emplace(table); desc.emplace(description); } diff --git a/bin/table_packing.hpp b/bin/table_packing.hpp new file mode 100644 index 000000000..f4ffe43d1 --- /dev/null +++ b/bin/table_packing.hpp @@ -0,0 +1,73 @@ +std::string add_filename_prefix( + const std::string& prefix, + const std::string& file_name +) { + std::filesystem::path path(file_name); + std::filesystem::path parent_path = path.parent_path(); + std::filesystem::path filename = path.filename(); + + std::string new_filename = prefix + filename.string(); + std::filesystem::path new_path = parent_path / new_filename; + + return new_path.string(); +} + + +bool append_binary_file_content_to_vector ( + std::vector& result_vector, + const std::string& prefix, + const std::string& assignment_table_file_name + +) { + std::ifstream icolumn; + icolumn.open(add_filename_prefix(prefix, assignment_table_file_name), std::ios_base::binary | std::ios_base::in); + if (!icolumn) { + std::cout << "Cannot open " << add_filename_prefix(prefix, assignment_table_file_name) << std::endl; + return false; + } + icolumn.seekg(0, std::ios_base::end); + const auto input_size = icolumn.tellg(); + std::size_t old_size = result_vector.size(); + result_vector.resize(old_size + input_size); + icolumn.seekg(0, std::ios_base::beg); + icolumn.read(reinterpret_cast(result_vector.data() + old_size), input_size); + icolumn.close(); + return true; +} + +template +void unmarshall_from_vector ( + const std::vector& v, + marshalling_type& marhsalling_data +) { + auto vect_iterator = v.begin(); + auto marshalling_status = marhsalling_data.read(vect_iterator, v.size()); + ASSERT(marshalling_status == nil::marshalling::status_type::success); +} + +template +void extract_from_binary_file( + marshalling_type& marshalling_file, + const std::string& prefix, + const std::string& file_name +) { + std::vector file_vector = {}; + ASSERT(append_binary_file_content_to_vector(file_vector, prefix, file_name)); + unmarshall_from_vector (file_vector, marshalling_file); +} + +template +marshalling_type extract_table_from_binary_file( + const std::string& assignment_file_name, + const std::string& circuit_file_name +) { + std::vector file_vector = {}; + ASSERT(append_binary_file_content_to_vector(file_vector, "header_", assignment_file_name)); + ASSERT(append_binary_file_content_to_vector(file_vector, "witness_", assignment_file_name)); + ASSERT(append_binary_file_content_to_vector(file_vector, "pub_inp_", assignment_file_name)); + ASSERT(append_binary_file_content_to_vector(file_vector, "constants_", circuit_file_name)); + ASSERT(append_binary_file_content_to_vector(file_vector, "selectors_", circuit_file_name)); + marshalling_type marshalling_data; + unmarshall_from_vector (file_vector, marshalling_data); + return marshalling_data; +} diff --git a/bin/transpiler/src/main.cpp b/bin/transpiler/src/main.cpp index 41380f2c1..6890d3bac 100644 --- a/bin/transpiler/src/main.cpp +++ b/bin/transpiler/src/main.cpp @@ -45,6 +45,8 @@ #include #include +#include "../../table_packing.hpp" + template void print_sol_files( zk::snark::plonk_table_description desc, @@ -242,6 +244,7 @@ int main(int argc, char *argv[]) { } + template int curve_dependent_main( boost::program_options::options_description options_desc, @@ -361,26 +364,11 @@ int curve_dependent_main( AssignmentTableType assignment_table; { - std::ifstream iassignment; - iassignment.open(assignment_table_file_name, std::ios_base::binary | std::ios_base::in); - if (!iassignment) { - std::cout << "Cannot open " << assignment_table_file_name << std::endl; - return 1; - } - std::vector v; - iassignment.seekg(0, std::ios_base::end); - const auto fsize = iassignment.tellg(); - v.resize(fsize); - iassignment.seekg(0, std::ios_base::beg); - iassignment.read(reinterpret_cast(v.data()), fsize); - if (!iassignment) { - std::cout << "Cannot parse input file " << assignment_table_file_name << std::endl; - return 1; - } - iassignment.close(); - table_value_marshalling_type marshalled_table_data; - auto read_iter = v.begin(); - auto status = marshalled_table_data.read(read_iter, v.size()); + + table_value_marshalling_type marshalled_table_data = + extract_table_from_binary_file + (assignment_table_file_name, circuit_file_name); + std::tie(desc, assignment_table) = nil::crypto3::marshalling::types::make_assignment_table( marshalled_table_data diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index bc381ce83..9ce9dc328 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -34,6 +34,7 @@ function(assign_ir) COMMAND $ -b ${binary_name} -c circuit_${target}.crct + -t assignment_${target}.tbl -e ${curve_type} --generate-type circuit ${max_num_provers_flag} ${max_num_provers_amount} @@ -83,7 +84,35 @@ function(assign_ir) COMMAND_EXPAND_LISTS VERBATIM) - add_custom_target(${target}_generate_tbl_no_check + add_custom_target(${target}_generate_tbl_fast + COMMAND $ + -b ${binary_name} + -i ${INPUTS_DIR}/${input} + ${minus_p} ${private_input_string} + -c circuit_${target}.crct + -t assignment_${target}.tbl -e ${curve_type} + --generate-type assignment-fast + ${max_num_provers_flag} ${max_num_provers_amount} + ${arithmetization_flag} ${arithmetization_amount} + DEPENDS ${target} ${INPUTS_DIR}/${input} $ + COMMAND_EXPAND_LISTS + VERBATIM) + + add_custom_target(${target}_generate_tbl_fast_depends_on_crct + COMMAND $ + -b ${binary_name} + -i ${INPUTS_DIR}/${input} + ${minus_p} ${private_input_string} + -c circuit_${target}.crct + -t assignment_${target}.tbl -e ${curve_type} + --generate-type assignment-fast + ${max_num_provers_flag} ${max_num_provers_amount} + ${arithmetization_flag} ${arithmetization_amount} + DEPENDS ${target} ${INPUTS_DIR}/${input} ${target}_generate_crct $ + COMMAND_EXPAND_LISTS + VERBATIM) + + add_custom_target(${target}_generate_tbl_no_check COMMAND $ -b ${binary_name} -i ${INPUTS_DIR}/${input} @@ -120,15 +149,15 @@ function(assign_ir) VERBATIM) endfunction() -function(gen_proof target curve_type provers_amount) +function(gen_proof target curve_type provers_amount tbl_gen_speed) if(provers_amount EQUAL 0) - gen_single_proof(${target} ${curve_type} 0) + gen_single_proof(${target} ${curve_type} 0 ${tbl_gen_speed}) else() add_custom_target(${target}_prove) foreach(prover_num RANGE 1 ${provers_amount}) math(EXPR prover_num_minus_1 "${prover_num} - 1") - gen_single_proof(${target} ${curve_type} ${prover_num}) + gen_single_proof(${target} ${curve_type} ${prover_num} ${tbl_gen_speed}) add_dependencies(${target}_prove ${target}_prove${prover_num_minus_1}) endforeach() @@ -143,7 +172,7 @@ function(gen_proof target curve_type provers_amount) endfunction() -function(gen_single_proof target curve_type provers_amount) +function(gen_single_proof target curve_type provers_amount tbl_gen_speed) if(NOT provers_amount EQUAL 0) set(multi_prover_flag --multi-prover) math(EXPR prover_num "${provers_amount} - 1") @@ -151,6 +180,11 @@ function(gen_single_proof target curve_type provers_amount) set(prover_num "") endif() + set (depends_tbl ${target}_generate_both) + if (tbl_gen_speed STREQUAL "fast") + set (depends_tbl ${target}_generate_tbl_fast_depends_on_crct) + endif() + add_custom_target(${target}_prove${prover_num} COMMAND $ -m gen-test-proof -c circuit_${target}.crct${prover_num} @@ -158,7 +192,7 @@ function(gen_single_proof target curve_type provers_amount) -o transpiler_output_${target}${prover_num} -e ${curve_type} ${multi_prover_flag} - DEPENDS ${target}_generate_crct ${target}_generate_tbl $ + DEPENDS ${depends_tbl} $ COMMAND_EXPAND_LISTS VERBATIM) endfunction() diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt index 29235f078..03a00cc10 100644 --- a/examples/cpp/CMakeLists.txt +++ b/examples/cpp/CMakeLists.txt @@ -1,5 +1,6 @@ add_custom_target(compile_cpp_examples) add_custom_target(cpp_examples_generate_tbl) +add_custom_target(cpp_examples_generate_tbl_fast) add_custom_target(cpp_examples_generate_tbl_no_check) add_custom_target(cpp_examples_generate_crct) add_custom_target(cpp_examples_generate_both) @@ -80,7 +81,7 @@ endfunction() function(add_example_with_proving example_target) set(prefix ARG) set(noValues "") - set(singleValues INPUT PRIVATE_INPUT CURVE_TYPE MAX_NUM_PROVERS) + set(singleValues INPUT PRIVATE_INPUT CURVE_TYPE MAX_NUM_PROVERS TBL_GEN_SPEED) set(multiValues SOURCES) cmake_parse_arguments(${prefix} "${noValues}" @@ -94,9 +95,18 @@ function(add_example_with_proving example_target) set(ARG_MAX_NUM_PROVERS 0) endif() - gen_proof(${example_target} ${ARG_CURVE_TYPE} ${ARG_MAX_NUM_PROVERS}) + if(NOT DEFINED ARG_TBL_GEN_SPEED) + set(ARG_TBL_GEN_SPEED "slow") + endif() + + gen_proof(${example_target} ${ARG_CURVE_TYPE} ${ARG_MAX_NUM_PROVERS} ${ARG_TBL_GEN_SPEED}) add_dependencies(prove_cpp_examples ${example_target}_prove) + if (ARG_TBL_GEN_SPEED STREQUAL "fast") + add_dependencies(cpp_examples_generate_tbl_fast ${example_target}_generate_tbl_fast) + endif() + + if(GENERATE_EVM_VERIFIER) gen_evm_verifier(${example_target} ${ARG_CURVE_TYPE} ${ARG_MAX_NUM_PROVERS}) add_dependencies(prove_cpp_examples ${example_target}_evm_verifier) @@ -107,7 +117,7 @@ endfunction() function(add_example_with_proving_and_recursion example_target) set(prefix ARG) set(noValues "") - set(singleValues INPUT PRIVATE_INPUT CURVE_TYPE MAX_NUM_PROVERS) + set(singleValues INPUT PRIVATE_INPUT CURVE_TYPE TBL_GEN_SPEED MAX_NUM_PROVERS) set(multiValues SOURCES) cmake_parse_arguments(${prefix} "${noValues}" @@ -115,12 +125,16 @@ function(add_example_with_proving_and_recursion example_target) "${multiValues}" ${ARGN}) - add_example_with_proving(${example_target} ${ARG_CURVE_TYPE} ${ARGN}) - if(NOT DEFINED ARG_MAX_NUM_PROVERS) set(ARG_MAX_NUM_PROVERS 0) endif() + if(NOT DEFINED ARG_TBL_GEN_SPEED) + set(ARG_TBL_GEN_SPEED "slow") + endif() + + add_example_with_proving(${example_target} ${ARG_CURVE_TYPE} ${ARG_MAX_NUM_PROVERS} ${ARG_TBL_GEN_SPEED} ${ARGN}) + add_custom_target(${example_target}_recursion) assign_recursive_verifiers(${example_target} ${ARG_CURVE_TYPE} ${ARG_MAX_NUM_PROVERS}) add_dependencies(${example_target}_recursion ${example_target}_assign_placeholder_verifiers) @@ -129,65 +143,68 @@ endfunction() add_custom_target("recursion") -add_example_with_proving(arithmetics_cpp_example SOURCES arithmetics.cpp INPUT arithmetics.inp CURVE_TYPE pallas) -add_example_with_proving(integer_arithmetics_cpp_example SOURCES integer_arithmetics.cpp INPUT integer_arithmetics.inp CURVE_TYPE pallas) -add_example_with_proving(poseidon_cpp_example SOURCES poseidon.cpp INPUT poseidon.inp CURVE_TYPE pallas) -add_example_with_proving_and_recursion(merkle_tree_poseidon_cpp_example SOURCES merkle_tree_poseidon.cpp INPUT merkle_tree_poseidon.inp CURVE_TYPE pallas) -add_example_with_proving(merkle_poseidon_1prover_cpp_example SOURCES merkle_poseidon_1prover.cpp INPUT merkle_poseidon_1prover_public.inp PRIVATE_INPUT merkle_poseidon_1prover_private.inp CURVE_TYPE pallas) -add_example_with_proving(merkle_poseidon_2provers_cpp_example SOURCES merkle_poseidon_2provers.cpp INPUT merkle_poseidon_2provers_public.inp PRIVATE_INPUT merkle_poseidon_2provers_private.inp CURVE_TYPE pallas MAX_NUM_PROVERS 2) -add_example_with_proving_and_recursion(merkle_poseidon_3provers_cpp_example SOURCES merkle_poseidon_3provers.cpp INPUT merkle_poseidon_3provers_public.inp PRIVATE_INPUT merkle_poseidon_3provers_private.inp CURVE_TYPE pallas MAX_NUM_PROVERS 3) -add_example_with_proving(merkle_poseidon_5provers_cpp_example SOURCES merkle_poseidon_5provers.cpp INPUT merkle_poseidon_5provers_public.inp PRIVATE_INPUT merkle_poseidon_5provers_private.inp CURVE_TYPE pallas MAX_NUM_PROVERS 5) -add_example_with_proving(merkle_poseidon_21prover_3layers_cpp_example SOURCES merkle_poseidon_21prover_3layers.cpp INPUT merkle_poseidon_21prover_3layers_public.inp PRIVATE_INPUT merkle_poseidon_21prover_3layers_private.inp CURVE_TYPE pallas MAX_NUM_PROVERS 21) - -add_example_without_proving(merkle_tree_sha2_256_cpp_example SOURCES merkle_tree_sha2_256.cpp INPUT merkle_tree_sha2_256.inp CURVE_TYPE pallas) -add_example_without_proving(validate_merkle_path_sha2_256_cpp_example SOURCES validate_merkle_path_sha2_256.cpp INPUT validate_merkle_path_sha2_256.inp CURVE_TYPE pallas) -add_example_without_proving(sha256_cpp_example SOURCES sha2_256.cpp INPUT sha2_256.inp CURVE_TYPE pallas) -add_example_with_proving(memory_cpp_example SOURCES memory.cpp INPUT memory.inp CURVE_TYPE pallas) -add_example_with_proving(polynomial_cpp_example SOURCES polynomial.cpp INPUT polynomial.inp COMPILER_OPTIONS -std=c++20 CURVE_TYPE pallas) +add_example_with_proving(arithmetics_cpp_example SOURCES arithmetics.cpp INPUT arithmetics.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(integer_arithmetics_cpp_example SOURCES integer_arithmetics.cpp INPUT integer_arithmetics.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(poseidon_cpp_example SOURCES poseidon.cpp INPUT poseidon.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving_and_recursion(merkle_tree_poseidon_cpp_example SOURCES merkle_tree_poseidon.cpp INPUT merkle_tree_poseidon.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +# add_example_with_proving(merkle_tree_poseidon_large_cpp_example SOURCES merkle_tree_poseidon_large.cpp INPUT merkle_tree_poseidon_large.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(merkle_poseidon_1prover_cpp_example SOURCES merkle_poseidon_1prover.cpp INPUT merkle_poseidon_1prover_public.inp PRIVATE_INPUT merkle_poseidon_1prover_private.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(merkle_poseidon_2provers_cpp_example SOURCES merkle_poseidon_2provers.cpp INPUT merkle_poseidon_2provers_public.inp PRIVATE_INPUT merkle_poseidon_2provers_private.inp CURVE_TYPE pallas MAX_NUM_PROVERS 2 TBL_GEN_SPEED fast) +add_example_with_proving_and_recursion(merkle_poseidon_3provers_cpp_example SOURCES merkle_poseidon_3provers.cpp INPUT merkle_poseidon_3provers_public.inp PRIVATE_INPUT merkle_poseidon_3provers_private.inp CURVE_TYPE pallas MAX_NUM_PROVERS 3 TBL_GEN_SPEED fast) +add_example_with_proving(merkle_poseidon_5provers_cpp_example SOURCES merkle_poseidon_5provers.cpp INPUT merkle_poseidon_5provers_public.inp PRIVATE_INPUT merkle_poseidon_5provers_private.inp CURVE_TYPE pallas MAX_NUM_PROVERS 5 TBL_GEN_SPEED fast) +add_example_with_proving(merkle_poseidon_21prover_3layers_cpp_example SOURCES merkle_poseidon_21prover_3layers.cpp INPUT merkle_poseidon_21prover_3layers_public.inp PRIVATE_INPUT merkle_poseidon_21prover_3layers_private.inp CURVE_TYPE pallas MAX_NUM_PROVERS 21 TBL_GEN_SPEED fast) + +add_example_without_proving(merkle_tree_sha2_256_cpp_example SOURCES merkle_tree_sha2_256.cpp INPUT merkle_tree_sha2_256.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_without_proving(validate_merkle_path_sha2_256_cpp_example SOURCES validate_merkle_path_sha2_256.cpp INPUT validate_merkle_path_sha2_256.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_without_proving(sha256_cpp_example SOURCES sha2_256.cpp INPUT sha2_256.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(memory_cpp_example SOURCES memory.cpp INPUT memory.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(polynomial_cpp_example SOURCES polynomial.cpp INPUT polynomial.inp COMPILER_OPTIONS -std=c++20 CURVE_TYPE pallas TBL_GEN_SPEED fast) add_example_with_proving(pallas_curve_addition_cpp_example SOURCES pallas_curve_examples/pallas_curve_add.cpp INPUT pallas_curve_examples/pallas_curve_add.inp - CURVE_TYPE pallas) + CURVE_TYPE pallas + TBL_GEN_SPEED fast) add_example_with_proving(pallas_curve_multiplication_cpp_example SOURCES pallas_curve_examples/pallas_curve_mul.cpp INPUT pallas_curve_examples/pallas_curve_mul.inp - CURVE_TYPE pallas) -add_example_with_proving(ed25519_curve_add_cpp SOURCES ed25519_curve_add.cpp INPUT ed25519_curve_add.inp CURVE_TYPE pallas) -add_example_with_proving(ed25519_curve_mul_cpp SOURCES ed25519_curve_mul.cpp INPUT ed25519_curve_mul.inp CURVE_TYPE pallas) -add_example_with_proving(ed25519_field_add_cpp SOURCES ed25519_field_add.cpp INPUT ed25519_field_add.inp CURVE_TYPE pallas) + CURVE_TYPE pallas + TBL_GEN_SPEED fast) +add_example_with_proving(ed25519_curve_add_cpp SOURCES ed25519_curve_add.cpp INPUT ed25519_curve_add.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(ed25519_curve_mul_cpp SOURCES ed25519_curve_mul.cpp INPUT ed25519_curve_mul.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(ed25519_field_add_cpp SOURCES ed25519_field_add.cpp INPUT ed25519_field_add.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) #add_example_with_proving(strlen_cpp_example SOURCES strlen.cpp INPUT strlen.inp CURVE_TYPE pallas) -add_example_with_proving(sha2_512_cpp SOURCES sha2_512.cpp INPUT sha2_512.inp CURVE_TYPE pallas) - -add_example_with_proving(uint_remainder_cpp SOURCES bit_operations/uint_remainder.cpp INPUT bit_operations/uint_remainder.inp CURVE_TYPE pallas) -add_example_with_proving(uint_division_cpp SOURCES bit_operations/uint_division.cpp INPUT bit_operations/uint_division.inp CURVE_TYPE pallas) -add_example_with_proving(uint_shift_left SOURCES bit_operations/shift_left.cpp INPUT bit_operations/shift_left.inp CURVE_TYPE pallas) -add_example_with_proving(uint_shift_right SOURCES bit_operations/shift_right.cpp INPUT bit_operations/shift_right.inp CURVE_TYPE pallas) -add_example_with_proving(uint_bit_decomposition SOURCES bit_operations/bit_decomposition.cpp INPUT bit_operations/bit_decomposition.inp CURVE_TYPE pallas) -add_example_with_proving(uint_bit_composition SOURCES bit_operations/bit_composition.cpp INPUT bit_operations/bit_composition.inp CURVE_TYPE pallas) - -add_example_with_proving(compare_neq_cpp SOURCES compare/neq.cpp INPUT compare/neq.inp CURVE_TYPE pallas) -add_example_with_proving(compare_eq_cpp SOURCES compare/eq.cpp INPUT compare/eq.inp CURVE_TYPE pallas) -add_example_with_proving(compare_grequal_cpp SOURCES compare/grequal.cpp INPUT compare/grequal.inp CURVE_TYPE pallas) -add_example_with_proving(compare_lequal_cpp SOURCES compare/lequal.cpp INPUT compare/lequal.inp CURVE_TYPE pallas) -add_example_with_proving(compare_greater_than_cpp SOURCES compare/greater_than.cpp INPUT compare/greater_than.inp CURVE_TYPE pallas) -add_example_with_proving(compare_less_than_cpp SOURCES compare/less_than.cpp INPUT compare/less_than.inp CURVE_TYPE pallas) +add_example_with_proving(sha2_512_cpp SOURCES sha2_512.cpp INPUT sha2_512.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) + +add_example_with_proving(uint_remainder_cpp SOURCES bit_operations/uint_remainder.cpp INPUT bit_operations/uint_remainder.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(uint_division_cpp SOURCES bit_operations/uint_division.cpp INPUT bit_operations/uint_division.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(uint_shift_left SOURCES bit_operations/shift_left.cpp INPUT bit_operations/shift_left.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(uint_shift_right SOURCES bit_operations/shift_right.cpp INPUT bit_operations/shift_right.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(uint_bit_decomposition SOURCES bit_operations/bit_decomposition.cpp INPUT bit_operations/bit_decomposition.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(uint_bit_composition SOURCES bit_operations/bit_composition.cpp INPUT bit_operations/bit_composition.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) + +add_example_with_proving(compare_neq_cpp SOURCES compare/neq.cpp INPUT compare/neq.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(compare_eq_cpp SOURCES compare/eq.cpp INPUT compare/eq.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(compare_grequal_cpp SOURCES compare/grequal.cpp INPUT compare/grequal.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(compare_lequal_cpp SOURCES compare/lequal.cpp INPUT compare/lequal.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(compare_greater_than_cpp SOURCES compare/greater_than.cpp INPUT compare/greater_than.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(compare_less_than_cpp SOURCES compare/less_than.cpp INPUT compare/less_than.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) #Balances tree example is too big to be proven in a reasonable time -add_example_without_proving(balances_tree_cpp_example SOURCES balances_tree.cpp INPUT balances_tree_public.inp PRIVATE_INPUT balances_tree_private.inp CURVE_TYPE pallas) +add_example_without_proving(balances_tree_cpp_example SOURCES balances_tree.cpp INPUT balances_tree_public.inp PRIVATE_INPUT balances_tree_private.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) -add_example_without_proving(eddsa_signature_verification_cpp SOURCES eddsa_signature_verification.cpp INPUT eddsa_signature_verification.inp CURVE_TYPE pallas) -add_example_without_proving(zkbridge_cpp SOURCES zkbridge.cpp INPUT zkbridge.inp CURVE_TYPE pallas ARITHMETIZARION 15 1 5 30 50 6) +add_example_without_proving(eddsa_signature_verification_cpp SOURCES eddsa_signature_verification.cpp INPUT eddsa_signature_verification.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_without_proving(zkbridge_cpp SOURCES zkbridge.cpp INPUT zkbridge.inp CURVE_TYPE pallas TBL_GEN_SPEED fast ARITHMETIZARION 15 1 5 30 50 6) -add_example_with_proving(private_input_cpp SOURCES private_input.cpp INPUT private_input_public.inp PRIVATE_INPUT private_input_private.inp CURVE_TYPE pallas) -add_example_with_proving(private_input_array_cpp SOURCES private_input_array.cpp INPUT private_input_array_public.inp PRIVATE_INPUT private_input_array_private.inp CURVE_TYPE pallas) +add_example_with_proving(private_input_cpp SOURCES private_input.cpp INPUT private_input_public.inp PRIVATE_INPUT private_input_private.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(private_input_array_cpp SOURCES private_input_array.cpp INPUT private_input_array_public.inp PRIVATE_INPUT private_input_array_private.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) -add_example_with_proving(fri_lin_inter SOURCES placeholder_prover/fri_lin_inter.cpp INPUT placeholder_prover/fri_lin_inter.inp CURVE_TYPE pallas) -add_example_with_proving(fri_array_swap SOURCES placeholder_prover/fri_array_swap.cpp INPUT placeholder_prover/fri_array_swap.inp CURVE_TYPE pallas) -add_example_with_proving(fri_array_swap_intrinsic SOURCES placeholder_prover/fri_array_swap_intrinsic.cpp INPUT placeholder_prover/fri_array_swap_intrinsic.inp CURVE_TYPE pallas) -add_example_with_proving(fri_cosets SOURCES placeholder_prover/fri_cosets.cpp INPUT placeholder_prover/fri_cosets.inp CURVE_TYPE pallas) -add_example_with_proving(gate_argument_verifier SOURCES placeholder_prover/gate_argument_verifier.cpp INPUT placeholder_prover/gate_argument_verifier.inp CURVE_TYPE pallas) -add_example_with_proving(permutation_argument_verifier SOURCES placeholder_prover/permutation_argument_verifier.cpp INPUT placeholder_prover/permutation_argument_verifier.inp CURVE_TYPE pallas) -add_example_with_proving(lookup_argument_verifier SOURCES placeholder_prover/lookup_argument_verifier.cpp INPUT placeholder_prover/lookup_argument_verifier.inp CURVE_TYPE pallas) +add_example_with_proving(fri_lin_inter SOURCES placeholder_prover/fri_lin_inter.cpp INPUT placeholder_prover/fri_lin_inter.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(fri_array_swap SOURCES placeholder_prover/fri_array_swap.cpp INPUT placeholder_prover/fri_array_swap.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(fri_array_swap_intrinsic SOURCES placeholder_prover/fri_array_swap_intrinsic.cpp INPUT placeholder_prover/fri_array_swap_intrinsic.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(fri_cosets SOURCES placeholder_prover/fri_cosets.cpp INPUT placeholder_prover/fri_cosets.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(gate_argument_verifier SOURCES placeholder_prover/gate_argument_verifier.cpp INPUT placeholder_prover/gate_argument_verifier.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(permutation_argument_verifier SOURCES placeholder_prover/permutation_argument_verifier.cpp INPUT placeholder_prover/permutation_argument_verifier.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) +add_example_with_proving(lookup_argument_verifier SOURCES placeholder_prover/lookup_argument_verifier.cpp INPUT placeholder_prover/lookup_argument_verifier.inp CURVE_TYPE pallas TBL_GEN_SPEED fast) add_example_without_proving(bls12_381_field_add_cpp SOURCES bls12_381_field_add.cpp INPUT bls12_381_field_add.inp CURVE_TYPE bls12381) add_example_without_proving(bls12_381_field_mul_cpp SOURCES bls12_381_field_mul.cpp INPUT bls12_381_field_mul.inp CURVE_TYPE bls12381) diff --git a/examples/cpp/merkle_tree_poseidon.cpp b/examples/cpp/merkle_tree_poseidon.cpp index 4ca9e29a2..cc331c667 100644 --- a/examples/cpp/merkle_tree_poseidon.cpp +++ b/examples/cpp/merkle_tree_poseidon.cpp @@ -7,7 +7,7 @@ using namespace nil::crypto3::algebra::curves; [[circuit]] pallas::base_field_type::value_type merkle_tree_poseidon ( std::array layer_0_leaves) { - + std::array layer_1_leaves; std::size_t layer_1_size = 0x10; std::array layer_2_leaves; @@ -41,4 +41,4 @@ using namespace nil::crypto3::algebra::curves; root = hash(layer_4_leaves[0], layer_4_leaves[1]); return root; -} +} \ No newline at end of file diff --git a/examples/cpp/merkle_tree_poseidon_large.cpp b/examples/cpp/merkle_tree_poseidon_large.cpp new file mode 100644 index 000000000..7f2583200 --- /dev/null +++ b/examples/cpp/merkle_tree_poseidon_large.cpp @@ -0,0 +1,86 @@ + +#include +#include + +using namespace nil::crypto3; +using namespace nil::crypto3::algebra::curves; + +[[circuit]] pallas::base_field_type::value_type merkle_tree_poseidon ( + std::array input) { + + std::array layer_400_leaves; + std::size_t layer_400_size = 0x400; + std::array layer_200_leaves; + std::size_t layer_200_size = 0x200; + std::array layer_100_leaves; + std::size_t layer_100_size = 0x100; + std::array layer_080_leaves; + std::size_t layer_080_size = 0x080; + std::array layer_040_leaves; + std::size_t layer_040_size = 0x040; + std::array layer_020_leaves; + std::size_t layer_020_size = 0x020; + std::array layer_010_leaves; + std::size_t layer_010_size = 0x010; + std::array layer_008_leaves; + std::size_t layer_008_size = 0x008; + std::array layer_004_leaves; + std::size_t layer_004_size = 0x004; + std::array layer_002_leaves; + std::size_t layer_002_size = 0x002; + typename pallas::base_field_type::value_type root; + + + for (std::size_t leaf_index = 0; leaf_index < layer_400_size; leaf_index++) { + layer_400_leaves[leaf_index] = + hash(input[2 * leaf_index], input[2 * leaf_index + 1]); + } + + for (std::size_t leaf_index = 0; leaf_index < layer_200_size; leaf_index++) { + layer_200_leaves[leaf_index] = + hash(layer_400_leaves[2 * leaf_index], layer_400_leaves[2 * leaf_index + 1]); + } + + for (std::size_t leaf_index = 0; leaf_index < layer_100_size; leaf_index++) { + layer_100_leaves[leaf_index] = + hash(layer_200_leaves[2 * leaf_index], layer_200_leaves[2 * leaf_index + 1]); + } + + for (std::size_t leaf_index = 0; leaf_index < layer_080_size; leaf_index++) { + layer_080_leaves[leaf_index] = + hash(layer_100_leaves[2 * leaf_index], layer_100_leaves[2 * leaf_index + 1]); + } + + for (std::size_t leaf_index = 0; leaf_index < layer_040_size; leaf_index++) { + layer_040_leaves[leaf_index] = + hash(layer_080_leaves[2 * leaf_index], layer_080_leaves[2 * leaf_index + 1]); + } + + for (std::size_t leaf_index = 0; leaf_index < layer_020_size; leaf_index++) { + layer_020_leaves[leaf_index] = + hash(layer_040_leaves[2 * leaf_index], layer_040_leaves[2 * leaf_index + 1]); + } + + for (std::size_t leaf_index = 0; leaf_index < layer_010_size; leaf_index++) { + layer_010_leaves[leaf_index] = + hash(layer_020_leaves[2 * leaf_index], layer_020_leaves[2 * leaf_index + 1]); + } + + for (std::size_t leaf_index = 0; leaf_index < layer_008_size; leaf_index++) { + layer_008_leaves[leaf_index] = + hash(layer_010_leaves[2 * leaf_index], layer_010_leaves[2 * leaf_index + 1]); + } + + for (std::size_t leaf_index = 0; leaf_index < layer_004_size; leaf_index++) { + layer_004_leaves[leaf_index] = + hash(layer_008_leaves[2 * leaf_index], layer_008_leaves[2 * leaf_index + 1]); + } + + for (std::size_t leaf_index = 0; leaf_index < layer_002_size; leaf_index++) { + layer_002_leaves[leaf_index] = + hash(layer_004_leaves[2 * leaf_index], layer_004_leaves[2 * leaf_index + 1]); + } + + typename pallas::base_field_type::value_type real_root = hash(layer_002_leaves[0], layer_002_leaves[1]); + return real_root; +} diff --git a/examples/inputs/merkle_tree_poseidon.inp b/examples/inputs/merkle_tree_poseidon.inp index a9ab5f73c..62732e33e 100644 --- a/examples/inputs/merkle_tree_poseidon.inp +++ b/examples/inputs/merkle_tree_poseidon.inp @@ -30,4 +30,4 @@ {"field":29}, {"field":30}, {"field":31}, - {"field":32}] } ] + {"field":32}] } ] \ No newline at end of file diff --git a/examples/inputs/merkle_tree_poseidon_large.inp b/examples/inputs/merkle_tree_poseidon_large.inp new file mode 100644 index 000000000..1803c3c6a --- /dev/null +++ b/examples/inputs/merkle_tree_poseidon_large.inp @@ -0,0 +1,2050 @@ +[ {"array": [ + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32}, + {"field":1}, + {"field":2}, + {"field":3}, + {"field":4}, + {"field":5}, + {"field":6}, + {"field":7}, + {"field":8}, + {"field":9}, + {"field":10}, + {"field":11}, + {"field":12}, + {"field":13}, + {"field":14}, + {"field":15}, + {"field":16}, + {"field":17}, + {"field":18}, + {"field":19}, + {"field":20}, + {"field":21}, + {"field":22}, + {"field":23}, + {"field":24}, + {"field":25}, + {"field":26}, + {"field":27}, + {"field":28}, + {"field":29}, + {"field":30}, + {"field":31}, + {"field":32} + ] } ] diff --git a/examples/rust/CMakeLists.txt b/examples/rust/CMakeLists.txt index 0021a40b0..4f363de54 100644 --- a/examples/rust/CMakeLists.txt +++ b/examples/rust/CMakeLists.txt @@ -50,7 +50,7 @@ function(add_rust_example_without_proving example_target) assign_ir(${example_target} ${binary_name} ${ARG_INPUT} ${ARG_PRIVATE_INPUT} ${ARG_CURVE_TYPE} ${ARG_ARITHMETIZARION} ${ARG_MAX_NUM_PROVERS}) - add_dependencies(rust_examples_generate_crct ${example_target}_generate_crct) + add_dependencies(rust_examples_generate_crct ${example_target}_generate_both) # assigner fails in gen_crct mode for some reason add_dependencies(rust_examples_generate_tbl ${example_target}_generate_tbl) add_dependencies(rust_examples_generate_both ${example_target}_generate_both) endfunction() @@ -58,7 +58,7 @@ endfunction() function(add_rust_example_with_proving example_target) set(prefix ARG) set(noValues "") - set(singleValues EXAMPLE_NAME INPUT CURVE_TYPE) + set(singleValues EXAMPLE_NAME INPUT CURVE_TYPE TBL_GEN_SPEED) set(multiValues) cmake_parse_arguments(${prefix} "${noValues}" @@ -72,7 +72,11 @@ function(add_rust_example_with_proving example_target) set(ARG_MAX_NUM_PROVERS 0) endif() - gen_proof(${example_target} ${ARG_CURVE_TYPE} ${ARG_MAX_NUM_PROVERS}) + if(NOT DEFINED ARG_TBL_GEN_SPEED) + set(ARG_TBL_GEN_SPEED "slow") + endif() + + gen_proof(${example_target} ${ARG_CURVE_TYPE} ${ARG_MAX_NUM_PROVERS} ${ARG_TBL_GEN_SPEED}) add_dependencies(prove_rust_examples ${example_target}_prove) if(GENERATE_EVM_VERIFIER) diff --git a/libs/assigner b/libs/assigner index c1cad6c35..8ada9380d 160000 --- a/libs/assigner +++ b/libs/assigner @@ -1 +1 @@ -Subproject commit c1cad6c3541a7534ce3e85e6ec5b7002f67553dd +Subproject commit 8ada9380de2805700bb8ec940a7dd86dfc052821 diff --git a/libs/blueprint b/libs/blueprint index 5a2209e09..52e62046a 160000 --- a/libs/blueprint +++ b/libs/blueprint @@ -1 +1 @@ -Subproject commit 5a2209e09c1e19ad41b1d3ff308185ea03a3c114 +Subproject commit 52e62046a49775651fe12d3c823234aa5949abca diff --git a/libs/crypto3 b/libs/crypto3 index 1baa61944..fa99a2729 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit 1baa619449013b5fb2962b7edc59a14dbe2f59f2 +Subproject commit fa99a27290862118db4282833a8015179b2e6d66