Skip to content

Commit

Permalink
Poseidon refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
x-mass committed Apr 18, 2024
1 parent 6c92fb0 commit 462a33c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions bin/proof-generator/include/nil/proof-generator/prover.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/detail/placeholder_policy.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/detail/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 @@ -257,7 +259,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>;
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 +280,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 @@ -329,7 +331,7 @@ namespace nil {
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_)
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
Expand Down
2 changes: 1 addition & 1 deletion libs/crypto3
Submodule crypto3 updated 3 files
+1 −1 libs/algebra
+1 −1 libs/marshalling/zk
+1 −1 libs/zk
2 changes: 1 addition & 1 deletion libs/transpiler

0 comments on commit 462a33c

Please sign in to comment.