-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into sync-noir
- Loading branch information
Showing
209 changed files
with
4,089 additions
and
5,216 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.secrets |
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
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
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.