Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
acvm 0.24
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed Aug 31, 2023
1 parent 2a9211f commit 8c8e0d8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 33 deletions.
21 changes: 7 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -13,7 +13,7 @@ license = "MIT OR Apache-2.0"
crate-type = ["cdylib", "lib"]

[dependencies]
acvm = { version = "0.23.0", features = ["bn254"] }
acvm = { git = "https://github.com/noir-lang/acvm", features = ["bn254"] }
thiserror = "1.0.21"
base64 = "0.21.2"

Expand Down
9 changes: 2 additions & 7 deletions src/proof_system.rs
Expand Up @@ -63,12 +63,10 @@ impl ProofSystemCompiler for Barretenberg {
}
}

fn prove_with_pk(
fn prove(
&self,
_common_reference_string: &[u8],
circuit: &Circuit,
witness_values: WitnessMap,
_proving_key: &[u8],
is_recursive: bool,
) -> Result<Vec<u8>, Self::Error> {
let temp_directory = tempdir().expect("could not create a temporary directory");

Check warning on line 72 in src/proof_system.rs

View workflow job for this annotation

GitHub Actions / Spellcheck / Spellcheck

Unknown word (tempdir)
Expand Down Expand Up @@ -117,13 +115,11 @@ impl ProofSystemCompiler for Barretenberg {
Ok(proof)
}

fn verify_with_vk(
fn verify(
&self,
_common_reference_string: &[u8],
proof: &[u8],
public_inputs: WitnessMap,
circuit: &Circuit,
_verification_key: &[u8],
is_recursive: bool,
) -> Result<bool, Self::Error> {
let temp_directory = tempdir().expect("could not create a temporary directory");

Check warning on line 125 in src/proof_system.rs

View workflow job for this annotation

GitHub Actions / Spellcheck / Spellcheck

Unknown word (tempdir)
Expand Down Expand Up @@ -184,7 +180,6 @@ impl ProofSystemCompiler for Barretenberg {

fn vk_as_fields(
&self,
_common_reference_string: &[u8],
_verification_key: &[u8],
) -> Result<(Vec<FieldElement>, FieldElement), Self::Error> {
panic!("vk_as_fields not supported in this backend");
Expand Down
14 changes: 3 additions & 11 deletions src/smart_contract.rs
Expand Up @@ -13,12 +13,7 @@ const ULTRA_VERIFIER_CONTRACT: &str = include_str!("contract.sol");
impl SmartContract for Barretenberg {
type Error = BackendError;

fn eth_contract_from_vk(
&self,
_common_reference_string: &[u8],
circuit: &Circuit,
_verification_key: &[u8],
) -> Result<String, Self::Error> {
fn eth_contract(&self, circuit: &Circuit) -> Result<String, Self::Error> {
let temp_directory = tempdir().expect("could not create a temporary directory");

Check warning on line 17 in src/smart_contract.rs

View workflow job for this annotation

GitHub Actions / Spellcheck / Spellcheck

Unknown word (tempdir)
let temp_directory_path = temp_directory.path();
let temp_dir_path = temp_directory_path.to_str().unwrap();
Expand Down Expand Up @@ -91,15 +86,12 @@ mod tests {
private_parameters: BTreeSet::from([Witness(1), Witness(2)]),
public_parameters: PublicInputs::default(),
return_values: PublicInputs::default(),
assert_messages: Default::default(),
};

let bb = Barretenberg;

let common_reference_string = Vec::new();
let verification_key = Vec::new();
let contract = bb
.eth_contract_from_vk(&common_reference_string, &circuit, &verification_key)
.unwrap();
let contract = bb.eth_contract(&circuit).unwrap();

assert!(contract.contains("contract BaseUltraVerifier"));
assert!(contract.contains("contract UltraVerifier"));
Expand Down

0 comments on commit 8c8e0d8

Please sign in to comment.