-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Establish API in purely virtual class - This is just a first pass. I will continue to work on this before showing dev rel and others to get buy-in. - Implement some API functions for ClientIVC: prove, verify, prove_and_verify - Support for constructing CIVC proof for input a single circuit - This is interpreted as a "compiletime stack" - Produces ECCVM and Translator proofs from dummy/empty data; future optimization could avoid. - Add `one_circuit` to CIVC to encode whether the MH part of the CIVC proof should be a hiding circuit (which takes a folding proof) or a proof for the single circuit. - Run almost all ACIR tests against ClientIVC - Previously only ran MegaHonk tests, which are not totally meaningful. - Four are skipped because they fail. These failures are expected to be superficial (see AztecProtocol/barretenberg#1164 and the references to it in the PR's new code). - fold_and_verify and mega honk flows go away in bb, but remain until bb.js alignment. - Delete large log file that should not be track (accounts for big negative diff).
- Loading branch information
1 parent
9106102
commit cc54a1e
Showing
31 changed files
with
554 additions
and
2,947 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
# this flow is deprecated. currently it is bb.js only. for bb is is replaced by: | ||
# prove_and_verify --scheme client_ivc --input-type compiletime_stack | ||
VFLAG=${VERBOSE:+-v} | ||
|
||
$BIN fold_and_verify_program $VFLAG -c $CRS_PATH -b ./target/program.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
VFLAG=${VERBOSE:+-v} | ||
INFLAG=${INPUT_TYPE=compiletime_stack} | ||
|
||
FLAGS="$CRS_PATH -b ./target/program.json $VFLAG --scheme client_ivc -c --input_type $INFLAG" | ||
|
||
$BIN prove_and_verify $FLAGS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
barretenberg/cpp/src/barretenberg/bb/acir_format_getters.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#pragma once | ||
#include "barretenberg/bb/config.hpp" | ||
#include "barretenberg/bb/file_io.hpp" | ||
#include "barretenberg/bb/get_bytecode.hpp" | ||
#include "barretenberg/dsl/acir_format/acir_format.hpp" | ||
#include "barretenberg/dsl/acir_format/acir_to_constraint_buf.hpp" | ||
|
||
namespace bb { | ||
|
||
acir_format::WitnessVector get_witness(std::string const& witness_path) | ||
{ | ||
auto witness_data = get_bytecode(witness_path); | ||
return acir_format::witness_buf_to_witness_data(witness_data); | ||
} | ||
|
||
acir_format::AcirFormat get_constraint_system(std::string const& bytecode_path, bool honk_recursion) | ||
{ | ||
auto bytecode = get_bytecode(bytecode_path); | ||
return acir_format::circuit_buf_to_acir_format(bytecode, honk_recursion); | ||
} | ||
|
||
acir_format::WitnessVectorStack get_witness_stack(std::string const& witness_path) | ||
{ | ||
auto witness_data = get_bytecode(witness_path); | ||
return acir_format::witness_buf_to_witness_stack(witness_data); | ||
} | ||
|
||
std::vector<acir_format::AcirFormat> get_constraint_systems(std::string const& bytecode_path, bool honk_recursion) | ||
{ | ||
auto bytecode = get_bytecode(bytecode_path); | ||
return acir_format::program_buf_to_acir_format(bytecode, honk_recursion); | ||
} | ||
|
||
} // namespace bb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#pragma once | ||
#include <filesystem> | ||
|
||
namespace bb { | ||
|
||
class API { | ||
public: | ||
struct Flags { | ||
std::optional<std::string> output_type; // bytes, fields, bytes_and_fields, fields_msgpack | ||
std::optional<std::string> input_type; // compiletime_stack, runtime_stack | ||
}; | ||
|
||
virtual void prove(const Flags& flags, | ||
const std::filesystem::path& bytecode_path, | ||
const std::filesystem::path& witness_path, | ||
const std::filesystem::path& output_dir) = 0; | ||
|
||
virtual bool verify(const Flags& flags, | ||
const std::filesystem::path& proof_path, | ||
const std::filesystem::path& vk_path) = 0; | ||
|
||
virtual bool prove_and_verify(const Flags& flags, | ||
const std::filesystem::path& bytecode_path, | ||
const std::filesystem::path& witness_path) = 0; | ||
|
||
virtual void gates(const Flags& flags, | ||
const std::filesystem::path& bytecode_path, | ||
const std::filesystem::path& witness_path) = 0; | ||
|
||
virtual void contract(const Flags& flags, | ||
const std::filesystem::path& output_path, | ||
const std::filesystem::path& vk_path) = 0; | ||
|
||
virtual void to_fields(const Flags& flags, | ||
const std::filesystem::path& proof_path, | ||
const std::filesystem::path& vk_path, | ||
const std::filesystem::path& output_path) = 0; | ||
}; | ||
} // namespace bb |
Oops, something went wrong.