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

Commit

Permalink
Few renames #36
Browse files Browse the repository at this point in the history
  • Loading branch information
ETatuzova authored and nkaskov committed Jan 3, 2024
1 parent 57d2a9b commit 7da0dec
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ namespace nil {
boost::filesystem::path input_circuit_file_path() const;
boost::filesystem::path input_assignment_file_path() const;
boost::filesystem::path output_proof_file_path() const;
std::size_t public_input_size() const;
std::size_t shared_size() const;
std::size_t public_input_rows() const;
std::size_t shared_rows() const;

bool is_skip_verification_mode_on() const;

Expand All @@ -67,8 +67,8 @@ namespace nil {
boost::filesystem::path circuit_file_path;
boost::filesystem::path assignment_table_file_path;
boost::filesystem::path proof_file_path;
std::size_t _public_input_size;
std::size_t _shared_size;
std::size_t _public_input_rows;
std::size_t _shared_rows;
bool skip_verification;
};
} // namespace aspects
Expand Down
12 changes: 6 additions & 6 deletions bin/proof-generator/include/nil/proof-generator/prover.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ namespace nil {
boost::filesystem::path assignment_table_file_name,
boost::filesystem::path proof_file,
bool skip_verification,
std::size_t public_input_size,
std::size_t shared_size
std::size_t public_input_rows,
std::size_t shared_rows
) {
using curve_type = nil::crypto3::algebra::curves::pallas;
using BlueprintFieldType = typename curve_type::base_field_type;
Expand Down Expand Up @@ -269,10 +269,10 @@ namespace nil {
{
std::array<std::size_t, PublicInputColumns> public_input_sizes;
for(std::size_t i = 0; i < PublicInputColumns; i++){
public_input_sizes[i] = public_input_size;
public_input_sizes[i] = public_input_rows;
}
if(PublicInputColumns > 1 && shared_size > 0){
public_input_sizes[PublicInputColumns - 1] = shared_size;
if(PublicInputColumns > 1 && shared_rows > 0){
public_input_sizes[PublicInputColumns - 1] = shared_rows;
}

proof_file.replace_extension(".json");
Expand All @@ -282,7 +282,7 @@ namespace nil {
placeholder_params,
nil::crypto3::zk::snark::placeholder_proof<BlueprintFieldType, placeholder_params>,
typename nil::crypto3::zk::snark::placeholder_public_preprocessor<BlueprintFieldType, placeholder_params>::preprocessed_data_type::common_data_type
>::generate_input(
>::generate_proof_json(
public_preprocessed_data.common_data.vk, assignment_table.public_inputs(), proof, public_input_sizes
);
output_file.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ namespace nil {
return out.str();
}

static inline std::string generate_input(
static inline std::string generate_proof_json(
const verification_key_type &vk,
const typename assignment_table_type::public_input_container_type &public_inputs,
const proof_type &proof,
Expand Down
24 changes: 12 additions & 12 deletions bin/proof-generator/src/aspects/prover_vanilla.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ namespace nil {
("proof", boost::program_options::value<std::string>(),"Output proof file")
("circuit,c", boost::program_options::value<std::string>(), "Circuit input file")
("assignment-table,t", boost::program_options::value<std::string>(), "Assignment table input file")
("public_input_size,p", boost::program_options::value<std::size_t>(), "Public input columns expected size")
("shared_size,s", boost::program_options::value<std::size_t>(), "Shared column expected size")
("used-public-input-rows,p", boost::program_options::value<std::size_t>(), "Public input columns expected size")
("used-shared-rows,s", boost::program_options::value<std::size_t>(), "Shared column expected size")
("log-level,l", boost::program_options::value<std::string>(), "Log level (trace, debug, info, warning, error, fatal)")
("skip-verification", "If set - skips verifiyng step of the generated proof");
// clang-format on
Expand Down Expand Up @@ -118,16 +118,16 @@ namespace nil {
BOOST_LOG_TRIVIAL(debug) << "Proof file path not specified, using default: " << proof_file_path;
}

if (vm.count("public_input_size")) {
_public_input_size = vm["public_input_size"].as<std::size_t>();
if (vm.count("used-public-input-rows")) {
_public_input_rows = vm["used-public-input-rows"].as<std::size_t>();
} else {
_public_input_size = 50;
_public_input_rows = 50;
}

if (vm.count("shared_size")) {
_shared_size = vm["shared_size"].as<std::size_t>();
if (vm.count("used-shared-rows")) {
_shared_rows = vm["used-shared-rows"].as<std::size_t>();
} else {
_shared_size = 0;
_shared_rows = 0;
}

if (vm.count("skip-verification")) {
Expand All @@ -147,12 +147,12 @@ namespace nil {
return assignment_table_file_path;
}

std::size_t prover_vanilla::public_input_size() const {
return _public_input_size;
std::size_t prover_vanilla::public_input_rows() const {
return _public_input_rows;
}

std::size_t prover_vanilla::shared_size() const {
return _shared_size;
std::size_t prover_vanilla::shared_rows() const {
return _shared_rows;
}

boost::filesystem::path prover_vanilla::output_proof_file_path() const {
Expand Down
6 changes: 3 additions & 3 deletions bin/proof-generator/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ struct prover {
context_.find<nil::proof_generator::aspects::prover_vanilla>()->input_assignment_file_path();

bool skip_verification = context_.find<nil::proof_generator::aspects::prover_vanilla>()->is_skip_verification_mode_on();
std::size_t public_input_size = context_.find<nil::proof_generator::aspects::prover_vanilla>()->public_input_size();
std::size_t shared_size = context_.find<nil::proof_generator::aspects::prover_vanilla>()->shared_size();
std::size_t public_input_rows = context_.find<nil::proof_generator::aspects::prover_vanilla>()->public_input_rows();
std::size_t shared_rows = context_.find<nil::proof_generator::aspects::prover_vanilla>()->shared_rows();

boost::filesystem::path proof_file = context_.find<nil::proof_generator::aspects::prover_vanilla>()->output_proof_file_path();

return nil::proof_generator::prover(
circuit_file_path, assignment_file_path, proof_file, skip_verification,
public_input_size, shared_size
public_input_rows, shared_rows
) ? 0 : 1;
}

Expand Down

0 comments on commit 7da0dec

Please sign in to comment.