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

Update actor/crypto3 zk #90

Closed
wants to merge 1 commit into from
Closed
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
20 changes: 12 additions & 8 deletions bin/proof-generator/include/nil/proof-generator/prover.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
#include <nil/crypto3/zk/snark/arithmetization/plonk/constraint_system.hpp>
#include <nil/crypto3/zk/snark/arithmetization/plonk/params.hpp>
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/detail/placeholder_policy.hpp>
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/detail/profiling.hpp>
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/params.hpp>
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/preprocessor.hpp>
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/profiling.hpp>
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/proof.hpp>
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/prover.hpp>
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/verifier.hpp>
Expand Down Expand Up @@ -117,6 +117,7 @@ namespace nil {
template<typename FRIScheme, typename FieldType>
typename FRIScheme::params_type create_fri_params(
std::size_t degree_log,
std::size_t lambda,
const int max_step = 1,
std::size_t expand_factor = 0
) {
Expand All @@ -126,7 +127,8 @@ namespace nil {
(1 << degree_log) - 1, // max_degree
nil::crypto3::math::calculate_domain_set<FieldType>(degree_log + expand_factor, r),
generate_random_step_list(r, max_step),
expand_factor
expand_factor,
lambda
);
}
} // namespace detail
Expand Down Expand Up @@ -256,8 +258,7 @@ namespace nil {

private:
using BlueprintField = typename CurveType::base_field_type;
using LpcParams = nil::crypto3::zk::commitments::
list_polynomial_commitment_params<HashType, HashType, all_lambda_params[LambdaParamIdx], 2>;
using LpcParams = nil::crypto3::zk::commitments::list_polynomial_commitment_params<HashType, HashType, 2>;
using Lpc = nil::crypto3::zk::commitments::list_polynomial_commitment<BlueprintField, LpcParams>;
using LpcScheme = typename nil::crypto3::zk::commitments::lpc_commitment_scheme<Lpc>;
using CircuitParams = nil::crypto3::zk::snark::placeholder_circuit_params<BlueprintField>;
Expand All @@ -278,7 +279,7 @@ namespace nil {
BOOST_LOG_TRIVIAL(info) << "Verifying proof...";
bool verification_result =
nil::crypto3::zk::snark::placeholder_verifier<BlueprintField, PlaceholderParams>::process(
*public_preprocessed_data_,
public_preprocessed_data_->common_data,
proof,
*table_description_,
*constraint_system_,
Expand Down Expand Up @@ -328,9 +329,12 @@ namespace nil {
// Lambdas and grinding bits should be passed threw preprocessor directives
std::size_t table_rows_log = std::ceil(std::log2(table_description_->rows_amount));

fri_params_.emplace(
detail::create_fri_params<typename Lpc::fri_type, BlueprintField>(table_rows_log, 1, expand_factor_)
);
fri_params_.emplace(detail::create_fri_params<typename Lpc::fri_type, BlueprintField>(
table_rows_log,
all_lambda_params[LambdaParamIdx],
1,
expand_factor_
));

std::size_t permutation_size = table_description_->witness_columns
+ table_description_->public_input_columns + component_constant_columns_;
Expand Down
2 changes: 1 addition & 1 deletion libs/actor/zk
Submodule zk updated 26 files
+232 −81 include/nil/crypto3/zk/commitments/detail/polynomial/basic_fri.hpp
+17 −26 include/nil/crypto3/zk/commitments/detail/polynomial/proof_of_work.hpp
+4 −9 include/nil/crypto3/zk/commitments/polynomial/fri.hpp
+20 −6 include/nil/crypto3/zk/commitments/polynomial/kzg.hpp
+348 −0 include/nil/crypto3/zk/commitments/polynomial/kzg_v2.hpp
+60 −46 include/nil/crypto3/zk/commitments/polynomial/lpc.hpp
+30 −2 include/nil/crypto3/zk/commitments/type_traits.hpp
+19 −6 include/nil/crypto3/zk/snark/arithmetization/plonk/constraint_system.hpp
+69 −1 include/nil/crypto3/zk/snark/arithmetization/plonk/copy_constraint.hpp
+16 −0 include/nil/crypto3/zk/snark/arithmetization/plonk/table_description.hpp
+65 −4 include/nil/crypto3/zk/snark/systems/plonk/placeholder/detail/profiling.hpp
+229 −40 include/nil/crypto3/zk/snark/systems/plonk/placeholder/lookup_argument.hpp
+165 −45 include/nil/crypto3/zk/snark/systems/plonk/placeholder/permutation_argument.hpp
+114 −62 include/nil/crypto3/zk/snark/systems/plonk/placeholder/preprocessor.hpp
+3 −1 include/nil/crypto3/zk/snark/systems/plonk/placeholder/proof.hpp
+23 −16 include/nil/crypto3/zk/snark/systems/plonk/placeholder/prover.hpp
+105 −65 include/nil/crypto3/zk/snark/systems/plonk/placeholder/verifier.hpp
+5 −2 test/commitment/fri.cpp
+354 −0 test/commitment/kzg.cpp
+26 −16 test/commitment/lpc.cpp
+12 −9 test/commitment/lpc_performance.cpp
+10 −11 test/commitment/proof_of_work.cpp
+92 −27 test/systems/plonk/placeholder/circuits.hpp
+7 −20 test/systems/plonk/placeholder/performance.cpp
+457 −95 test/systems/plonk/placeholder/placeholder.cpp
+35 −3 test/systems/plonk/plonk_constraint.cpp
2 changes: 1 addition & 1 deletion libs/crypto3
Loading