diff --git a/bin/proof-generator/include/nil/proof-generator/prover.hpp b/bin/proof-generator/include/nil/proof-generator/prover.hpp index 192be3e9..e18b9d2b 100644 --- a/bin/proof-generator/include/nil/proof-generator/prover.hpp +++ b/bin/proof-generator/include/nil/proof-generator/prover.hpp @@ -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(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, typename nil::crypto3::zk::snark::placeholder_public_preprocessor::preprocessed_data_type::common_data_type @@ -213,7 +214,7 @@ namespace nil { *public_inputs_, proof, (*constraint_system_).public_input_sizes() ); - output_file.close(); + output_file->close(); return res; } diff --git a/bin/proof-generator/src/arg_parser.cpp b/bin/proof-generator/src/arg_parser.cpp index 01c93988..11d96e31 100644 --- a/bin/proof-generator/src/arg_parser.cpp +++ b/bin/proof-generator/src/arg_parser.cpp @@ -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"); @@ -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>, "poseidon") +#define HASH_TYPES \ + X(nil::crypto3::hashes::keccak_1600<256>, "keccak") \ + X(nil::crypto3::hashes::poseidon>, "poseidon") #define X(type, name) TYPE_TO_STRING(type, name) GENERATE_WRITE_OPERATOR(HASH_TYPES, HashesVariant) #undef X