Skip to content
This repository has been archived by the owner on Feb 17, 2025. It is now read-only.

Commit

Permalink
Required changes added #86
Browse files Browse the repository at this point in the history
  • Loading branch information
ETatuzova committed Mar 22, 2024
1 parent 51f0ff7 commit 88444f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
9 changes: 5 additions & 4 deletions bin/proof-generator/include/nil/proof-generator/prover.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,10 @@ namespace nil {
}

BOOST_LOG_TRIVIAL(info) << "Writing json proof to " << json_file_;
std::ofstream output_file;
output_file.open(json_file_);
output_file << nil::blueprint::recursive_verifier_generator<
auto output_file = open_file<std::ofstream>(json_file_.string(), std::ios_base::out);
if( !output_file ) return res;

(*output_file) << nil::blueprint::recursive_verifier_generator<
PlaceholderParams,
nil::crypto3::zk::snark::placeholder_proof<BlueprintField, PlaceholderParams>,
typename nil::crypto3::zk::snark::placeholder_public_preprocessor<BlueprintField, PlaceholderParams>::preprocessed_data_type::common_data_type
Expand All @@ -213,7 +214,7 @@ namespace nil {
*public_inputs_, proof,
(*constraint_system_).public_input_sizes()
);
output_file.close();
output_file->close();

return res;
}
Expand Down
12 changes: 7 additions & 5 deletions bin/proof-generator/src/arg_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ namespace nil {
// clang-format off
auto options_appender = config.add_options()
("proof,p", make_defaulted_option(prover_options.proof_file_path), "Output proof file")
("json,json", make_defaulted_option(prover_options.json_file_path), "JSON proof file")
("common-data", make_defaulted_option(prover_options.preprocessed_common_data_path), "Output preprocessed common data file")
("json,j", make_defaulted_option(prover_options.json_file_path), "JSON proof file")
("common-data,d", make_defaulted_option(prover_options.preprocessed_common_data_path), "Output preprocessed common data file")
("circuit,c", po::value(&prover_options.circuit_file_path)->required(), "Circuit input file")
("assignment-table,t", po::value(&prover_options.assignment_table_file_path)->required(), "Assignment table input file")
("log-level,l", make_defaulted_option(prover_options.log_level), "Log level (trace, debug, info, warning, error, fatal)")
("elliptic-curve-type,e", make_defaulted_option(prover_options.elliptic_curve_type), "Elliptic curve type (pallas)")
("hash-type", make_defaulted_option(prover_options.hash_type), "Hash type (keccak, poseidon)")
("lambda-param", make_defaulted_option(prover_options.lambda), "Lambda param (9)")
("lambda-param,l", make_defaulted_option(prover_options.lambda), "Lambda param (9)")
("grind-param", make_defaulted_option(prover_options.grind), "Grind param (69)")
("expand-factor", make_defaulted_option(prover_options.expand_factor), "Expand factor")
("expand-factor,x", make_defaulted_option(prover_options.expand_factor), "Expand factor")
("component-constant-columns", make_defaulted_option(prover_options.component_constant_columns), "Component constant columns")
("skip-verification", po::bool_switch(&prover_options.skip_verification), "Skip generated proof verifying step")
("verification-only", po::bool_switch(&prover_options.verification_only), "Read proof for verification instead of writing to it");
Expand Down Expand Up @@ -240,7 +240,9 @@ namespace nil {
GENERATE_READ_OPERATOR(CURVE_TYPES, CurvesVariant)
#undef X

#define HASH_TYPES X(nil::crypto3::hashes::keccak_1600<256>, "keccak") X(nil::crypto3::hashes::poseidon<nil::crypto3::hashes::detail::mina_poseidon_policy<typename nil::crypto3::algebra::curves::pallas::base_field_type>>, "poseidon")
#define HASH_TYPES \
X(nil::crypto3::hashes::keccak_1600<256>, "keccak") \
X(nil::crypto3::hashes::poseidon<nil::crypto3::hashes::detail::mina_poseidon_policy<typename nil::crypto3::algebra::curves::pallas::base_field_type>>, "poseidon")
#define X(type, name) TYPE_TO_STRING(type, name)
GENERATE_WRITE_OPERATOR(HASH_TYPES, HashesVariant)
#undef X
Expand Down

0 comments on commit 88444f1

Please sign in to comment.