Skip to content

Commit

Permalink
Placeholder_info object updated#78
Browse files Browse the repository at this point in the history
  • Loading branch information
ETatuzova committed Apr 25, 2024
1 parent 3f607e0 commit 994527c
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ namespace nil {
std::size_t permutation_batch_size;
bool use_lookups;
bool use_permutations;
std::size_t points_num;
std::size_t table_values_num;

// Commitments order in placeholder proof
int variable_value_batch_order;
Expand All @@ -66,6 +68,7 @@ namespace nil {
// Polynomial_amount
std::size_t permutation_poly_amount;
std::size_t lookup_poly_amount;
std::size_t sorted_poly_amount;

std::size_t permutation_size;
std::size_t round_proof_layers_num;
Expand Down Expand Up @@ -135,8 +138,6 @@ namespace nil {
}

if(res.use_lookups) res.batches_sizes[cur++] = constraint_system.sorted_lookup_columns_number();
res.poly_num = std::accumulate(res.batches_sizes.begin(), res.batches_sizes.end(), 0);

res.round_proof_layers_num = 0;
for(std::size_t i = 0; i < fri_params.r; i++ ){
res.round_proof_layers_num += log2(fri_params.D[i]->m) -1;
Expand All @@ -149,12 +150,15 @@ namespace nil {

std::map<std::size_t, std::size_t> zero_indices;

res.points_num = 2 * res.permutation_size + 4;
res.table_values_num = 0;
for(std::size_t i = 0; i < common_data.desc.constant_columns; i++){
for(auto& rot: col_rotations[i + common_data.desc.witness_columns + common_data.desc.public_input_columns]){
variable_type v(i, rot, true, variable_type::column_type::constant);
res.var_indices[v] = j;
if( rot == 0 ) zero_indices[i + common_data.desc.witness_columns + common_data.desc.public_input_columns] = j;
j++;
res.table_values_num++;
}
}
for(std::size_t i = 0; i < common_data.desc.selector_columns; i++){
Expand All @@ -163,6 +167,7 @@ namespace nil {
res.var_indices[v] = j;
if( rot == 0) zero_indices[i + common_data.desc.witness_columns + common_data.desc.public_input_columns + common_data.desc.constant_columns] = j;
j++;
res.table_values_num++;
}
}
for(std::size_t i = 0; i < common_data.desc.witness_columns; i++){
Expand All @@ -171,6 +176,7 @@ namespace nil {
res.var_indices[v] = j;
if(rot == 0) zero_indices[i] = j;
j++;
res.table_values_num++;
}
}
for(std::size_t i = 0; i < common_data.desc.public_input_columns; i++){
Expand All @@ -179,14 +185,27 @@ namespace nil {
res.var_indices[v] = j;
if(rot == 0) zero_indices[i + common_data.desc.witness_columns] = j;
j++;
res.table_values_num++;
}
}
res.points_num += res.table_values_num;

for( std::size_t i = 0; i < common_data.permuted_columns.size(); i++ ){
std::size_t ind = common_data.permuted_columns[i];
res.permuted_zero_indices.push_back(zero_indices[ind]);
}

if( res.use_permutations ){
res.points_num += res.permutation_poly_amount + 1;
}
if( res.use_lookups ){
res.points_num += res.lookup_poly_amount + 1;
}
res.points_num += res.quotient_size;
res.points_num += constraint_system.sorted_lookup_columns_number() * 3;

res.sorted_poly_amount = constraint_system.sorted_lookup_columns_number();

return res;
}

Expand Down

0 comments on commit 994527c

Please sign in to comment.