Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SyncWith:crypto3-zk#263] Q computation updated #263 #264

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions include/nil/crypto3/zk/commitments/detail/polynomial/basic_fri.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace nil {
using polynomial_type = math::polynomial<typename FieldType::value_type>;

struct params_type {

using field_type = FieldType;
using merkle_tree_type = containers::merkle_tree<MerkleTreeHashType, 2>;
using merkle_proof_type = typename containers::merkle_proof<MerkleTreeHashType, 2>;
Expand Down Expand Up @@ -143,7 +143,7 @@ namespace nil {

const std::size_t max_degree;
const std::vector<std::shared_ptr<math::evaluation_domain<FieldType>>> D;

// The total number of FRI-rounds, the sum of 'step_list'.
const std::size_t r;
const std::vector<std::size_t> step_list;
Expand Down Expand Up @@ -584,7 +584,7 @@ namespace nil {

return correct_order_idx;
}

template<typename FRI, typename PolynomialType,
typename std::enable_if<
std::is_base_of<
Expand All @@ -595,7 +595,7 @@ namespace nil {
FRI::use_grinding, typename FRI::grinding_type>,
FRI>::value,
bool>::type = true>
static typename FRI::proof_type proof_eval(
static typename FRI::proof_type proof_eval(
const std::map<std::size_t, std::vector<PolynomialType>> &g,
const PolynomialType combined_Q,
const std::map<std::size_t, typename FRI::precommitment_type> &precommitments,
Expand All @@ -604,7 +604,7 @@ namespace nil {
typename FRI::transcript_type &transcript
) {
typename FRI::proof_type proof;

BOOST_ASSERT(check_step_list<FRI>(fri_params));
// TODO: add necessary checks
//BOOST_ASSERT(check_initial_precommitment<FRI>(precommitments, fri_params));
Expand Down Expand Up @@ -682,9 +682,11 @@ namespace nil {
) {
for (const auto &[key, poly_vector]: g) {
for (const auto& poly: poly_vector) {
// All the polynomials have the same size, so we have no bugs here.
if (poly.size() != fri_params.D[0]->size()) {
g_coeffs[key].emplace_back(poly.coefficients());
g_coeffs[key].emplace_back(poly.coefficients());
} else {
// These polynomials won't be used
g_coeffs[key].emplace_back(math::polynomial<typename FRI::field_type::value_type>());
}
}
}
Expand Down Expand Up @@ -819,7 +821,7 @@ namespace nil {
BOOST_ASSERT(combined_U.size() == denominators.size());
std::size_t evals_num = combined_U.size();
// TODO: Add size correcness checks.

if (proof.final_polynomial.degree() >
std::pow(2, std::log2(fri_params.max_degree + 1) - fri_params.r + 1) - 1) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ namespace nil {
PROFILE_PLACEHOLDER_SCOPE("split_polynomial_dfs_conversion_time");

std::size_t split_polynomial_size = std::max(
(preprocessed_public_data.identity_polynomials.size() + 1) * (preprocessed_public_data.common_data.rows_amount -1 ),
(preprocessed_public_data.identity_polynomials.size() + 2) * (preprocessed_public_data.common_data.rows_amount -1 ),
(constraint_system.lookup_poly_degree_bound() + 1) * (preprocessed_public_data.common_data.rows_amount -1 )//,
);
split_polynomial_size = std::max(
Expand Down Expand Up @@ -386,7 +386,7 @@ namespace nil {
if(_is_lookup_enabled){
_commitment_scheme.append_eval_point(LOOKUP_BATCH, _proof.eval_proof.challenge);
_commitment_scheme.append_eval_point(LOOKUP_BATCH, _proof.eval_proof.challenge * _omega);
_commitment_scheme.append_eval_point(LOOKUP_BATCH, _proof.eval_proof.challenge *
_commitment_scheme.append_eval_point(LOOKUP_BATCH, _proof.eval_proof.challenge *
_omega.pow(preprocessed_public_data.common_data.usable_rows_amount));
}

Expand Down
Loading