diff --git a/.gitignore b/.gitignore index 351f5e16a7f..a3d669b44e3 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ result *.pk *.vk **/Verifier.toml +**/target diff --git a/Cargo.lock b/Cargo.lock index 85b5c12aa46..846110fead2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,8 +5,7 @@ version = 3 [[package]] name = "acir" version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "018148d69bf14422b1c1d62909a241af2a7f51fec064feb2b01de88fb02b11b8" +source = "git+https://github.com/noir-lang/acvm.git?branch=mv/verify_proof#3c492db693d9f4cb83c4814bdc5d6cf0945f4b47" dependencies = [ "acir_field", "flate2", @@ -17,8 +16,7 @@ dependencies = [ [[package]] name = "acir_field" version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d40dac25cf6be6335dd86286caeac859afd0dc74a4a75c64eed041b0f00a278" +source = "git+https://github.com/noir-lang/acvm.git?branch=mv/verify_proof#3c492db693d9f4cb83c4814bdc5d6cf0945f4b47" dependencies = [ "ark-bn254", "ark-ff", @@ -31,8 +29,7 @@ dependencies = [ [[package]] name = "acvm" version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17b7bc8f2b2215075b8e080ba3a0b8b7d759f04bc44b27e5bb8d845f4c77f20" +source = "git+https://github.com/noir-lang/acvm.git?branch=mv/verify_proof#3c492db693d9f4cb83c4814bdc5d6cf0945f4b47" dependencies = [ "acir", "acvm_stdlib", @@ -46,11 +43,28 @@ dependencies = [ "thiserror", ] +[[package]] +name = "acvm-backend-barretenberg" +version = "0.0.0" +dependencies = [ + "acvm", + "barretenberg-sys", + "blake2", + "dirs 3.0.2", + "futures-util", + "getrandom", + "indicatif", + "pkg-config", + "reqwest", + "rust-embed", + "tokio", + "wasmer", +] + [[package]] name = "acvm_stdlib" version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ce2d19a9d1e7ff1bf415ed909b43031e33ef6df21be70e470bb1817b3e6989" +source = "git+https://github.com/noir-lang/acvm.git?branch=mv/verify_proof#3c492db693d9f4cb83c4814bdc5d6cf0945f4b47" dependencies = [ "acir", ] @@ -101,6 +115,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + [[package]] name = "android_system_properties" version = "0.1.5" @@ -110,11 +133,54 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6342bd4f5a1205d7f41e94a41a901f5647c938cdfa96036338e8533c9d6c2450" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + [[package]] name = "anstyle" -version = "0.3.5" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" + +[[package]] +name = "anstyle-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] [[package]] name = "arena" @@ -136,9 +202,9 @@ dependencies = [ [[package]] name = "ark-ec" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c60370a92f8e1a5f053cad73a862e1b99bc642333cd676fa11c0c39f80f4ac2" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" dependencies = [ "ark-ff", "ark-poly", @@ -153,9 +219,9 @@ dependencies = [ [[package]] name = "ark-ff" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2d42532524bee1da5a4f6f733eb4907301baa480829557adcff5dfaeee1d9a" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" dependencies = [ "ark-ff-asm", "ark-ff-macros", @@ -173,32 +239,32 @@ dependencies = [ [[package]] name = "ark-ff-asm" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6873aaba7959593d89babed381d33e2329453368f1bf3c67e07686a1c1056f" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "ark-ff-macros" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c2e7d0f2d67cc7fc925355c74d36e7eda19073639be4a0a233d4611b8c959d" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ "num-bigint", "num-traits", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "ark-poly" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6ec811462cabe265cfe1b102fcfe3df79d7d2929c2425673648ee9abfd0272" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" dependencies = [ "ark-ff", "ark-serialize", @@ -209,9 +275,9 @@ dependencies = [ [[package]] name = "ark-serialize" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7e735959bc173ea4baf13327b19c22d452b8e9e8e8f7b7fc34e6bf0e316c33e" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ "ark-serialize-derive", "ark-std", @@ -221,13 +287,13 @@ dependencies = [ [[package]] name = "ark-serialize-derive" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd34f0920d995d2c932f38861c416f70de89a6de9875876b012557079603e6cc" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -242,14 +308,14 @@ dependencies = [ [[package]] name = "assert_cmd" -version = "2.0.10" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0b2340f55d9661d76793b2bfc2eb0e62689bd79d067a95707ea762afd5e9dd" +checksum = "86d6b683edf8d1119fe420a94f8a7e389239666aa72e65495d91c00462510151" dependencies = [ "anstyle", "bstr", "doc-comment", - "predicates 3.0.2", + "predicates 3.0.3", "predicates-core", "predicates-tree", "wait-timeout", @@ -257,14 +323,14 @@ dependencies = [ [[package]] name = "assert_fs" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d5bf7e5441c6393b5a9670a5036abe6b4847612f594b870f7332dbf10cf6fa" +checksum = "f070617a68e5c2ed5d06ee8dd620ee18fb72b99f6c094bed34cf8ab07c875b48" dependencies = [ "anstyle", "doc-comment", "globwalk", - "predicates 3.0.2", + "predicates 3.0.3", "predicates-core", "predicates-tree", "tempfile", @@ -286,16 +352,15 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide", + "miniz_oxide 0.6.2", "object 0.30.3", "rustc-demangle", ] [[package]] name = "barretenberg-sys" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bc96e40cc45e7d5622cbc57a140aee926a7fb6e4f7d07dda758daa9256f3317" +version = "0.1.3" +source = "git+https://github.com/noir-lang/barretenberg-sys.git?branch=mv/recursion-bindings#78ce8a7ecc2689fbd91788ee0cbc6f2258835f14" dependencies = [ "bindgen", "cc", @@ -305,27 +370,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "barretenberg_static_lib" -version = "0.1.0" -source = "git+https://github.com/noir-lang/aztec_backend?rev=e3d4504f15e1295e637c4da80b1d08c87c267c45#e3d4504f15e1295e637c4da80b1d08c87c267c45" -dependencies = [ - "barretenberg-sys", - "common", -] - -[[package]] -name = "barretenberg_wasm" -version = "0.1.0" -source = "git+https://github.com/noir-lang/aztec_backend?rev=e3d4504f15e1295e637c4da80b1d08c87c267c45#e3d4504f15e1295e637c4da80b1d08c87c267c45" -dependencies = [ - "common", - "getrandom", - "pkg-config", - "rust-embed", - "wasmer", -] - [[package]] name = "base64" version = "0.21.0" @@ -350,7 +394,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn", + "syn 1.0.109", "which", ] @@ -414,9 +458,9 @@ dependencies = [ [[package]] name = "build-data" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a94f9f7aab679acac7ce29ba5581c00d3971a861c3b501c5bb74c3ba0026d90" +checksum = "4ac83c47416b2db78a5a8a45d7d229a730b62806fa41ac6b4dbde6d016798776" dependencies = [ "chrono", "safe-lock", @@ -425,9 +469,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" [[package]] name = "bytecheck" @@ -448,7 +492,7 @@ checksum = "e31225543cb46f81a7e224762764f4a6a0f097b1db0b175f69e8065efaa42de5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -516,9 +560,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ed9a53e5d4d9c573ae844bfac6872b159cb1d1585a83b29e7a64b7eef7332a" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" dependencies = [ "glob", "libc", @@ -527,40 +571,45 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.8" +version = "4.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d7ae14b20b94cb02149ed21a86c423859cbe18dc7ed69845cace50e52b40a5" +checksum = "8a1f23fa97e1d1641371b51f35535cb26959b8e27ab50d167a8b996b5bada819" dependencies = [ - "bitflags", + "clap_builder", "clap_derive", - "clap_lex", - "is-terminal", "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fdc5d93c358224b4d6867ef1356d740de2303e9892edc06c5340daeccd96bab" +dependencies = [ + "anstream", + "anstyle", + "bitflags", + "clap_lex", "strsim", - "termcolor", ] [[package]] name = "clap_derive" -version = "4.1.8" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bec8e5c9d09e439c4335b1af0abaab56dcf3b94999a936e1bb47b9134288f0" +checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] name = "clap_lex" -version = "0.3.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350b9cf31731f9957399229e9b2adc51eeabdfbe9d71d9a0552275fd12710d09" -dependencies = [ - "os_str_bytes", -] +checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" [[package]] name = "codespan" @@ -619,19 +668,10 @@ dependencies = [ ] [[package]] -name = "common" -version = "0.1.0" -source = "git+https://github.com/noir-lang/aztec_backend?rev=e3d4504f15e1295e637c4da80b1d08c87c267c45#e3d4504f15e1295e637c4da80b1d08c87c267c45" -dependencies = [ - "acvm", - "blake2", - "dirs 3.0.2", - "futures-util", - "indicatif", - "reqwest", - "sled", - "tokio", -] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "console" @@ -684,9 +724,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "corosensei" @@ -703,9 +743,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" dependencies = [ "libc", ] @@ -780,9 +820,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -853,9 +893,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a140f260e6f3f79013b8bfc65e7ce630c9ab4388c6a89c71e07226f49487b72" +checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" dependencies = [ "cc", "cxxbridge-flags", @@ -865,9 +905,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6383f459341ea689374bf0a42979739dc421874f112ff26f829b8040b8e613" +checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" dependencies = [ "cc", "codespan-reporting 0.11.1", @@ -875,24 +915,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 2.0.15", ] [[package]] name = "cxxbridge-flags" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90201c1a650e95ccff1c8c0bb5a343213bdd317c6e600a93075bca2eff54ec97" +checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" [[package]] name = "cxxbridge-macro" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56" +checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -915,7 +955,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -926,7 +966,7 @@ checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ "darling_core", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -946,7 +986,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1076,7 +1116,7 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1097,18 +1137,18 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "errno" -version = "0.2.8" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" dependencies = [ "errno-dragonfly", "libc", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -1159,12 +1199,12 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.7.1", ] [[package]] @@ -1202,16 +1242,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "fuchsia-cprng" version = "0.1.1" @@ -1226,53 +1256,53 @@ checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" [[package]] name = "futures-channel" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-io" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-macro" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] name = "futures-sink" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-core", "futures-io", @@ -1285,15 +1315,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "generational-arena" version = "0.2.8" @@ -1305,9 +1326,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -1315,9 +1336,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" dependencies = [ "cfg-if 1.0.0", "libc", @@ -1353,7 +1374,7 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" dependencies = [ - "aho-corasick", + "aho-corasick 0.7.20", "bstr", "fnv", "log", @@ -1514,9 +1535,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" dependencies = [ "bytes", "futures-channel", @@ -1551,16 +1572,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi", + "windows", ] [[package]] @@ -1614,9 +1635,9 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", @@ -1646,30 +1667,31 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.6" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfa919a82ea574332e2de6e74b4c36e74d41982b335080fa59d4ef31be20fdf3" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" dependencies = [ + "hermit-abi 0.3.1", "libc", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "ipnet" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" [[package]] name = "is-terminal" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" dependencies = [ "hermit-abi 0.3.1", "io-lifetimes", "rustix", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -1732,9 +1754,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.140" +version = "0.2.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" [[package]] name = "libloading" @@ -1757,19 +1779,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - -[[package]] -name = "lock_api" -version = "0.4.9" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" -dependencies = [ - "autocfg", - "scopeguard", -] +checksum = "b64f40e5e03e0d54f03845c8197d0291253cdbedfb1cb46b13c2c117554a9f4c" [[package]] name = "log" @@ -1798,7 +1810,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1845,9 +1857,9 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minimal-lexical" @@ -1864,6 +1876,15 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + [[package]] name = "mio" version = "0.8.6" @@ -1901,10 +1922,9 @@ name = "nargo_cli" version = "0.4.1" dependencies = [ "acvm", + "acvm-backend-barretenberg", "assert_cmd", "assert_fs", - "barretenberg_static_lib", - "barretenberg_wasm", "build-data", "cfg-if 1.0.0", "clap", @@ -2112,43 +2132,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "os_str_bytes" -version = "6.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" - [[package]] name = "owo-colors" version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if 1.0.0", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", -] - [[package]] name = "paste" version = "1.0.12" @@ -2222,9 +2211,9 @@ dependencies = [ [[package]] name = "predicates" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c575290b64d24745b6c57a12a31465f0a66f3a4799686a6921526a33b0797965" +checksum = "09963355b9f467184c04017ced4a2ba2d75cbcb4e7462690d388233253d4b1a9" dependencies = [ "anstyle", "difflib", @@ -2257,7 +2246,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -2274,9 +2263,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.52" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] @@ -2307,7 +2296,7 @@ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2429,6 +2418,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + [[package]] name = "redox_users" version = "0.4.3" @@ -2436,7 +2434,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom", - "redox_syscall", + "redox_syscall 0.2.16", "thiserror", ] @@ -2453,11 +2451,11 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.1" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" dependencies = [ - "aho-corasick", + "aho-corasick 1.0.1", "memchr", "regex-syntax", ] @@ -2470,9 +2468,9 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" [[package]] name = "region" @@ -2562,9 +2560,9 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.40" +version = "0.7.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c30f1d45d9aa61cbc8cd1eb87705470892289bb2d01943e7803b873a57404dc3" +checksum = "21499ed91807f07ae081880aabb2ccc0235e9d88011867d984525e9a4c3cfa3e" dependencies = [ "bytecheck", "hashbrown 0.12.3", @@ -2576,13 +2574,13 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.40" +version = "0.7.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff26ed6c7c4dfc2aa9480b86a60e3c7233543a270a680e10758a507c5a4ce476" +checksum = "ac1c672430eb41556291981f45ca900a0239ad007242d1cb4b4167af842db666" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2609,9 +2607,9 @@ dependencies = [ [[package]] name = "rust-embed" -version = "6.6.0" +version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb133b9a38b5543fad3807fb2028ea47c5f2b566f4f5e28a11902f1a358348b6" +checksum = "1b68543d5527e158213414a92832d2aab11a84d2571a5eb021ebe22c43aab066" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -2628,7 +2626,7 @@ dependencies = [ "quote", "rust-embed-utils", "shellexpand", - "syn", + "syn 1.0.109", "walkdir", ] @@ -2645,9 +2643,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" @@ -2666,16 +2664,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.9" +version = "0.37.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc" +checksum = "a0661814f891c57c930a610266415528da53c4933e6dea5fb350cbfe048a9ece" dependencies = [ "bitflags", "errno", "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -2809,9 +2807,9 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.155" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71f2b4817415c6d4210bfe1c7bfcf4801b2d904cb4d0e1a8fdb651013c9e86b8" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" dependencies = [ "serde_derive", ] @@ -2827,20 +2825,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.155" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d071a94a3fac4aff69d023a7f411e33f40f3483f8c5190b1953822b6b76d7630" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] name = "serde_json" -version = "1.0.94" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa", "ryu", @@ -2941,22 +2939,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "sled" -version = "0.34.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f96b4737c2ce5987354855aed3797279def4ebf734436c6aa4552cf8e169935" -dependencies = [ - "crc32fast", - "crossbeam-epoch", - "crossbeam-utils", - "fs2", - "fxhash", - "libc", - "log", - "parking_lot", -] - [[package]] name = "smallvec" version = "1.10.0" @@ -3029,7 +3011,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.109", ] [[package]] @@ -3050,22 +3032,21 @@ dependencies = [ ] [[package]] -name = "synstructure" -version = "0.12.6" +name = "syn" +version = "2.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" dependencies = [ "proc-macro2", "quote", - "syn", - "unicode-xid", + "unicode-ident", ] [[package]] name = "target-lexicon" -version = "0.12.6" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5" +checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" [[package]] name = "tempdir" @@ -3079,15 +3060,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" dependencies = [ "cfg-if 1.0.0", "fastrand", - "redox_syscall", + "redox_syscall 0.3.5", "rustix", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -3107,22 +3088,22 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -3163,18 +3144,17 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.26.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" dependencies = [ "autocfg", "bytes", "libc", - "memchr", "mio", "pin-project-lite", "socket2", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -3190,9 +3170,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", @@ -3225,9 +3205,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.6" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08de71aa0d6e348f070457f85af8bd566e2bc452156a423ddf22861b3a953fae" +checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" dependencies = [ "indexmap", "serde", @@ -3244,11 +3224,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "cf9cf6a813d3f40c88b0b6b6f29a5c95c6cdbf97c1f9cc53fb820200f5ad814d" dependencies = [ - "cfg-if 1.0.0", "log", "pin-project-lite", "tracing-attributes", @@ -3257,13 +3236,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -3288,9 +3267,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" dependencies = [ "sharded-slab", "thread_local", @@ -3311,9 +3290,9 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicode-bidi" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524b68aca1d05e03fdf03fcdce2c6c94b6daf6d16861ddaa7e4f2b6638a9052c" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" @@ -3359,6 +3338,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "valuable" version = "0.1.0" @@ -3382,12 +3367,11 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" dependencies = [ "same-file", - "winapi", "winapi-util", ] @@ -3436,7 +3420,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-shared", ] @@ -3470,7 +3454,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3483,9 +3467,9 @@ checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "wasm-encoder" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eff853c4f09eec94d76af527eddad4e9de13b11d6286a1ef7134bc30135a2b7" +checksum = "d05d0b6fcd0aeb98adf16e7975331b3c17222aa815148f5b976370ce589d80ef" dependencies = [ "leb128", ] @@ -3601,7 +3585,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3753,9 +3737,9 @@ checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" [[package]] name = "wast" -version = "55.0.0" +version = "57.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4984d3e1406571f4930ba5cf79bd70f75f41d0e87e17506e0bd19b0e5d085f05" +checksum = "6eb0f5ed17ac4421193c7477da05892c2edafd67f9639e3c11a82086416662dc" dependencies = [ "leb128", "memchr", @@ -3765,9 +3749,9 @@ dependencies = [ [[package]] name = "wat" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af2b53f4da14db05d32e70e9c617abdf6620c575bd5dd972b7400037b4df2091" +checksum = "ab9ab0d87337c3be2bb6fc5cd331c4ba9fd6bcb4ee85048a0dd59ed9ecf92e53" dependencies = [ "wast", ] @@ -3843,6 +3827,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.0", +] + [[package]] name = "windows-sys" version = "0.33.0" @@ -3862,12 +3855,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", + "windows_aarch64_gnullvm 0.42.2", "windows_aarch64_msvc 0.42.2", "windows_i686_gnu 0.42.2", "windows_i686_msvc 0.42.2", "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm", + "windows_x86_64_gnullvm 0.42.2", "windows_x86_64_msvc 0.42.2", ] @@ -3877,7 +3870,16 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets", + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", ] [[package]] @@ -3886,21 +3888,42 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "windows_aarch64_gnullvm", + "windows_aarch64_gnullvm 0.42.2", "windows_aarch64_msvc 0.42.2", "windows_i686_gnu 0.42.2", "windows_i686_msvc 0.42.2", "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm", + "windows_x86_64_gnullvm 0.42.2", "windows_x86_64_msvc 0.42.2", ] +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + [[package]] name = "windows_aarch64_msvc" version = "0.33.0" @@ -3913,6 +3936,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + [[package]] name = "windows_i686_gnu" version = "0.33.0" @@ -3925,6 +3954,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + [[package]] name = "windows_i686_msvc" version = "0.33.0" @@ -3937,6 +3972,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + [[package]] name = "windows_x86_64_gnu" version = "0.33.0" @@ -3949,12 +3990,24 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + [[package]] name = "windows_x86_64_msvc" version = "0.33.0" @@ -3967,11 +4020,17 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + [[package]] name = "winnow" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee7b2c67f962bf5042bfd8b6a916178df33a26eec343ae064cb8e069f638fa6f" +checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" dependencies = [ "memchr", ] @@ -3993,21 +4052,20 @@ checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" [[package]] name = "zeroize" -version = "1.5.7" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.3.3" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn", - "synstructure", + "syn 2.0.15", ] diff --git a/Cargo.toml b/Cargo.toml index 26eec846ef9..897f27f85fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,9 @@ edition = "2021" rust-version = "1.66" [workspace.dependencies] -acvm = "0.9.0" +# acvm = "0.9.0" +acvm = { features = ["bn254"], git = "https://github.com/noir-lang/acvm.git", branch = "mv/verify_proof" } +# acvm = { features = ["bn254"], path = "/Users/maximvezenov/Documents/dev/noir-lang/acvm/acvm" } arena = { path = "crates/arena" } fm = { path = "crates/fm" } iter-extended = { path = "crates/iter-extended" } diff --git a/crates/nargo/src/ops/execute.rs b/crates/nargo/src/ops/execute.rs index eb82df60d41..e4c8a5afbb5 100644 --- a/crates/nargo/src/ops/execute.rs +++ b/crates/nargo/src/ops/execute.rs @@ -1,5 +1,5 @@ -use acvm::PartialWitnessGenerator; use acvm::{acir::circuit::Circuit, pwg::block::Blocks}; +use acvm::{PartialWitnessGenerator, PartialWitnessGeneratorStatus}; use noirc_abi::WitnessMap; use crate::NargoError; @@ -10,9 +10,8 @@ pub fn execute_circuit( mut initial_witness: WitnessMap, ) -> Result { let mut blocks = Blocks::default(); - let (unresolved_opcodes, oracles) = - backend.solve(&mut initial_witness, &mut blocks, circuit.opcodes)?; - if !unresolved_opcodes.is_empty() || !oracles.is_empty() { + let solver_status = backend.solve(&mut initial_witness, &mut blocks, circuit.opcodes)?; + if matches!(solver_status, PartialWitnessGeneratorStatus::RequiresOracleData { .. }) { todo!("Add oracle support to nargo execute") } diff --git a/crates/nargo/src/ops/mod.rs b/crates/nargo/src/ops/mod.rs index 5d1f096ecf4..83b10a32a80 100644 --- a/crates/nargo/src/ops/mod.rs +++ b/crates/nargo/src/ops/mod.rs @@ -3,9 +3,11 @@ pub use self::execute::execute_circuit; pub use self::preprocess::{preprocess_contract, preprocess_program}; pub use self::prove::prove_execution; pub use self::verify::verify_proof; +pub use self::recursion::{proof_as_fields, vk_as_fields}; mod codegen_verifier; mod execute; mod preprocess; mod prove; mod verify; +mod recursion; diff --git a/crates/nargo/src/ops/recursion.rs b/crates/nargo/src/ops/recursion.rs new file mode 100644 index 00000000000..fc1827c8f94 --- /dev/null +++ b/crates/nargo/src/ops/recursion.rs @@ -0,0 +1,23 @@ +use acvm::{ProofSystemCompiler, FieldElement}; +use noirc_abi::WitnessMap; + +use crate::NargoError; + +pub fn proof_as_fields( + backend: &impl ProofSystemCompiler, + proof: &[u8], + public_inputs: WitnessMap, +) -> Result, NargoError> { + let proof_as_fields = backend.proof_as_fields(proof, public_inputs); + + Ok(proof_as_fields) +} + +pub fn vk_as_fields( + backend: &impl ProofSystemCompiler, + verification_key: &[u8], +) -> Result<(Vec, FieldElement), NargoError> { + let (vk_as_fields, vk_hash) = backend.vk_as_fields(verification_key); + + Ok((vk_as_fields, vk_hash)) +} \ No newline at end of file diff --git a/crates/nargo_cli/Cargo.toml b/crates/nargo_cli/Cargo.toml index 40ab4b92459..ba8d189502b 100644 --- a/crates/nargo_cli/Cargo.toml +++ b/crates/nargo_cli/Cargo.toml @@ -37,8 +37,8 @@ termcolor = "1.1.2" color-eyre = "0.6.2" # Backends -aztec_backend = { optional = true, package = "barretenberg_static_lib", git = "https://github.com/noir-lang/aztec_backend", rev = "e3d4504f15e1295e637c4da80b1d08c87c267c45" } -aztec_wasm_backend = { optional = true, package = "barretenberg_wasm", git = "https://github.com/noir-lang/aztec_backend", rev = "e3d4504f15e1295e637c4da80b1d08c87c267c45" } +# acvm-backend-barretenberg = { git = "https://github.com/noir-lang/aztec_backend", branch = "mv/recursion", default-features=false } +acvm-backend-barretenberg = { path = "/Users/maximvezenov/Documents/dev/noir-lang/aztec_backend", default-features=false } [dev-dependencies] tempdir = "0.3.7" @@ -49,6 +49,6 @@ predicates = "2.1.5" [features] default = ["plonk_bn254"] # The plonk backend can only use bn254, so we do not specify the field -plonk_bn254 = ["aztec_backend"] -plonk_bn254_wasm = ["aztec_wasm_backend"] +plonk_bn254 = ["acvm-backend-barretenberg/native"] +plonk_bn254_wasm = ["acvm-backend-barretenberg/wasm"] diff --git a/crates/nargo_cli/src/backends.rs b/crates/nargo_cli/src/backends.rs index e1113279f80..bbec5c99006 100644 --- a/crates/nargo_cli/src/backends.rs +++ b/crates/nargo_cli/src/backends.rs @@ -1,14 +1,8 @@ -cfg_if::cfg_if! { - if #[cfg(feature = "plonk_bn254")] { - pub(crate) use aztec_backend::Plonk as ConcreteBackend; - } else if #[cfg(feature = "plonk_bn254_wasm")] { - pub(crate) use aztec_wasm_backend::Plonk as ConcreteBackend; - } else { - compile_error!("please specify a backend to compile with"); - } -} +pub(crate) use acvm_backend_barretenberg::Barretenberg as ConcreteBackend; + +#[cfg(not(any(feature = "plonk_bn254", feature = "plonk_bn254_wasm")))] +compile_error!("please specify a backend to compile with"); -// As we have 3 feature flags we must test all 3 potential pairings to ensure they're mutually exclusive. #[cfg(all(feature = "plonk_bn254", feature = "plonk_bn254_wasm"))] compile_error!( "feature \"plonk_bn254\" and feature \"plonk_bn254_wasm\" cannot be enabled at the same time" diff --git a/crates/nargo_cli/src/cli/check_cmd.rs b/crates/nargo_cli/src/cli/check_cmd.rs index 557093444a1..3049c830def 100644 --- a/crates/nargo_cli/src/cli/check_cmd.rs +++ b/crates/nargo_cli/src/cli/check_cmd.rs @@ -24,7 +24,7 @@ pub(crate) fn run(args: CheckCommand, config: NargoConfig) -> Result<(), CliErro } fn check_from_path>(p: P, compile_options: &CompileOptions) -> Result<(), CliError> { - let backend = crate::backends::ConcreteBackend; + let backend = crate::backends::ConcreteBackend::default(); let mut driver = Resolver::resolve_root_manifest(p.as_ref(), backend.np_language())?; diff --git a/crates/nargo_cli/src/cli/codegen_verifier_cmd.rs b/crates/nargo_cli/src/cli/codegen_verifier_cmd.rs index 319a5722708..f23502a15b5 100644 --- a/crates/nargo_cli/src/cli/codegen_verifier_cmd.rs +++ b/crates/nargo_cli/src/cli/codegen_verifier_cmd.rs @@ -19,7 +19,7 @@ pub(crate) struct CodegenVerifierCommand { } pub(crate) fn run(args: CodegenVerifierCommand, config: NargoConfig) -> Result<(), CliError> { - let backend = crate::backends::ConcreteBackend; + let backend = crate::backends::ConcreteBackend::default(); // TODO(#1201): Should this be a utility function? let circuit_build_path = args diff --git a/crates/nargo_cli/src/cli/compile_cmd.rs b/crates/nargo_cli/src/cli/compile_cmd.rs index 50c21486385..78b52003166 100644 --- a/crates/nargo_cli/src/cli/compile_cmd.rs +++ b/crates/nargo_cli/src/cli/compile_cmd.rs @@ -30,7 +30,7 @@ pub(crate) struct CompileCommand { pub(crate) fn run(args: CompileCommand, config: NargoConfig) -> Result<(), CliError> { let circuit_dir = config.program_dir.join(TARGET_DIR); - let backend = crate::backends::ConcreteBackend; + let backend = crate::backends::ConcreteBackend::default(); // If contracts is set we're compiling every function in a 'contract' rather than just 'main'. if args.contracts { diff --git a/crates/nargo_cli/src/cli/execute_cmd.rs b/crates/nargo_cli/src/cli/execute_cmd.rs index 9d1429bbda7..adeefc860a5 100644 --- a/crates/nargo_cli/src/cli/execute_cmd.rs +++ b/crates/nargo_cli/src/cli/execute_cmd.rs @@ -46,7 +46,7 @@ fn execute_with_path( program_dir: &Path, compile_options: &CompileOptions, ) -> Result<(Option, WitnessMap), CliError> { - let backend = crate::backends::ConcreteBackend; + let backend = crate::backends::ConcreteBackend::default(); let compiled_program = compile_circuit(&backend, program_dir, compile_options)?; diff --git a/crates/nargo_cli/src/cli/gates_cmd.rs b/crates/nargo_cli/src/cli/gates_cmd.rs index a5093b4d775..9fe9f5c7a53 100644 --- a/crates/nargo_cli/src/cli/gates_cmd.rs +++ b/crates/nargo_cli/src/cli/gates_cmd.rs @@ -23,7 +23,7 @@ fn count_gates_with_path>( program_dir: P, compile_options: &CompileOptions, ) -> Result<(), CliError> { - let backend = crate::backends::ConcreteBackend; + let backend = crate::backends::ConcreteBackend::default(); let compiled_program = compile_circuit(&backend, program_dir.as_ref(), compile_options)?; let num_opcodes = compiled_program.circuit.opcodes.len(); diff --git a/crates/nargo_cli/src/cli/mod.rs b/crates/nargo_cli/src/cli/mod.rs index 2bb92925e59..b90c90225cb 100644 --- a/crates/nargo_cli/src/cli/mod.rs +++ b/crates/nargo_cli/src/cli/mod.rs @@ -20,6 +20,7 @@ mod print_acir_cmd; mod prove_cmd; mod test_cmd; mod verify_cmd; +mod recursion_cmd; const GIT_HASH: &str = env!("GIT_COMMIT"); const IS_DIRTY: &str = env!("GIT_DIRTY"); @@ -58,6 +59,7 @@ enum NargoCommand { Test(test_cmd::TestCommand), Gates(gates_cmd::GatesCommand), PrintAcir(print_acir_cmd::PrintAcirCommand), + Recursion(recursion_cmd::RecursionCommand), } pub fn start_cli() -> eyre::Result<()> { @@ -79,6 +81,7 @@ pub fn start_cli() -> eyre::Result<()> { NargoCommand::Gates(args) => gates_cmd::run(args, config), NargoCommand::CodegenVerifier(args) => codegen_verifier_cmd::run(args, config), NargoCommand::PrintAcir(args) => print_acir_cmd::run(args, config), + NargoCommand::Recursion(args) => recursion_cmd::run(args, config), }?; Ok(()) diff --git a/crates/nargo_cli/src/cli/print_acir_cmd.rs b/crates/nargo_cli/src/cli/print_acir_cmd.rs index 589cc490f40..38b841121bc 100644 --- a/crates/nargo_cli/src/cli/print_acir_cmd.rs +++ b/crates/nargo_cli/src/cli/print_acir_cmd.rs @@ -22,7 +22,7 @@ fn print_acir_with_path>( program_dir: P, compile_options: &CompileOptions, ) -> Result<(), CliError> { - let backend = crate::backends::ConcreteBackend; + let backend = crate::backends::ConcreteBackend::default(); let compiled_program = compile_circuit(&backend, program_dir.as_ref(), compile_options)?; println!("{}", compiled_program.circuit); diff --git a/crates/nargo_cli/src/cli/prove_cmd.rs b/crates/nargo_cli/src/cli/prove_cmd.rs index fd60f004e2b..1698da2d3a0 100644 --- a/crates/nargo_cli/src/cli/prove_cmd.rs +++ b/crates/nargo_cli/src/cli/prove_cmd.rs @@ -34,6 +34,10 @@ pub(crate) struct ProveCommand { #[arg(short, long)] verify: bool, + /// Whether to generate this proof using the recursive prover + #[arg(short, long)] + recursive: bool, + #[clap(flatten)] compile_options: CompileOptions, } @@ -65,7 +69,7 @@ pub(crate) fn prove_with_path>( check_proof: bool, compile_options: &CompileOptions, ) -> Result, CliError> { - let backend = crate::backends::ConcreteBackend; + let backend = crate::backends::ConcreteBackend::default(); let preprocessed_program = match circuit_build_path { Some(circuit_build_path) => read_program_from_file(circuit_build_path)?, diff --git a/crates/nargo_cli/src/cli/recursion_cmd.rs b/crates/nargo_cli/src/cli/recursion_cmd.rs new file mode 100644 index 00000000000..2f51f4a2cae --- /dev/null +++ b/crates/nargo_cli/src/cli/recursion_cmd.rs @@ -0,0 +1,78 @@ +use std::{path::{PathBuf, Path}, collections::BTreeMap}; + +use crate::{ + errors::CliError, + constants::{PROOFS_DIR, TARGET_DIR, VERIFIER_INPUT_FILE, PROOF_EXT} +}; + +use clap::Args; +use nargo::ops::{proof_as_fields, vk_as_fields}; +use noirc_abi::input_parser::{Format, InputValue}; +use super::{NargoConfig, fs::{program::read_program_from_file, inputs::{read_inputs_from_file, write_inputs_to_file}, load_hex_data, create_named_dir}, compile_cmd::compile_circuit}; + +#[derive(Debug, Clone, Args)] +pub(crate) struct RecursionCommand { + /// The name of the proof + proof_name: String, + + /// The name of the circuit build fiels (ACIR, proving and verification key) + circuit_name: String, +} + +pub(crate) fn run(args: RecursionCommand, config: NargoConfig) -> Result<(), CliError> { + let proof_path = config.program_dir.join(PROOFS_DIR).join(&args.proof_name).with_extension(PROOF_EXT); + + let target_dir = config.program_dir.join(TARGET_DIR); + + let circuit_build_path = target_dir.join(&args.circuit_name); + + let recursion_artifacts_path = target_dir.join("recursion"); + create_named_dir(recursion_artifacts_path.as_ref(), "recursion"); + + gen_recursion_artifacts_with_path(config.program_dir, proof_path, circuit_build_path, recursion_artifacts_path, args.circuit_name)?; + + Ok(()) +} + +pub(crate) fn gen_recursion_artifacts_with_path>( + program_dir: P, + proof_path: PathBuf, + circuit_build_path: P, + recursion_artifacts_path: P, + circuit_name: String, +) -> Result<(), CliError> { + // TODO: do we want circuit's to be optional? If the circuit has not changed + // the verification key will be the same, but the proof generated could potentially be generated by a different circuit + // let preprocessed_program = match circuit_build_path { + // Some(circuit_build_path) => read_program_from_file(circuit_build_path)?, + // None => { + // let compiled_program = + // compile_circuit(&backend, program_dir.as_ref(), compile_options)?; + // preprocess_program(&backend, compiled_program)? + // } + // }; + + let preprocessed_program = read_program_from_file(&circuit_build_path)?; + + let backend = crate::backends::ConcreteBackend::default(); + + let public_abi = preprocessed_program.abi.clone().public_abi(); + let (public_inputs_map, return_value) = + read_inputs_from_file(program_dir, VERIFIER_INPUT_FILE, Format::Toml, &public_abi)?; + let public_inputs = public_abi.encode(&public_inputs_map, return_value)?; + + let proof = &load_hex_data(&proof_path)?; + + let proof_fields = proof_as_fields(&backend, proof, public_inputs)?; + + let mut recursion_artifacts_map = BTreeMap::new(); + recursion_artifacts_map.insert("proof".to_owned(), InputValue::Vec(proof_fields)); + + let (vk_fields, vk_hash) = vk_as_fields(&backend, &preprocessed_program.verification_key)?; + recursion_artifacts_map.insert("verification_key".to_owned(), InputValue::Vec(vk_fields)); + recursion_artifacts_map.insert("key_hash".to_owned(), InputValue::Field(vk_hash)); + + write_inputs_to_file(&recursion_artifacts_map, &None, recursion_artifacts_path, &circuit_name, Format::Toml)?; + + Ok(()) +} diff --git a/crates/nargo_cli/src/cli/test_cmd.rs b/crates/nargo_cli/src/cli/test_cmd.rs index d168e6c39ca..65f8265a862 100644 --- a/crates/nargo_cli/src/cli/test_cmd.rs +++ b/crates/nargo_cli/src/cli/test_cmd.rs @@ -32,7 +32,7 @@ fn run_tests( test_name: &str, compile_options: &CompileOptions, ) -> Result<(), CliError> { - let backend = crate::backends::ConcreteBackend; + let backend = crate::backends::ConcreteBackend::default(); let mut driver = Resolver::resolve_root_manifest(program_dir, backend.np_language())?; @@ -79,7 +79,7 @@ fn run_test( driver: &Driver, config: &CompileOptions, ) -> Result<(), CliError> { - let backend = crate::backends::ConcreteBackend; + let backend = crate::backends::ConcreteBackend::default(); let program = driver .compile_no_check(config, main) diff --git a/crates/nargo_cli/src/cli/verify_cmd.rs b/crates/nargo_cli/src/cli/verify_cmd.rs index cf2e4859091..07b7e351ee9 100644 --- a/crates/nargo_cli/src/cli/verify_cmd.rs +++ b/crates/nargo_cli/src/cli/verify_cmd.rs @@ -43,7 +43,7 @@ fn verify_with_path>( circuit_build_path: Option

, compile_options: CompileOptions, ) -> Result<(), CliError> { - let backend = crate::backends::ConcreteBackend; + let backend = crate::backends::ConcreteBackend::default(); let preprocessed_program = match circuit_build_path { Some(circuit_build_path) => read_program_from_file(circuit_build_path)?, diff --git a/crates/nargo_cli/tests/hello_world.rs b/crates/nargo_cli/tests/hello_world.rs index 121f09f0ece..52b8c12f7b9 100644 --- a/crates/nargo_cli/tests/hello_world.rs +++ b/crates/nargo_cli/tests/hello_world.rs @@ -2,9 +2,16 @@ //! It then follows the steps published at https://noir-lang.org/getting_started/hello_world.html //! Any modifications to the commands run here MUST be documented in the noir-lang book. +mod prove_and_verify; + +use acvm::FieldElement; use assert_cmd::prelude::*; +use noirc_abi::input_parser::{Format, InputValue}; use predicates::prelude::*; -use std::process::Command; +use std::{process::Command, collections::BTreeMap, fs::File, io::Write}; +use tempdir::TempDir; + +use prove_and_verify::copy_recursively; use assert_fs::prelude::{FileWriteStr, PathAssert, PathChild}; @@ -54,3 +61,88 @@ fn hello_world_example() { cmd.arg("verify").arg(proof_name); cmd.assert().success(); } + +#[test] +fn recursive_proof_composition() { + let current_dir = std::env::current_dir().unwrap(); + + let xor_dir = current_dir.join("tests/test_data/xor"); + let recursion_dir = current_dir.join("tests/test_data/recursion"); + + let tmp_dir = TempDir::new("recursion_tests").unwrap(); + let tmp_xor_dir = tmp_dir.as_ref().join("xor"); + let tmp_recursion_dir = tmp_dir.as_ref().join("recursion"); + + copy_recursively(xor_dir, &tmp_xor_dir) + .expect("failed to copy test cases to temp directory"); + + copy_recursively(recursion_dir, &tmp_recursion_dir) + .expect("failed to copy test cases to temp directory"); + + std::env::set_current_dir(&tmp_xor_dir).unwrap(); + + // `nargo check` + let mut cmd = Command::cargo_bin("nargo").unwrap(); + cmd.arg("check"); + cmd.assert() + .success() + .stdout(predicate::str::contains("Constraint system successfully built!")); + + let circuit_name = "c"; + let mut cmd = Command::cargo_bin("nargo").unwrap(); + cmd.arg("compile").arg(circuit_name); + cmd.assert().success(); + + let proof_name = "p"; + let mut cmd = Command::cargo_bin("nargo").unwrap(); + cmd.arg("prove").arg(proof_name).arg(circuit_name); + cmd.assert().success(); + + let mut cmd = Command::cargo_bin("nargo").unwrap(); + cmd.arg("recursion").arg(proof_name).arg(circuit_name); + cmd.assert().success(); + + let recursion_artifacts_path = tmp_xor_dir.join("target/recursion").join(format!("{circuit_name}.toml")); + + let recursion_artifacts_string = std::fs::read_to_string(recursion_artifacts_path).unwrap(); + + let mut recursion_circuit_inputs_map = BTreeMap::new(); + recursion_circuit_inputs_map.insert("public_input".to_owned(), InputValue::Field(FieldElement::from_hex("0x0a").unwrap())); + + let input_aggregation_object = [FieldElement::zero(); 16].to_vec(); + recursion_circuit_inputs_map.insert("input_aggregation_object".to_owned(), InputValue::Vec(input_aggregation_object)); + + let additional_inputs = Format::Toml.serialize(&recursion_circuit_inputs_map).unwrap(); + let full_recursion_prover_inputs = recursion_artifacts_string + "\n" + &additional_inputs; + + let recursion_prover_file_path = tmp_recursion_dir.join("Prover").with_extension("toml"); + let mut recursion_prover_file = match File::create(recursion_prover_file_path) { + Err(why) => panic!("couldn't create recursion Prover.toml: {why}"), + Ok(file) => file, + }; + match recursion_prover_file.write_all(full_recursion_prover_inputs.as_bytes()) { + Err(why) => panic!("couldn't write to recursion Prover.toml: {why}"), + Ok(_) => (), + } + + std::env::set_current_dir(&tmp_recursion_dir).unwrap(); + + // `nargo check` + let mut cmd = Command::cargo_bin("nargo").unwrap(); + cmd.arg("check"); + cmd.assert() + .success() + .stdout(predicate::str::contains("Constraint system successfully built!")); + + // `nargo prove p` + let proof_name = "p"; + let mut cmd = Command::cargo_bin("nargo").unwrap(); + cmd.arg("prove").arg(proof_name); + cmd.assert().success(); + + // `nargo verify p` + let mut cmd = Command::cargo_bin("nargo").unwrap(); + cmd.arg("verify").arg(proof_name); + cmd.assert().success(); + +} diff --git a/crates/nargo_cli/tests/prove_and_verify.rs b/crates/nargo_cli/tests/prove_and_verify.rs index 070db6d8ce8..60910bdc9ed 100644 --- a/crates/nargo_cli/tests/prove_and_verify.rs +++ b/crates/nargo_cli/tests/prove_and_verify.rs @@ -1,7 +1,26 @@ use tempdir::TempDir; use std::collections::BTreeMap; -use std::fs; +use std::fs::{self, DirEntry}; +use std::path::Path; + +/// Copy files from source to destination recursively. +pub fn copy_recursively( + source: impl AsRef, + destination: impl AsRef, +) -> std::io::Result<()> { + fs::create_dir_all(&destination)?; + for entry in fs::read_dir(&source)? { + let entry = entry?; + let filetype = entry.file_type()?; + if filetype.is_dir() { + copy_recursively(entry.path(), destination.as_ref().join(entry.file_name()))?; + } else { + fs::copy(entry.path(), destination.as_ref().join(entry.file_name()))?; + } + } + Ok(()) +} mod tests { use std::path::{Path, PathBuf}; @@ -27,24 +46,6 @@ mod tests { conf_data } - /// Copy files from source to destination recursively. - pub fn copy_recursively( - source: impl AsRef, - destination: impl AsRef, - ) -> std::io::Result<()> { - fs::create_dir_all(&destination)?; - for entry in fs::read_dir(source)? { - let entry = entry?; - let filetype = entry.file_type()?; - if filetype.is_dir() { - copy_recursively(entry.path(), destination.as_ref().join(entry.file_name()))?; - } else { - fs::copy(entry.path(), destination.as_ref().join(entry.file_name()))?; - } - } - Ok(()) - } - #[test] fn noir_integration() { // Try to find the directory that Cargo sets when it is running; otherwise fallback to assuming the CWD diff --git a/crates/nargo_cli/tests/test_data/merkle_insert/src/main.nr b/crates/nargo_cli/tests/test_data/merkle_insert/src/main.nr index 9d612977fa8..3ab4efb64c0 100644 --- a/crates/nargo_cli/tests/test_data/merkle_insert/src/main.nr +++ b/crates/nargo_cli/tests/test_data/merkle_insert/src/main.nr @@ -12,8 +12,8 @@ fn main( let old_leaf_exists = std::merkle::check_membership(old_root, old_leaf, index, old_hash_path); constrain old_leaf_exists == 1; constrain old_root == std::merkle::compute_root_from_leaf(old_leaf, index, old_hash_path); - let new_leaf_exists = std::merkle::check_membership(new_root, leaf, index, old_hash_path); - constrain new_leaf_exists == 1; + let calculated_root = std::merkle::compute_merkle_root(leaf, index, old_hash_path); + constrain new_root == calculated_root; let h = std::hash::mimc_bn254(mimc_input); // Regression test for PR #891 diff --git a/crates/nargo_cli/tests/test_data/recursion/Nargo.toml b/crates/nargo_cli/tests/test_data/recursion/Nargo.toml new file mode 100644 index 00000000000..65ab14da16d --- /dev/null +++ b/crates/nargo_cli/tests/test_data/recursion/Nargo.toml @@ -0,0 +1,5 @@ +[package] +authors = [""] +compiler_version = "0.4.1" + +[dependencies] \ No newline at end of file diff --git a/crates/nargo_cli/tests/test_data/recursion/Prover.toml b/crates/nargo_cli/tests/test_data/recursion/Prover.toml new file mode 100644 index 00000000000..4a39740bdfc --- /dev/null +++ b/crates/nargo_cli/tests/test_data/recursion/Prover.toml @@ -0,0 +1,219 @@ +# verification_key = [ +# "0x006fab49b869ae62001deac878b2667bd31bf3e28e3a2d764aa49b8d9bbdd310", +# "0x0000000000000000000000000000000000000000000000000000000000002000", +# "0x0000000000000000000000000000000000000000000000000000000000000005", +# "0x0000000000000000000000000000000000000000000000000000000000002000", +# "0x0000000000000000000000000000000000000000000000000000000000000001", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x0000000000000000000000000000000000000000000000000000000000000000", +# "0x000000000000000000000000000000a904b1de9ad47b61e91edf7e92d17b6bb7", +# "0x00000000000000000000000000000000002d3ba7a870ee60c8200367da6c4b21", +# "0x0000000000000000000000000000001c96168d733fc3e36b92ebcf10c0cb2f04", +# "0x000000000000000000000000000000000021eb21934504526eda8379c3889cfd", +# "0x0000000000000000000000000000002f60152775671437b19a6605a23ab2450d", +# "0x0000000000000000000000000000000000094f46605db7eaebc318a1d6eb0a13", +# "0x000000000000000000000000000000576808b58acd54b5177b3c99d034bb9dba", +# "0x000000000000000000000000000000000026b9a55104cb174c15dcbf67fc20a0", +# "0x0000000000000000000000000000002d7e6c91b2d26100a77d60e5234f6e8211", +# "0x00000000000000000000000000000000001b034f950be2961221b01094798b59", +# "0x000000000000000000000000000000d493bda45c0b79d493cac0ec3d355e645b", +# "0x00000000000000000000000000000000000e07368208a1c7dffac6f8a0f30cb7", +# "0x00000000000000000000000000000085da19557d2c1954f8e4b50c8f9f416cb8", +# "0x000000000000000000000000000000000028f437ec8d2a42df2a711764ce675a", +# "0x00000000000000000000000000000053eebb686a574202f7a6e7056dac4e6a04", +# "0x00000000000000000000000000000000000a30a2af6d9faaf84d75107090fbb8", +# "0x000000000000000000000000000000a5c526253b5d7fe5bc03090f882512cf51", +# "0x00000000000000000000000000000000001264282b9bdf8043ad67c553d11486", +# "0x000000000000000000000000000000892d49bcae8a30f909f5e27198818422ef", +# "0x0000000000000000000000000000000000044c1cf862883cc720de3bf1a65158", +# "0x00000000000000000000000000000063bb9b6be191ad0333a01860021474652e", +# "0x000000000000000000000000000000000021d4a4fbf4255ec22363c0e67fddcd", +# "0x00000000000000000000000000000031df120c8c2cdaa1deced300e262a41a59", +# "0x0000000000000000000000000000000000127f2963c9cc3e46c9b2a81f010566", +# "0x00000000000000000000000000000055b3eb94ad7db1cebf2493787119372bf2", +# "0x0000000000000000000000000000000000125ef4e2acb74a4d7e1746b1cb3556", +# "0x000000000000000000000000000000b6e69abc23cbd3ea2b7e0ac8e44f500473", +# "0x000000000000000000000000000000000012a37dea2c03430ee09cfaf0dab3b7", +# "0x00000000000000000000000000000091c4b58c9466db7519e549de29653f7e08", +# "0x000000000000000000000000000000000005da324c9f8c5928b073bd5d3d4b0f", +# "0x000000000000000000000000000000b6cc35b21df59fb4e2a36cefe98fe936c4", +# "0x0000000000000000000000000000000000135878d2105778eaba1a0023a84035", +# "0x000000000000000000000000000000e648cd91b86f4b17f30e4e62110f41f410", +# "0x00000000000000000000000000000000001c354c314e59ad314b5388a1feb73d", +# "0x000000000000000000000000000000b06b91150e48b16fa9a3d52188b430447f", +# "0x000000000000000000000000000000000018b19ba5b1ef0342f198ff0ef41bab", +# "0x000000000000000000000000000000cc6b57ed37a72741fd60d4a9c9de019013", +# "0x000000000000000000000000000000000012343e6875fb97c8dd7ba0515caa0b", +# "0x000000000000000000000000000000a7e527a7eb6b1ae11fe00e4c5277f9a685", +# "0x0000000000000000000000000000000000029ff8300c511064acecd1f509280e", +# "0x000000000000000000000000000000aba815ed47cd5327e88b0e6d4d960841be", +# "0x0000000000000000000000000000000000298d7dd2078f23d81794a103c6a939", +# "0x000000000000000000000000000000adcc03754ce27c5cb859e0e7ac9689ed91", +# "0x00000000000000000000000000000000001b5b68b99135eae353f5548c9b51ee", +# "0x00000000000000000000000000000084f5b77a5b58efd058ba2665c6b6b1ac34", +# "0x00000000000000000000000000000000000eca3879d07d56b03547f5918dbbcf", +# "0x000000000000000000000000000000c284df7c18c6ae5283b6f8129f92ed472d", +# "0x000000000000000000000000000000000015f16fd4eb9aa6666014196d6702fd", +# "0x000000000000000000000000000000752ba2765db2aac10ebdde6d0954088ddb", +# "0x000000000000000000000000000000000020314bbb4fa0afb75f05ccbbb69e0d", +# "0x0000000000000000000000000000003c2f0dafe942b951991059b7c66f56f833", +# "0x00000000000000000000000000000000002992687a5ef7b76ef90090489c3598", +# "0x000000000000000000000000000000767b4ae549b9aa953c610e38d4b3351ed5", +# "0x0000000000000000000000000000000000221ae6adc6ffe610b699626477c68d", +# "0x000000000000000000000000000000b1b18973b282233d3c6e59746e038ca762", +# "0x00000000000000000000000000000000001607fb50cb21a1584e26d3de279356", +# "0x000000000000000000000000000000031738dc11c806fc626e06f3c528f261d1", +# "0x000000000000000000000000000000000004058b5c321f1d0de7302f994ef5b0", +# "0x000000000000000000000000000000e6e99bd35fbcabda70289996fea3a93011", +# "0x00000000000000000000000000000000000db7c40d801d2e7eac001a5673c3cd", +# "0x0000000000000000000000000000004994438a00d1ab228927f908ccfcf2ed3d", +# "0x0000000000000000000000000000000000237c83789d39d8459848d87929a49e", +# "0x0000000000000000000000000000008725eb45c8e1888226f2bcc036e0d6a698", +# "0x000000000000000000000000000000000009d3b1fef691b49a440d6a0ad2be80", +# "0x0000000000000000000000000000004ad874e52a05928aa2b170cc2b63c274ef", +# "0x000000000000000000000000000000000010c9d5ae2475ab1b23571f638477ca", +# "0x000000000000000000000000000000c690acbf94666d3cdb1700cf7aad52ad26", +# "0x00000000000000000000000000000000000eb136ae272592f98cc23b90dd9b9e", +# "0x0000000000000000000000000000006dfe9ae4650c42e2d748c4a41f31ef3f79", +# "0x00000000000000000000000000000000002cc60738774946a2165785da782965", +# "0x000000000000000000000000000000b372175007e1d700a6c6dccf7725a68cf4", +# "0x0000000000000000000000000000000000055b0ef271f117387a3e661982046e", +# "0x00000000000000000000000000000030c29017ffa425c6869ff399db0e9adb6d", +# "0x000000000000000000000000000000000029379efcf5b36e94fa459fcf11803e", +# "0x000000000000000000000000000000bed1592b719b28e44dc87b6ad1884f642c", +# "0x00000000000000000000000000000000000d0037fb7889608353203ef391d7a1", +# "0x00000000000000000000000000000021a91fa2bd116913d763836e62dbb9957f", +# "0x000000000000000000000000000000000029cc2825f5f92281f1c7a3df846304", +# "0x000000000000000000000000000000e4a765d9dccfd5af2cc8d69af2ece343a3", +# "0x00000000000000000000000000000000001242a3f2f4fec5433e22394c4541b1", +# "0x000000000000000000000000000000f9992678a973b8fb38c824d0c9a6d14010", +# "0x00000000000000000000000000000000001a146c1b754ee0eb69e6895b7dd9bf", +# "0x000000000000000000000000000000c2fc1876673fbae3031dc825559b61f6dc", +# "0x00000000000000000000000000000000002d45c6df9b1a2d830fb34f1519341e", +# "0x0000000000000000000000000000007a72745061f1f059046fd03f84564e5d7a", +# "0x000000000000000000000000000000000012592c8f38051aaf92a955aa17ae75", +# "0x000000000000000000000000000000081c6ba09203e3e0d874f8bc31e6a0ec40", +# "0x00000000000000000000000000000000000cdbf1a771f6eb78964a939acddeb9", +# "0x000000000000000000000000000000b66e472a0cfd42cc6313ec34ff6882e4dc", +# "0x00000000000000000000000000000000000ebaed1a9a0773ce3a62637ea9d53a", +# "0x000000000000000000000000000000d2a2bfd3e7ac5860e62f2495a5e792d513", +# "0x000000000000000000000000000000000022ab28abcec226916d0c7258ba9d2d", +# ] +# proof = [ +# "0x000000000000000000000000000000000000000000000000000000000000000a", +# "0x00000000000000000000000000000041a4436085f0bbbf1e0985e913afda1401", +# "0x00000000000000000000000000000000002264cc0566827b86010670f212f074", +# "0x000000000000000000000000000000a2c96ba30333fe9266940dfcf43abc8c7f", +# "0x000000000000000000000000000000000024238f050204649a393be6165e7bab", +# "0x000000000000000000000000000000929d1592953294f4a63b8656bd230c618c", +# "0x00000000000000000000000000000000001851a2f71fd3993807c7db6b90592f", +# "0x0000000000000000000000000000004f1efe1de420feb5c333bc07b83c47e819", +# "0x000000000000000000000000000000000017a19a0f19ca0e051dd9e2a16de93d", +# "0x0000000000000000000000000000002bea92bb443df918ac177ae0e93a33b3e4", +# "0x000000000000000000000000000000000027c3f3ce03b7d3bfaf4133a24a3168", +# "0x0000000000000000000000000000007460f0846f2f6f749a8869d62c6fe6bdc6", +# "0x0000000000000000000000000000000000247699da015ef6f32ce39bf13ff7aa", +# "0x000000000000000000000000000000b22221217d14acf7d97536a75249216d22", +# "0x0000000000000000000000000000000000203d37905bc6ea5ceab7509ace4a8d", +# "0x000000000000000000000000000000688b19e5f5d7e5ac0a1355210c43072e91", +# "0x00000000000000000000000000000000002d088977dcdaae88a793f241c07af5", +# "0x000000000000000000000000000000f212fd497e11adae13146d40414c7427e7", +# "0x000000000000000000000000000000000000d873a13aa189a9afde7ce03a4313", +# "0x000000000000000000000000000000131faa60a2d2a9f4121b8d24ee93502bff", +# "0x0000000000000000000000000000000000016dea32d8aafdc1ad3b512c2670c6", +# "0x00000000000000000000000000000044b1289c57da6df57d0b69544a115e431a", +# "0x00000000000000000000000000000000002919c687faaf9a8e5dd1315521dbba", +# "0x000000000000000000000000000000fe86dea0851b7ec3772b7e534188f36af1", +# "0x00000000000000000000000000000000001d6c22cca133cb2809a31b360cf420", +# "0x000000000000000000000000000000b0e0e3f91b3d432416803172aefbf01363", +# "0x00000000000000000000000000000000000b12bfac0c4fa9d70b37fa76aae6f7", +# "0x0000000000000000000000000000009f9d715e0f7780332bdb1bf4f5a06cfe8f", +# "0x000000000000000000000000000000000001c4b9ce0f94706c1fc5d3c2bc8e26", +# "0x000000000000000000000000000000a9873af0671480f16068fbc03aab9a1f9f", +# "0x000000000000000000000000000000000029fae08456e5728f0e5075afcf4f70", +# "0x000000000000000000000000000000e0d468d42400401d36f51aded525ffb22b", +# "0x0000000000000000000000000000000000096458c398416375134c68f44d9a56", +# "0x000000000000000000000000000000dda81c1a311a2086a47deb54219e5437c1", +# "0x00000000000000000000000000000000002b89f2f116a2c9f3ead912193a277c", +# "0x00000000000000000000000000000051892ab6c7404ed5f739b7c9d8aa95c6de", +# "0x00000000000000000000000000000000000be6fe3e88b639a21e56e4c3ba13df", +# "0x0000000000000000000000000000007cd9f7bad73b7f779d7b42476025ca9746", +# "0x00000000000000000000000000000000000f9920532057046dd7baf48b0f7773", +# "0x000000000000000000000000000000da395cdb52d239c40df3438a8b69c9f9a9", +# "0x00000000000000000000000000000000002b987703591e685c7f767454d512a8", +# "0x0000000000000000000000000000007080feb46b784c4a15624c46556499344a", +# "0x00000000000000000000000000000000001d85724a6eece0575f6b9ff651f0be", +# "0x000000000000000000000000000000015578ceed71702771f6671972d6b7e849", +# "0x00000000000000000000000000000000002e1839a7888333244d68f8bffac213", +# "0x1bcef727b212b141c7ffca149d29048e7ced8418ca33bf031d6e01434e44c582", +# "0x305579ec1c47ae8f0ece00ab82815e3b6eec90bb3464e327847b8356f39ab0ad", +# "0x0f261b4cdcc94eb8b286569f9181f5894b41b6cf94c62985be9407d46ded02f6", +# "0x20d7b76b31fea396839f3e67b12080f073d6857612ccd665a16b7bd1467249b4", +# "0x15b575ec49753203ef727c7605e25d403de1d289a36d66c88bed4ddb2fac9b3e", +# "0x2df93c83d36c93e86c11d350803e768c61d5c349f0366a8057f5606954024076", +# "0x000c8a8dead64553b703db8d06196cf1bcac298331e1855dc4a8d55ad2552936", +# "0x2d96ef9203dc156889a6cd692c9284df56470da31c502dd14cf19f5be5b0a31d", +# "0x03d67b5d53bf5669a52c5e84ee1495bdb7380aef537af759c99697532fef0660", +# "0x17122495e511485137dfa0f178b7af99186c461cfd1a10070f2077c4ef69cec5", +# "0x08838fd5cb54dfb07dc3a79eb5853e5e5c34ea847041bb6d926e8c5a327303f1", +# "0x2c8f85922c7042e0e2e930210d581d1841bb45aaafcd31bc702376ae0601fb79", +# "0x13e3c35d063e846d00b67c903c3a81e3493d6164094f0aa90960be5417d53f98", +# "0x08f152659198b2068371ca45bbe13ccd932d7759a53dbc8445dcbad87e9ca52d", +# "0x27ccd695f868a3ff6ba7142eff1c3eab4131b2d0f02cff43c57c669e19f02b27", +# "0x06221a2b8b87eaa713d81ff6e078ff587c84e9b47912e41406a270e5aa7cb7c5", +# "0x119183d82269285122903301f9bfa121afbba9118521c11a1674ece72ba70514", +# "0x16090de7394916e410d3743df6774ba9f50facd0f76b2f2a95d38cf5896cb00f", +# "0x1481997b4e2cde02201171a8f47d56522a46eaf03434d561add4e5b84b7513e3", +# "0x289fc2bf7064cc3dbe83a70a2be6348f2283cea02833bc94f4ef81b3f58a2a59", +# "0x0aca68f94e715450366d1db8cdbcedcd8bea965dbc456051159988a4f848dae7", +# "0x25c2fa0a8a882e84cdd10cbd62c3f00eaa495ae23489b44d7b9e4c9fa2eceaf6", +# "0x0309b16ccd13e4d8869edd81389242569e05176f230761d5f5c21fbff4906161", +# "0x12557a565889a5642a70b3347be51e5f70d5a19400930d2c092ad6e5364a489f", +# "0x1a5a45c4339dbc79b3d84c82f69f71b287997d9a47b2a1a721af635ac17a879e", +# "0x156e62a3536f637f8d258ba114b3b08b698ba9203aed28b2a76d5240dd312d65", +# "0x0bf503faeae51d0863c268fab4a9b886c772dfdc03ff3597f57898847a830c28", +# "0x279dcee5555028129c7f4591c99d446d0a685de36a42b34aa3918cbbda3688d1", +# "0x134291febbbabcab21b365a66de96abe76385e0d405bcad17a90b4df45d615c5", +# "0x0c9a3ae01335f4b35ff18fb2ee0551ed093be213881afa6632aad55eef63587c", +# "0x275f403bcf600f4acd7b79ca1ee31d6c772de825900aad943ebb40fa2eccc0ee", +# "0x2eb885a6833595e4c2397beddb31688194d011091b0719838d7b1ebcaee96dab", +# "0x1456efbab4fc9581ad4fa9029b91d3997fbcd6f5866240ff5855377dc3471ee8", +# "0x21fac92a4faa84529df79407657bc8dac53ad1d376018e1df1d698dc93ca83ac", +# "0x244c20d583735d68ccc37bed7e878729bcf762d5c9f23bc71d58368d829b9967", +# "0x0190ca6818740838b1727b494fc512abb902002c5ba314c25cc3006b693a9caf", +# "0x13056bc5ae8a5d0bccdad585d84caa55b34c209d54234a9bc332d00e7d699fb4", +# "0x210ad436afe85067004e534e467b12b065d21062a06d9f441bb74fae23cc7d96", +# "0x0195658a7602bc8db47c2a383b65a456f67521045ce0680aafb734f5e186bbea", +# "0x038d367d0877007ad0141c5a68c5363eec3483ae908e66a6539cfc2d7f31c36c", +# "0x0e397c5e7a847ca5e5027c5b5ebd03d2767a461d927763667ff43584dc31d831", +# "0x0000000000000000000000000000009a6eeda9ee8db851800319cb992406b988", +# "0x000000000000000000000000000000000021da314c7b771ce486c97c87bafe2d", +# "0x000000000000000000000000000000fabc1e7567e9a19392425bcd7bc72fe4b4", +# "0x000000000000000000000000000000000029432a06eed8669a9bc74a0681783b", +# "0x00000000000000000000000000000080ffa4294e16ad616eb87207685bcf6709", +# "0x000000000000000000000000000000000012f785b140d229a56b6883a0a30219", +# "0x0000000000000000000000000000006bd8ef038234662cf7fa53330a4144c9a7", +# "0x00000000000000000000000000000000001bb2fda6ee1d62ab10b84e7db98326", +# ] +public_input = "0x0a" +# key_hash = "0x02163b301299d5e495a7b4aab1645bcbb38c5253c675217990f17b5de572cf02" +input_aggregation_object = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"] + +proof = ["0x000000000000000000000000000000000000000000000000000000000000000a", "0x0000000000000000000000000000003605bd784b10fa108f75bf902992104090", "0x0000000000000000000000000000000000079182e3d1d9ac9365459e2ee593b2", "0x0000000000000000000000000000005eff62801d347b6585e34ca1bdbcfcc44e", "0x000000000000000000000000000000000028e690977c619ad1a94cd2e53b9090", "0x0000000000000000000000000000001e2186e2d16f9ee5b9f34901f3a15647dd", "0x00000000000000000000000000000000002e124c3494ac81cdd8eed2890f72be", "0x000000000000000000000000000000edd9235d3d66f2c7740296f667bbbb7cf1", "0x000000000000000000000000000000000011a4937908fa06f0e760b1f274b438", "0x0000000000000000000000000000001467c7829724b2813c4d424b3d3c6b815f", "0x00000000000000000000000000000000000946441492ff70f55d34186ca89de7", "0x0000000000000000000000000000003a2c7944ca2aa04f1abb13d1178a57955c", "0x000000000000000000000000000000000000426ed23d57cb6727bf7dc3549693", "0x0000000000000000000000000000006765bba55f7629f54858baa7e5ccb7168d", "0x000000000000000000000000000000000029e43ebaf8f62f50d4b355a5fcc922", "0x000000000000000000000000000000d56d91e5ba6a69bd196ec92ab0bea93647", "0x0000000000000000000000000000000000148f46afa46543255a81914c5279e1", "0x000000000000000000000000000000ee5f9749910d8a63b33bb369c834a500bf", "0x00000000000000000000000000000000001011e1e2d76750fbcceebaf2157840", "0x00000000000000000000000000000036268dff2bc112ecc0322c88579390e0b3", "0x00000000000000000000000000000000001ad5728e6bf12a82af01eeb1487802", "0x000000000000000000000000000000b6c4596b778ab2404672e07fa0ac19ec86", "0x0000000000000000000000000000000000027d448a20e433003295d074b0f0e0", "0x00000000000000000000000000000018c4347708e93a0e2fc7f190cebc6fe036", "0x00000000000000000000000000000000002d5c3527dde0816ee1836500a5d420", "0x000000000000000000000000000000b33906cbc4e9badec6bd61f0b100df45b8", "0x00000000000000000000000000000000002c7513e6507493550d40bfac85e933", "0x0000000000000000000000000000004e3aae0b73031a38513038218da180cab7", "0x0000000000000000000000000000000000060debf0c1bbb74e4ddbf554f8b5d3", "0x0000000000000000000000000000006efb6cb32ce7e61243d2ed91f223bdb20d", "0x000000000000000000000000000000000020de0c23d10cd268a17fc641a024e2", "0x000000000000000000000000000000db92550b30be7d5a944d42d1526f970800", "0x0000000000000000000000000000000000002b2891ff35b817850407610ce864", "0x0000000000000000000000000000008ab82ffe538b09d1b30ae1045af6d9ece4", "0x00000000000000000000000000000000001ce120441dae2f06f06b5f1b7f0571", "0x00000000000000000000000000000012306dfba880f78fdcfd198e287df3dd00", "0x0000000000000000000000000000000000115ff991e4ecec23a5f363517f9fec", "0x000000000000000000000000000000c156a25d190e4a010a18b8185ef311bfc2", "0x0000000000000000000000000000000000067625706cdd46fced6af42e57aa31", "0x000000000000000000000000000000ebf11762356fedebd5c414875b778d08bc", "0x00000000000000000000000000000000000ee3f392c42f0cf2ef31a24211dc04", "0x00000000000000000000000000000073c2e8b17c897a26a491dae2e84031c2c7", "0x0000000000000000000000000000000000074f13ce4cd700a6e96ad5beb82459", "0x0000000000000000000000000000005ec1a9ddf3c2a0339a2cc1af9d4c554d04", "0x00000000000000000000000000000000000501957be5a070a890e03df0335cb5", "0x180f9ffb422a88f9e94ac05aee10e44dc93ff6dbc500075f0faf74895021e0df", "0x2b94b3f53b48e388fa3d4993177a0fc1660b22a6702b88b8b72909ddb6f615dc", "0x253c56360f9bb22d07c70c53862b4711448aab506c2e3e31fad128690cbbec5a", "0x018b802461f551a53b4b7fd18f5a4a760bd1df9985d3d471b29d261527b00e62", "0x288de370d960235736d4eb9f7e7818ba138d0b7cd49d8dc918de0538f012d96c", "0x2764ef9c90cab3673c0772887397b4b7c04d79d5b9731fd5c7d82ef62cbf9a1f", "0x0712ff6793ebb0b0668944d581a14d1737d859b12331268513d4074dbca6149f", "0x2c9d3f3257f167c8c6e5d4a1c72538c270960b48608ad5cf0d1e1b8d93c94d08", "0x20f3f943daa1d0f0ddd93fa755e8600abe8a9ad70fc9cb506c959d48088c0d85", "0x11ecad3379384fad7b73325820ca4f41dff8cbb4d2c0df6d20406dc7bd5174a0", "0x0fd924cb4584b3f6df037cdd6a2c26673582e19e8431ea740e89764000602f11", "0x21d3137bf8c81d05280afd4721798d86c8bac4efac0a2cc6a8ecebaf37af0bc7", "0x2455e7d6be911a29a32ecc3c82715427f5aff400642b16aa4f39f53e411e7602", "0x072bd713f54a2ef55f36ef168b2bdc70965e872e001be321205117be7017724e", "0x0c1f64a0e7a3e08560b43c72325d3a64b26289aff1d84570672f0a94389a6a10", "0x270063ac9000cc565d0728b2e5b1de213d3d508e7e91be481ab9a332c8340a33", "0x25f5499686fb5f77c4a9b3b27f0c97a8cdcc95080d5471954f0a7d99c3c80b55", "0x26820d37b4c651c5d2fa5bc38b0bda4ab5328ebbb73ba78a9a17dc52e0bd3409", "0x0576c995eb08940dbb447e9c984a0da18d062cfad767d6859d683503fe13d0e0", "0x143c44dbccb1dc104d924db44f8d25c9df921399417338ab9f8c64bf4b4f444e", "0x0b5a48b1162c1e346802ab38dfb7b6fa071552170ff097a1df815875cf38491b", "0x1798a9c7d32e392207030330c45c950d61ea9dd9ca70a07cd7d6bfdff617760d", "0x28c912e5129036cb39172d8e8b6833ee7417fed70776535408d9184d5ec3d9b3", "0x2d3e00aea2f0f6107d40e8719b8d0ee62ec41de4ae824b61f05e79437fbf9f90", "0x20bdc72859e03f1ecad66ab07dd2374ea098eb67d721f217549ec19cadac10ff", "0x012205502e172b2ee14b2b8329802628c82fca888b226fb8647aa5710aa650e4", "0x1cc0a2c97dd57937d142a29f0321c23feec6b2c42dae8d2673e7727a3e59da9d", "0x22821946637280bcfe3cdc68f6199285d5984c964fbf507c061e1e735a6dde0f", "0x24485e955fface253303598088fab224b656815d2ab9b9cfed25858e4513b049", "0x11785ca28b175f273428f9e3e88e0749f9a79e8313e2ab18aab7133e9e498d3d", "0x158d4815958ec5b62815984596965bd035bbae0b9ab43bf27c909a6870c536d5", "0x06a090e3c4e140f005709a1ec2c4578f4eb527eec59ad764317c0d423eb774f4", "0x2c0a940acdb1f4849c10f8265711614f09ae2a3f64d4a625799a0c3bc2932a90", "0x246eed25c919832279df0bb2366520ab038c81e3d186289b37113bbc648f8826", "0x298865d048017afb0b28604eaf33d24ffaacc547bc1d5b0c925b472437309026", "0x0a13dc472f0cd5477e1a8bab96b97da23c8f715d28c40bb71e01594893a67037", "0x07d5694314a48513013c684661e39f9f5fe3ed5ab7284299bdfe12d062118c8b", "0x1d560f2cb22815b9afa3c3a15143f5fe1d14275b0c2fe34b2b3b4c5ab329c095", "0x1389a993e59ba69c0b94170a45b17811ac4945d66fa31576b7a4130ace04dc0a", "0x074a6bcf69542eb84d2e3bb67004391650e339b683cc067aadfeb9d1830b58c6", "0x2a911a141086ae4909d39f3b770e834b14e90e74a56ce19e94c444eda43b3d6b", "0x000000000000000000000000000000354c43d822f8540138390c7e7a74ff3684", "0x00000000000000000000000000000000001cea2728d37fe22cb1ed06226a1316", "0x0000000000000000000000000000004f0792a24b610e27065dce8c964fa83d45", "0x0000000000000000000000000000000000171b5ca5c86e0c1fe785b20a09b8ba", "0x00000000000000000000000000000020cb95424c60c1be50aaf3b12500c7045e", "0x00000000000000000000000000000000002b6cedbf9ee921c34d9181dec84410", "0x0000000000000000000000000000003f34c36812654767666c9c59339b0b790e", "0x000000000000000000000000000000000014d9d9a27f8cd1add117b834c3422e"] +verification_key = ["0x006fab49b869ae62001deac878b2667bd31bf3e28e3a2d764aa49b8d9bbdd310", "0x0000000000000000000000000000000000000000000000000000000000002000", "0x0000000000000000000000000000000000000000000000000000000000000005", "0x0000000000000000000000000000000000000000000000000000000000002000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000003404be1595e5504cc605ac8ef3860aa700", "0x000000000000000000000000000000000018f7f7038aa55c168070e5fa71c711", "0x0000000000000000000000000000007737623180d6db14eedd88a292c32a66ed", "0x000000000000000000000000000000000002cb868dc42d2272ed05cea780a3b2", "0x0000000000000000000000000000002f60152775671437b19a6605a23ab2450d", "0x0000000000000000000000000000000000094f46605db7eaebc318a1d6eb0a13", "0x000000000000000000000000000000576808b58acd54b5177b3c99d034bb9dba", "0x000000000000000000000000000000000026b9a55104cb174c15dcbf67fc20a0", "0x000000000000000000000000000000771e7c3d88f1a9363e1c19c8350c85e3cd", "0x0000000000000000000000000000000000011b26f3ec083ed471c710105af3cd", "0x0000000000000000000000000000001719c7ef326dc9b65b7404014c0a192149", "0x00000000000000000000000000000000001c448abfcf36e5020a79c88d61ebbc", "0x00000000000000000000000000000085da19557d2c1954f8e4b50c8f9f416cb8", "0x000000000000000000000000000000000028f437ec8d2a42df2a711764ce675a", "0x00000000000000000000000000000053eebb686a574202f7a6e7056dac4e6a04", "0x00000000000000000000000000000000000a30a2af6d9faaf84d75107090fbb8", "0x000000000000000000000000000000a5c526253b5d7fe5bc03090f882512cf51", "0x00000000000000000000000000000000001264282b9bdf8043ad67c553d11486", "0x000000000000000000000000000000892d49bcae8a30f909f5e27198818422ef", "0x0000000000000000000000000000000000044c1cf862883cc720de3bf1a65158", "0x00000000000000000000000000000063bb9b6be191ad0333a01860021474652e", "0x000000000000000000000000000000000021d4a4fbf4255ec22363c0e67fddcd", "0x00000000000000000000000000000031df120c8c2cdaa1deced300e262a41a59", "0x0000000000000000000000000000000000127f2963c9cc3e46c9b2a81f010566", "0x00000000000000000000000000000055b3eb94ad7db1cebf2493787119372bf2", "0x0000000000000000000000000000000000125ef4e2acb74a4d7e1746b1cb3556", "0x000000000000000000000000000000b6e69abc23cbd3ea2b7e0ac8e44f500473", "0x000000000000000000000000000000000012a37dea2c03430ee09cfaf0dab3b7", "0x00000000000000000000000000000091c4b58c9466db7519e549de29653f7e08", "0x000000000000000000000000000000000005da324c9f8c5928b073bd5d3d4b0f", "0x000000000000000000000000000000b6cc35b21df59fb4e2a36cefe98fe936c4", "0x0000000000000000000000000000000000135878d2105778eaba1a0023a84035", "0x000000000000000000000000000000e648cd91b86f4b17f30e4e62110f41f410", "0x00000000000000000000000000000000001c354c314e59ad314b5388a1feb73d", "0x000000000000000000000000000000b06b91150e48b16fa9a3d52188b430447f", "0x000000000000000000000000000000000018b19ba5b1ef0342f198ff0ef41bab", "0x000000000000000000000000000000cc6b57ed37a72741fd60d4a9c9de019013", "0x000000000000000000000000000000000012343e6875fb97c8dd7ba0515caa0b", "0x000000000000000000000000000000a7e527a7eb6b1ae11fe00e4c5277f9a685", "0x0000000000000000000000000000000000029ff8300c511064acecd1f509280e", "0x000000000000000000000000000000eb82b47185154284553789f289db5818b6", "0x00000000000000000000000000000000001016abd0ae2334d050428e797067df", "0x000000000000000000000000000000fc433da4e3998d5adde582a6df90efffd3", "0x000000000000000000000000000000000020d603d61b3c2e0779dfdacf85432c", "0x00000000000000000000000000000038bf08fd657ed34b579855216db4c51e0e", "0x00000000000000000000000000000000001362b7a10dfb405d68f831ba5b1f1e", "0x00000000000000000000000000000018511419fe4ece0a80041eee0eb05974bd", "0x00000000000000000000000000000000001d13a06c7ac45280962393773ded47", "0x0000000000000000000000000000002dce77d4a83bda0ed9e93f8c382a9a1a83", "0x0000000000000000000000000000000000223d882d759fc08bac197c0c0b4a0c", "0x000000000000000000000000000000e797720f53bf212d66d2b15866404d04dd", "0x00000000000000000000000000000000001f7a89c97f3459327900e148f7c021", "0x00000000000000000000000000000095cf09e567947e95b25161db1a6493a63e", "0x00000000000000000000000000000000001ca18c9d8bd644fc8080ddcf840839", "0x000000000000000000000000000000b65e49b9800ebf970b5d5810cca03feb48", "0x00000000000000000000000000000000000791f68e28d22fabb3f7c95b2872c3", "0x000000000000000000000000000000031738dc11c806fc626e06f3c528f261d1", "0x000000000000000000000000000000000004058b5c321f1d0de7302f994ef5b0", "0x000000000000000000000000000000e6e99bd35fbcabda70289996fea3a93011", "0x00000000000000000000000000000000000db7c40d801d2e7eac001a5673c3cd", "0x0000000000000000000000000000004994438a00d1ab228927f908ccfcf2ed3d", "0x0000000000000000000000000000000000237c83789d39d8459848d87929a49e", "0x0000000000000000000000000000008725eb45c8e1888226f2bcc036e0d6a698", "0x000000000000000000000000000000000009d3b1fef691b49a440d6a0ad2be80", "0x0000000000000000000000000000004ad874e52a05928aa2b170cc2b63c274ef", "0x000000000000000000000000000000000010c9d5ae2475ab1b23571f638477ca", "0x000000000000000000000000000000c690acbf94666d3cdb1700cf7aad52ad26", "0x00000000000000000000000000000000000eb136ae272592f98cc23b90dd9b9e", "0x0000000000000000000000000000006dfe9ae4650c42e2d748c4a41f31ef3f79", "0x00000000000000000000000000000000002cc60738774946a2165785da782965", "0x000000000000000000000000000000b372175007e1d700a6c6dccf7725a68cf4", "0x0000000000000000000000000000000000055b0ef271f117387a3e661982046e", "0x00000000000000000000000000000030c29017ffa425c6869ff399db0e9adb6d", "0x000000000000000000000000000000000029379efcf5b36e94fa459fcf11803e", "0x000000000000000000000000000000bed1592b719b28e44dc87b6ad1884f642c", "0x00000000000000000000000000000000000d0037fb7889608353203ef391d7a1", "0x00000000000000000000000000000021a91fa2bd116913d763836e62dbb9957f", "0x000000000000000000000000000000000029cc2825f5f92281f1c7a3df846304", "0x000000000000000000000000000000e4a765d9dccfd5af2cc8d69af2ece343a3", "0x00000000000000000000000000000000001242a3f2f4fec5433e22394c4541b1", "0x000000000000000000000000000000f9992678a973b8fb38c824d0c9a6d14010", "0x00000000000000000000000000000000001a146c1b754ee0eb69e6895b7dd9bf", "0x000000000000000000000000000000c2fc1876673fbae3031dc825559b61f6dc", "0x00000000000000000000000000000000002d45c6df9b1a2d830fb34f1519341e", "0x0000000000000000000000000000007a72745061f1f059046fd03f84564e5d7a", "0x000000000000000000000000000000000012592c8f38051aaf92a955aa17ae75", "0x000000000000000000000000000000081c6ba09203e3e0d874f8bc31e6a0ec40", "0x00000000000000000000000000000000000cdbf1a771f6eb78964a939acddeb9", "0x000000000000000000000000000000b66e472a0cfd42cc6313ec34ff6882e4dc", "0x00000000000000000000000000000000000ebaed1a9a0773ce3a62637ea9d53a", "0x000000000000000000000000000000d2a2bfd3e7ac5860e62f2495a5e792d513", "0x000000000000000000000000000000000022ab28abcec226916d0c7258ba9d2d"] +key_hash = "0x2b6e74a005fa5dd61ae599dc14f53bdf2b0643a8ebd005ab63a99e145cc81ed4" diff --git a/crates/nargo_cli/tests/test_data/recursion/src/main.nr b/crates/nargo_cli/tests/test_data/recursion/src/main.nr new file mode 100644 index 00000000000..d9fd4e2e9f2 --- /dev/null +++ b/crates/nargo_cli/tests/test_data/recursion/src/main.nr @@ -0,0 +1,23 @@ +use dep::std; + +fn main( + verification_key : [Field; 114], + proof : [Field; 94], + public_input : Field, + key_hash : Field, + input_aggregation_object : [Field; 16] +) -> pub [Field; 16] { + let output_aggregation_object = std::verify_proof( + verification_key, + proof, + public_input, + key_hash, + input_aggregation_object + ); + + let mut output = [0; 16]; + for i in 0..16 { + output[i] = output_aggregation_object[i]; + } + output +} \ No newline at end of file diff --git a/crates/noirc_evaluator/src/lib.rs b/crates/noirc_evaluator/src/lib.rs index 64a02061b0f..438ada0167c 100644 --- a/crates/noirc_evaluator/src/lib.rs +++ b/crates/noirc_evaluator/src/lib.rs @@ -174,7 +174,7 @@ impl Evaluator { let inter_var_witness = self.add_witness_to_cs(); // Link that witness to the arithmetic gate - let constraint = &arithmetic_gate - &inter_var_witness; + let constraint = &arithmetic_gate - inter_var_witness; self.opcodes.push(AcirOpcode::Arithmetic(constraint)); inter_var_witness } diff --git a/crates/noirc_evaluator/src/ssa/acir_gen/constraints.rs b/crates/noirc_evaluator/src/ssa/acir_gen/constraints.rs index 8257e0c9f9a..11371dc54a6 100644 --- a/crates/noirc_evaluator/src/ssa/acir_gen/constraints.rs +++ b/crates/noirc_evaluator/src/ssa/acir_gen/constraints.rs @@ -31,7 +31,7 @@ pub(crate) fn mul_with_witness( let a_arith; let a_arith = if !a.mul_terms.is_empty() && !b.is_const() { let a_witness = evaluator.create_intermediate_variable(a.clone()); - a_arith = Expression::from(&a_witness); + a_arith = Expression::from(a_witness); &a_arith } else { a @@ -42,7 +42,7 @@ pub(crate) fn mul_with_witness( a_arith } else { let b_witness = evaluator.create_intermediate_variable(b.clone()); - b_arith = Expression::from(&b_witness); + b_arith = Expression::from(b_witness); &b_arith } } else { @@ -54,9 +54,9 @@ pub(crate) fn mul_with_witness( //a*b pub(crate) fn mul(a: &Expression, b: &Expression) -> Expression { if a.is_const() { - return b * &a.q_c; + return b * a.q_c; } else if b.is_const() { - return a * &b.q_c; + return a * b.q_c; } else if !(a.is_linear() && b.is_linear()) { unreachable!("Can only multiply linear terms"); } @@ -125,9 +125,9 @@ pub(crate) fn subtract(a: &Expression, k: FieldElement, b: &Expression) -> Expre // TODO in either case, we can put this in ACIR, if its useful pub(crate) fn add(a: &Expression, k: FieldElement, b: &Expression) -> Expression { if a.is_const() { - return (b * &k) + &a.q_c; + return (b * k) + a.q_c; } else if b.is_const() { - return a.clone() + &(k * b.q_c); + return a.clone() + (k * b.q_c); } let mut output = Expression::from_field(a.q_c + k * b.q_c); @@ -497,7 +497,7 @@ pub(crate) fn evaluate_truncate( if let Some(a_c) = lhs.to_const() { let mut a_big = BigUint::from_bytes_be(&a_c.to_be_bytes()); a_big %= exp_big; - return Expression::from(&FieldElement::from_be_bytes_reduce(&a_big.to_bytes_be())); + return Expression::from(FieldElement::from_be_bytes_reduce(&a_big.to_bytes_be())); } let exp = FieldElement::from_be_bytes_reduce(&exp_big.to_bytes_be()); @@ -524,7 +524,7 @@ pub(crate) fn evaluate_truncate( let my_constraint = add(&res, -FieldElement::one(), lhs); evaluator.push_opcode(AcirOpcode::Arithmetic(my_constraint)); - Expression::from(&b_witness) + Expression::from(b_witness) } pub(crate) fn evaluate_udiv( @@ -552,8 +552,8 @@ pub(crate) fn evaluate_udiv( //range check q<=a try_range_constraint(q_witness, bit_size, evaluator); // a-b*q-r = 0 - let mut d = mul_with_witness(evaluator, rhs, &Expression::from(&q_witness)); - d = add(&d, FieldElement::one(), &Expression::from(&r_witness)); + let mut d = mul_with_witness(evaluator, rhs, &Expression::from(q_witness)); + d = add(&d, FieldElement::one(), &Expression::from(r_witness)); d = mul_with_witness(evaluator, &d, predicate); let div_euclidean = subtract(&pa, FieldElement::one(), &d); diff --git a/crates/noirc_evaluator/src/ssa/acir_gen/internal_var.rs b/crates/noirc_evaluator/src/ssa/acir_gen/internal_var.rs index 8e6e16776a9..27d6b0ec25b 100644 --- a/crates/noirc_evaluator/src/ssa/acir_gen/internal_var.rs +++ b/crates/noirc_evaluator/src/ssa/acir_gen/internal_var.rs @@ -98,7 +98,7 @@ impl InternalVar { /// Expression, this method is infallible. pub(crate) fn from_witness(witness: Witness) -> InternalVar { InternalVar { - expression: Expression::from(&witness), + expression: Expression::from(witness), cached_witness: Some(witness), id: None, } diff --git a/crates/noirc_evaluator/src/ssa/acir_gen/operations/binary.rs b/crates/noirc_evaluator/src/ssa/acir_gen/operations/binary.rs index bf1f59391f9..87280eb1fde 100644 --- a/crates/noirc_evaluator/src/ssa/acir_gen/operations/binary.rs +++ b/crates/noirc_evaluator/src/ssa/acir_gen/operations/binary.rs @@ -146,12 +146,12 @@ pub(crate) fn evaluate( if r_value.is_zero() { panic!("Panic - division by zero"); } else { - (l_c.expression() * &r_value.inverse()).into() + (l_c.expression() * r_value.inverse()).into() } } else { //TODO avoid creating witnesses here. let x_witness = acir_gen.var_cache.get_or_compute_witness(r_c, evaluator).expect("unexpected constant expression"); - let inverse = Expression::from(&constraints::evaluate_inverse( + let inverse = Expression::from(constraints::evaluate_inverse( x_witness, &predicate, evaluator, )); InternalVar::from(constraints::mul_with_witness( diff --git a/crates/noirc_evaluator/src/ssa/acir_gen/operations/bitwise.rs b/crates/noirc_evaluator/src/ssa/acir_gen/operations/bitwise.rs index 947cf93edd9..f8ca271835e 100644 --- a/crates/noirc_evaluator/src/ssa/acir_gen/operations/bitwise.rs +++ b/crates/noirc_evaluator/src/ssa/acir_gen/operations/bitwise.rs @@ -155,9 +155,9 @@ pub(super) fn evaluate_bitwise( constraints::subtract( &Expression::from_field(max), FieldElement::one(), - &Expression::from(&result), + &Expression::from(result), ) } else { - Expression::from(&result) + Expression::from(result) } } diff --git a/crates/noirc_evaluator/src/ssa/acir_gen/operations/cmp.rs b/crates/noirc_evaluator/src/ssa/acir_gen/operations/cmp.rs index 4abd34f6e01..0f8091e2f6f 100644 --- a/crates/noirc_evaluator/src/ssa/acir_gen/operations/cmp.rs +++ b/crates/noirc_evaluator/src/ssa/acir_gen/operations/cmp.rs @@ -69,7 +69,7 @@ pub(super) fn evaluate_neq( .get_or_compute_witness(x, evaluator) .expect("unexpected constant expression"); - return Expression::from(&constraints::evaluate_zero_equality(x_witness, evaluator)); + return Expression::from(constraints::evaluate_zero_equality(x_witness, evaluator)); } // Arriving here means that `lhs` and `rhs` are not Arrays @@ -95,7 +95,7 @@ pub(super) fn evaluate_neq( .var_cache .get_or_compute_witness(x, evaluator) .expect("unexpected constant expression"); - Expression::from(&constraints::evaluate_zero_equality(x_witness, evaluator)) + Expression::from(constraints::evaluate_zero_equality(x_witness, evaluator)) } } diff --git a/crates/noirc_evaluator/src/ssa/acir_gen/operations/intrinsics.rs b/crates/noirc_evaluator/src/ssa/acir_gen/operations/intrinsics.rs index 7d6f7e2c32c..e69c30b1931 100644 --- a/crates/noirc_evaluator/src/ssa/acir_gen/operations/intrinsics.rs +++ b/crates/noirc_evaluator/src/ssa/acir_gen/operations/intrinsics.rs @@ -80,9 +80,9 @@ pub(crate) fn evaluate( } Opcode::LowLevel(op) => { let inputs = prepare_inputs(acir_gen, args, ctx, evaluator); - let output_count = op.definition().output_size.0 as u32; + outputs = - prepare_outputs(&mut acir_gen.memory, instruction_id, output_count, ctx, evaluator); + prepare_outputs_no_count(&mut acir_gen.memory, instruction_id, ctx, evaluator); let func_call = BlackBoxFuncCall { name: op, @@ -107,7 +107,7 @@ pub(crate) fn evaluate( } outputs = prepare_outputs(&mut acir_gen.memory, instruction_id, array.len, ctx, evaluator); - let out_expr: Vec = outputs.iter().map(|w| w.into()).collect(); + let out_expr: Vec = outputs.iter().map(|w| (*w).into()).collect(); for i in 0..(out_expr.len() - 1) { bound_constraint_with_offset( &out_expr[i], @@ -235,6 +235,25 @@ fn prepare_outputs( outputs } +fn prepare_outputs_no_count( + memory_map: &mut AcirMem, + pointer: NodeId, + ctx: &SsaContext, + evaluator: &mut Evaluator, +) -> Vec { + // Create fresh variables that will link to the output + let l_obj = ctx.try_get_node(pointer).unwrap(); + if let node::ObjectType::ArrayPointer(a) = l_obj.get_type() { + let mem_array = &ctx.mem[a]; + let output_nb = mem_array.len; + let outputs = vecmap(0..output_nb, |_| evaluator.add_witness_to_cs()); + memory_map.map_array(a, &outputs, ctx); + outputs + } else { + vec![evaluator.add_witness_to_cs()] + } +} + fn evaluate_println( var_cache: &mut InternalVarCache, memory_map: &mut AcirMem, diff --git a/crates/noirc_evaluator/src/ssa/acir_gen/operations/not.rs b/crates/noirc_evaluator/src/ssa/acir_gen/operations/not.rs index ff8bb26f788..76ad7c93a88 100644 --- a/crates/noirc_evaluator/src/ssa/acir_gen/operations/not.rs +++ b/crates/noirc_evaluator/src/ssa/acir_gen/operations/not.rs @@ -19,7 +19,7 @@ pub(crate) fn evaluate( let l_c = var_cache.get_or_compute_internal_var_unwrap(*value, evaluator, ctx); Some( constraints::subtract( - &Expression::from(&FieldElement::from(a)), + &Expression::from(FieldElement::from(a)), FieldElement::one(), l_c.expression(), ) diff --git a/crates/noirc_evaluator/src/ssa/acir_gen/operations/sort.rs b/crates/noirc_evaluator/src/ssa/acir_gen/operations/sort.rs index 04524959fbe..ffcbf1ea7c0 100644 --- a/crates/noirc_evaluator/src/ssa/acir_gen/operations/sort.rs +++ b/crates/noirc_evaluator/src/ssa/acir_gen/operations/sort.rs @@ -119,6 +119,7 @@ mod test { acir::{circuit::opcodes::BlackBoxFuncCall, native_types::Witness}, pwg::block::Blocks, FieldElement, OpcodeResolution, OpcodeResolutionError, PartialWitnessGenerator, + PartialWitnessGeneratorStatus, }; use crate::{ @@ -180,10 +181,10 @@ mod test { // compute the network output by solving the constraints let backend = MockBackend {}; let mut blocks = Blocks::default(); - let (unresolved_opcodes, oracles) = backend + let solver_status = backend .solve(&mut solved_witness, &mut blocks, eval.opcodes.clone()) .expect("Could not solve permutation constraints"); - assert!(unresolved_opcodes.is_empty() && oracles.is_empty(), "Incomplete solution"); + assert_eq!(solver_status, PartialWitnessGeneratorStatus::Solved, "Incomplete solution"); let mut b_val = Vec::new(); for i in 0..output.len() { b_val.push(solved_witness[&b_wit[i]]); diff --git a/crates/noirc_evaluator/src/ssa/builtin.rs b/crates/noirc_evaluator/src/ssa/builtin.rs index 8248322c488..0ace5969d0c 100644 --- a/crates/noirc_evaluator/src/ssa/builtin.rs +++ b/crates/noirc_evaluator/src/ssa/builtin.rs @@ -75,12 +75,13 @@ impl Opcode { BlackBoxFunc::SHA256 | BlackBoxFunc::Blake2s | BlackBoxFunc::Pedersen - | BlackBoxFunc::FixedBaseScalarMul => BigUint::zero(), + | BlackBoxFunc::FixedBaseScalarMul + | BlackBoxFunc::VerifyProof => BigUint::zero(), // Verify returns zero or one - BlackBoxFunc::SchnorrVerify - | BlackBoxFunc::EcdsaSecp256k1 - | BlackBoxFunc::MerkleMembership => BigUint::one(), - BlackBoxFunc::HashToField128Security => ObjectType::native_field().max_size(), + BlackBoxFunc::SchnorrVerify | BlackBoxFunc::EcdsaSecp256k1 => BigUint::one(), + BlackBoxFunc::ComputeMerkleRoot | BlackBoxFunc::HashToField128Security => { + ObjectType::native_field().max_size() + } BlackBoxFunc::AES => { todo!("ICE: AES is unimplemented") } @@ -111,13 +112,16 @@ impl Opcode { BlackBoxFunc::SHA256 | BlackBoxFunc::Blake2s => { (32, ObjectType::unsigned_integer(8)) } - BlackBoxFunc::HashToField128Security => (1, ObjectType::native_field()), + BlackBoxFunc::ComputeMerkleRoot | BlackBoxFunc::HashToField128Security => { + (1, ObjectType::native_field()) + } // See issue #775 on changing this to return a boolean - BlackBoxFunc::MerkleMembership - | BlackBoxFunc::SchnorrVerify - | BlackBoxFunc::EcdsaSecp256k1 => (1, ObjectType::native_field()), + BlackBoxFunc::SchnorrVerify | BlackBoxFunc::EcdsaSecp256k1 => { + (1, ObjectType::native_field()) + } BlackBoxFunc::Pedersen => (2, ObjectType::native_field()), BlackBoxFunc::FixedBaseScalarMul => (2, ObjectType::native_field()), + BlackBoxFunc::VerifyProof => (16, ObjectType::native_field()), BlackBoxFunc::RANGE | BlackBoxFunc::AND | BlackBoxFunc::XOR => { unreachable!("ICE: these opcodes do not have Noir builtin functions") } diff --git a/examples_failing/ecdsa_secp256k1/src/main.nr b/examples_failing/ecdsa_secp256k1/src/main.nr index 6ee7a98a89d..6919c2584cc 100644 --- a/examples_failing/ecdsa_secp256k1/src/main.nr +++ b/examples_failing/ecdsa_secp256k1/src/main.nr @@ -9,7 +9,7 @@ use dep::std; // - Noir should be agnostic to backends, so even though // the only backend implemented does not work properly for this, // we can still implement it on the frontend. -fn main(hashed_message : [32]u8, pub_key_x : [32]u8, pub_key_y : [32]u8, signature : [64]u8) { +fn main(hashed_message : [u8; 32], pub_key_x : [u8; 32], pub_key_y : [u8; 32], signature : [u8; 64]) { // Is there ever a situation where someone would want // to ensure that a signature was invalid? let x = std::ecdsa_secp256k1::verify_signature(pub_key_x,pub_key_y,signature, hashed_message); diff --git a/flake.lock b/flake.lock index 7c01326f86d..6a6aff10f73 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ ] }, "locked": { - "lastModified": 1682345890, - "narHash": "sha256-ZsInK9Iy81MaCugouU3ifa5Vw2GKlJK9MxCU/LF8bIw=", + "lastModified": 1682626614, + "narHash": "sha256-TC535frlYLUTDZ2iHAtUtKpMJWngL1MFxzEXhOfeCo8=", "owner": "AztecProtocol", "repo": "barretenberg", - "rev": "87aeb375d7b434e0faf47abb79f97753ab760987", + "rev": "7b5598890c1fa4ee485a4a0015fcb23b5389392e", "type": "github" }, "original": { diff --git a/noir_stdlib/src/lib.nr b/noir_stdlib/src/lib.nr index f0af06b97ba..870c799eb39 100644 --- a/noir_stdlib/src/lib.nr +++ b/noir_stdlib/src/lib.nr @@ -13,3 +13,7 @@ mod collections; #[builtin(println)] fn println(_input : T) {} + +// TODO: have the compiler insert the key_hash and remove as param +#[foreign(verify_proof)] +fn verify_proof(_verification_key : [Field], _proof : [Field], _public_input : Field, _key_hash : Field, _input_aggregation_object : [Field]) -> [Field] {} diff --git a/noir_stdlib/src/merkle.nr b/noir_stdlib/src/merkle.nr index 9f7c5d5b130..a47ce86c94b 100644 --- a/noir_stdlib/src/merkle.nr +++ b/noir_stdlib/src/merkle.nr @@ -5,16 +5,15 @@ // and the hashpath proves this // Currently we assume that it is a binary tree, so depth k implies a width of 2^k // XXX: In the future we can add an arity parameter -#[foreign(merkle_membership)] -fn check_membership(_root : Field, _leaf : Field, _index : Field, _hash_path: [Field]) -> Field {} - - -#[alternative(merkle_membership)] -fn check_membership_in_noir(root : Field, leaf : Field, index : Field, hash_path: [Field]) -> Field { - (compute_root_from_leaf(leaf, index, hash_path) == root) as Field +fn check_membership(_root : Field, _leaf : Field, _index : Field, _hash_path: [Field]) -> Field { + (compute_merkle_root(_leaf, _index, _hash_path) == _root) as Field } +#[foreign(compute_merkle_root)] +fn compute_merkle_root(_leaf : Field, _index : Field, _hash_path: [Field]) -> Field {} + // Returns the root of the tree from the provided leaf and its hashpath, using pedersen hash +#[alternative(compute_merkle_root)] fn compute_root_from_leaf(leaf : Field, index : Field, hash_path: [Field]) -> Field { let n = hash_path.len(); let index_bits = index.to_le_bits(n as u32);