Skip to content

Commit

Permalink
Split placeholder tests #330
Browse files Browse the repository at this point in the history
  • Loading branch information
vo-nil committed May 20, 2024
1 parent 6431244 commit 96cc7af
Show file tree
Hide file tree
Showing 12 changed files with 2,154 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,8 @@ namespace nil {
std::size_t id1 = s_indices[j][0] < s_indices[j][1] ? 1 : 0;
Q[j][0] -= combined_U[p];
Q[j][1] -= combined_U[p];
Q[j][0] /= denominators[p].evaluate(s[j][id0]);
Q[j][1] /= denominators[p].evaluate(s[j][id1]);
Q[j][0] *= denominators[p].evaluate(s[j][id0]).inversed();
Q[j][1] *= denominators[p].evaluate(s[j][id1]).inversed();
y[j][0] += Q[j][0];
y[j][1] += Q[j][1];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ namespace nil {
auto reduced_g = reduce_dfs_polynomial_domain(g, basic_domain->m);
auto reduced_h = reduce_dfs_polynomial_domain(h, basic_domain->m);
for( std::size_t j = 0; j < preprocessed_data.common_data.desc.usable_rows_amount; j++){
current_poly[j] = (previous_poly[j] * reduced_g[j]) / reduced_h[j];
current_poly[j] = (previous_poly[j] * reduced_g[j]) * reduced_h[j].inversed();
}
commitment_scheme.append_to_batch(PERMUTATION_BATCH, current_poly);
auto par = lookup_alphas[i] * (previous_poly * g - current_poly * h);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ namespace nil {
nom *= g_v[i][j - 1];
denom *= h_v[i][j - 1];
}
V_P[j] = V_P[j - 1] * nom / denom;
V_P[j] = V_P[j - 1] * nom * denom.inversed();
}

// 4. Compute and add commitment to $V_P$ to $\text{transcript}$.
Expand Down Expand Up @@ -198,7 +198,7 @@ namespace nil {
auto reduced_g = reduce_dfs_polynomial_domain(g, basic_domain->m);
auto reduced_h = reduce_dfs_polynomial_domain(h, basic_domain->m);
for(std::size_t j = 0; j < preprocessed_data.common_data.desc.usable_rows_amount; j++){
current_poly[j] = (previous_poly[j] * reduced_g[j]) / reduced_h[j];
current_poly[j] = (previous_poly[j] * reduced_g[j]) * reduced_h[j].inversed();
}
commitment_scheme.append_to_batch(PERMUTATION_BATCH, current_poly);
auto part = permutation_alphas[i] * (previous_poly * g - current_poly * h);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ namespace nil {
auto omega = common_data.basic_domain->get_domain_element(1);
auto challenge = proof.eval_proof.challenge;
auto numerator = challenge.pow(table_description.rows_amount) - FieldType::value_type::one();
numerator /= typename FieldType::value_type(table_description.rows_amount);
numerator *= typename FieldType::value_type(table_description.rows_amount).inversed();

// If public input sizes are set, all of them should be set.
if(constraint_system.public_input_sizes_num() != 0 && constraint_system.public_input_sizes_num() != table_description.public_input_columns){
Expand All @@ -165,7 +165,7 @@ namespace nil {
max_size = std::min(max_size, constraint_system.public_input_size(i));
auto omega_pow = FieldType::value_type::one();
for( std::size_t j = 0; j < max_size; ++j ){
value += (public_input[i][j] * omega_pow) / (challenge - omega_pow);
value += (public_input[i][j] * omega_pow) * (challenge - omega_pow).inversed();
omega_pow = omega_pow * omega;
}
value *= numerator;
Expand Down
7 changes: 6 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@ set(TESTS_NAMES
"systems/plonk/pickles/to_field"
"systems/plonk/pickles/to_group"

"systems/plonk/placeholder/placeholder"
"systems/plonk/placeholder/placeholder_circuits"
"systems/plonk/placeholder/placeholder_lookup_argument"
"systems/plonk/placeholder/placeholder_gate_argument"
"systems/plonk/placeholder/placeholder_permutation_argument"
"systems/plonk/placeholder/placeholder_kzg"
"systems/plonk/placeholder/placeholder_hashes"

# "systems/pcd/r1cs_pcd/r1cs_mp_ppzkpcd/r1cs_mp_ppzkpcd"
# "systems/pcd/r1cs_pcd/r1cs_sp_ppzkpcd/r1cs_sp_ppzkpcd"
Expand Down
Loading

0 comments on commit 96cc7af

Please sign in to comment.