diff --git a/include/nil/actor/zk/snark/arithmetization/plonk/detail/lookup_table_definition.hpp b/include/nil/actor/zk/snark/arithmetization/plonk/detail/lookup_table_definition.hpp index f30843e5..a29df889 100644 --- a/include/nil/actor/zk/snark/arithmetization/plonk/detail/lookup_table_definition.hpp +++ b/include/nil/actor/zk/snark/arithmetization/plonk/detail/lookup_table_definition.hpp @@ -33,7 +33,7 @@ namespace nil { namespace actor { namespace zk { namespace snark { - namespace detail { + namespace detail { // Interf-ace for lookup table definitions. template class lookup_subtable_definition{ @@ -53,7 +53,7 @@ namespace nil { lookup_table_definition(const std::string table_name){ this->table_name = table_name; - } + } virtual void generate() = 0; virtual std::size_t get_columns_number() = 0; @@ -89,7 +89,7 @@ namespace nil { template std::size_t pack_lookup_tables( const std::map &lookup_table_ids, - const std::map>> &lookup_tables, + const std::map>> &lookup_tables, plonk_constraint_system &bp, plonk_assignment_table &assignment, const std::vector &constant_columns_ids, @@ -119,10 +119,11 @@ namespace nil { for( const auto&[k, table]:lookup_tables ){ // Place table into constant_columns. for( std::size_t i = 0; i < table->get_table().size(); i++ ){ - if(constant_columns[i].size() < start_row + table->get_table()[i].size()){ - constant_columns[i].resize(start_row + table->get_table()[i].size()); - if( usable_rows_after < start_row + table->get_table()[i].size() ){ - usable_rows_after = start_row + table->get_table()[i].size(); + auto end = start_row + table->get_table()[i].size(); + if(constant_columns[i].size() < end){ + constant_columns[i].resize(end); + if( usable_rows_after < end ){ + usable_rows_after = end; } } for( std::size_t j = 0; j < table->get_table()[i].size(); j++ ){ @@ -142,7 +143,7 @@ namespace nil { std::vector> option; for( const auto &column_index:subtable.column_indices ){ option.emplace_back( plonk_variable( - constant_columns_ids[column_index], 0, + constant_columns_ids[column_index], 0, false, plonk_variable::column_type::constant ) ); }