diff --git a/Cargo.lock b/Cargo.lock index 42476cea2a4..1807a7d4527 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,11 +16,11 @@ dependencies = [ [[package]] name = "acir" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d756bcab90b3a4a84dc53245890cf9bb8fcde31a1394931f5abca551b48eb20" +checksum = "104242ac56c936464e3ac9618e1f635151e83334d8d4138f9a39490ca11acaa9" dependencies = [ - "acir_field 0.4.1", + "acir_field 0.5.0", "flate2", "rmp-serde", "serde", @@ -33,8 +33,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "687506e635efa7ce15d6b93ceae14dec1519ed2e54c24298fc8c40e86edbce24" dependencies = [ "ark-bls12-381", - "ark-bn254", - "ark-ff", + "ark-bn254 0.3.0", + "ark-ff 0.3.0", "blake2", "cfg-if 1.0.0", "hex", @@ -45,12 +45,13 @@ dependencies = [ [[package]] name = "acir_field" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb7e1e30625a9125a0e700c6c6fd7442ffbcb1d235933100b791ba3786ef49e" +checksum = "ebd6cc7ebc948cde55bf10a8c4f3e1479e03f34e00ee8ab83e86891b693dd503" dependencies = [ - "ark-bn254", - "ark-ff", + "ark-bn254 0.4.0", + "ark-ff 0.4.1", + "ark-serialize 0.4.1", "blake2", "cfg-if 1.0.0", "hex", @@ -80,14 +81,13 @@ dependencies = [ [[package]] name = "acvm" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c4fae94e7f3fe0d21bec4796de00bbf0cd8f781271b5203dea54897aa5387b9" +checksum = "6145438d6c89c208cae93e49b925b0e2ac1963048a8ee4e002ca0f0de87d789e" dependencies = [ - "acir 0.4.1", - "acvm_stdlib 0.4.1", + "acir 0.5.0", + "acvm_stdlib 0.5.0", "blake2", - "hex", "indexmap", "k256", "num-bigint", @@ -108,11 +108,11 @@ dependencies = [ [[package]] name = "acvm_stdlib" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf6617b72c2cd4e965d425bc768bb77a803e485a7e37cbc09cccc5967becd7a" +checksum = "aaabcf52a534df7ed591451cf5ac2a765416fee4e38e0c523cc29da8c244aa7c" dependencies = [ - "acir 0.4.1", + "acir 0.5.0", ] [[package]] @@ -141,6 +141,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.20" @@ -172,9 +183,9 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65be532f9dd1e98ad0150b037276cde464c6f371059e6dd02c0222395761f6aa" dependencies = [ - "ark-ec", - "ark-ff", - "ark-std", + "ark-ec 0.3.0", + "ark-ff 0.3.0", + "ark-std 0.3.0", ] [[package]] @@ -183,9 +194,20 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea691771ebbb28aea556c044e2e5c5227398d840cee0c34d4d20fa8eb2689e8c" dependencies = [ - "ark-ec", - "ark-ff", - "ark-std", + "ark-ec 0.3.0", + "ark-ff 0.3.0", + "ark-std 0.3.0", +] + +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec 0.4.1", + "ark-ff 0.4.1", + "ark-std 0.4.0", ] [[package]] @@ -194,10 +216,27 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dea978406c4b1ca13c2db2373b05cc55429c3575b8b21f1b9ee859aa5b03dd42" dependencies = [ - "ark-ff", - "ark-serialize", - "ark-std", + "ark-ff 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ec" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c60370a92f8e1a5f053cad73a862e1b99bc642333cd676fa11c0c39f80f4ac2" +dependencies = [ + "ark-ff 0.4.1", + "ark-poly 0.4.1", + "ark-serialize 0.4.1", + "ark-std 0.4.0", "derivative", + "hashbrown 0.13.2", + "itertools", "num-traits", "zeroize", ] @@ -208,10 +247,10 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" dependencies = [ - "ark-ff-asm", - "ark-ff-macros", - "ark-serialize", - "ark-std", + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", "derivative", "num-bigint", "num-traits", @@ -220,6 +259,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ark-ff" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2d42532524bee1da5a4f6f733eb4907301baa480829557adcff5dfaeee1d9a" +dependencies = [ + "ark-ff-asm 0.4.1", + "ark-ff-macros 0.4.1", + "ark-serialize 0.4.1", + "ark-std 0.4.0", + "derivative", + "digest 0.10.6", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.0", + "zeroize", +] + [[package]] name = "ark-ff-asm" version = "0.3.0" @@ -230,6 +289,16 @@ dependencies = [ "syn", ] +[[package]] +name = "ark-ff-asm" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6873aaba7959593d89babed381d33e2329453368f1bf3c67e07686a1c1056f" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "ark-ff-macros" version = "0.3.0" @@ -242,20 +311,33 @@ dependencies = [ "syn", ] +[[package]] +name = "ark-ff-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c2e7d0f2d67cc7fc925355c74d36e7eda19073639be4a0a233d4611b8c959d" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "ark-marlin" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "caa8510faa8e64f0a6841ee4b58efe2d56f7a80d86fa0ce9891bbb3aa20166d9" dependencies = [ - "ark-ff", - "ark-poly", + "ark-ff 0.3.0", + "ark-poly 0.3.0", "ark-poly-commit", "ark-relations", - "ark-serialize", - "ark-std", + "ark-serialize 0.3.0", + "ark-std 0.3.0", "derivative", - "digest", + "digest 0.9.0", "rand_chacha", ] @@ -265,26 +347,39 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b0f78f47537c2f15706db7e98fe64cc1711dbf9def81218194e17239e53e5aa" dependencies = [ - "ark-ff", - "ark-serialize", - "ark-std", + "ark-ff 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", "derivative", "hashbrown 0.11.2", ] +[[package]] +name = "ark-poly" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6ec811462cabe265cfe1b102fcfe3df79d7d2929c2425673648ee9abfd0272" +dependencies = [ + "ark-ff 0.4.1", + "ark-serialize 0.4.1", + "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", +] + [[package]] name = "ark-poly-commit" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a71ddfa72bad1446cab7bbecb6018dbbdc9abcbc3a0065483ae5186ad2a64dcd" dependencies = [ - "ark-ec", - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", + "ark-ec 0.3.0", + "ark-ff 0.3.0", + "ark-poly 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", "derivative", - "digest", + "digest 0.9.0", "tracing", ] @@ -294,8 +389,8 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cba4c1c99792a6834bd97f7fd76578ec2cd58d2afc5139a17e1d1bec65b38f6" dependencies = [ - "ark-ff", - "ark-std", + "ark-ff 0.3.0", + "ark-std 0.3.0", "tracing", ] @@ -305,9 +400,21 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" dependencies = [ - "ark-serialize-derive", - "ark-std", - "digest", + "ark-serialize-derive 0.3.0", + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e735959bc173ea4baf13327b19c22d452b8e9e8e8f7b7fc34e6bf0e316c33e" +dependencies = [ + "ark-serialize-derive 0.4.1", + "ark-std 0.4.0", + "digest 0.10.6", + "num-bigint", ] [[package]] @@ -321,6 +428,17 @@ dependencies = [ "syn", ] +[[package]] +name = "ark-serialize-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd34f0920d995d2c932f38861c416f70de89a6de9875876b012557079603e6cc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "ark-std" version = "0.3.0" @@ -331,6 +449,16 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + [[package]] name = "arkworks_backend" version = "0.1.0" @@ -338,14 +466,14 @@ source = "git+https://github.com/noir-lang/arkworks_backend?rev=2f3f0db182004d5c dependencies = [ "acvm 0.3.1", "ark-bls12-381", - "ark-bn254", - "ark-ff", + "ark-bn254 0.3.0", + "ark-ff 0.3.0", "ark-marlin", - "ark-poly", + "ark-poly 0.3.0", "ark-poly-commit", "ark-relations", - "ark-serialize", - "ark-std", + "ark-serialize 0.3.0", + "ark-std 0.3.0", "blake2", "cfg-if 1.0.0", ] @@ -385,7 +513,7 @@ dependencies = [ [[package]] name = "barretenberg_static_lib" version = "0.1.0" -source = "git+https://github.com/noir-lang/aztec_backend?rev=cff757dca7971161e4bd25e7a744d910c37c22be#cff757dca7971161e4bd25e7a744d910c37c22be" +source = "git+https://github.com/noir-lang/aztec_backend?rev=74b4d8d8b118e4477880c04149e5e9d93d388384#74b4d8d8b118e4477880c04149e5e9d93d388384" dependencies = [ "barretenberg_wrapper", "blake2", @@ -405,7 +533,7 @@ dependencies = [ [[package]] name = "barretenberg_wasm" version = "0.1.0" -source = "git+https://github.com/noir-lang/aztec_backend?rev=cff757dca7971161e4bd25e7a744d910c37c22be#cff757dca7971161e4bd25e7a744d910c37c22be" +source = "git+https://github.com/noir-lang/aztec_backend?rev=74b4d8d8b118e4477880c04149e5e9d93d388384#74b4d8d8b118e4477880c04149e5e9d93d388384" dependencies = [ "blake2", "common", @@ -479,7 +607,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" dependencies = [ "crypto-mac 0.8.0", - "digest", + "digest 0.9.0", "opaque-debug", ] @@ -733,9 +861,9 @@ dependencies = [ [[package]] name = "common" version = "0.1.0" -source = "git+https://github.com/noir-lang/aztec_backend?rev=cff757dca7971161e4bd25e7a744d910c37c22be#cff757dca7971161e4bd25e7a744d910c37c22be" +source = "git+https://github.com/noir-lang/aztec_backend?rev=74b4d8d8b118e4477880c04149e5e9d93d388384#74b4d8d8b118e4477880c04149e5e9d93d388384" dependencies = [ - "acvm 0.4.1", + "acvm 0.5.0", "blake2", "dirs 3.0.2", "downloader", @@ -932,6 +1060,16 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "crypto-mac" version = "0.8.0" @@ -1059,6 +1197,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "crypto-common", +] + [[package]] name = "dirs" version = "3.0.2" @@ -1125,7 +1272,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2db227e61a43a34915680bdda462ec0e212095518020a88a1f91acd16092c39" dependencies = [ "bitvec", - "digest", + "digest 0.9.0", "ff", "funty", "generic-array", @@ -1521,7 +1668,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash", + "ahash 0.7.6", ] [[package]] @@ -1530,7 +1677,16 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.6", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", ] [[package]] @@ -1576,7 +1732,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" dependencies = [ "crypto-mac 0.10.1", - "digest", + "digest 0.9.0", ] [[package]] @@ -1766,6 +1922,15 @@ dependencies = [ name = "iter-extended" version = "0.2.0" +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.5" @@ -1976,7 +2141,7 @@ checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" name = "nargo" version = "0.2.0" dependencies = [ - "acvm 0.4.1", + "acvm 0.5.0", "barretenberg_static_lib", "barretenberg_wasm", "build-data", @@ -2005,7 +2170,7 @@ dependencies = [ name = "noir_wasm" version = "0.2.0" dependencies = [ - "acvm 0.4.1", + "acvm 0.5.0", "build-data", "console_error_panic_hook", "getrandom", @@ -2021,7 +2186,7 @@ dependencies = [ name = "noirc_abi" version = "0.2.0" dependencies = [ - "acvm 0.4.1", + "acvm 0.5.0", "iter-extended", "serde", "serde_json", @@ -2033,7 +2198,7 @@ dependencies = [ name = "noirc_driver" version = "0.2.0" dependencies = [ - "acvm 0.4.1", + "acvm 0.5.0", "dirs 4.0.0", "fm", "noirc_abi", @@ -2057,7 +2222,7 @@ dependencies = [ name = "noirc_evaluator" version = "0.2.0" dependencies = [ - "acvm 0.4.1", + "acvm 0.5.0", "arena", "fm", "iter-extended", @@ -2074,7 +2239,7 @@ dependencies = [ name = "noirc_frontend" version = "0.2.0" dependencies = [ - "acvm 0.4.1", + "acvm 0.5.0", "arena", "chumsky", "fm", @@ -2878,7 +3043,7 @@ dependencies = [ "block-buffer", "cfg-if 1.0.0", "cpufeatures", - "digest", + "digest 0.9.0", "opaque-debug", ] @@ -2903,7 +3068,7 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29f060a7d147e33490ec10da418795238fd7545bba241504d6b31a409f2e6210" dependencies = [ - "digest", + "digest 0.9.0", "rand_core 0.5.1", ] diff --git a/Cargo.toml b/Cargo.toml index 6141d5e3c0a..dc61f50eb4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ edition = "2021" rust-version = "1.66" [workspace.dependencies] -acvm = "0.4.1" +acvm = "0.5.0" arena = { path = "crates/arena" } fm = { path = "crates/fm" } iter-extended = { path = "crates/iter-extended" } diff --git a/crates/nargo/Cargo.toml b/crates/nargo/Cargo.toml index ac5af0de804..069508d01c4 100644 --- a/crates/nargo/Cargo.toml +++ b/crates/nargo/Cargo.toml @@ -32,8 +32,8 @@ termcolor = "1.1.2" tempdir = "0.3.7" # Backends -aztec_backend = { optional = true, package = "barretenberg_static_lib", git = "https://github.com/noir-lang/aztec_backend", rev = "cff757dca7971161e4bd25e7a744d910c37c22be" } -aztec_wasm_backend = { optional = true, package = "barretenberg_wasm", git = "https://github.com/noir-lang/aztec_backend", rev = "cff757dca7971161e4bd25e7a744d910c37c22be" } +aztec_backend = { optional = true, package = "barretenberg_static_lib", git = "https://github.com/noir-lang/aztec_backend", rev = "74b4d8d8b118e4477880c04149e5e9d93d388384" } +aztec_wasm_backend = { optional = true, package = "barretenberg_wasm", git = "https://github.com/noir-lang/aztec_backend", rev = "74b4d8d8b118e4477880c04149e5e9d93d388384" } marlin_arkworks_backend = { optional = true, git = "https://github.com/noir-lang/marlin_arkworks_backend", rev = "144378edad821bfaa52bf2cacca8ecc87514a4fc" } color-eyre = "0.6.2" diff --git a/crates/nargo/src/cli/compile_cmd.rs b/crates/nargo/src/cli/compile_cmd.rs index 70b9d22f73b..ada806842c0 100644 --- a/crates/nargo/src/cli/compile_cmd.rs +++ b/crates/nargo/src/cli/compile_cmd.rs @@ -45,7 +45,7 @@ fn compile_and_preprocess_circuit>( let compiled_program = compile_circuit(program_dir, false, allow_warnings)?; let circuit_path = save_acir_to_dir(&compiled_program.circuit, circuit_name, &circuit_dir); - preprocess_with_path(circuit_name, circuit_dir, compiled_program.circuit)?; + preprocess_with_path(circuit_name, circuit_dir, &compiled_program.circuit)?; Ok(circuit_path) } @@ -65,7 +65,7 @@ pub fn compile_circuit>( fn preprocess_with_path>( key_name: &str, preprocess_dir: P, - circuit: Circuit, + circuit: &Circuit, ) -> Result<(PathBuf, PathBuf), CliError> { let backend = crate::backends::ConcreteBackend; diff --git a/crates/nargo/src/cli/contract_cmd.rs b/crates/nargo/src/cli/contract_cmd.rs index 1aa2711d679..175e69543b2 100644 --- a/crates/nargo/src/cli/contract_cmd.rs +++ b/crates/nargo/src/cli/contract_cmd.rs @@ -16,6 +16,7 @@ pub(crate) fn run(args: ContractCommand, config: NargoConfig) -> Result<(), CliE let compiled_program = compile_circuit(config.program_dir.clone(), false, args.allow_warnings)?; let backend = crate::backends::ConcreteBackend; + #[allow(deprecated)] let smart_contract_string = backend.eth_contract_from_cs(compiled_program.circuit); let mut contract_dir = config.program_dir; diff --git a/crates/nargo/src/cli/gates_cmd.rs b/crates/nargo/src/cli/gates_cmd.rs index bae5dd22953..875a28f84e3 100644 --- a/crates/nargo/src/cli/gates_cmd.rs +++ b/crates/nargo/src/cli/gates_cmd.rs @@ -38,7 +38,7 @@ pub fn count_gates_with_path>( num_opcodes ); - let exact_circuit_size = backend.get_exact_circuit_size(compiled_program.circuit); + let exact_circuit_size = backend.get_exact_circuit_size(&compiled_program.circuit); println!("Backend circuit size: {exact_circuit_size}"); Ok(()) diff --git a/crates/nargo/src/cli/prove_cmd.rs b/crates/nargo/src/cli/prove_cmd.rs index e71185fa732..3a3ef39dad1 100644 --- a/crates/nargo/src/cli/prove_cmd.rs +++ b/crates/nargo/src/cli/prove_cmd.rs @@ -81,7 +81,7 @@ pub fn prove_with_path>( } None => { let backend = crate::backends::ConcreteBackend; - backend.preprocess(compiled_program.circuit.clone()) + backend.preprocess(&compiled_program.circuit) } }; @@ -108,17 +108,16 @@ pub fn prove_with_path>( )?; let backend = crate::backends::ConcreteBackend; - let proof = - backend.prove_with_pk(compiled_program.circuit.clone(), solved_witness, proving_key); + let proof = backend.prove_with_pk(&compiled_program.circuit, solved_witness, &proving_key); if check_proof { let no_proof_name = "".into(); verify_proof( - compiled_program, + &compiled_program, public_inputs, return_value, &proof, - verification_key, + &verification_key, no_proof_name, )?; } diff --git a/crates/nargo/src/cli/verify_cmd.rs b/crates/nargo/src/cli/verify_cmd.rs index 8f5a1cc5789..ab1f8468b2c 100644 --- a/crates/nargo/src/cli/verify_cmd.rs +++ b/crates/nargo/src/cli/verify_cmd.rs @@ -4,7 +4,7 @@ use crate::{ constants::{PROOFS_DIR, PROOF_EXT, TARGET_DIR, VERIFIER_INPUT_FILE}, errors::CliError, }; -use acvm::{FieldElement, ProofSystemCompiler}; +use acvm::ProofSystemCompiler; use clap::Args; use noirc_abi::input_parser::{Format, InputValue}; use noirc_driver::CompiledProgram; @@ -54,7 +54,7 @@ fn verify_with_path>( } None => { let backend = crate::backends::ConcreteBackend; - backend.preprocess(compiled_program.circuit.clone()) + backend.preprocess(&compiled_program.circuit) } }; @@ -64,35 +64,29 @@ fn verify_with_path>( read_inputs_from_file(program_dir, VERIFIER_INPUT_FILE, Format::Toml, &public_abi)?; verify_proof( - compiled_program, + &compiled_program, public_inputs_map, return_value, &load_hex_data(&proof_path)?, - verification_key, + &verification_key, proof_path, ) } pub(crate) fn verify_proof( - compiled_program: CompiledProgram, + compiled_program: &CompiledProgram, public_inputs_map: InputMap, return_value: Option, proof: &[u8], - verification_key: Vec, + verification_key: &[u8], proof_name: PathBuf, ) -> Result<(), CliError> { - let public_abi = compiled_program.abi.public_abi(); + let public_abi = compiled_program.abi.clone().public_abi(); let public_inputs = public_abi.encode(&public_inputs_map, return_value)?; - let public_inputs_vec: Vec = public_inputs.values().copied().collect(); - let backend = crate::backends::ConcreteBackend; - let valid_proof = backend.verify_with_vk( - proof, - public_inputs_vec, - compiled_program.circuit, - verification_key, - ); + let valid_proof = + backend.verify_with_vk(proof, public_inputs, &compiled_program.circuit, verification_key); if valid_proof { Ok(()) diff --git a/crates/noirc_evaluator/src/lib.rs b/crates/noirc_evaluator/src/lib.rs index a6e47afbd2f..fb0ad69331b 100644 --- a/crates/noirc_evaluator/src/lib.rs +++ b/crates/noirc_evaluator/src/lib.rs @@ -5,7 +5,7 @@ mod ssa; use acvm::{ acir::circuit::{opcodes::Opcode as AcirOpcode, Circuit, PublicInputs}, acir::native_types::{Expression, Witness}, - compiler::fallback::IsBlackBoxSupported, + compiler::transformers::IsBlackBoxSupported, Language, }; use errors::{RuntimeError, RuntimeErrorKind}; diff --git a/crates/noirc_evaluator/src/ssa/acir_gen/constraints.rs b/crates/noirc_evaluator/src/ssa/acir_gen/constraints.rs index 645be675f40..47ffc1fd3c8 100644 --- a/crates/noirc_evaluator/src/ssa/acir_gen/constraints.rs +++ b/crates/noirc_evaluator/src/ssa/acir_gen/constraints.rs @@ -407,6 +407,7 @@ pub(crate) fn to_radix_base( a: lhs.clone(), b: result.clone(), radix, + is_little_endian: true, })); evaluator.opcodes.push(AcirOpcode::Arithmetic(subtract(lhs, FieldElement::one(), &bytes))); diff --git a/crates/noirc_evaluator/src/ssa/builtin.rs b/crates/noirc_evaluator/src/ssa/builtin.rs index 248cfe1e7a2..da1c51568dc 100644 --- a/crates/noirc_evaluator/src/ssa/builtin.rs +++ b/crates/noirc_evaluator/src/ssa/builtin.rs @@ -70,6 +70,9 @@ impl Opcode { BlackBoxFunc::AES => { todo!("ICE: AES is unimplemented") } + BlackBoxFunc::Keccak256 => { + todo!("ICE: Keccak256 is unimplemented") + } BlackBoxFunc::RANGE | BlackBoxFunc::AND | BlackBoxFunc::XOR => { unimplemented!("ICE: these opcodes do not have Noir builtin functions") } @@ -86,6 +89,9 @@ impl Opcode { Opcode::LowLevel(op) => { match op { BlackBoxFunc::AES => todo!("ICE: AES is unimplemented"), + BlackBoxFunc::Keccak256 => { + todo!("ICE: Keccak256 is unimplemented") + } BlackBoxFunc::SHA256 | BlackBoxFunc::Blake2s => (32, ObjectType::Unsigned(8)), BlackBoxFunc::HashToField128Security => (1, ObjectType::NativeField), // See issue #775 on changing this to return a boolean diff --git a/cspell.json b/cspell.json index 5126d7a0bdf..43bf6916bbb 100644 --- a/cspell.json +++ b/cspell.json @@ -4,6 +4,7 @@ // In code // "aeiou", + "arraysort", "arithmetization", "arity", "barretenberg", @@ -22,6 +23,7 @@ "injective", "interner", "intrinsics", + "keccak", "krate", "lvalue", "merkle",