diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000000..8e5093868d --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,5469 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli 0.28.1", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +dependencies = [ + "getrandom 0.2.11", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "airgen" +version = "0.1.0" +dependencies = [ + "ast 0.1.0", + "log", + "num-bigint 0.4.4", + "number 0.1.0", +] + +[[package]] +name = "alga" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f823d037a7ec6ea2197046bafd4ae150e6bc36f9ca347404f46a46823fa84f2" +dependencies = [ + "approx", + "num-complex 0.2.4", + "num-traits", +] + +[[package]] +name = "algebraic" +version = "0.0.1" +source = "git+https://github.com/0xEigenLabs/eigen-zkvm.git?rev=4ed1da7#4ed1da7766f7aa8740f355d8c1f3d213411ccf4b" +dependencies = [ + "byteorder", + "ff_ce 0.11.0", + "fnv", + "franklin-crypto", + "hex", + "hex-literal 0.2.2", + "itertools 0.8.2", + "log", + "num", + "num-bigint 0.3.3", + "num-traits", + "proptest", + "rand 0.4.6", + "rand 0.6.5", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasmer", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "alloy-primitives" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0628ec0ba5b98b3370bb6be17b12f23bfce8ee4ad83823325a20546d9b03b78" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if 1.0.0", + "const-hex", + "derive_more 0.99.17", + "hex-literal 0.4.1", + "itoa", + "ruint", + "tiny-keccak 2.0.2", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc0fac0fc16baf1f63f78b47c3d24718f3619b0714076f6a02957d808d52cbef" +dependencies = [ + "alloy-rlp-derive", + "bytes", +] + +[[package]] +name = "alloy-rlp-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0391754c09fab4eae3404d19d0d297aa1c670c1775ab51d8a5312afeca23157" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.39", +] + +[[package]] +name = "analysis" +version = "0.1.0" +dependencies = [ + "asm_to_pil 0.1.0", + "ast 0.1.0", + "env_logger", + "itertools 0.10.5", + "log", + "number 0.1.0", + "parser 0.1.0", + "pretty_assertions", + "test-log", + "type_check 0.1.0", +] + +[[package]] +name = "analysis" +version = "0.1.0" +source = "git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b#eb593dee15e194bd066085022f8a6ea52e2dab9b" +dependencies = [ + "asm_to_pil 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "ast 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "itertools 0.10.5", + "log", + "number 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "parser 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "type_check 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", +] + +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + +[[package]] +name = "anstream" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3a318f1f38d2418400f8209655bfd825785afd25aa30bb7ba6cc792e4596748" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "approx" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" +dependencies = [ + "num-traits", +] + +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint 0.4.4", + "num-traits", + "paste", + "rustc_version 0.4.0", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint 0.4.4", + "num-traits", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint 0.4.4", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "array_tool" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f8cb5d814eb646a863c4f24978cff2880c4be96ad8cde2c0f0678732902e271" + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +dependencies = [ + "nodrop", +] + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "ascii-canvas" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +dependencies = [ + "term", +] + +[[package]] +name = "asm_to_pil" +version = "0.1.0" +dependencies = [ + "ast 0.1.0", + "log", + "num-bigint 0.4.4", + "number 0.1.0", + "parser 0.1.0", + "pretty_assertions", + "type_check 0.1.0", +] + +[[package]] +name = "asm_to_pil" +version = "0.1.0" +source = "git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b#eb593dee15e194bd066085022f8a6ea52e2dab9b" +dependencies = [ + "ast 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "log", + "num-bigint 0.4.4", + "number 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "parser 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "pretty_assertions", +] + +[[package]] +name = "asm_utils" +version = "0.1.0" +dependencies = [ + "itertools 0.10.5", +] + +[[package]] +name = "ast" +version = "0.1.0" +dependencies = [ + "derive_more 0.99.17", + "diff", + "itertools 0.11.0", + "log", + "num-bigint 0.4.4", + "number 0.1.0", +] + +[[package]] +name = "ast" +version = "0.1.0" +source = "git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b#eb593dee15e194bd066085022f8a6ea52e2dab9b" +dependencies = [ + "derive_more 0.99.17", + "diff", + "itertools 0.11.0", + "log", + "num-bigint 0.4.4", + "number 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "auto_impl" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" +dependencies = [ + "proc-macro-error", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "autocfg" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backend" +version = "0.1.0" +dependencies = [ + "ast 0.1.0", + "bberg", + "env_logger", + "halo2", + "log", + "mktemp", + "number 0.1.0", + "pil_analyzer 0.1.0", + "pretty_assertions", + "serde_json", + "starky", + "strum", + "test-log", + "thiserror", +] + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +dependencies = [ + "byteorder", +] + +[[package]] +name = "bberg" +version = "0.1.0" +dependencies = [ + "ast 0.1.0", + "itertools 0.10.5", + "log", + "num-bigint 0.4.4", + "num-integer", + "num-traits", + "number 0.1.0", + "rand 0.8.5", +] + +[[package]] +name = "bberg_bin_cli" +version = "0.1.0" +dependencies = [ + "analysis 0.1.0", + "ast 0.1.0", + "clap 4.4.11", + "compiler", + "executor", + "importer", + "itertools 0.10.5", + "linker", + "log", + "num-bigint 0.4.4", + "num-integer", + "num-traits", + "number 0.1.0", + "parser 0.1.0", + "pil_analyzer 0.1.0", + "rand 0.8.5", +] + +[[package]] +name = "bellman_ce" +version = "0.3.2" +source = "git+https://github.com/matter-labs/bellman?branch=beta#416f79d3f93fc855fb96bb61bfe73d2472e95548" +dependencies = [ + "bit-vec", + "blake2s_const", + "blake2s_simd", + "byteorder", + "cfg-if 1.0.0", + "crossbeam", + "futures 0.3.29", + "hex", + "lazy_static", + "num_cpus", + "pairing_ce", + "rand 0.4.6", + "tiny-keccak 1.5.0", +] + +[[package]] +name = "bellman_vk_codegen" +version = "0.2.0" +source = "git+https://github.com/0xEigenLabs/solidity_plonk_verifier.git#c23d7d15cf38ff8ee0089eb8c97a0ef4efa47427" +dependencies = [ + "bellman_ce", + "handlebars", + "hex", + "serde_json", + "web3", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "bitvec" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" +dependencies = [ + "funty 1.1.0", + "radium 0.6.2", + "tap", + "wyz 0.2.0", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty 2.0.0", + "radium 0.7.0", + "tap", + "wyz 0.5.1", +] + +[[package]] +name = "blake2" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" +dependencies = [ + "crypto-mac 0.8.0", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "blake2-rfc_bellman_edition" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc60350286c7c3db13b98e91dbe5c8b6830a6821bc20af5b0c310ce94d74915" +dependencies = [ + "arrayvec 0.4.12", + "byteorder", + "constant_time_eq 0.1.5", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "constant_time_eq 0.3.0", +] + +[[package]] +name = "blake2s_const" +version = "0.6.0" +source = "git+https://github.com/matter-labs/bellman?branch=beta#416f79d3f93fc855fb96bb61bfe73d2472e95548" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "constant_time_eq 0.1.5", +] + +[[package]] +name = "blake2s_simd" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "constant_time_eq 0.1.5", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding 0.1.5", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "block-padding 0.2.1", + "generic-array 0.14.7", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "bytecheck" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "ciborium" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" + +[[package]] +name = "ciborium-ll" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "bitflags 1.3.2", + "clap_lex 0.2.4", + "indexmap 1.9.3", + "textwrap", +] + +[[package]] +name = "clap" +version = "4.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap-markdown" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "325f50228f76921784b6d9f2d62de6778d834483248eefecd27279174797e579" +dependencies = [ + "clap 4.4.11", +] + +[[package]] +name = "clap_builder" +version = "4.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +dependencies = [ + "anstream", + "anstyle", + "clap_lex 0.6.0", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +dependencies = [ + "heck", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.39", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "clap_lex" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "compiler" +version = "0.1.0" +dependencies = [ + "airgen", + "analysis 0.1.0", + "asm_to_pil 0.1.0", + "asm_utils", + "ast 0.1.0", + "backend", + "criterion", + "env_logger", + "executor", + "halo2", + "importer", + "itertools 0.10.5", + "linker", + "log", + "mktemp", + "number 0.1.0", + "parser 0.1.0", + "parser_util 0.1.0", + "pil_analyzer 0.1.0", + "pilopt", + "riscv", + "test-log", + "walkdir", +] + +[[package]] +name = "const-hex" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5104de16b218eddf8e34ffe2f86f74bfa4e61e95a1b89732fccf6325efd0557" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "hex", + "proptest", + "serde", +] + +[[package]] +name = "const-oid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "corosensei" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80128832c58ea9cbd041d2a759ec449224487b2c1e400453d99d244eead87a8e" +dependencies = [ + "autocfg 1.1.0", + "cfg-if 1.0.0", + "libc", + "scopeguard", + "windows-sys 0.33.0", +] + +[[package]] +name = "cpufeatures" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +dependencies = [ + "libc", +] + +[[package]] +name = "cranelift-bforest" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2ab4512dfd3a6f4be184403a195f76e81a8a9f9e6c898e19d2dc3ce20e0115" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98b022ed2a5913a38839dfbafe6cf135342661293b08049843362df4301261dc" +dependencies = [ + "arrayvec 0.7.4", + "bumpalo", + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-egraph", + "cranelift-entity", + "cranelift-isle", + "gimli 0.26.2", + "log", + "regalloc2", + "smallvec 1.11.2", + "target-lexicon", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "639307b45434ad112a98f8300c0f0ab085cbefcd767efcdef9ef19d4c0756e74" +dependencies = [ + "cranelift-codegen-shared", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "278e52e29c53fcf32431ef08406c295699a70306d05a0715c5b1bf50e33a9ab7" + +[[package]] +name = "cranelift-egraph" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624b54323b06e675293939311943ba82d323bb340468ce1889be5da7932c8d73" +dependencies = [ + "cranelift-entity", + "fxhash", + "hashbrown 0.12.3", + "indexmap 1.9.3", + "log", + "smallvec 1.11.2", +] + +[[package]] +name = "cranelift-entity" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a59bcbca89c3f1b70b93ab3cbba5e5e0cbf3e63dadb23c7525cb142e21a9d4c" + +[[package]] +name = "cranelift-frontend" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d70abacb8cfef3dc8ff7e8836e9c1d70f7967dfdac824a4cd5e30223415aca6" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec 1.11.2", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "393bc73c451830ff8dbb3a07f61843d6cb41a084f9996319917c0b291ed785bb" + +[[package]] +name = "criterion" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" +dependencies = [ + "anes", + "atty", + "cast", + "ciborium", + "clap 3.2.25", + "criterion-plot", + "itertools 0.10.5", + "lazy_static", + "num-traits", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" +dependencies = [ + "cast", + "itertools 0.10.5", +] + +[[package]] +name = "crossbeam" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" +dependencies = [ + "cfg-if 0.1.10", + "crossbeam-channel", + "crossbeam-deque 0.7.4", + "crossbeam-epoch 0.8.2", + "crossbeam-queue", + "crossbeam-utils 0.7.2", +] + +[[package]] +name = "crossbeam-channel" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +dependencies = [ + "crossbeam-utils 0.7.2", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" +dependencies = [ + "crossbeam-epoch 0.8.2", + "crossbeam-utils 0.7.2", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-epoch 0.9.15", + "crossbeam-utils 0.8.16", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +dependencies = [ + "autocfg 1.1.0", + "cfg-if 0.1.10", + "crossbeam-utils 0.7.2", + "lazy_static", + "maybe-uninit", + "memoffset 0.5.6", + "scopeguard", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg 1.1.0", + "cfg-if 1.0.0", + "crossbeam-utils 0.8.16", + "memoffset 0.9.0", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" +dependencies = [ + "cfg-if 0.1.10", + "crossbeam-utils 0.7.2", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +dependencies = [ + "autocfg 1.1.0", + "cfg-if 0.1.10", + "lazy_static", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array 0.14.7", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + +[[package]] +name = "csv" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" +dependencies = [ + "memchr", +] + +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.39", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core", + "quote 1.0.33", + "syn 2.0.39", +] + +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if 1.0.0", + "hashbrown 0.14.3", + "lock_api 0.4.11", + "once_cell", + "parking_lot_core 0.9.9", +] + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a141330240c921ec6d074a3e188a7c7ef95668bb95e7d44fa0e5778ec2a7afe" +dependencies = [ + "lazy_static", + "proc-macro2 0.4.30", + "quote 0.6.13", + "regex", + "rustc_version 0.2.3", + "syn 0.15.44", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2 1.0.70", + "quote 1.0.33", + "rustc_version 0.4.0", + "syn 1.0.109", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "ecc" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/halo2wrong?tag=v2023_04_20#f72db265aa3cebe297c9b9816e940d0e1d400886" +dependencies = [ + "integer", + "num-bigint 0.4.4", + "num-integer", + "num-traits", + "rand 0.8.5", + "subtle", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array 0.14.7", + "group", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "ena" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +dependencies = [ + "log", +] + +[[package]] +name = "enum-iterator" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "enumn" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.39", +] + +[[package]] +name = "enumset" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" +dependencies = [ + "darling", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.39", +] + +[[package]] +name = "env_logger" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "error-chain" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" +dependencies = [ + "version_check", +] + +[[package]] +name = "ethabi" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebdeeea85a6d217b9fcc862906d7e283c047e04114165c433756baf5dce00a6c" +dependencies = [ + "error-chain", + "ethereum-types 0.6.0", + "rustc-hex", + "serde", + "serde_derive", + "serde_json", + "tiny-keccak 1.5.0", +] + +[[package]] +name = "ethabi" +version = "14.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01317735d563b3bad2d5f90d2e1799f414165408251abb762510f40e790e69a" +dependencies = [ + "anyhow", + "ethereum-types 0.11.0", + "hex", + "serde", + "serde_json", + "sha3 0.9.1", + "thiserror", + "uint 0.9.5", +] + +[[package]] +name = "ethbloom" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3932e82d64d347a045208924002930dc105a138995ccdc1479d0f05f0359f17c" +dependencies = [ + "crunchy", + "fixed-hash 0.3.2", + "impl-rlp 0.2.1", + "impl-serde 0.2.3", + "tiny-keccak 1.5.0", +] + +[[package]] +name = "ethbloom" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfb684ac8fa8f6c5759f788862bb22ec6fe3cb392f6bfd08e3c64b603661e3f8" +dependencies = [ + "crunchy", + "fixed-hash 0.7.0", + "impl-rlp 0.3.0", + "impl-serde 0.3.2", + "tiny-keccak 2.0.2", +] + +[[package]] +name = "ethereum-types" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62d1bc682337e2c5ec98930853674dd2b4bd5d0d246933a9e98e5280f7c76c5f" +dependencies = [ + "ethbloom 0.6.4", + "fixed-hash 0.3.2", + "impl-rlp 0.2.1", + "impl-serde 0.2.3", + "primitive-types 0.3.0", + "uint 0.7.1", +] + +[[package]] +name = "ethereum-types" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f64b5df66a228d85e4b17e5d6c6aa43b0310898ffe8a85988c4c032357aaabfd" +dependencies = [ + "ethbloom 0.11.1", + "fixed-hash 0.7.0", + "impl-rlp 0.3.0", + "impl-serde 0.3.2", + "primitive-types 0.9.1", + "uint 0.9.5", +] + +[[package]] +name = "executor" +version = "0.1.0" +dependencies = [ + "ast 0.1.0", + "bit-vec", + "env_logger", + "itertools 0.10.5", + "lazy_static", + "log", + "num-traits", + "number 0.1.0", + "parser_util 0.1.0", + "pil_analyzer 0.1.0", + "pretty_assertions", + "rayon", + "test-log", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "bitvec 1.0.1", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "ff_ce" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d3a682c12d0cc98a32ab7540401a5ea1ed21d11571eea11d5829cd721f85ff0" +dependencies = [ + "byteorder", + "ff_derive_ce 0.8.0", + "hex", + "rand 0.4.6", +] + +[[package]] +name = "ff_ce" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38107cbd8bac0d907d7e7513c9f68c95adbda9e6f6f6bdf3f5111c6ecac4fe47" +dependencies = [ + "byteorder", + "ff_derive_ce 0.9.3", + "hex", + "rand 0.4.6", +] + +[[package]] +name = "ff_derive_ce" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c052fa6d4c2f12305ec364bfb8ef884836f3f61ea015b202372ff996d1ac4b" +dependencies = [ + "num-bigint 0.2.6", + "num-integer", + "num-traits", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ff_derive_ce" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde5a00073374b4d7aa2d3a8359a5709f9c0bfac8393f254655d16b4acdfe823" +dependencies = [ + "num-bigint 0.4.4", + "num-integer", + "num-traits", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "fixed-hash" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1a683d1234507e4f3bf2736eeddf0de1dc65996dc0164d57eba0a74bcf29489" +dependencies = [ + "byteorder", + "heapsize", + "rand 0.5.6", + "rustc-hex", + "static_assertions 0.2.5", +] + +[[package]] +name = "fixed-hash" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions 1.1.0", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding 2.3.1", +] + +[[package]] +name = "franklin-crypto" +version = "0.0.5" +source = "git+https://github.com/matter-labs/franklin-crypto?branch=beta#9e3c2a12053c014df9b6c1f227db4470e02b4c5b" +dependencies = [ + "bellman_ce", + "bit-vec", + "blake2", + "blake2-rfc_bellman_edition", + "blake2s_simd", + "byteorder", + "digest 0.9.0", + "hex", + "hmac 0.11.0", + "itertools 0.9.0", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "poseidon_hash", + "rand 0.4.6", + "serde", + "serde_derive", + "sha2 0.9.9", + "splitmut", + "tiny-keccak 1.5.0", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "funty" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" + +[[package]] +name = "futures" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" + +[[package]] +name = "futures-executor" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" + +[[package]] +name = "futures-sink" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" + +[[package]] +name = "futures-task" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" + +[[package]] +name = "futures-util" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab 0.4.9", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +dependencies = [ + "fallible-iterator", + "indexmap 1.9.3", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "halo2" +version = "0.1.0" +dependencies = [ + "airgen", + "analysis 0.1.0", + "ast 0.1.0", + "compiler", + "env_logger", + "executor", + "halo2_proofs", + "halo2curves", + "importer", + "itertools 0.10.5", + "linker", + "log", + "num-bigint 0.4.4", + "num-integer", + "num-traits", + "number 0.1.0", + "parser 0.1.0", + "pil_analyzer 0.1.0", + "polyexen", + "rand 0.8.5", + "snark-verifier", + "test-log", +] + +[[package]] +name = "halo2_proofs" +version = "0.2.0" +source = "git+https://github.com/powdr-org/halo2?branch=kilic/shuffle#410bfdfa3ee9b37a990562d2f2639a4b2efe877b" +dependencies = [ + "blake2b_simd", + "ff", + "group", + "halo2curves", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "rayon", + "sha3 0.9.1", + "tracing", +] + +[[package]] +name = "halo2curves" +version = "0.3.2" +source = "git+https://github.com/privacy-scaling-explorations/halo2curves?tag=0.3.2#9f5c50810bbefe779ee5cf1d852b2fe85dc35d5e" +dependencies = [ + "ff", + "group", + "lazy_static", + "num-bigint 0.4.4", + "num-traits", + "pasta_curves", + "paste", + "rand 0.8.5", + "rand_core 0.6.4", + "static_assertions 1.1.0", + "subtle", +] + +[[package]] +name = "halo2wrong" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/halo2wrong?tag=v2023_04_20#f72db265aa3cebe297c9b9816e940d0e1d400886" +dependencies = [ + "halo2_proofs", + "num-bigint 0.4.4", + "num-integer", + "num-traits", +] + +[[package]] +name = "handlebars" +version = "3.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4498fc115fa7d34de968184e473529abb40eeb6be8bc5f7faba3d08c316cb3e3" +dependencies = [ + "log", + "pest", + "pest_derive", + "quick-error 2.0.1", + "serde", + "serde_json", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.7", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.6", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash 0.8.6", + "allocator-api2", +] + +[[package]] +name = "heapsize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" +dependencies = [ + "winapi", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d70693199b3cf4552f3fa720b54163927a3ebed2aef240efaf556033ab336a11" +dependencies = [ + "hex-literal-impl", + "proc-macro-hack", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hex-literal-impl" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59448fc2f82a5fb6907f78c3d69d843e82ff5b051923313cc4438cb0c7b745a8" +dependencies = [ + "proc-macro-hack", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "impl-codec" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2050d823639fbeae26b2b5ba09aca8907793117324858070ade0673c49f793b" +dependencies = [ + "parity-codec", +] + +[[package]] +name = "impl-codec" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-rlp" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f7a72f11830b52333f36e3b09a288333888bf54380fd0ac0790a3c31ab0f3c5" +dependencies = [ + "rlp 0.4.6", +] + +[[package]] +name = "impl-rlp" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +dependencies = [ + "rlp 0.5.2", +] + +[[package]] +name = "impl-serde" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58e3cae7e99c7ff5a995da2cf78dd0a5383740eda71d98cf7b1910c301ac69b8" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-serde" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "importer" +version = "0.1.0" +dependencies = [ + "ast 0.1.0", + "number 0.1.0", + "parser 0.1.0", + "pretty_assertions", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg 1.1.0", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", +] + +[[package]] +name = "integer" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/halo2wrong?tag=v2023_04_20#f72db265aa3cebe297c9b9816e940d0e1d400886" +dependencies = [ + "maingate", + "num-bigint 0.4.4", + "num-integer", + "num-traits", + "rand 0.8.5", + "subtle", +] + +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi 0.3.3", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "itertools" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "js-sys" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonrpc-core" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b83fdc5e0218128d0d270f2f2e7a5ea716f3240c8518a58bc89e6716ba8581" +dependencies = [ + "futures 0.1.31", + "log", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "k256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b" +dependencies = [ + "cfg-if 1.0.0", + "ecdsa", + "elliptic-curve", + "sha2 0.10.8", +] + +[[package]] +name = "keccak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lalrpop" +version = "0.19.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" +dependencies = [ + "ascii-canvas", + "bit-set", + "diff", + "ena", + "is-terminal", + "itertools 0.10.5", + "lalrpop-util", + "petgraph", + "regex", + "regex-syntax 0.6.29", + "string_cache", + "term", + "tiny-keccak 2.0.2", + "unicode-xid 0.2.4", +] + +[[package]] +name = "lalrpop-util" +version = "0.19.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" +dependencies = [ + "regex", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall 0.4.1", +] + +[[package]] +name = "linker" +version = "0.1.0" +dependencies = [ + "airgen", + "analysis 0.1.0", + "ast 0.1.0", + "importer", + "number 0.1.0", + "parser 0.1.0", + "pretty_assertions", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" + +[[package]] +name = "lock_api" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed946d4529956a20f2d63ebe1b69996d5a2137c91913fe3ebbeff957f5bca7ff" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg 1.1.0", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + +[[package]] +name = "maingate" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/halo2wrong?tag=v2023_04_20#f72db265aa3cebe297c9b9816e940d0e1d400886" +dependencies = [ + "halo2wrong", + "num-bigint 0.4.4", + "num-integer", + "num-traits", + "rand 0.8.5", + "subtle", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "mathru" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7584d97fddf282cc3e5cc6fae54e596cfcd708a3b375633294d9db8e8b6d776" +dependencies = [ + "rand 0.7.3", + "serde", +] + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + +[[package]] +name = "memchr" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mktemp" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69fed8fbcd01affec44ac226784c6476a6006d98d13e33bc0ca7977aaf046bd8" +dependencies = [ + "uuid", +] + +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +dependencies = [ + "num-bigint 0.4.4", + "num-complex 0.4.4", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg 1.1.0", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg 1.1.0", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg 1.1.0", + "num-integer", + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "num-complex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +dependencies = [ + "autocfg 1.1.0", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg 1.1.0", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg 1.1.0", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg 1.1.0", + "num-bigint 0.4.4", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg 1.1.0", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.3", + "libc", +] + +[[package]] +name = "number" +version = "0.1.0" +dependencies = [ + "ark-bn254", + "ark-ff", + "csv", + "env_logger", + "num-bigint 0.4.4", + "num-traits", + "test-log", +] + +[[package]] +name = "number" +version = "0.1.0" +source = "git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b#eb593dee15e194bd066085022f8a6ea52e2dab9b" +dependencies = [ + "ark-bn254", + "ark-ff", + "num-bigint 0.4.4", + "num-traits", +] + +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "oorandom" +version = "11.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "pairing_ce" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e753515675eaaa98071d814bea0148ae8c9d7995fa0531bf222e7857e3f1759" +dependencies = [ + "byteorder", + "cfg-if 1.0.0", + "ff_ce 0.12.0", + "rand 0.4.6", +] + +[[package]] +name = "parity-codec" +version = "3.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b9df1283109f542d8852cd6b30e9341acc2137481eb6157d2e62af68b0afec9" +dependencies = [ + "arrayvec 0.4.12", + "serde", +] + +[[package]] +name = "parity-scale-codec" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" +dependencies = [ + "arrayvec 0.7.4", + "bitvec 0.20.4", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" +dependencies = [ + "proc-macro-crate", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "parking_lot" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7767817701cce701d5585b9c4db3cdd02086398322c1d7e8bf5094a96a2ce7" +dependencies = [ + "lock_api 0.2.0", + "parking_lot_core 0.5.0", + "rustc_version 0.2.3", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api 0.4.11", + "parking_lot_core 0.9.9", +] + +[[package]] +name = "parking_lot_core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb88cb1cb3790baa6776844f968fea3be44956cf184fa1be5a03341f5491278c" +dependencies = [ + "cfg-if 0.1.10", + "cloudabi", + "libc", + "rand 0.6.5", + "redox_syscall 0.1.57", + "rustc_version 0.2.3", + "smallvec 0.6.14", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.4.1", + "smallvec 1.11.2", + "windows-targets 0.48.5", +] + +[[package]] +name = "parser" +version = "0.1.0" +dependencies = [ + "ast 0.1.0", + "env_logger", + "lalrpop", + "lalrpop-util", + "num-bigint 0.4.4", + "num-traits", + "number 0.1.0", + "parser_util 0.1.0", + "pretty_assertions", + "regex-syntax 0.6.29", + "test-log", +] + +[[package]] +name = "parser" +version = "0.1.0" +source = "git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b#eb593dee15e194bd066085022f8a6ea52e2dab9b" +dependencies = [ + "ast 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "lalrpop", + "lalrpop-util", + "num-bigint 0.4.4", + "num-traits", + "number 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "parser_util 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "regex-syntax 0.6.29", +] + +[[package]] +name = "parser_util" +version = "0.1.0" +dependencies = [ + "codespan-reporting", + "env_logger", + "lalrpop-util", + "test-log", +] + +[[package]] +name = "parser_util" +version = "0.1.0" +source = "git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b#eb593dee15e194bd066085022f8a6ea52e2dab9b" +dependencies = [ + "codespan-reporting", + "lalrpop-util", +] + +[[package]] +name = "pasta_curves" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" +dependencies = [ + "blake2b_simd", + "ff", + "group", + "lazy_static", + "rand 0.8.5", + "static_assertions 1.1.0", + "subtle", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pest" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.39", +] + +[[package]] +name = "pest_meta" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" +dependencies = [ + "once_cell", + "pest", + "sha2 0.10.8", +] + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap 2.1.0", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pil_analyzer" +version = "0.1.0" +dependencies = [ + "ast 0.1.0", + "env_logger", + "itertools 0.10.5", + "number 0.1.0", + "parser 0.1.0", + "parser_util 0.1.0", + "pretty_assertions", + "test-log", +] + +[[package]] +name = "pil_analyzer" +version = "0.1.0" +source = "git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b#eb593dee15e194bd066085022f8a6ea52e2dab9b" +dependencies = [ + "analysis 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "ast 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "itertools 0.10.5", + "number 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "parser 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "parser_util 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", +] + +[[package]] +name = "pilopt" +version = "0.1.0" +dependencies = [ + "ast 0.1.0", + "log", + "number 0.1.0", + "pil_analyzer 0.1.0", + "pretty_assertions", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "plonky" +version = "0.0.2" +source = "git+https://github.com/0xEigenLabs/eigen-zkvm.git?rev=4ed1da7#4ed1da7766f7aa8740f355d8c1f3d213411ccf4b" +dependencies = [ + "algebraic", + "bellman_vk_codegen", + "byteorder", + "ethabi 14.1.0", + "fnv", + "franklin-crypto", + "handlebars", + "hex", + "hex-literal 0.2.2", + "itertools 0.8.2", + "log", + "num", + "num-bigint 0.3.3", + "num-traits", + "rand 0.4.6", + "recursive_aggregation_circuit", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "plotters" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" + +[[package]] +name = "plotters-svg" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "polyexen" +version = "0.1.0" +source = "git+https://github.com/Dhole/polyexen?branch=feature/shuffles#53c57e072925fbd114957fee5dc0357aaadd462f" +dependencies = [ + "halo2_proofs", + "lazy_static", + "log", + "nom", + "num-bigint 0.4.4", + "num-integer", + "num-traits", + "pest", + "pest_derive", + "rand 0.8.5", + "rand_chacha 0.3.1", + "static_assertions 1.1.0", +] + +[[package]] +name = "poseidon" +version = "0.2.0" +source = "git+https://github.com/privacy-scaling-explorations/poseidon?tag=v2023_04_20#807f8f555313f726ca03bdf941f798098f488ba4" +dependencies = [ + "halo2curves", + "subtle", +] + +[[package]] +name = "poseidon_hash" +version = "0.0.1" +source = "git+https://github.com/shamatar/poseidon_hash.git#495ae87ff066d066b140c7d0dff8d929b87d31ee" +dependencies = [ + "alga", + "approx", + "blake2-rfc_bellman_edition", + "byteorder", + "mathru", + "num-bigint 0.2.6", + "num-integer", + "num-traits", + "pairing_ce", + "rand 0.4.6", + "sha2 0.8.2", + "tiny-keccak 1.5.0", +] + +[[package]] +name = "powdr_cli" +version = "0.1.0" +dependencies = [ + "backend", + "clap 4.4.11", + "clap-markdown", + "compiler", + "env_logger", + "halo2", + "log", + "number 0.1.0", + "parser 0.1.0", + "pilopt", + "riscv", + "riscv_executor", + "strum", + "tempfile", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "pretty_assertions" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +dependencies = [ + "diff", + "yansi", +] + +[[package]] +name = "primitive-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2288eb2a39386c4bc817974cc413afe173010dc80e470fcb1e9a35580869f024" +dependencies = [ + "fixed-hash 0.3.2", + "impl-codec 0.2.0", + "impl-rlp 0.2.1", + "impl-serde 0.2.3", + "uint 0.7.1", +] + +[[package]] +name = "primitive-types" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06345ee39fbccfb06ab45f3a1a5798d9dafa04cb8921a76d227040003a234b0e" +dependencies = [ + "fixed-hash 0.7.0", + "impl-codec 0.5.1", + "impl-rlp 0.3.0", + "impl-serde 0.3.2", + "uint 0.9.5", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +dependencies = [ + "unicode-xid 0.1.0", +] + +[[package]] +name = "proc-macro2" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.4.1", + "lazy_static", + "num-traits", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_xorshift 0.3.0", + "regex-syntax 0.8.2", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +dependencies = [ + "proc-macro2 0.4.30", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2 1.0.70", +] + +[[package]] +name = "radium" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +dependencies = [ + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi", +] + +[[package]] +name = "rand" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "winapi", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +dependencies = [ + "autocfg 0.1.8", + "libc", + "rand_chacha 0.1.1", + "rand_core 0.4.2", + "rand_hc 0.1.0", + "rand_isaac", + "rand_jitter", + "rand_os", + "rand_pcg", + "rand_xorshift 0.1.1", + "winapi", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +dependencies = [ + "autocfg 0.1.8", + "rand_core 0.3.1", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.11", +] + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +dependencies = [ + "libc", + "rand_core 0.4.2", + "winapi", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.4.2", + "rdrand", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +dependencies = [ + "autocfg 0.1.8", + "rand_core 0.4.2", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rayon" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +dependencies = [ + "crossbeam-deque 0.8.3", + "crossbeam-utils 0.8.16", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "recursive_aggregation_circuit" +version = "1.0.0" +source = "git+https://github.com/0xEigenLabs/recursive_aggregation_circuit.git#c1a4313744af13c8fc37ea60b941c4b587f2938b" +dependencies = [ + "franklin-crypto", + "hex", + "once_cell", + "sha2 0.9.9", +] + +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +dependencies = [ + "getrandom 0.2.11", + "libredox", + "thiserror", +] + +[[package]] +name = "regalloc2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" +dependencies = [ + "fxhash", + "log", + "slice-group-by", + "smallvec 1.11.2", +] + +[[package]] +name = "regex" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "region" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +dependencies = [ + "bitflags 1.3.2", + "libc", + "mach", + "winapi", +] + +[[package]] +name = "rend" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" +dependencies = [ + "bytecheck", +] + +[[package]] +name = "revm" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f4ca8ae0345104523b4af1a8a7ea97cfa1865cdb7a7c25d23c1a18d9b48598" +dependencies = [ + "auto_impl", + "revm-interpreter", + "revm-precompile", +] + +[[package]] +name = "revm-interpreter" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f959cafdf64a7f89b014fa73dc2325001cf654b3d9400260b212d19a2ebe3da0" +dependencies = [ + "revm-primitives", +] + +[[package]] +name = "revm-precompile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d360a88223d85709d2e95d4609eb1e19c649c47e28954bfabae5e92bb37e83e" +dependencies = [ + "k256", + "num", + "once_cell", + "revm-primitives", + "ripemd", + "sha2 0.10.8", + "substrate-bn", +] + +[[package]] +name = "revm-primitives" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51187b852d9e458816a2e19c81f1dd6c924077e1a8fccd16e4f044f865f299d7" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "auto_impl", + "bitflags 2.4.1", + "bitvec 1.0.1", + "enumn", + "hashbrown 0.14.3", + "hex", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "riscv" +version = "0.1.0" +dependencies = [ + "asm_utils", + "compiler", + "env_logger", + "hex", + "itertools 0.10.5", + "lalrpop", + "lalrpop-util", + "log", + "mktemp", + "number 0.1.0", + "parser_util 0.1.0", + "regex-syntax 0.6.29", + "riscv_executor", + "serde_json", + "test-log", +] + +[[package]] +name = "riscv_executor" +version = "0.1.0" +dependencies = [ + "analysis 0.1.0", + "ast 0.1.0", + "importer", + "itertools 0.11.0", + "log", + "number 0.1.0", + "parser 0.1.0", +] + +[[package]] +name = "rkyv" +version = "0.7.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" +dependencies = [ + "bitvec 1.0.1", + "bytecheck", + "hashbrown 0.12.3", + "indexmap 1.9.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "rlp" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1190dcc8c3a512f1eef5d09bb8c84c7f39e1054e174d1795482e18f5272f2e73" +dependencies = [ + "rustc-hex", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "ruint" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608a5726529f2f0ef81b8fde9873c4bb829d6b5b5ca6be4d97345ddf0749c825" +dependencies = [ + "alloy-rlp", + "proptest", + "rand 0.8.5", + "ruint-macro", + "serde", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e666a5496a0b2186dbcd0ff6106e29e093c15591bde62c20d3842007c6978a09" + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.20", +] + +[[package]] +name = "rustix" +version = "0.38.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error 1.2.3", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array 0.14.7", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.39", +] + +[[package]] +name = "serde_json" +version = "1.0.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "keccak", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "slab" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + +[[package]] +name = "smallvec" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" +dependencies = [ + "maybe-uninit", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "snark-verifier" +version = "0.1.1" +source = "git+https://github.com/privacy-scaling-explorations/snark-verifier#9feead7d4dbad951e6aa1d572230b1c098ec8040" +dependencies = [ + "ecc", + "halo2_proofs", + "halo2curves", + "hex", + "itertools 0.10.5", + "lazy_static", + "num-bigint 0.4.4", + "num-integer", + "num-traits", + "poseidon", + "rand 0.8.5", + "revm", + "sha3 0.10.8", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "splitmut" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85070f382340e8b23a75808e83573ddf65f9ad9143df9573ca37c1ed2ee956a" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "starky" +version = "0.0.1" +source = "git+https://github.com/0xEigenLabs/eigen-zkvm.git?rev=4ed1da7#4ed1da7766f7aa8740f355d8c1f3d213411ccf4b" +dependencies = [ + "algebraic", + "array_tool", + "ast 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "byteorder", + "ff_ce 0.11.0", + "lazy_static", + "log", + "num-bigint 0.4.4", + "num-integer", + "num-traits", + "num_cpus", + "number 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "pil_analyzer 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "plonky", + "rand 0.4.6", + "rayon", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "static_assertions" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot 0.12.1", + "phf_shared", + "precomputed-hash", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2 1.0.70", + "quote 1.0.33", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "substrate-bn" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b5bbfa79abbae15dd642ea8176a21a635ff3c00059961d1ea27ad04e5b441c" +dependencies = [ + "byteorder", + "crunchy", + "lazy_static", + "rand 0.8.5", + "rustc-hex", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "0.15.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "unicode-xid 0.1.0", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "unicode-ident", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "target-lexicon" +version = "0.12.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" + +[[package]] +name = "tempfile" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +dependencies = [ + "cfg-if 1.0.0", + "fastrand", + "redox_syscall 0.4.1", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "test-log" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6159ab4116165c99fc88cce31f99fa2c9dbe08d3691cb38da02fc3b45f357d2b" +dependencies = [ + "env_logger", + "test-log-macros", +] + +[[package]] +name = "test-log-macros" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ba277e77219e9eea169e8508942db1bf5d8a41ff2db9b20aab5a5aadc9fa25d" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.39", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.39", +] + +[[package]] +name = "tiny-keccak" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d8a021c69bb74a44ccedb824a046447e2c84a01df9e5c20779750acb38e11b2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio-timer" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6131e780037787ff1b3f8aad9da83bca02438b72277850dd6ad0d455e0e20efc" +dependencies = [ + "futures 0.1.31", + "slab 0.3.0", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.1.0", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.39", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "type_check" +version = "0.1.0" +dependencies = [ + "ast 0.1.0", + "importer", + "number 0.1.0", +] + +[[package]] +name = "type_check" +version = "0.1.0" +source = "git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b#eb593dee15e194bd066085022f8a6ea52e2dab9b" +dependencies = [ + "ast 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", + "number 0.1.0 (git+https://github.com/powdr-labs/powdr.git?rev=eb593dee15e194bd066085022f8a6ea52e2dab9b)", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + +[[package]] +name = "uint" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2143cded94692b156c356508d92888acc824db5bffc0b4089732264c6fcf86d4" +dependencies = [ + "byteorder", + "crunchy", + "heapsize", + "rustc-hex", +] + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions 1.1.0", +] + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-bidi" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +dependencies = [ + "idna 0.1.5", + "matches", + "percent-encoding 1.0.1", +] + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna 0.5.0", + "percent-encoding 2.3.1", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +dependencies = [ + "getrandom 0.2.11", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +dependencies = [ + "cfg-if 1.0.0", + "serde", + "serde_json", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.39", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-downcast" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dac026d43bcca6e7ce1c0956ba68f59edf6403e8e930a5d891be72c31a44340" +dependencies = [ + "js-sys", + "once_cell", + "wasm-bindgen", + "wasm-bindgen-downcast-macros", +] + +[[package]] +name = "wasm-bindgen-downcast-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5020cfa87c7cecefef118055d44e3c1fc122c7ec25701d528ee458a0b45f38f" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +dependencies = [ + "quote 1.0.33", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.39", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" + +[[package]] +name = "wasm-encoder" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad2b51884de9c7f4fe2fd1043fccb8dcad4b1e29558146ee57a144d15779f3f" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasmer" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78caedecd8cb71ed47ccca03b68d69414a3d278bb031e6f93f15759344efdd52" +dependencies = [ + "bytes", + "cfg-if 1.0.0", + "derivative", + "indexmap 1.9.3", + "js-sys", + "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "target-lexicon", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-downcast", + "wasmer-compiler", + "wasmer-compiler-cranelift", + "wasmer-derive", + "wasmer-types", + "wasmer-vm", + "wat", + "winapi", +] + +[[package]] +name = "wasmer-compiler" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726a8450541af4a57c34af7b6973fdbfc79f896cc7e733429577dfd1d1687180" +dependencies = [ + "backtrace", + "cfg-if 1.0.0", + "enum-iterator", + "enumset", + "lazy_static", + "leb128", + "memmap2", + "more-asserts", + "region", + "smallvec 1.11.2", + "thiserror", + "wasmer-types", + "wasmer-vm", + "wasmparser", + "winapi", +] + +[[package]] +name = "wasmer-compiler-cranelift" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e5633f90f372563ebbdf3f9799c7b29ba11c90e56cf9b54017112d2e656c95" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "gimli 0.26.2", + "more-asserts", + "rayon", + "smallvec 1.11.2", + "target-lexicon", + "tracing", + "wasmer-compiler", + "wasmer-types", +] + +[[package]] +name = "wasmer-derive" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97901fdbaae383dbb90ea162cc3a76a9fa58ac39aec7948b4c0b9bbef9307738" +dependencies = [ + "proc-macro-error", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "wasmer-types" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67f1f2839f4f61509550e4ddcd0e658e19f3af862b51c79fda15549d735d659b" +dependencies = [ + "bytecheck", + "enum-iterator", + "enumset", + "indexmap 1.9.3", + "more-asserts", + "rkyv", + "target-lexicon", + "thiserror", +] + +[[package]] +name = "wasmer-vm" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043118ec4f16d1714fed3aab758b502b864bd865e1d5188626c9ad290100563f" +dependencies = [ + "backtrace", + "cc", + "cfg-if 1.0.0", + "corosensei", + "dashmap", + "derivative", + "enum-iterator", + "fnv", + "indexmap 1.9.3", + "lazy_static", + "libc", + "mach", + "memoffset 0.8.0", + "more-asserts", + "region", + "scopeguard", + "thiserror", + "wasmer-types", + "winapi", +] + +[[package]] +name = "wasmparser" +version = "0.95.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ea896273ea99b15132414be1da01ab0d8836415083298ecaffbe308eaac87a" +dependencies = [ + "indexmap 1.9.3", + "url 2.5.0", +] + +[[package]] +name = "wast" +version = "69.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ee37317321afde358e4d7593745942c48d6d17e0e6e943704de9bbee121e7a" +dependencies = [ + "leb128", + "memchr", + "unicode-width", + "wasm-encoder", +] + +[[package]] +name = "wat" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeb338ee8dee4d4cd05e6426683f21c5087dc7cfc8903e839ccf48d43332da3c" +dependencies = [ + "wast", +] + +[[package]] +name = "web-sys" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076f34ed252d74a8521e3b013254b1a39f94a98f23aae7cfc85cda6e7b395664" +dependencies = [ + "arrayvec 0.4.12", + "base64", + "derive_more 0.15.0", + "ethabi 8.0.1", + "ethereum-types 0.6.0", + "futures 0.1.31", + "jsonrpc-core", + "log", + "parking_lot 0.8.0", + "rustc-hex", + "serde", + "serde_json", + "tokio-timer", + "url 1.7.2", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" +dependencies = [ + "windows_aarch64_msvc 0.33.0", + "windows_i686_gnu 0.33.0", + "windows_i686_msvc 0.33.0", + "windows_x86_64_gnu 0.33.0", + "windows_x86_64_msvc 0.33.0", +] + +[[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.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winnow" +version = "0.5.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e87b8dfbe3baffbe687eef2e164e32286eff31a5ee16463ce03d991643ec94" +dependencies = [ + "memchr", +] + +[[package]] +name = "wyz" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + +[[package]] +name = "zerocopy" +version = "0.7.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d075cf85bbb114e933343e087b92f2146bac0d55b534cbb8188becf0039948e" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86cd5ca076997b97ef09d3ad65efe811fa68c9e874cb636ccb211223a813b0c2" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.39", +] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.39", +] diff --git a/Cargo.toml b/Cargo.toml index 71d0107654..4b1cca2075 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,8 @@ members = [ "asm_to_pil", "halo2", "backend", + "bberg", + "bberg_pil_cli", "ast", "analysis", "linker", diff --git a/asm_to_pil/src/vm_to_constrained.rs b/asm_to_pil/src/vm_to_constrained.rs index 68cf46dbc2..d944ce7d8f 100644 --- a/asm_to_pil/src/vm_to_constrained.rs +++ b/asm_to_pil/src/vm_to_constrained.rs @@ -144,6 +144,7 @@ impl ASMPILConverter { ), PilStatement::PolynomialIdentity( 0, + None, lhs - (Expression::from(T::one()) - next_reference("first_step")) * direct_reference(pc_update_name), @@ -154,10 +155,14 @@ impl ASMPILConverter { ReadOnly => { let not_reset: Expression = Expression::from(T::one()) - direct_reference("instr__reset"); - vec![PilStatement::PolynomialIdentity(0, not_reset * (lhs - rhs))] + vec![PilStatement::PolynomialIdentity( + 0, + None, + not_reset * (lhs - rhs), + )] } _ => { - vec![PilStatement::PolynomialIdentity(0, lhs - rhs)] + vec![PilStatement::PolynomialIdentity(0, None, lhs - rhs)] } } }) @@ -175,6 +180,7 @@ impl ASMPILConverter { self.pil.push(PilStatement::PlookupIdentity( 0, + None, SelectedExpressions { selector: None, expressions: self @@ -389,7 +395,7 @@ impl ASMPILConverter { }); for mut statement in body { - if let PilStatement::PolynomialIdentity(_start, expr) = statement { + if let PilStatement::PolynomialIdentity(_start, _attr, expr) = statement { match extract_update(expr) { (Some(var), expr) => { let reference = direct_reference(&instruction_flag); @@ -406,13 +412,14 @@ impl ASMPILConverter { } (None, expr) => self.pil.push(PilStatement::PolynomialIdentity( 0, + None, direct_reference(&instruction_flag) * expr.clone(), )), } } else { match &mut statement { - PilStatement::PermutationIdentity(_, left, _) - | PilStatement::PlookupIdentity(_, left, _) => { + PilStatement::PermutationIdentity(_, _attr, left, _) + | PilStatement::PlookupIdentity(_, _attr, left, _) => { assert!( left.selector.is_none(), "LHS selector not supported, could and-combine with instruction flag later." @@ -715,6 +722,7 @@ impl ASMPILConverter { .sum(); self.pil.push(PilStatement::PolynomialIdentity( 0, + None, direct_reference(register) - assign_constraint, )); } diff --git a/ast/src/analyzed/display.rs b/ast/src/analyzed/display.rs index 1218143de2..c5194b4992 100644 --- a/ast/src/analyzed/display.rs +++ b/ast/src/analyzed/display.rs @@ -149,7 +149,13 @@ impl Display for Identity> { } } IdentityKind::Plookup => write!(f, "{} in {};", self.left, self.right), - IdentityKind::Permutation => write!(f, "{} is {};", self.left, self.right), + IdentityKind::Permutation => write!( + f, + "#[{}] {} is {};", + self.attribute.clone().unwrap_or_default(), + self.left, + self.right + ), IdentityKind::Connect => write!(f, "{} connect {};", self.left, self.right), } } diff --git a/ast/src/analyzed/mod.rs b/ast/src/analyzed/mod.rs index acbc82c699..4fda5bbfb1 100644 --- a/ast/src/analyzed/mod.rs +++ b/ast/src/analyzed/mod.rs @@ -226,6 +226,7 @@ impl Analyzed { self.identities.push(Identity { id, kind: IdentityKind::Polynomial, + attribute: None, // TODO(md): None for the meantime as we do not have tagged identities, will be updated in following pr source, left: SelectedExpressions { selector: Some(identity), @@ -504,11 +505,16 @@ pub struct Identity { /// The ID is specific to the identity kind. pub id: u64, pub kind: IdentityKind, + pub attribute: Option, pub source: SourceRef, /// For a simple polynomial identity, the selector contains /// the actual expression (see expression_for_poly_id). - pub left: SelectedExpressions, - pub right: SelectedExpressions, + // + // + // NTS(Md) Both left and right are only used in the case of perm / plookup + // + pub left: SelectedExpressions, // left is selector expressions - for an arithmetic gate, the entire relation is in SL + pub right: SelectedExpressions, // right is the overall expressions } impl Identity { @@ -530,7 +536,7 @@ pub enum IdentityKind { Polynomial, Plookup, Permutation, - Connect, + Connect, // not used } impl SelectedExpressions> { diff --git a/ast/src/parsed/display.rs b/ast/src/parsed/display.rs index ac23386dc4..8d4168b2f3 100644 --- a/ast/src/parsed/display.rs +++ b/ast/src/parsed/display.rs @@ -383,15 +383,20 @@ impl Display for PilStatement { value.as_ref().map(|v| format!("{v}")).unwrap_or_default() ) } - PilStatement::PolynomialIdentity(_, expression) => { + PilStatement::PolynomialIdentity(_, _attr, expression) => { if let Expression::BinaryOperation(left, BinaryOperator::Sub, right) = expression { write!(f, "{left} = {right};") } else { write!(f, "{expression} = 0;") } } - PilStatement::PlookupIdentity(_, left, right) => write!(f, "{left} in {right};"), - PilStatement::PermutationIdentity(_, left, right) => write!(f, "{left} is {right};"), + PilStatement::PlookupIdentity(_, _, left, right) => write!(f, "{left} in {right};"), + PilStatement::PermutationIdentity( + _, // + _, // + left, + right, + ) => write!(f, "{left} is {right};"), // PilStatement::ConnectIdentity(_, left, right) => write!( f, "{{ {} }} connect {{ {} }};", diff --git a/ast/src/parsed/mod.rs b/ast/src/parsed/mod.rs index 26657af854..1c6bfeafb5 100644 --- a/ast/src/parsed/mod.rs +++ b/ast/src/parsed/mod.rs @@ -34,14 +34,16 @@ pub enum PilStatement { PolynomialConstantDeclaration(usize, Vec>), PolynomialConstantDefinition(usize, String, FunctionDefinition), PolynomialCommitDeclaration(usize, Vec>, Option>), - PolynomialIdentity(usize, Expression), + PolynomialIdentity(usize, Option, Expression), PlookupIdentity( usize, + Option, SelectedExpressions>, SelectedExpressions>, ), PermutationIdentity( usize, + Option, SelectedExpressions>, SelectedExpressions>, ), @@ -50,6 +52,11 @@ pub enum PilStatement { Expression(usize, Expression), } +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)] +pub struct Attribute { + pub name: Option, +} + #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)] pub struct SelectedExpressions { pub selector: Option, diff --git a/ast/src/parsed/visitor.rs b/ast/src/parsed/visitor.rs index 8fa9e7bfa2..8050399a0f 100644 --- a/ast/src/parsed/visitor.rs +++ b/ast/src/parsed/visitor.rs @@ -192,8 +192,13 @@ impl ExpressionVisitable> for Pi { match self { PilStatement::Expression(_, e) => e.visit_expressions_mut(f, o), - PilStatement::PlookupIdentity(_, left, right) - | PilStatement::PermutationIdentity(_, left, right) => [left, right] + PilStatement::PlookupIdentity(_, _, left, right) + | PilStatement::PermutationIdentity( + _, // + _, // + left, + right, + ) => [left, right] // .into_iter() .try_for_each(|e| e.visit_expressions_mut(f, o)), PilStatement::ConnectIdentity(_start, left, right) => left @@ -203,7 +208,7 @@ impl ExpressionVisitable> for Pi PilStatement::Namespace(_, _, e) | PilStatement::PolynomialDefinition(_, _, e) - | PilStatement::PolynomialIdentity(_, e) + | PilStatement::PolynomialIdentity(_, _, e) | PilStatement::PublicDeclaration(_, _, _, None, e) | PilStatement::ConstantDefinition(_, _, e) | PilStatement::LetStatement(_, _, Some(e)) => e.visit_expressions_mut(f, o), @@ -229,8 +234,13 @@ impl ExpressionVisitable> for Pi { match self { PilStatement::Expression(_, e) => e.visit_expressions(f, o), - PilStatement::PlookupIdentity(_, left, right) - | PilStatement::PermutationIdentity(_, left, right) => [left, right] + PilStatement::PlookupIdentity(_, _, left, right) + | PilStatement::PermutationIdentity( + _, // + _, // + left, + right, + ) => [left, right] // .into_iter() .try_for_each(|e| e.visit_expressions(f, o)), PilStatement::ConnectIdentity(_start, left, right) => left @@ -240,7 +250,7 @@ impl ExpressionVisitable> for Pi PilStatement::Namespace(_, _, e) | PilStatement::PolynomialDefinition(_, _, e) - | PilStatement::PolynomialIdentity(_, e) + | PilStatement::PolynomialIdentity(_, _, e) | PilStatement::PublicDeclaration(_, _, _, None, e) | PilStatement::ConstantDefinition(_, _, e) | PilStatement::LetStatement(_, _, Some(e)) => e.visit_expressions(f, o), diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 7a8159706d..9c958ff4c5 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -5,9 +5,13 @@ edition = "2021" [features] halo2 = ["dep:halo2"] +# TODO: enable feature flag for bberg backend +# bberg = ["dep:bberg"] [dependencies] halo2 = { path = "../halo2", optional = true } +bberg = { path = "../bberg"} + pil_analyzer = { path = "../pil_analyzer" } number = { path = "../number" } ast = { path = "../ast" } diff --git a/backend/src/BBergCodegen::assert_field_is_compatible:: b/backend/src/BBergCodegen::assert_field_is_compatible:: new file mode 100644 index 0000000000..e69de29bb2 diff --git a/backend/src/bberg_impl.rs b/backend/src/bberg_impl.rs new file mode 100644 index 0000000000..ae30a08af9 --- /dev/null +++ b/backend/src/bberg_impl.rs @@ -0,0 +1,68 @@ +use std::io::{self}; + +use crate::{BackendImpl, BackendImplWithSetup, Proof}; +use ast::analyzed::Analyzed; + +// We do not directly have a bberg prover at the moment +// however we can just perform codegen +use bberg::bberg_codegen::BBergCodegen; +use number::{DegreeType, FieldElement}; + +impl BackendImpl for BBergCodegen { + fn new(degree: DegreeType) -> Self { + BBergCodegen::assert_field_is_compatible::(); + BBergCodegen::new(degree) + } + + fn prove( + &self, + pil: &Analyzed, + fixed: &[(String, Vec)], + witness: &[(String, Vec)], + _prev_proof: Option, + bname: Option, + ) -> (Option, Option) { + self.build_ast(pil, fixed, witness, bname); + + // Note(md): In the current bberg impl we do not produce proofs here + // as we do cpp code generation, and then create proofs with bberg + // This may change in the future when the library matures to be more pluggable + (None, None) + } +} + +impl BackendImplWithSetup for BBergCodegen { + fn new_from_setup(mut input: &mut dyn io::Read) -> Result { + BBergCodegen::assert_field_is_compatible::(); + BBergCodegen::new_from_setup(&mut input) + } + + // TODO: implement this + fn write_setup(&self, _output: &mut dyn io::Write) -> Result<(), io::Error> { + Ok(()) + // self.write_setup(&mut output) + } +} + +pub struct BBergMock; +impl BackendImpl for BBergMock { + fn new(_degree: DegreeType) -> Self { + Self + } + + fn prove( + &self, + _pil: &Analyzed, + _fixed: &[(String, Vec)], + _witness: &[(String, Vec)], + prev_proof: Option, + _bname: Option, + ) -> (Option, Option) { + if prev_proof.is_some() { + unimplemented!("BBergMock backend does not support aggregation"); + } + + // TODO: mock prover + unimplemented!("BBergMock backend is not implemented"); + } +} diff --git a/backend/src/halo2_impl.rs b/backend/src/halo2_impl.rs index 0d5664a896..0368e9516d 100644 --- a/backend/src/halo2_impl.rs +++ b/backend/src/halo2_impl.rs @@ -17,6 +17,7 @@ impl BackendImpl for Halo2Prover { fixed: &[(String, Vec)], witness: &[(String, Vec)], prev_proof: Option, + _name: Option, ) -> (Option, Option) { let proof = match prev_proof { Some(proof) => self.prove_aggr(pil, fixed, witness, proof), @@ -27,7 +28,7 @@ impl BackendImpl for Halo2Prover { } } -impl BackendImplWithSetup for halo2::Halo2Prover { +impl BackendImplWithSetup for Halo2Prover { fn new_from_setup(mut input: &mut dyn io::Read) -> Result { Halo2Prover::assert_field_is_compatible::(); Halo2Prover::new_from_setup(&mut input) @@ -50,6 +51,7 @@ impl BackendImpl for Halo2Mock { fixed: &[(String, Vec)], witness: &[(String, Vec)], prev_proof: Option, + _name: Option, ) -> (Option, Option) { if prev_proof.is_some() { unimplemented!("Halo2Mock backend does not support aggregation"); diff --git a/backend/src/lib.rs b/backend/src/lib.rs index ad55141a4e..d318484b5a 100644 --- a/backend/src/lib.rs +++ b/backend/src/lib.rs @@ -1,5 +1,7 @@ #![deny(clippy::print_stdout)] +// #[cfg(feature = "bberg")] +mod bberg_impl; #[cfg(feature = "halo2")] mod halo2_impl; mod pilstark; @@ -11,6 +13,9 @@ use strum::{Display, EnumString, EnumVariantNames}; #[derive(Clone, EnumString, EnumVariantNames, Display)] pub enum BackendType { + // #[cfg(feature = "bberg")] + #[strum(serialize = "bberg")] + BBerg, #[cfg(feature = "halo2")] #[strum(serialize = "halo2")] Halo2, @@ -34,6 +39,8 @@ impl BackendType { WithoutSetupFactory(PhantomData); const PIL_STARK_CLI_FACTORY: WithoutSetupFactory = WithoutSetupFactory(PhantomData); + const BBERG_FACTORY: WithoutSetupFactory = + WithoutSetupFactory(PhantomData); match self { #[cfg(feature = "halo2")] @@ -42,6 +49,7 @@ impl BackendType { BackendType::Halo2Mock => &HALO2_MOCK_FACTORY, BackendType::PilStarkCli => &PIL_STARK_CLI_FACTORY, BackendType::EStark => &ESTARK_FACTORY, + BackendType::BBerg => &BBERG_FACTORY, } } } @@ -71,8 +79,9 @@ impl> Backend for ConcreteBackendWithoutSe fixed: &[(String, Vec)], witness: &[(String, Vec)], prev_proof: Option, + bname: Option, ) -> (Option, Option) { - self.0.prove(pil, fixed, witness, prev_proof) + self.0.prove(pil, fixed, witness, prev_proof, bname) } fn write_setup(&self, _output: &mut dyn io::Write) -> Result<(), Error> { @@ -109,8 +118,9 @@ impl> Backend for ConcreteBackend fixed: &[(String, Vec)], witness: &[(String, Vec)], prev_proof: Option, + bname: Option, ) -> (Option, Option) { - self.0.prove(pil, fixed, witness, prev_proof) + self.0.prove(pil, fixed, witness, prev_proof, bname) } fn write_setup(&self, output: &mut dyn io::Write) -> Result<(), Error> { @@ -147,6 +157,7 @@ pub trait Backend { fixed: &[(String, Vec)], witness: &[(String, Vec)], prev_proof: Option, + bname: Option, ) -> (Option, Option); /// Write the prover setup to a file, so that it can be loaded later. @@ -176,6 +187,7 @@ trait BackendImpl { fixed: &[(String, Vec)], witness: &[(String, Vec)], prev_proof: Option, + bname: Option, ) -> (Option, Option); } diff --git a/backend/src/pilstark/estark.rs b/backend/src/pilstark/estark.rs index 6fbe569d5d..21c48f05b2 100644 --- a/backend/src/pilstark/estark.rs +++ b/backend/src/pilstark/estark.rs @@ -54,6 +54,7 @@ impl BackendImpl for EStark { fixed: &[(String, Vec)], witness: &[(String, Vec)], prev_proof: Option, + _bname: Option, ) -> (Option, Option) { if prev_proof.is_some() { unimplemented!("aggregration is not implemented"); diff --git a/backend/src/pilstark/mod.rs b/backend/src/pilstark/mod.rs index 30af04c917..0417fe6f81 100644 --- a/backend/src/pilstark/mod.rs +++ b/backend/src/pilstark/mod.rs @@ -18,6 +18,7 @@ impl BackendImpl for PilStarkCli { _fixed: &[(String, Vec)], _witness: &[(String, Vec)], prev_proof: Option, + _bname: Option, ) -> (Option, Option) { if prev_proof.is_some() { unimplemented!("Aggregration is not implemented for pil-stark CLI backend"); diff --git a/bberg/Cargo.toml b/bberg/Cargo.toml new file mode 100644 index 0000000000..c687bb9e99 --- /dev/null +++ b/bberg/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "bberg" +version = "0.1.0" +authors = ["Maddiaa"] +edition = "2021" + +[dependencies] +num-bigint = "0.4.3" + +number = { path = "../number" } +num-traits = "0.2.15" +num-integer = "0.1.45" +itertools = "^0.10" +log = "0.4.17" +rand = "0.8.5" +ast = { version = "0.1.0", path = "../ast" } diff --git a/bberg/README.md b/bberg/README.md new file mode 100644 index 0000000000..6c5fc9d169 --- /dev/null +++ b/bberg/README.md @@ -0,0 +1,38 @@ +## Operations + +Field Ops { + Add, + Sub, + Mul, + Div, + Equals +} + +Int ops { + Add, + sub, + mul, + div, + equals, + lt, + lte, + and, + or, + xor, + shl, + shr +} + +jumpin // Surely this can just be removed, and allow for negative conditions +jumpi +jump +call +const <- really just push for a field elem +return +foregincall // do we need +mov +load +store +blackbox <- cant really use in a vm +trap <- failure +stop <- complete diff --git a/bberg/src/bberg_codegen.rs b/bberg/src/bberg_codegen.rs new file mode 100644 index 0000000000..0e4a09a9f3 --- /dev/null +++ b/bberg/src/bberg_codegen.rs @@ -0,0 +1,51 @@ +use ast::analyzed::Analyzed; +use std::io; + +use number::{BigInt, Bn254Field, DegreeType, FieldElement}; + +use crate::vm_builder::analyzed_to_cpp; + +// TODO: there will need to be multiple files that are generated, one for each relation + +/// Barretenberg codegen +/// +/// This module will take pil compiler output and make it generate relation header files that can be compiled into bberg + +pub struct BBergCodegen { + // Note: Im not sure we need to know the degree ahead of time + // degree: DegreeType, +} + +impl BBergCodegen { + pub fn new(_degree: DegreeType) -> Self { + Self {} + } + + pub fn new_from_setup(_input: &mut impl io::Read) -> Result { + println!("warning bberg: new_from_setup not implemented"); + Ok(Self {}) + } + + // Note: only returns vec to keep with the interface + pub fn build_ast( + &self, + pil: &Analyzed, + fixed: &[(String, Vec)], + witness: &[(String, Vec)], + bname: Option, + ) -> Vec { + analyzed_to_cpp(pil, fixed, witness, bname); + + Vec::new() + } + + pub fn assert_field_is_compatible() { + if Bn254Field::modulus().to_arbitrary_integer() != F::modulus().to_arbitrary_integer() { + panic!("powdr modulus doesn't match halo2 modulus. Make sure you are using Bn254"); + } + } +} + +// static str& template = r#" + +// "#; diff --git a/bberg/src/circuit_builder.rs b/bberg/src/circuit_builder.rs new file mode 100644 index 0000000000..35eec1508b --- /dev/null +++ b/bberg/src/circuit_builder.rs @@ -0,0 +1,263 @@ +use crate::{ + file_writer::BBFiles, + relation_builder::create_row_type, + utils::{get_relations_imports, map_with_newline, snake_case}, +}; + +pub trait CircuitBuilder { + fn create_circuit_builder_hpp( + &mut self, + name: &str, + relations: &[String], + permutations: &[String], + all_cols_without_inverses: &[String], + all_cols: &[String], + to_be_shifted: &[String], + all_cols_with_shifts: &[String], + ); +} + +fn circuit_hpp_includes(name: &str, relations: &[String], permutations: &[String]) -> String { + let relation_imports = get_relations_imports(name, relations, permutations); + format!( + " + // AUTOGENERATED FILE + #pragma once + + #include \"barretenberg/common/constexpr_utils.hpp\" + #include \"barretenberg/common/throw_or_abort.hpp\" + #include \"barretenberg/ecc/curves/bn254/fr.hpp\" + #include \"barretenberg/stdlib_circuit_builders/circuit_builder_base.hpp\" + #include \"barretenberg/relations/generic_permutation/generic_permutation_relation.hpp\" + #include \"barretenberg/relations/generic_lookup/generic_lookup_relation.hpp\" + #include \"barretenberg/honk/proof_system/logderivative_library.hpp\" + + #include \"barretenberg/vm/generated/{name}_flavor.hpp\" + {relation_imports} +" + ) +} + +fn get_params() -> &'static str { + r#" + const FF gamma = FF::random_element(); + const FF beta = FF::random_element(); + bb::RelationParameters params{ + .eta = 0, + .beta = beta, + .gamma = gamma, + .public_input_delta = 0, + .lookup_grand_product_delta = 0, + .beta_sqr = 0, + .beta_cube = 0, + .eccvm_set_permutation_delta = 0, + }; + "# +} + +impl CircuitBuilder for BBFiles { + // Create circuit builder + // Generate some code that can read a commits.bin and constants.bin into data structures that bberg understands + fn create_circuit_builder_hpp( + &mut self, + name: &str, + relations: &[String], + permutations: &[String], + all_cols_without_inverses: &[String], + all_cols: &[String], + to_be_shifted: &[String], + all_cols_with_shifts: &[String], + ) { + let includes = circuit_hpp_includes(&snake_case(name), relations, permutations); + + let row_with_all_included = create_row_type(&format!("{name}Full"), all_cols_with_shifts); + + let num_polys = all_cols.len(); + let num_cols = all_cols.len() + to_be_shifted.len(); + + // Declare mapping transformations + let compute_polys_transformation = + |name: &String| format!("polys.{name}[i] = rows[i].{name};"); + let all_polys_transformation = + |name: &String| format!("polys.{name}_shift = Polynomial(polys.{name}.shifted());"); + let check_circuit_transformation = |relation_name: &String| { + format!( + "if (!evaluate_relation.template operator()<{name}_vm::{relation_name}>(\"{relation_name}\", {name}_vm::get_relation_label_{relation_name})) {{ + return false; + }}", + name = name, + relation_name = relation_name + ) + }; + let check_lookup_transformation = |lookup_name: &String| { + let lookup_name_upper = lookup_name.to_uppercase(); + format!( + "if (!evaluate_logderivative.template operator()<{lookup_name}_relation>(\"{lookup_name_upper}\")) {{ + return false; + }}" + ) + }; + + // Apply transformations + let compute_polys_assignemnt = + map_with_newline(all_cols_without_inverses, compute_polys_transformation); + let all_poly_shifts = map_with_newline(to_be_shifted, all_polys_transformation); + let check_circuit_for_each_relation = + map_with_newline(relations, check_circuit_transformation); + let check_circuit_for_each_lookup = + map_with_newline(permutations, check_lookup_transformation); + + let (params, lookup_check_closure) = if !permutations.is_empty() { + (get_params(), get_lookup_check_closure()) + } else { + ("", "".to_owned()) + }; + let relation_check_closure = if !relations.is_empty() { + get_relation_check_closure() + } else { + "".to_owned() + }; + + let circuit_hpp = format!(" +{includes} + +namespace bb {{ + +{row_with_all_included}; + +class {name}CircuitBuilder {{ + public: + using Flavor = bb::{name}Flavor; + using FF = Flavor::FF; + using Row = {name}FullRow; + + // TODO: template + using Polynomial = Flavor::Polynomial; + using ProverPolynomials = Flavor::ProverPolynomials; + + static constexpr size_t num_fixed_columns = {num_cols}; + static constexpr size_t num_polys = {num_polys}; + std::vector rows; + + void set_trace(std::vector&& trace) {{ rows = std::move(trace); }} + + ProverPolynomials compute_polynomials() {{ + const auto num_rows = get_circuit_subgroup_size(); + ProverPolynomials polys; + + // Allocate mem for each column + for (auto& poly : polys.get_all()) {{ + poly = Polynomial(num_rows); + }} + + for (size_t i = 0; i < rows.size(); i++) {{ + {compute_polys_assignemnt} + }} + + {all_poly_shifts } + + return polys; + }} + + [[maybe_unused]] bool check_circuit() + {{ + {params} + + auto polys = compute_polynomials(); + const size_t num_rows = polys.get_polynomial_size(); + + {relation_check_closure} + + {lookup_check_closure} + + {check_circuit_for_each_relation} + + {check_circuit_for_each_lookup} + + return true; + }} + + + [[nodiscard]] size_t get_num_gates() const {{ return rows.size(); }} + + [[nodiscard]] size_t get_circuit_subgroup_size() const + {{ + const size_t num_rows = get_num_gates(); + const auto num_rows_log2 = static_cast(numeric::get_msb64(num_rows)); + size_t num_rows_pow2 = 1UL << (num_rows_log2 + (1UL << num_rows_log2 == num_rows ? 0 : 1)); + return num_rows_pow2; + }} + + +}}; +}} + "); + + self.write_file( + &self.circuit, + &format!("{}_circuit_builder.hpp", snake_case(name)), + &circuit_hpp, + ); + } +} + +fn get_lookup_check_closure() -> String { + " + const auto evaluate_logderivative = [&](const std::string& lookup_name) { + + // Check the logderivative relation + bb::compute_logderivative_inverse< + Flavor, + LogDerivativeSettings>( + polys, params, num_rows); + + typename LogDerivativeSettings::SumcheckArrayOfValuesOverSubrelations + lookup_result; + + for (auto& r : lookup_result) { + r = 0; + } + for (size_t i = 0; i < num_rows; ++i) { + LogDerivativeSettings::accumulate(lookup_result, polys.get_row(i), params, 1); + } + for (auto r : lookup_result) { + if (r != 0) { + throw_or_abort(format(\"Lookup \", lookup_name, \" failed.\")); + return false; + } + } + return true; + }; + ".to_string() +} + +fn get_relation_check_closure() -> String { + " + const auto evaluate_relation = [&](const std::string& relation_name, + std::string (*debug_label)(int)) { + typename Relation::SumcheckArrayOfValuesOverSubrelations result; + for (auto& r : result) { + r = 0; + } + constexpr size_t NUM_SUBRELATIONS = result.size(); + + for (size_t i = 0; i < num_rows; ++i) { + Relation::accumulate(result, polys.get_row(i), {}, 1); + + bool x = true; + for (size_t j = 0; j < NUM_SUBRELATIONS; ++j) { + if (result[j] != 0) { + std::string row_name = debug_label(static_cast(j)); + throw_or_abort( + format(\"Relation \", relation_name, \", subrelation index \", row_name, \" failed at row \", i)); + x = false; + } + } + if (!x) { + return false; + } + } + return true; + }; + ".to_string() +} diff --git a/bberg/src/composer_builder.rs b/bberg/src/composer_builder.rs new file mode 100644 index 0000000000..2cbd8576d1 --- /dev/null +++ b/bberg/src/composer_builder.rs @@ -0,0 +1,210 @@ +use crate::file_writer::BBFiles; +use crate::utils::snake_case; + +pub trait ComposerBuilder { + fn create_composer_cpp(&mut self, name: &str); + fn create_composer_hpp(&mut self, name: &str); +} + +impl ComposerBuilder for BBFiles { + fn create_composer_cpp(&mut self, name: &str) { + // Create a composer file, this is used to a prover and verifier for our flavour + let include_str = cpp_includes(&snake_case(name)); + + let composer_cpp = format!( + " +{include_str} + +namespace bb {{ + +using Flavor = {name}Flavor; +void {name}Composer::compute_witness(CircuitConstructor& circuit) +{{ + if (computed_witness) {{ + return; + }} + + auto polynomials = circuit.compute_polynomials(); + + for (auto [key_poly, prover_poly] : zip_view(proving_key->get_all(), polynomials.get_unshifted())) {{ + ASSERT(flavor_get_label(*proving_key, key_poly) == flavor_get_label(polynomials, prover_poly)); + key_poly = prover_poly; + }} + + computed_witness = true; +}} + +{name}Prover {name}Composer::create_prover(CircuitConstructor& circuit_constructor) +{{ + compute_proving_key(circuit_constructor); + compute_witness(circuit_constructor); + compute_commitment_key(circuit_constructor.get_circuit_subgroup_size()); + + {name}Prover output_state(proving_key, proving_key->commitment_key); + + return output_state; +}} + +{name}Verifier {name}Composer::create_verifier( + CircuitConstructor& circuit_constructor) +{{ + auto verification_key = compute_verification_key(circuit_constructor); + + {name}Verifier output_state(verification_key); + + auto pcs_verification_key = std::make_unique(); + + output_state.pcs_verification_key = std::move(pcs_verification_key); + + return output_state; +}} + +std::shared_ptr {name}Composer::compute_proving_key( + CircuitConstructor& circuit_constructor) +{{ + if (proving_key) {{ + return proving_key; + }} + + // Initialize proving_key + {{ + const size_t subgroup_size = circuit_constructor.get_circuit_subgroup_size(); + proving_key = std::make_shared(subgroup_size, 0); + }} + + proving_key->contains_recursive_proof = false; + + return proving_key; +}} + +std::shared_ptr {name}Composer::compute_verification_key( + CircuitConstructor& circuit_constructor) +{{ + if (verification_key) {{ + return verification_key; + }} + + if (!proving_key) {{ + compute_proving_key(circuit_constructor); + }} + + verification_key = + std::make_shared(proving_key->circuit_size, proving_key->num_public_inputs); + + return verification_key; +}} + +}} +"); + self.write_file( + &self.composer, + &format!("{}_composer.cpp", snake_case(name)), + &composer_cpp, + ); + } + + fn create_composer_hpp(&mut self, name: &str) { + let include_str = hpp_includes(&snake_case(name)); + + let composer_hpp = format!( + " +{include_str} + +namespace bb {{ +class {name}Composer {{ + public: + using Flavor = {name}Flavor; + using CircuitConstructor = {name}CircuitBuilder; + using ProvingKey = Flavor::ProvingKey; + using VerificationKey = Flavor::VerificationKey; + using PCS = Flavor::PCS; + using CommitmentKey = Flavor::CommitmentKey; + using VerifierCommitmentKey = Flavor::VerifierCommitmentKey; + + // TODO: which of these will we really need + static constexpr std::string_view NAME_STRING = \"{name}\"; + static constexpr size_t NUM_RESERVED_GATES = 0; + static constexpr size_t NUM_WIRES = Flavor::NUM_WIRES; + + std::shared_ptr proving_key; + std::shared_ptr verification_key; + + // The crs_factory holds the path to the srs and exposes methods to extract the srs elements + std::shared_ptr> crs_factory_; + + // The commitment key is passed to the prover but also used herein to compute the verfication key commitments + std::shared_ptr commitment_key; + + std::vector recursive_proof_public_input_indices; + bool contains_recursive_proof = false; + bool computed_witness = false; + + {name}Composer() + {{ + crs_factory_ = bb::srs::get_bn254_crs_factory(); + }} + + {name}Composer(std::shared_ptr p_key, std::shared_ptr v_key) + : proving_key(std::move(p_key)) + , verification_key(std::move(v_key)) + {{}} + + {name}Composer({name}Composer&& other) noexcept = default; + {name}Composer({name}Composer const& other) noexcept = default; + {name}Composer& operator=({name}Composer&& other) noexcept = default; + {name}Composer& operator=({name}Composer const& other) noexcept = default; + ~{name}Composer() = default; + + std::shared_ptr compute_proving_key(CircuitConstructor& circuit_constructor); + std::shared_ptr compute_verification_key(CircuitConstructor& circuit_constructor); + + void compute_witness(CircuitConstructor& circuit_constructor); + + {name}Prover create_prover(CircuitConstructor& circuit_constructor); + {name}Verifier create_verifier(CircuitConstructor& circuit_constructor); + + void add_table_column_selector_poly_to_proving_key(bb::polynomial& small, const std::string& tag); + + void compute_commitment_key(size_t circuit_size) + {{ + proving_key->commitment_key = std::make_shared(circuit_size); + }}; +}}; + +}} // namespace bb +" + ); + + self.write_file( + &self.composer, + &format!("{}_composer.hpp", snake_case(name)), + &composer_hpp, + ); + } +} + +fn cpp_includes(name: &str) -> String { + format!( + " +#include \"./{name}_composer.hpp\" +#include \"barretenberg/plonk_honk_shared/composer/composer_lib.hpp\" +#include \"barretenberg/plonk_honk_shared/composer/permutation_lib.hpp\" +#include \"barretenberg/vm/generated/{name}_circuit_builder.hpp\" +#include \"barretenberg/vm/generated/{name}_verifier.hpp\" +" + ) +} + +pub fn hpp_includes(name: &str) -> String { + format!( + " +#pragma once + +#include \"barretenberg/plonk_honk_shared/composer/composer_lib.hpp\" +#include \"barretenberg/srs/global_crs.hpp\" +#include \"barretenberg/vm/generated/{name}_circuit_builder.hpp\" +#include \"barretenberg/vm/generated/{name}_prover.hpp\" +#include \"barretenberg/vm/generated/{name}_verifier.hpp\" + " + ) +} diff --git a/bberg/src/file_writer.rs b/bberg/src/file_writer.rs new file mode 100644 index 0000000000..ad1153d6d0 --- /dev/null +++ b/bberg/src/file_writer.rs @@ -0,0 +1,59 @@ +use std::fs::File; +use std::io::Write; + +pub struct BBFiles { + // Relative paths + pub file_name: String, + pub base: String, + pub rel: String, + pub circuit: String, + pub flavor: String, + pub composer: String, + pub prover: String, // path for both prover and verifier files +} + +impl BBFiles { + pub fn default(file_name: String) -> Self { + Self::new(file_name, None, None, None, None, None, None) + } + + #[allow(clippy::too_many_arguments)] + pub fn new( + file_name: String, + base: Option, + rel: Option, + circuit: Option, + flavor: Option, + composer: Option, + prover: Option, + ) -> Self { + let base = base.unwrap_or("src/barretenberg".to_owned()); + let rel = rel.unwrap_or("relations/generated".to_owned()); + let circuit = circuit.unwrap_or("vm/generated".to_owned()); + let flavor = flavor.unwrap_or("vm/generated".to_owned()); + let composer = composer.unwrap_or("vm/generated".to_owned()); + let prover = prover.unwrap_or("vm/generated".to_owned()); + + Self { + file_name, + + base, + rel, + circuit, + flavor, + composer, + prover, + } + } + + pub fn write_file(&self, folder: &str, filename: &str, contents: &String) { + // attempt to create dir + let base_path = format!("{}/{}", self.base, folder); + let _ = std::fs::create_dir_all(&base_path); + + let joined = format!("{}/{}", base_path, filename); + println!("Writing file: {}", joined); + let mut file = File::create(joined).unwrap(); + file.write_all(contents.as_bytes()).unwrap(); + } +} diff --git a/bberg/src/flavor_builder.rs b/bberg/src/flavor_builder.rs new file mode 100644 index 0000000000..b9d6bb2534 --- /dev/null +++ b/bberg/src/flavor_builder.rs @@ -0,0 +1,627 @@ +use crate::{ + file_writer::BBFiles, + utils::{get_relations_imports, map_with_newline, snake_case}, +}; + +pub trait FlavorBuilder { + #[allow(clippy::too_many_arguments)] + fn create_flavor_hpp( + &mut self, + name: &str, + relation_file_names: &[String], + lookups: &[String], + fixed: &[String], + witness: &[String], + all_cols: &[String], + to_be_shifted: &[String], + shifted: &[String], + all_cols_and_shifts: &[String], + ); +} + +/// Build the boilerplate for the flavor file +impl FlavorBuilder for BBFiles { + fn create_flavor_hpp( + &mut self, + name: &str, + relation_file_names: &[String], + lookups: &[String], + fixed: &[String], + witness: &[String], + all_cols: &[String], + to_be_shifted: &[String], + shifted: &[String], + all_cols_and_shifts: &[String], + ) { + let first_poly = &witness[0]; + let includes = flavor_includes(&snake_case(name), relation_file_names, lookups); + let num_precomputed = fixed.len(); + let num_witness = witness.len(); + let num_all = all_cols_and_shifts.len(); + + // Top of file boilerplate + let class_aliases = create_class_aliases(); + let relation_definitions = create_relation_definitions(name, relation_file_names, lookups); + let container_size_definitions = + container_size_definitions(num_precomputed, num_witness, num_all); + + // Entities classes + let precomputed_entities = create_precomputed_entities(fixed); + let witness_entities = create_witness_entities(witness); + let all_entities = + create_all_entities(all_cols, to_be_shifted, shifted, all_cols_and_shifts); + + let proving_and_verification_key = + create_proving_and_verification_key(name, lookups, to_be_shifted); + let polynomial_views = create_polynomial_views(first_poly); + + let commitment_labels_class = create_commitment_labels(all_cols); + + let verification_commitments = create_verifier_commitments(fixed); + + let transcript = generate_transcript(witness); + + let flavor_hpp = format!( + " +{includes} + +namespace bb {{ + +class {name}Flavor {{ + public: + {class_aliases} + + {container_size_definitions} + + {relation_definitions} + + static constexpr bool has_zero_row = true; + + private: + {precomputed_entities} + + {witness_entities} + + {all_entities} + + + {proving_and_verification_key} + + + {polynomial_views} + + {commitment_labels_class} + + {verification_commitments} + + {transcript} +}}; + +}} // namespace bb + + + " + ); + + self.write_file( + &self.flavor, + &format!("{}_flavor.hpp", snake_case(name)), + &flavor_hpp, + ); + } +} + +/// Imports located at the top of the flavor files +fn flavor_includes(name: &str, relation_file_names: &[String], lookups: &[String]) -> String { + let relation_imports = get_relations_imports(name, relation_file_names, lookups); + + format!( + " +#pragma once +#include \"barretenberg/commitment_schemes/kzg/kzg.hpp\" +#include \"barretenberg/ecc/curves/bn254/g1.hpp\" +#include \"barretenberg/flavor/relation_definitions.hpp\" +#include \"barretenberg/polynomials/barycentric.hpp\" +#include \"barretenberg/polynomials/univariate.hpp\" + +#include \"barretenberg/relations/generic_permutation/generic_permutation_relation.hpp\" + +#include \"barretenberg/flavor/flavor_macros.hpp\" +#include \"barretenberg/transcript/transcript.hpp\" +#include \"barretenberg/polynomials/evaluation_domain.hpp\" +#include \"barretenberg/polynomials/polynomial.hpp\" +#include \"barretenberg/flavor/flavor.hpp\" +{relation_imports} +" + ) +} + +/// Creates comma separated relations tuple file +fn create_relations_tuple(master_name: &str, relation_file_names: &[String]) -> String { + relation_file_names + .iter() + .map(|name| format!("{master_name}_vm::{name}")) + .collect::>() + .join(", ") +} + +/// Creates comma separated relations tuple file +fn create_lookups_tuple(lookups: &[String]) -> Option { + if lookups.is_empty() { + return None; + } + Some( + lookups + .iter() + .map(|lookup| format!("{}_relation", lookup.clone())) + .collect::>() + .join(", "), + ) +} + +/// Create Class Aliases +/// +/// Contains boilerplate defining key characteristics of the flavor class +fn create_class_aliases() -> &'static str { + r#" + using Curve = curve::BN254; + using G1 = Curve::Group; + using PCS = KZG; + + using FF = G1::subgroup_field; + using Polynomial = bb::Polynomial; + using PolynomialHandle = std::span; + using GroupElement = G1::element; + using Commitment = G1::affine_element; + using CommitmentHandle = G1::affine_element; + using CommitmentKey = bb::CommitmentKey; + using VerifierCommitmentKey = bb::VerifierCommitmentKey; + using RelationSeparator = FF; + "# +} + +/// Create relation definitions +/// +/// Contains all of the boilerplate code required to generate relation definitions. +/// We instantiate the Relations container, which contains a tuple of all of the separate relation file +/// definitions. +/// +/// We then also define some constants, making use of the preprocessor. +fn create_relation_definitions( + name: &str, + relation_file_names: &[String], + lookups: &[String], +) -> String { + // Relations tuple = ns::relation_name_0, ns::relation_name_1, ... ns::relation_name_n (comma speratated) + let comma_sep_relations = create_relations_tuple(name, relation_file_names); + let comma_sep_lookups: Option = create_lookups_tuple(lookups); + + // We only include the grand product relations if we are given lookups + let mut grand_product_relations = String::new(); + let mut all_relations = comma_sep_relations.to_string(); + if let Some(lookups) = comma_sep_lookups { + all_relations = all_relations + &format!(", {lookups}"); + grand_product_relations = format!("using GrandProductRelations = std::tuple<{lookups}>;"); + } + + format!(" + {grand_product_relations} + + using Relations = std::tuple<{all_relations}>; + + static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length(); + + // BATCHED_RELATION_PARTIAL_LENGTH = algebraic degree of sumcheck relation *after* multiplying by the `pow_zeta` + // random polynomial e.g. For \\sum(x) [A(x) * B(x) + C(x)] * PowZeta(X), relation length = 2 and random relation + // length = 3 + static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH = MAX_PARTIAL_RELATION_LENGTH + 1; + static constexpr size_t NUM_RELATIONS = std::tuple_size_v; + + template + using ProtogalaxyTupleOfTuplesOfUnivariates = + decltype(create_protogalaxy_tuple_of_tuples_of_univariates()); + using SumcheckTupleOfTuplesOfUnivariates = decltype(create_sumcheck_tuple_of_tuples_of_univariates()); + using TupleOfArraysOfValues = decltype(create_tuple_of_arrays_of_values()); + ") +} + +/// Create the number of columns boilerplate for the flavor file +fn container_size_definitions( + num_precomputed: usize, + num_witness: usize, + num_all: usize, +) -> String { + format!(" + static constexpr size_t NUM_PRECOMPUTED_ENTITIES = {num_precomputed}; + static constexpr size_t NUM_WITNESS_ENTITIES = {num_witness}; + static constexpr size_t NUM_WIRES = NUM_WITNESS_ENTITIES + NUM_PRECOMPUTED_ENTITIES; + // We have two copies of the witness entities, so we subtract the number of fixed ones (they have no shift), one for the unshifted and one for the shifted + static constexpr size_t NUM_ALL_ENTITIES = {num_all}; + + ") +} + +/// Returns a Ref Vector with the given name, +/// +/// The vector returned will reference the columns names given +/// Used in all entities declarations +fn return_ref_vector(name: &str, columns: &[String]) -> String { + let comma_sep = create_comma_separated(columns); + + format!("RefVector {name}() {{ return {{ {comma_sep} }}; }};") +} + +/// list -> "list[0], list[1], ... list[n-1]" +fn create_comma_separated(list: &[String]) -> String { + list.join(", ") +} + +/// Create Precomputed Entities +/// +/// Precomputed first contains a pointer view defining all of the precomputed columns +/// As-well as any polys conforming to tables / ids / permutations +fn create_precomputed_entities(fixed: &[String]) -> String { + let pointer_view = create_flavor_members(fixed); + + let selectors = return_ref_vector("get_selectors", fixed); + let sigma_polys = return_ref_vector("get_sigma_polynomials", &[]); + let id_polys = return_ref_vector("get_id_polynomials", &[]); + let table_polys = return_ref_vector("get_table_polynomials", &[]); + + format!( + " + template + class PrecomputedEntities : public PrecomputedEntitiesBase {{ + public: + using DataType = DataType_; + + {pointer_view} + + {selectors} + {sigma_polys} + {id_polys} + {table_polys} + }}; + " + ) +} + +fn create_witness_entities(witness: &[String]) -> String { + let pointer_view = create_flavor_members(witness); + + let wires = return_ref_vector("get_wires", witness); + + format!( + " + template + class WitnessEntities {{ + public: + + {pointer_view} + + {wires} + }}; + " + ) +} + +/// Creates container of all witness entities and shifts +fn create_all_entities( + all_cols: &[String], + to_be_shifted: &[String], + shifted: &[String], + all_cols_and_shifts: &[String], +) -> String { + let all_entities_flavor_members = create_flavor_members(all_cols_and_shifts); + + let wires = return_ref_vector("get_wires", all_cols_and_shifts); + let get_unshifted = return_ref_vector("get_unshifted", all_cols); + let get_to_be_shifted = return_ref_vector("get_to_be_shifted", to_be_shifted); + let get_shifted = return_ref_vector("get_shifted", shifted); + + format!( + " + template + class AllEntities {{ + public: + + {all_entities_flavor_members} + + + {wires} + {get_unshifted} + {get_to_be_shifted} + {get_shifted} + }}; + " + ) +} + +fn create_proving_and_verification_key( + flavor_name: &str, + lookups: &[String], + to_be_shifted: &[String], +) -> String { + let get_to_be_shifted = return_ref_vector("get_to_be_shifted", to_be_shifted); + let compute_logderivative_inverses = + create_compute_logderivative_inverses(flavor_name, lookups); + + format!(" + public: + class ProvingKey : public ProvingKeyAvm_, WitnessEntities, CommitmentKey> {{ + public: + // Expose constructors on the base class + using Base = ProvingKeyAvm_, WitnessEntities, CommitmentKey>; + using Base::Base; + + {get_to_be_shifted} + + {compute_logderivative_inverses} + }}; + + using VerificationKey = VerificationKey_, VerifierCommitmentKey>; + ") +} + +fn create_polynomial_views(first_poly: &String) -> String { + format!(" + + using FoldedPolynomials = AllEntities>; + + class AllValues : public AllEntities {{ + public: + using Base = AllEntities; + using Base::Base; + }}; + + /** + * @brief A container for the prover polynomials handles. + */ + class ProverPolynomials : public AllEntities {{ + public: + // Define all operations as default, except copy construction/assignment + ProverPolynomials() = default; + ProverPolynomials& operator=(const ProverPolynomials&) = delete; + ProverPolynomials(const ProverPolynomials& o) = delete; + ProverPolynomials(ProverPolynomials&& o) noexcept = default; + ProverPolynomials& operator=(ProverPolynomials&& o) noexcept = default; + ~ProverPolynomials() = default; + + ProverPolynomials(ProvingKey& proving_key) + {{ + for (auto [prover_poly, key_poly] : zip_view(this->get_unshifted(), proving_key.get_all())) {{ + ASSERT(flavor_get_label(*this, prover_poly) == flavor_get_label(proving_key, key_poly)); + prover_poly = key_poly.share(); + }} + for (auto [prover_poly, key_poly] : zip_view(this->get_shifted(), proving_key.get_to_be_shifted())) {{ + ASSERT(flavor_get_label(*this, prover_poly) == (flavor_get_label(proving_key, key_poly) + \"_shift\")); + prover_poly = key_poly.shifted(); + }} + }} + + [[nodiscard]] size_t get_polynomial_size() const {{ return {first_poly}.size(); }} + /** + * @brief Returns the evaluations of all prover polynomials at one point on the boolean hypercube, which + * represents one row in the execution trace. + */ + [[nodiscard]] AllValues get_row(size_t row_idx) const + {{ + AllValues result; + for (auto [result_field, polynomial] : zip_view(result.get_all(), this->get_all())) {{ + result_field = polynomial[row_idx]; + }} + return result; + }} + }}; + + + using RowPolynomials = AllEntities; + + class PartiallyEvaluatedMultivariates : public AllEntities {{ + public: + PartiallyEvaluatedMultivariates() = default; + PartiallyEvaluatedMultivariates(const size_t circuit_size) + {{ + // Storage is only needed after the first partial evaluation, hence polynomials of size (n / 2) + for (auto& poly : get_all()) {{ + poly = Polynomial(circuit_size / 2); + }} + }} + }}; + + /** + * @brief A container for univariates used during Protogalaxy folding and sumcheck. + * @details During folding and sumcheck, the prover evaluates the relations on these univariates. + */ + template + using ProverUnivariates = AllEntities>; + + /** + * @brief A container for univariates used during Protogalaxy folding and sumcheck with some of the computation + * optmistically ignored + * @details During folding and sumcheck, the prover evaluates the relations on these univariates. + */ + template + using OptimisedProverUnivariates = AllEntities>; + + /** + * @brief A container for univariates produced during the hot loop in sumcheck. + */ + using ExtendedEdges = ProverUnivariates; + + /** + * @brief A container for the witness commitments. + * + */ + using WitnessCommitments = WitnessEntities; + + ") +} + +fn create_flavor_members(entities: &[String]) -> String { + let pointer_list = create_comma_separated(entities); + + format!( + "DEFINE_FLAVOR_MEMBERS(DataType, {pointer_list})", + pointer_list = pointer_list + ) +} + +fn create_labels(all_ents: &[String]) -> String { + let mut labels = String::new(); + for name in all_ents { + labels.push_str(&format!( + "Base::{name} = \"{}\"; + ", + name.to_uppercase() + )); + } + labels +} + +fn create_commitment_labels(all_ents: &[String]) -> String { + let labels = create_labels(all_ents); + + format!( + " + class CommitmentLabels: public AllEntities {{ + private: + using Base = AllEntities; + + public: + CommitmentLabels() : AllEntities() + {{ + {labels} + }}; + }}; + " + ) +} + +fn create_compute_logderivative_inverses(flavor_name: &str, lookups: &[String]) -> String { + let compute_inverse_transformation = |lookup_name: &String| { + format!("bb::compute_logderivative_inverse<{flavor_name}Flavor, {lookup_name}_relation>(prover_polynomials, relation_parameters, this->circuit_size);") + }; + + let compute_inverses = map_with_newline(lookups, compute_inverse_transformation); + + format!( + " + void compute_logderivative_inverses(const RelationParameters& relation_parameters) + {{ + ProverPolynomials prover_polynomials = ProverPolynomials(*this); + + {compute_inverses} + }} + " + ) +} + +fn create_key_dereference(fixed: &[String]) -> String { + let deref_transformation = |name: &String| format!("{name} = verification_key->{name};"); + + map_with_newline(fixed, deref_transformation) +} + +fn create_verifier_commitments(fixed: &[String]) -> String { + let key_dereference = create_key_dereference(fixed); + + format!( + " + class VerifierCommitments : public AllEntities {{ + private: + using Base = AllEntities; + + public: + VerifierCommitments(const std::shared_ptr& verification_key) + {{ + {key_dereference} + }} + }}; +" + ) +} + +fn generate_transcript(witness: &[String]) -> String { + // Transformations + let declaration_transform = |c: &_| format!("Commitment {c};"); + let deserialize_transform = |name: &_| { + format!( + "{name} = deserialize_from_buffer(Transcript::proof_data, num_frs_read);", + ) + }; + let serialize_transform = + |name: &_| format!("serialize_to_buffer({name}, Transcript::proof_data);"); + + // Perform Transformations + let declarations = map_with_newline(witness, declaration_transform); + let deserialize_wires = map_with_newline(witness, deserialize_transform); + let serialize_wires = map_with_newline(witness, serialize_transform); + + format!(" + class Transcript : public NativeTranscript {{ + public: + uint32_t circuit_size; + + {declarations} + + std::vector> sumcheck_univariates; + std::array sumcheck_evaluations; + std::vector zm_cq_comms; + Commitment zm_cq_comm; + Commitment zm_pi_comm; + + Transcript() = default; + + Transcript(const std::vector& proof) + : NativeTranscript(proof) + {{}} + + void deserialize_full_transcript() + {{ + size_t num_frs_read = 0; + circuit_size = deserialize_from_buffer(proof_data, num_frs_read); + size_t log_n = numeric::get_msb(circuit_size); + + {deserialize_wires} + + for (size_t i = 0; i < log_n; ++i) {{ + sumcheck_univariates.emplace_back( + deserialize_from_buffer>( + Transcript::proof_data, num_frs_read)); + }} + sumcheck_evaluations = deserialize_from_buffer>( + Transcript::proof_data, num_frs_read); + for (size_t i = 0; i < log_n; ++i) {{ + zm_cq_comms.push_back(deserialize_from_buffer(proof_data, num_frs_read)); + }} + zm_cq_comm = deserialize_from_buffer(proof_data, num_frs_read); + zm_pi_comm = deserialize_from_buffer(proof_data, num_frs_read); + }} + + void serialize_full_transcript() + {{ + size_t old_proof_length = proof_data.size(); + Transcript::proof_data.clear(); + size_t log_n = numeric::get_msb(circuit_size); + + serialize_to_buffer(circuit_size, Transcript::proof_data); + + {serialize_wires} + + for (size_t i = 0; i < log_n; ++i) {{ + serialize_to_buffer(sumcheck_univariates[i], Transcript::proof_data); + }} + serialize_to_buffer(sumcheck_evaluations, Transcript::proof_data); + for (size_t i = 0; i < log_n; ++i) {{ + serialize_to_buffer(zm_cq_comms[i], proof_data); + }} + serialize_to_buffer(zm_cq_comm, proof_data); + serialize_to_buffer(zm_pi_comm, proof_data); + + // sanity check to make sure we generate the same length of proof as before. + ASSERT(proof_data.size() == old_proof_length); + }} + }}; + ") +} diff --git a/bberg/src/lib.rs b/bberg/src/lib.rs new file mode 100644 index 0000000000..7067a6012a --- /dev/null +++ b/bberg/src/lib.rs @@ -0,0 +1,12 @@ +pub mod bberg_codegen; +mod circuit_builder; +mod composer_builder; +mod file_writer; +mod flavor_builder; +pub mod lookup_builder; +pub mod permutation_builder; +mod prover_builder; +mod relation_builder; +mod utils; +mod verifier_builder; +pub mod vm_builder; diff --git a/bberg/src/lookup_builder.rs b/bberg/src/lookup_builder.rs new file mode 100644 index 0000000000..dc3a23d0b7 --- /dev/null +++ b/bberg/src/lookup_builder.rs @@ -0,0 +1,373 @@ +use crate::{ + file_writer::BBFiles, + utils::{create_get_const_entities, create_get_nonconst_entities, snake_case}, +}; +use ast::{ + analyzed::{AlgebraicExpression, Analyzed, Identity, IdentityKind}, + parsed::SelectedExpressions, +}; +use itertools::Itertools; +use number::FieldElement; + +use crate::utils::sanitize_name; + +#[derive(Debug)] +/// Lookup +/// +/// Contains the information required to produce a lookup relation +/// Lookup object and lookup side object are very similar in structure, however they are duplicated for +/// readability. +pub struct Lookup { + /// the name given to the inverse helper column + pub attribute: Option, + /// The name of the counts polynomial that stores the number of times a lookup is read + pub counts_poly: String, + /// the left side of the lookup + pub left: LookupSide, + /// the right side of the lookup + pub right: LookupSide, +} + +#[derive(Debug)] +/// LookupSide +/// +/// One side of a two sided lookup relationship +pub struct LookupSide { + /// -> Option - the selector for the lookup ( on / off toggle ) + selector: Option, + /// The columns involved in this side of the lookup + cols: Vec, +} + +pub trait LookupBuilder { + /// Takes in an AST and works out what lookup relations are needed + /// Note: returns the name of the inverse columns, such that they can be added to the prover in subsequent steps + fn create_lookup_files( + &self, + name: &str, + analyzed: &Analyzed, + ) -> Vec; +} + +impl LookupBuilder for BBFiles { + fn create_lookup_files( + &self, + project_name: &str, + analyzed: &Analyzed, + ) -> Vec { + let lookups: Vec<&Identity>> = analyzed + .identities + .iter() + .filter(|identity| matches!(identity.kind, IdentityKind::Plookup)) + .collect(); + let new_lookups = lookups + .iter() + .map(|lookup| Lookup { + attribute: lookup.attribute.clone().map(|att| att.to_lowercase()), + counts_poly: format!( + "{}_counts", + lookup.attribute.clone().unwrap().to_lowercase() + ), + left: get_lookup_side(&lookup.left), + right: get_lookup_side(&lookup.right), + }) + .collect_vec(); + + create_lookups(self, project_name, &new_lookups); + new_lookups + } +} + +/// The attributes of a lookup contain the name of the inverse, we collect all of these to create the inverse column +pub fn get_inverses_from_lookups(lookups: &[Lookup]) -> Vec { + lookups + .iter() + .map(|lookup| lookup.attribute.clone().unwrap()) + .collect() +} + +pub fn get_counts_from_lookups(lookups: &[Lookup]) -> Vec { + lookups + .iter() + .map(|lookup| lookup.counts_poly.clone()) + .collect() +} + +/// Write the lookup settings files to disk +fn create_lookups(bb_files: &BBFiles, project_name: &str, lookups: &Vec) { + for lookup in lookups { + let lookup_settings = create_lookup_settings_file(lookup); + + let folder = format!("{}/{}", bb_files.rel, &snake_case(project_name)); + let file_name = format!( + "{}{}", + lookup.attribute.clone().unwrap_or("NONAME".to_owned()), + ".hpp".to_owned() + ); + bb_files.write_file(&folder, &file_name, &lookup_settings); + } +} + +/// All relation types eventually get wrapped in the relation type +/// This function creates the export for the relation type so that it can be added to the flavor +fn create_relation_exporter(lookup_name: &str) -> String { + let settings_name = format!("{}_lookup_settings", lookup_name); + let lookup_export = format!("template using {lookup_name}_relation = GenericLookupRelation<{settings_name}, FF_>;"); + let relation_export = format!( + "template using {lookup_name} = GenericLookup<{settings_name}, FF_>;" + ); + + format!( + " + {lookup_export} + {relation_export} + " + ) +} + +fn lookup_settings_includes() -> &'static str { + r#" + #pragma once + + #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" + + #include + #include + "# +} + +fn create_lookup_settings_file(lookup: &Lookup) -> String { + let columns_per_set = lookup.left.cols.len(); + let lookup_name = lookup + .attribute + .clone() + .expect("Inverse column name must be provided within lookup attribute - #[]"); + let counts_poly_name = lookup.counts_poly.to_owned(); + + // NOTE: https://github.com/AztecProtocol/aztec-packages/issues/3879 + // Settings are not flexible enough to combine inverses + + let lhs_selector = lookup + .left + .selector + .clone() + .expect("Left hand side selector for lookup required"); + let rhs_selector = lookup + .right + .selector + .clone() + .expect("Right hand side selector for lookup required"); + let lhs_cols = lookup.left.cols.clone(); + let rhs_cols = lookup.right.cols.clone(); + + assert!( + lhs_cols.len() == rhs_cols.len(), + "Lookup columns lhs must be the same length as rhs" + ); + + // 0. The polynomial containing the inverse products -> taken from the attributes + // 1. The polynomial with the counts! + // 2. lhs selector + // 3. rhs selector + // 4.. + columns per set. lhs cols + // 4 + columns per set.. . rhs cols + let mut lookup_entities: Vec = [ + lookup_name.clone(), + counts_poly_name.clone(), + lhs_selector.clone(), + rhs_selector.clone(), + ] + .to_vec(); + + lookup_entities.extend(lhs_cols); + lookup_entities.extend(rhs_cols); + + // NOTE: these are hardcoded as 1 for now until more optimizations are required + let read_terms = 1; + let write_terms = 1; + let lookup_tuple_size = columns_per_set; + + // NOTE: hardcoded until optimizations required + let inverse_degree = 4; + let read_term_degree = 0; + let write_term_degree = 0; + let read_term_types = "{0}"; + let write_term_types = "{0}"; + + let lookup_settings_includes = lookup_settings_includes(); + let inverse_polynomial_is_computed_at_row = + create_inverse_computed_at(&lhs_selector, &rhs_selector); + let compute_inverse_exists = create_compute_inverse_exist(&lhs_selector, &rhs_selector); + let const_entities = create_get_const_entities(&lookup_entities); + let nonconst_entities = create_get_nonconst_entities(&lookup_entities); + let relation_exporter = create_relation_exporter(&lookup_name); + + format!( + " + {lookup_settings_includes} + + namespace bb {{ + + /** + * @brief This class contains an example of how to set LookupSettings classes used by the + * GenericLookupRelationImpl class to specify a scaled lookup + * + * @details To create your own lookup: + * 1) Create a copy of this class and rename it + * 2) Update all the values with the ones needed for your lookup + * 3) Update \"DECLARE_LOOKUP_IMPLEMENTATIONS_FOR_ALL_SETTINGS\" and \"DEFINE_LOOKUP_IMPLEMENTATIONS_FOR_ALL_SETTINGS\" to + * include the new settings + * 4) Add the relation with the chosen settings to Relations in the flavor (for example,\"` + * using Relations = std::tuple>;)` + * + */ + class {lookup_name}_lookup_settings {{ + public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ + static constexpr size_t READ_TERMS = {read_terms}; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ + static constexpr size_t WRITE_TERMS = {write_terms}; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ + static constexpr size_t READ_TERM_TYPES[READ_TERMS] = {read_term_types}; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ + static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = {write_term_types}; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ + static constexpr size_t LOOKUP_TUPLE_SIZE = {lookup_tuple_size}; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ + static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = {inverse_degree}; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ + static constexpr size_t READ_TERM_DEGREE = {read_term_degree}; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + + static constexpr size_t WRITE_TERM_DEGREE = {write_term_degree}; + + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + {inverse_polynomial_is_computed_at_row} + + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + {compute_inverse_exists} + + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + {const_entities} + + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + {nonconst_entities} + }}; + + {relation_exporter} + }} + " + ) +} + +fn create_inverse_computed_at(lhs_selector: &String, rhs_selector: &String) -> String { + let lhs_computed_selector = format!("in.{lhs_selector}"); + let rhs_computed_selector = format!("in.{rhs_selector}"); + format!(" + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) {{ + return ({lhs_computed_selector } == 1 || {rhs_computed_selector} == 1); + }}") +} + +fn create_compute_inverse_exist(lhs_selector: &String, rhs_selector: &String) -> String { + let lhs_computed_selector = format!("in.{lhs_selector}"); + let rhs_computed_selector = format!("in.{rhs_selector}"); + format!(" + template static inline auto compute_inverse_exists(const AllEntities& in) {{ + using View = typename Accumulator::View; + const auto is_operation = View({lhs_computed_selector}); + const auto is_table_entry = View({rhs_computed_selector}); + return (is_operation + is_table_entry - is_operation * is_table_entry); + }}") +} + +fn get_lookup_side( + def: &SelectedExpressions>, +) -> LookupSide { + let get_name = |expr: &AlgebraicExpression| match expr { + AlgebraicExpression::Reference(a_ref) => sanitize_name(&a_ref.name), + _ => panic!("Expected reference"), + }; + + LookupSide { + selector: def.selector.as_ref().map(|expr| get_name(expr)), + cols: def + .expressions + .iter() + .map(|expr| get_name(expr)) + .collect_vec(), + } +} diff --git a/bberg/src/permutation_builder.rs b/bberg/src/permutation_builder.rs new file mode 100644 index 0000000000..6cc00db960 --- /dev/null +++ b/bberg/src/permutation_builder.rs @@ -0,0 +1,258 @@ +use crate::{ + file_writer::BBFiles, + utils::{create_get_const_entities, create_get_nonconst_entities, snake_case}, +}; +use ast::{ + analyzed::{AlgebraicExpression, Analyzed, Identity, IdentityKind}, + parsed::SelectedExpressions, +}; +use itertools::Itertools; +use number::FieldElement; + +use crate::utils::sanitize_name; + +#[derive(Debug)] +/// Permutation +/// +/// Contains the information required to produce a permutation relation +pub struct Permutation { + /// -> Attribute - the name given to the inverse helper column + pub attribute: Option, + /// -> PermSide - the left side of the permutation + pub left: PermutationSide, + /// -> PermSide - the right side of the permutation + pub right: PermutationSide, +} + +#[derive(Debug)] +/// PermSide +/// +/// One side of a two sided permutation relationship +pub struct PermutationSide { + /// -> Option - the selector for the permutation ( on / off toggle ) + selector: Option, + /// The columns involved in this side of the permutation + cols: Vec, +} + +pub trait PermutationBuilder { + /// Takes in an AST and works out what permutation relations are needed + /// Note: returns the name of the inverse columns, such that they can be added to he prover in subsequent steps + fn create_permutation_files( + &self, + name: &str, + analyzed: &Analyzed, + ) -> Vec; +} + +impl PermutationBuilder for BBFiles { + fn create_permutation_files( + &self, + project_name: &str, + analyzed: &Analyzed, + ) -> Vec { + let perms: Vec<&Identity>> = analyzed + .identities + .iter() + .filter(|identity| matches!(identity.kind, IdentityKind::Permutation)) + .collect(); + let new_perms = perms + .iter() + .map(|perm| Permutation { + attribute: perm.attribute.clone().map(|att| att.to_lowercase()), + left: get_perm_side(&perm.left), + right: get_perm_side(&perm.right), + }) + .collect_vec(); + + create_permutations(self, project_name, &new_perms); + new_perms + } +} + +/// The attributes of a permutation contain the name of the inverse, we collect all of these to create the inverse column +pub fn get_inverses_from_permutations(permutations: &[Permutation]) -> Vec { + permutations + .iter() + .map(|perm| perm.attribute.clone().unwrap()) + .collect() +} + +/// Write the permutation settings files to disk +fn create_permutations(bb_files: &BBFiles, project_name: &str, permutations: &Vec) { + for permutation in permutations { + let perm_settings = create_permutation_settings_file(permutation); + + let folder = format!("{}/{}", bb_files.rel, &snake_case(project_name)); + let file_name = format!( + "{}{}", + permutation.attribute.clone().unwrap_or("NONAME".to_owned()), + ".hpp".to_owned() + ); + bb_files.write_file(&folder, &file_name, &perm_settings); + } +} + +/// All relation types eventually get wrapped in the relation type +/// This function creates the export for the relation type so that it can be added to the flavor +fn create_relation_exporter(permutation_name: &str) -> String { + let settings_name = format!("{}_permutation_settings", permutation_name); + let permutation_export = format!("template using {permutation_name}_relation = GenericPermutationRelation<{settings_name}, FF_>;"); + let relation_export = format!("template using {permutation_name} = GenericPermutation<{settings_name}, FF_>;"); + + format!( + " + {permutation_export} + {relation_export} + " + ) +} + +fn permutation_settings_includes() -> &'static str { + r#" + #pragma once + + #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" + + #include + #include + "# +} + +fn create_permutation_settings_file(permutation: &Permutation) -> String { + println!("Permutation: {:?}", permutation); + let columns_per_set = permutation.left.cols.len(); + // TODO(md): In the future we will need to condense off the back of this - combining those with the same inverse column + let permutation_name = permutation + .attribute + .clone() + .expect("Inverse column name must be provided using attribute syntax"); + + // This also will need to work for both sides of this ! + let lhs_selector = permutation + .left + .selector + .clone() + .expect("At least one selector must be provided"); + // If a rhs selector is not present, then we use the rhs selector -- TODO(md): maybe we want the default to be always on? + let rhs_selector = permutation + .right + .selector + .clone() + .unwrap_or(lhs_selector.clone()); + + let lhs_cols = permutation.left.cols.clone(); + let rhs_cols = permutation.right.cols.clone(); + + // 0. The polynomial containing the inverse products -> taken from the attributes + // 1. The polynomial enabling the relation (the selector) + // 2. lhs selector + // 3. rhs selector + // 4.. + columns per set. lhs cols + // 4 + columns per set.. . rhs cols + let mut perm_entities: Vec = [ + permutation_name.clone(), + lhs_selector.clone(), + lhs_selector.clone(), + rhs_selector.clone(), + ] + .to_vec(); + + perm_entities.extend(lhs_cols); + perm_entities.extend(rhs_cols); + + let permutation_settings_includes = permutation_settings_includes(); + + let inverse_computed_at = create_inverse_computed_at(&lhs_selector, &rhs_selector); + let const_entities = create_get_const_entities(&perm_entities); + let nonconst_entities = create_get_nonconst_entities(&perm_entities); + let relation_exporter = create_relation_exporter(&permutation_name); + + format!( + " + {permutation_settings_includes} + + namespace bb {{ + + class {permutation_name}_permutation_settings {{ + public: + // This constant defines how many columns are bundled together to form each set. + constexpr static size_t COLUMNS_PER_SET = {columns_per_set}; + + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + {inverse_computed_at} + + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + {const_entities} + + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + {nonconst_entities} + }}; + + {relation_exporter} + }} + " + ) +} + +fn create_inverse_computed_at(lhs_selector: &String, rhs_selector: &String) -> String { + let lhs_computed_selector = format!("in.{lhs_selector}"); + let rhs_computed_selector = format!("in.{rhs_selector}"); + format!(" + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) {{ + return ({lhs_computed_selector } == 1 || {rhs_computed_selector} == 1); + }}") +} + +fn get_perm_side( + def: &SelectedExpressions>, +) -> PermutationSide { + let get_name = |expr: &AlgebraicExpression| match expr { + AlgebraicExpression::Reference(a_ref) => sanitize_name(&a_ref.name), + _ => panic!("Expected reference"), + }; + + PermutationSide { + selector: def.selector.as_ref().map(|expr| get_name(expr)), + cols: def + .expressions + .iter() + .map(|expr| get_name(expr)) + .collect_vec(), + } +} diff --git a/bberg/src/prover_builder.rs b/bberg/src/prover_builder.rs new file mode 100644 index 0000000000..b7a313e2d3 --- /dev/null +++ b/bberg/src/prover_builder.rs @@ -0,0 +1,321 @@ +use crate::file_writer::BBFiles; +use crate::utils::{map_with_newline, snake_case}; + +pub trait ProverBuilder { + fn create_prover_hpp(&mut self, name: &str); + + fn create_prover_cpp( + &mut self, + name: &str, + commitment_polys: &[String], + lookup_names: &[String], + ); +} + +impl ProverBuilder for BBFiles { + fn create_prover_hpp(&mut self, name: &str) { + let include_str = includes_hpp(&snake_case(name)); + let prover_hpp = format!(" + {include_str} + namespace bb {{ + + class {name}Prover {{ + + using Flavor = {name}Flavor; + using FF = Flavor::FF; + using PCS = Flavor::PCS; + using PCSCommitmentKey = Flavor::CommitmentKey; + using ProvingKey = Flavor::ProvingKey; + using Polynomial = Flavor::Polynomial; + using ProverPolynomials = Flavor::ProverPolynomials; + using CommitmentLabels = Flavor::CommitmentLabels; + using Transcript = Flavor::Transcript; + + public: + explicit {name}Prover(std::shared_ptr input_key, std::shared_ptr commitment_key); + + void execute_preamble_round(); + void execute_wire_commitments_round(); + void execute_log_derivative_inverse_round(); + void execute_relation_check_rounds(); + void execute_zeromorph_rounds(); + + HonkProof& export_proof(); + HonkProof& construct_proof(); + + std::shared_ptr transcript = std::make_shared(); + + std::vector public_inputs; + + bb::RelationParameters relation_parameters; + + std::shared_ptr key; + + // Container for spans of all polynomials required by the prover (i.e. all multivariates evaluated by Sumcheck). + ProverPolynomials prover_polynomials; + + CommitmentLabels commitment_labels; + typename Flavor::WitnessCommitments witness_commitments; + + Polynomial quotient_W; + + SumcheckOutput sumcheck_output; + + std::shared_ptr commitment_key; + + using ZeroMorph = ZeroMorphProver_; + + private: + HonkProof proof; + }}; + + }} // namespace bb + + "); + self.write_file( + &self.prover, + &format!("{}_prover.hpp", snake_case(name)), + &prover_hpp, + ); + } + + /// Create the prover cpp file + /// + /// Committed polys are included as we manually unroll all commitments, as we do not commit to everything + fn create_prover_cpp( + &mut self, + name: &str, + commitment_polys: &[String], + lookup_names: &[String], + ) { + let include_str = includes_cpp(&snake_case(name)); + + let polynomial_commitment_phase = create_commitments_phase(commitment_polys); + let log_derivative_inverse_phase = create_log_derivative_inverse_round(lookup_names); + + let prover_cpp = format!(" + {include_str} + + namespace bb {{ + + using Flavor = {name}Flavor; + using FF = Flavor::FF; + + /** + * Create {name}Prover from proving key, witness and manifest. + * + * @param input_key Proving key. + * @param input_manifest Input manifest + * + * @tparam settings Settings class. + * */ + {name}Prover::{name}Prover(std::shared_ptr input_key, + std::shared_ptr commitment_key) + : key(input_key) + , commitment_key(commitment_key) + {{ + for (auto [prover_poly, key_poly] : zip_view(prover_polynomials.get_unshifted(), key->get_all())) {{ + ASSERT(bb::flavor_get_label(prover_polynomials, prover_poly) == + bb::flavor_get_label(*key, key_poly)); + prover_poly = key_poly.share(); + }} + for (auto [prover_poly, key_poly] : zip_view(prover_polynomials.get_shifted(), key->get_to_be_shifted())) {{ + ASSERT(bb::flavor_get_label(prover_polynomials, prover_poly) == + bb::flavor_get_label(*key, key_poly) + \"_shift\"); + prover_poly = key_poly.shifted(); + }} + }} + + + /** + * @brief Add circuit size, public input size, and public inputs to transcript + * + */ + void {name}Prover::execute_preamble_round() + {{ + const auto circuit_size = static_cast(key->circuit_size); + + transcript->send_to_verifier(\"circuit_size\", circuit_size); + }} + + /** + * @brief Compute commitments to all of the witness wires (apart from the logderivative inverse wires) + * + */ + void {name}Prover::execute_wire_commitments_round() + {{ + + {polynomial_commitment_phase} + + }} + + void {name}Prover::execute_log_derivative_inverse_round() + {{ + + {log_derivative_inverse_phase} + }} + + /** + * @brief Run Sumcheck resulting in u = (u_1,...,u_d) challenges and all evaluations at u being calculated. + * + */ + void {name}Prover::execute_relation_check_rounds() + {{ + using Sumcheck = SumcheckProver; + + auto sumcheck = Sumcheck(key->circuit_size, transcript); + + FF alpha = transcript->template get_challenge(\"Sumcheck:alpha\"); + std::vector gate_challenges(numeric::get_msb(key->circuit_size)); + + for (size_t idx = 0; idx < gate_challenges.size(); idx++) {{ + gate_challenges[idx] = transcript->template get_challenge(\"Sumcheck:gate_challenge_\" + std::to_string(idx)); + }} + sumcheck_output = sumcheck.prove(prover_polynomials, relation_parameters, alpha, gate_challenges); + }} + + + /** + * @brief Execute the ZeroMorph protocol to prove the multilinear evaluations produced by Sumcheck + * @details See https://hackmd.io/dlf9xEwhTQyE3hiGbq4FsA?view for a complete description of the unrolled protocol. + * + * */ + void {name}Prover::execute_zeromorph_rounds() + {{ + ZeroMorph::prove(prover_polynomials.get_unshifted(), + prover_polynomials.get_to_be_shifted(), + sumcheck_output.claimed_evaluations.get_unshifted(), + sumcheck_output.claimed_evaluations.get_shifted(), + sumcheck_output.challenge, + commitment_key, + transcript); + + }} + + + HonkProof& {name}Prover::export_proof() + {{ + proof = transcript->proof_data; + return proof; + }} + + HonkProof& {name}Prover::construct_proof() + {{ + // Add circuit size public input size and public inputs to transcript. + execute_preamble_round(); + + // Compute wire commitments + execute_wire_commitments_round(); + + // Compute sorted list accumulator and commitment + execute_log_derivative_inverse_round(); + + // Fiat-Shamir: alpha + // Run sumcheck subprotocol. + execute_relation_check_rounds(); + + // Fiat-Shamir: rho, y, x, z + // Execute Zeromorph multilinear PCS + execute_zeromorph_rounds(); + + return export_proof(); + }} + + }} // namespace bb + + + "); + + self.write_file( + &self.prover, + &format!("{}_prover.cpp", snake_case(name)), + &prover_cpp, + ); + } +} + +fn includes_hpp(name: &str) -> String { + format!( + " +#pragma once +#include \"barretenberg/commitment_schemes/zeromorph/zeromorph.hpp\" +#include \"barretenberg/plonk/proof_system/types/proof.hpp\" +#include \"barretenberg/relations/relation_parameters.hpp\" +#include \"barretenberg/sumcheck/sumcheck_output.hpp\" +#include \"barretenberg/transcript/transcript.hpp\" + +#include \"barretenberg/vm/generated/{name}_flavor.hpp\" + + " + ) +} + +fn includes_cpp(name: &str) -> String { + format!( + " + + #include \"{name}_prover.hpp\" + #include \"barretenberg/commitment_schemes/claim.hpp\" + #include \"barretenberg/commitment_schemes/commitment_key.hpp\" + #include \"barretenberg/honk/proof_system/logderivative_library.hpp\" + #include \"barretenberg/honk/proof_system/permutation_library.hpp\" + #include \"barretenberg/plonk_honk_shared/library/grand_product_library.hpp\" + #include \"barretenberg/polynomials/polynomial.hpp\" + #include \"barretenberg/relations/lookup_relation.hpp\" + #include \"barretenberg/relations/permutation_relation.hpp\" + #include \"barretenberg/sumcheck/sumcheck.hpp\" + " + ) +} + +/// Commitment Transform +/// +/// Produces code to perform kzg commitment, then stores in the witness_commitments struct +fn commitment_transform(name: &String) -> String { + format!("witness_commitments.{name} = commitment_key->commit(key->{name});") +} + +/// Send to Verifier Transform +/// +/// Sends commitment produces in commitment_transform to the verifier +fn send_to_verifier_transform(name: &String) -> String { + format!("transcript->send_to_verifier(commitment_labels.{name}, witness_commitments.{name});") +} + +fn create_commitments_phase(polys_to_commit_to: &[String]) -> String { + let all_commit_operations = map_with_newline(polys_to_commit_to, commitment_transform); + let send_to_verifier_operations = + map_with_newline(polys_to_commit_to, send_to_verifier_transform); + + format!( + " + // Commit to all polynomials (apart from logderivative inverse polynomials, which are committed to in the later logderivative phase) + {all_commit_operations} + + // Send all commitments to the verifier + {send_to_verifier_operations} + " + ) +} + +fn create_log_derivative_inverse_round(lookup_operations: &[String]) -> String { + let all_commit_operations = map_with_newline(lookup_operations, commitment_transform); + let send_to_verifier_operations = + map_with_newline(lookup_operations, send_to_verifier_transform); + + format!( + " + auto [beta, gamm] = transcript->template get_challenges(\"beta\", \"gamma\"); + relation_parameters.beta = beta; + relation_parameters.gamma = gamm; + + key->compute_logderivative_inverses(relation_parameters); + + // Commit to all logderivative inverse polynomials + {all_commit_operations} + + // Send all commitments to the verifier + {send_to_verifier_operations} + " + ) +} diff --git a/bberg/src/relation_builder.rs b/bberg/src/relation_builder.rs new file mode 100644 index 0000000000..6855f21813 --- /dev/null +++ b/bberg/src/relation_builder.rs @@ -0,0 +1,529 @@ +use ast::analyzed::AlgebraicExpression; +use ast::analyzed::Identity; +use ast::analyzed::{ + AlgebraicBinaryOperator, AlgebraicExpression as Expression, AlgebraicUnaryOperator, + IdentityKind, +}; +use ast::parsed::SelectedExpressions; +use itertools::Itertools; +use num_bigint::BigUint; +use std::collections::HashMap; +use std::collections::HashSet; + +use number::{DegreeType, FieldElement}; + +use crate::file_writer::BBFiles; +use crate::utils::{capitalize, map_with_newline, snake_case}; + +/// Returned back to the vm builder from the create_relations call +pub struct RelationOutput { + /// A list of the names of the created relations + pub relations: Vec, + /// A list of the names of all of the 'used' shifted polys + pub shifted_polys: Vec, +} + +/// Each created bb Identity is passed around with its degree so as needs to be manually +/// provided for sumcheck +type BBIdentity = (DegreeType, String); + +pub trait RelationBuilder { + /// Create Relations + /// + /// Takes in the ast ( for relations ), groups each of them by file, and then + /// calls 'create relation' for each + /// + /// Relation output is passed back to the caller as the prover requires both: + /// - The shifted polys + /// - The names of the relations files created + fn create_relations( + &self, + root_name: &str, + identities: &[Identity>], + ) -> RelationOutput; + + /// Create Relation + /// + /// Name and root name are required to determine the file path, e.g. it will be in the bberg/relations/generated + /// followed by /root_name/name + /// - root name should be the name provided with the --name flag + /// - name will be a pil namespace + /// + /// - Identities are the identities that will be used to create the relations, they are generated within create_relations + /// - row_type contains all of the columns that the relations namespace touches. + fn create_relation( + &self, + root_name: &str, + name: &str, + sub_relations: &[String], + identities: &[BBIdentity], + row_type: &str, + labels_lookup: String, + ); + + /// Declare views + /// + /// Declare views is a macro that generates a reference for each of the columns + /// This reference will be a span into a sumcheck related object, it must be declared for EACH sub-relation + /// as the sumcheck object is sensitive to the degree of the relation. + fn create_declare_views(&self, name: &str, all_cols_and_shifts: &[String]); +} + +impl RelationBuilder for BBFiles { + fn create_relations( + &self, + file_name: &str, + analyzed_identities: &[Identity>], + ) -> RelationOutput { + // Group relations per file + let grouped_relations: HashMap>>> = + group_relations_per_file(analyzed_identities); + let mut relations = grouped_relations.keys().cloned().collect_vec(); + relations.sort(); + + // Contains all of the rows in each relation, will be useful for creating composite builder types + let mut all_rows: HashMap = HashMap::new(); + let mut shifted_polys: Vec = Vec::new(); + + // ----------------------- Create the relation files ----------------------- + for (relation_name, analyzed_idents) in grouped_relations.iter() { + let IdentitiesOutput { + subrelations, + identities, + collected_cols, + collected_shifts, + expression_labels, + } = create_identities(file_name, analyzed_idents); + + // TODO: This can probably be moved into the create_identities function + let row_type = create_row_type(&capitalize(relation_name), &collected_cols); + + // Aggregate all shifted polys + shifted_polys.extend(collected_shifts); + // Aggregate all rows + all_rows.insert(relation_name.to_owned(), row_type.clone()); + + let labels_lookup = create_relation_labels(relation_name, expression_labels); + self.create_relation( + file_name, + relation_name, + &subrelations, + &identities, + &row_type, + labels_lookup, + ); + } + + shifted_polys.sort(); + relations.sort(); + + RelationOutput { + relations, + shifted_polys, + } + } + + fn create_relation( + &self, + root_name: &str, + name: &str, + sub_relations: &[String], + identities: &[BBIdentity], + row_type: &str, + labels_lookup: String, + ) { + let includes = relation_includes(); + let class_boilerplate = relation_class_boilerplate(name, sub_relations, identities); + let export = get_export(name); + + let relations = format!( + "{includes} +namespace bb::{root_name}_vm {{ + +{row_type}; + +{labels_lookup} + +{class_boilerplate} + +{export} + + }}" + ); + + self.write_file( + &format!("{}/{}", &self.rel, snake_case(root_name)), + &format!("{}.hpp", snake_case(name)), + &relations, + ); + } + + fn create_declare_views(&self, name: &str, all_cols_and_shifts: &[String]) { + let view_transformation = + |name: &String| format!("[[maybe_unused]] auto {name} = View(new_term.{name}); \\"); + let make_view_per_row = map_with_newline(all_cols_and_shifts, view_transformation); + + let declare_views = format!( + " + #define {name}_DECLARE_VIEWS(index) \\ + using Accumulator = typename std::tuple_element::type; \\ + using View = typename Accumulator::View; \\ + {make_view_per_row} + + + " + ); + + self.write_file( + &format!("{}/{}", &self.rel, snake_case(name)), + "declare_views.hpp", + &declare_views, + ); + } +} + +/// Group relations per file +/// +/// The compiler returns all relations in one large vector, however we want to distinguish +/// which files .pil files the relations belong to for later code gen +/// +/// Say we have two files foo.pil and bar.pil +/// foo.pil contains the following relations: +/// - foo1 +/// - foo2 +/// bar.pil contains the following relations: +/// - bar1 +/// - bar2 +/// +/// This function will return a hashmap with the following structure: +/// { +/// "foo": [foo1, foo2], +/// "bar": [bar1, bar2] +/// } +/// +/// This allows us to generate a relation.hpp file containing ONLY the relations for that .pil file +fn group_relations_per_file( + identities: &[Identity>], +) -> HashMap>>> { + identities + .iter() + .cloned() + .into_group_map_by(|identity| identity.source.file.clone().replace(".pil", "")) +} + +fn relation_class_boilerplate( + name: &str, + sub_relations: &[String], + identities: &[BBIdentity], +) -> String { + // We add one to all degrees because we have an extra scaling factor + let degrees = identities.iter().map(|(d, _)| d + 1).collect(); + let degree_boilerplate = get_degree_boilerplate(degrees); + let relation_code = get_relation_code(sub_relations); + format!( + "template class {name}Impl {{ + public: + using FF = FF_; + + {degree_boilerplate} + + {relation_code} +}};", + ) +} + +fn get_export(name: &str) -> String { + format!( + "template using {name} = Relation<{name}Impl>;", + name = name + ) +} + +fn get_relation_code(ids: &[String]) -> String { + let mut relation_code = r#" + template + void static accumulate( + ContainerOverSubrelations& evals, + const AllEntities& new_term, + [[maybe_unused]] const RelationParameters&, + [[maybe_unused]] const FF& scaling_factor + ){ + + "# + .to_owned(); + for id in ids { + relation_code.push_str(&format!("{}\n", id)); + } + relation_code.push_str("}\n"); + relation_code +} + +fn get_degree_boilerplate(degrees: Vec) -> String { + let num_degrees = degrees.len(); + + let mut degree_boilerplate = format!( + "static constexpr std::array SUBRELATION_PARTIAL_LENGTHS{{\n" + ); + for degree in °rees { + degree_boilerplate.push_str(&format!(" {},\n", degree)); + } + degree_boilerplate.push_str("};"); + + degree_boilerplate +} + +// The include statements required for a new relation file +fn relation_includes() -> &'static str { + r#" +#pragma once +#include "../../relation_parameters.hpp" +#include "../../relation_types.hpp" +#include "./declare_views.hpp" +"# +} + +// Each vm will need to have a row which is a combination of all of the witness columns +pub(crate) fn create_row_type(name: &str, all_rows: &[String]) -> String { + let row_transformation = |row: &_| format!(" FF {row} {{}};"); + let all_annotated = map_with_newline(all_rows, row_transformation); + + format!( + "template struct {name}Row {{ \n{}\n }}", + all_annotated, + ) +} + +fn create_identity( + expression: &SelectedExpressions>, + collected_cols: &mut HashSet, + collected_public_identities: &mut HashSet, +) -> Option { + // We want to read the types of operators and then create the appropiate code + + if let Some(expr) = &expression.selector { + let x = craft_expression(expr, collected_cols, collected_public_identities); + println!("{:?}", x); + Some(x) + } else { + None + } +} + +// TODO: replace the preamble with a macro so the code looks nicer +fn create_subrelation(index: usize, preamble: String, identity: &mut BBIdentity) -> String { + // \\\ + let id = &identity.1; + + format!( + "//Contribution {index} + {{\n{preamble} + + auto tmp = {id}; + tmp *= scaling_factor; + std::get<{index}>(evals) += tmp; +}}", + ) +} + +fn craft_expression( + expr: &Expression, + // TODO: maybe make state? + collected_cols: &mut HashSet, + collected_public_identities: &mut HashSet, +) -> BBIdentity { + match expr { + Expression::Number(n) => { + let number: BigUint = n.to_arbitrary_integer(); + if number.bits() < 32 { + return (1, format!("FF({})", number)); + } + if number.bits() < 64 { + return (1, format!("FF({}UL)", number)); + } + if number.bits() < 256 { + let mut chunks: Vec = number.iter_u64_digits().collect::>(); + chunks.resize(4, 0); + return ( + 1, + format!( + "FF(uint256_t{{{}UL, {}UL, {}UL, {}UL}})", + chunks[0], chunks[1], chunks[2], chunks[3], + ), + ); + } + unimplemented!("{:?}", expr); + } + Expression::Reference(polyref) => { + let mut poly_name = polyref.name.replace('.', "_").to_string(); + if polyref.next { + // NOTE: Naive algorithm to collect all shifted polys + poly_name = format!("{}_shift", poly_name); + } + collected_cols.insert(poly_name.clone()); + (1, poly_name) + } + Expression::BinaryOperation(lhe, op, rhe) => { + let (ld, lhs) = craft_expression(lhe, collected_cols, collected_public_identities); + let (rd, rhs) = craft_expression(rhe, collected_cols, collected_public_identities); + + let degree = std::cmp::max(ld, rd); + match op { + AlgebraicBinaryOperator::Add => match lhe.as_ref() { + // BBerg hack, we do not want a field on the lhs of an expression + Expression::Number(_) => (degree, format!("({} + {})", rhs, lhs)), + _ => (degree, format!("({} + {})", lhs, rhs)), + }, + AlgebraicBinaryOperator::Sub => match lhe.as_ref() { + // BBerg hack, we do not want a field on the lhs of an expression + Expression::Number(_) => (degree, format!("(-{} + {})", rhs, lhs)), + _ => (degree, format!("({} - {})", lhs, rhs)), + }, + AlgebraicBinaryOperator::Mul => match lhe.as_ref() { + // BBerg hack, we do not want a field on the lhs of an expression + Expression::Number(_) => (ld + rd, format!("({} * {})", rhs, lhs)), + _ => (ld + rd, format!("({} * {})", lhs, rhs)), + }, + _ => unimplemented!("{:?}", expr), + } + } + Expression::UnaryOperation(operator, expression) => match operator { + AlgebraicUnaryOperator::Minus => { + let (d, e) = + craft_expression(expression, collected_cols, collected_public_identities); + (d, format!("-{}", e)) + } + _ => unimplemented!("{:?}", expr), + }, + // TODO: for now we do nothing with calls to public identities + // These probably can be implemented as some form of copy, however im not sure how we are going to process these down the line + Expression::PublicReference(name) => { + // We collect them for now to warn the user what is going on + collected_public_identities.insert(name.clone()); + (1, "FF(0)".to_string()) + } + } +} + +pub struct IdentitiesOutput { + subrelations: Vec, + identities: Vec, + collected_cols: Vec, + collected_shifts: Vec, + expression_labels: HashMap, +} + +pub(crate) fn create_identities( + file_name: &str, + identities: &[Identity>], +) -> IdentitiesOutput { + // We only want the expressions for now + // When we have a poly type, we only need the left side of it + let ids = identities + .iter() + .filter(|identity| identity.kind == IdentityKind::Polynomial) + .collect::>(); + + let mut identities = Vec::new(); + let mut subrelations = Vec::new(); + let mut expression_labels: HashMap = HashMap::new(); // Each relation can be given a label, this label can be assigned here + let mut collected_cols: HashSet = HashSet::new(); + let mut collected_public_identities: HashSet = HashSet::new(); + + // Collect labels for each identity + // TODO: shite + for (i, id) in ids.iter().enumerate() { + if let Some(label) = &id.attribute { + expression_labels.insert(i, label.clone()); + } + } + + let expressions = ids.iter().map(|id| id.left.clone()).collect::>(); + for (i, expression) in expressions.iter().enumerate() { + let relation_boilerplate = format!( + "{file_name}_DECLARE_VIEWS({i}); + ", + ); + + // TODO: collected pattern is shit + let mut identity = create_identity( + expression, + &mut collected_cols, + &mut collected_public_identities, + ) + .unwrap(); + let subrelation = create_subrelation(i, relation_boilerplate, &mut identity); + + identities.push(identity); + + subrelations.push(subrelation); + } + + // Print a warning to the user about usage of public identities + if !collected_public_identities.is_empty() { + println!("Public Identities are not supported yet in codegen, however some were collected"); + println!("Public Identities: {:?}", collected_public_identities); + } + + let mut collected_cols: Vec = collected_cols.drain().collect(); + let mut collected_shifts: Vec = collected_cols + .clone() + .iter() + .filter_map(|col| { + if col.ends_with("shift") { + Some(col.clone()) + } else { + None + } + }) + .collect(); + + collected_cols.sort(); + collected_shifts.sort(); + + IdentitiesOutput { + subrelations, + identities, + collected_cols, + collected_shifts, + expression_labels, + } +} + +/// Relation labels +/// +/// To view relation labels we create a sparse switch that contains all of the collected labels +/// Whenever there is a failure, we can lookup into this mapping +/// +/// Note: this mapping will never be that big, so we are quite naive in implementation +/// It should be able to be called from else where with relation_name::get_relation_label +fn create_relation_labels(relation_name: &str, labels: HashMap) -> String { + // Sort labels by the index + let label_transformation = |(index, label)| { + format!( + "case {index}: + return \"{label}\"; + " + ) + }; + + // Sort the labels by their index + let mut sorted_labels: Vec<(usize, String)> = labels.into_iter().collect(); + sorted_labels.sort_by(|a, b| a.0.cmp(&b.0)); + + let switch_statement: String = sorted_labels + .into_iter() + .map(label_transformation) + .collect::>() + .join("\n"); + + format!( + " + inline std::string get_relation_label_{relation_name}(int index) {{ + switch (index) {{ + {switch_statement} + }} + return std::to_string(index); + }} + " + ) +} diff --git a/bberg/src/utils.rs b/bberg/src/utils.rs new file mode 100644 index 0000000000..3211a097c2 --- /dev/null +++ b/bberg/src/utils.rs @@ -0,0 +1,147 @@ +use itertools::Itertools; +use number::FieldElement; + +/// Get Relations Imports +/// +/// We may have multiple relation files in the generated foler +/// This method will return all of the imports for the relation header files +pub fn get_relations_imports(name: &str, relations: &[String], permutations: &[String]) -> String { + let all_relations = flatten(&[relations.to_vec(), permutations.to_vec()]); + let transformation = |relation_name: &_| { + format!("#include \"barretenberg/relations/generated/{name}/{relation_name}.hpp\"") + }; + + map_with_newline(&all_relations, transformation) +} + +/// Sanitize Names +/// +/// Column titles that we get from pil contain . to distinguish which pil namespace they belong to +/// We need to replace these with _ to make them valid C++ identifiers +pub fn sanitize_name(string: &str) -> String { + string.replace(['.', '[', ']'], "_") +} + +/// Capitalize +pub fn capitalize(s: &str) -> String { + let mut c = s.chars(); + match c.next() { + None => String::new(), + Some(f) => f.to_uppercase().collect::() + c.as_str(), + } +} + +/// Map With Newline +/// This utility function is used all over the codegen pipeline +/// It takes a list, usually the names of columns in an execution trace and applies a string transformation "op" +/// to each element in the list +pub fn map_with_newline(list: &[String], op: Func) -> String +where + Func: Fn(&String) -> String, +{ + transform_map(list, op).join("\n") +} + +/// Collect Col +/// +/// Transforms columns from powdr representation ( where the witnesses are linked ) +/// Into a version where we just keep the columns +/// As this is all we are about +pub fn collect_col(list: &[(String, Vec)], op: Func) -> Vec +where + F: FieldElement, + Func: Fn(&(String, Vec)) -> String, +{ + list.iter().map(op).collect::>() +} + +/// Transform Map +/// +/// Apply a transformation to a list of strings +pub fn transform_map(list: &[String], op: Func) -> Vec +where + Func: Fn(&String) -> String, +{ + list.iter().map(op).collect::>() +} + +/// Flatten +/// +/// Returns a flattened concatenation of the input arrays +pub fn flatten(list: &[Vec]) -> Vec { + let arr = list.iter().cloned(); + arr.into_iter().flatten().collect() +} + +/// Create Forward As Tuple +/// +/// Helper function to create a forward as tuple cpp statement +pub fn create_forward_as_tuple(settings: &[String]) -> String { + let adjusted = settings.iter().map(|col| format!("in.{col}")).join(",\n"); + format!( + " + return std::forward_as_tuple( + {} + ); + ", + adjusted + ) +} + +// TODO: may make sense to move the below around a bit +pub fn create_get_const_entities(settings: &[String]) -> String { + let forward = create_forward_as_tuple(settings); + format!( + " + template static inline auto get_const_entities(const AllEntities& in) {{ + {forward} + }} + " + ) +} + +pub fn create_get_nonconst_entities(settings: &[String]) -> String { + let forward = create_forward_as_tuple(settings); + format!( + " + template static inline auto get_nonconst_entities(AllEntities& in) {{ + {forward} + }} + " + ) +} + +/// Snake Case +/// +/// Transform camel case string into snake case, such as: RedFlower --> red_flower +pub fn snake_case(input: &str) -> String { + let mut result = String::new(); + + // Handle the first character + if input.is_empty() { + return result; // Empty input + } + let mut first_char = input.chars().next().unwrap(); + if first_char.is_uppercase() { + first_char = first_char.to_ascii_lowercase(); + } + result.push(first_char); + + // Process remaining characters + for ch in input.chars().skip(1) { + if ch.is_uppercase() { + result.push('_'); + result.push(ch.to_ascii_lowercase()); + } else { + result.push(ch); + } + } + + result +} + +pub fn sort_cols(cols: &[(String, Vec)]) -> Vec<(String, Vec)> { + let mut cols = cols.to_vec(); + cols.sort_by(|a, b| a.0.cmp(&b.0)); + cols +} diff --git a/bberg/src/verifier_builder.rs b/bberg/src/verifier_builder.rs new file mode 100644 index 0000000000..db789e18cc --- /dev/null +++ b/bberg/src/verifier_builder.rs @@ -0,0 +1,194 @@ +use crate::{ + file_writer::BBFiles, + utils::{map_with_newline, snake_case}, +}; + +pub trait VerifierBuilder { + fn create_verifier_cpp(&mut self, name: &str, witness: &[String], inverses: &[String]); + + fn create_verifier_hpp(&mut self, name: &str); +} + +impl VerifierBuilder for BBFiles { + fn create_verifier_cpp(&mut self, name: &str, witness: &[String], inverses: &[String]) { + let include_str = includes_cpp(&snake_case(name)); + + let wire_transformation = |n: &String| { + format!( + "commitments.{n} = transcript->template receive_from_prover(commitment_labels.{n});" + ) + }; + let wire_commitments = map_with_newline(witness, wire_transformation); + let inverse_commitments = map_with_newline(inverses, wire_transformation); + + let ver_cpp = format!(" +{include_str} + + namespace bb {{ + {name}Verifier::{name}Verifier(std::shared_ptr verifier_key) + : key(verifier_key) + {{}} + + {name}Verifier::{name}Verifier({name}Verifier&& other) noexcept + : key(std::move(other.key)) + , pcs_verification_key(std::move(other.pcs_verification_key)) + {{}} + + {name}Verifier& {name}Verifier::operator=({name}Verifier&& other) noexcept + {{ + key = other.key; + pcs_verification_key = (std::move(other.pcs_verification_key)); + commitments.clear(); + return *this; + }} + + /** + * @brief This function verifies an {name} Honk proof for given program settings. + * + */ + bool {name}Verifier::verify_proof(const HonkProof& proof) + {{ + using Flavor = {name}Flavor; + using FF = Flavor::FF; + using Commitment = Flavor::Commitment; + // using PCS = Flavor::PCS; + // using ZeroMorph = ZeroMorphVerifier_; + using VerifierCommitments = Flavor::VerifierCommitments; + using CommitmentLabels = Flavor::CommitmentLabels; + + RelationParameters relation_parameters; + + transcript = std::make_shared(proof); + + VerifierCommitments commitments {{ key }}; + CommitmentLabels commitment_labels; + + const auto circuit_size = transcript->template receive_from_prover(\"circuit_size\"); + + if (circuit_size != key->circuit_size) {{ + return false; + }} + + // Get commitments to VM wires + {wire_commitments} + + auto [beta, gamm] = transcript->template get_challenges(\"beta\", \"gamma\"); + relation_parameters.beta = beta; + relation_parameters.gamma = gamm; + + // Get commitments to inverses + {inverse_commitments} + + // Execute Sumcheck Verifier + const size_t log_circuit_size = numeric::get_msb(circuit_size); + auto sumcheck = SumcheckVerifier(log_circuit_size, transcript); + + FF alpha = transcript->template get_challenge(\"Sumcheck:alpha\"); + + auto gate_challenges = std::vector(log_circuit_size); + for (size_t idx = 0; idx < log_circuit_size; idx++) {{ + gate_challenges[idx] = transcript->template get_challenge(\"Sumcheck:gate_challenge_\" + std::to_string(idx)); + }} + + auto [multivariate_challenge, claimed_evaluations, sumcheck_verified] = + sumcheck.verify(relation_parameters, alpha, gate_challenges); + + // If Sumcheck did not verify, return false + if (sumcheck_verified.has_value() && !sumcheck_verified.value()) {{ + return false; + }} + + // Execute ZeroMorph rounds. See https://hackmd.io/dlf9xEwhTQyE3hiGbq4FsA?view for a complete description of the + // unrolled protocol. + // NOTE: temporarily disabled - facing integration issues + // auto pairing_points = ZeroMorph::verify(commitments.get_unshifted(), + // commitments.get_to_be_shifted(), + // claimed_evaluations.get_unshifted(), + // claimed_evaluations.get_shifted(), + // multivariate_challenge, + // transcript); + + // auto verified = pcs_verification_key->pairing_check(pairing_points[0], pairing_points[1]); + // return sumcheck_verified.value() && verified; + return sumcheck_verified.value(); + }} + + + }} // namespace bb + + + "); + + self.write_file( + &self.prover, + &format!("{}_verifier.cpp", snake_case(name)), + &ver_cpp, + ); + } + + fn create_verifier_hpp(&mut self, name: &str) { + let include_str = include_hpp(&snake_case(name)); + let ver_hpp = format!( + " +{include_str} + + namespace bb {{ + class {name}Verifier {{ + using Flavor = {name}Flavor; + using FF = Flavor::FF; + using Commitment = Flavor::Commitment; + using VerificationKey = Flavor::VerificationKey; + using VerifierCommitmentKey = Flavor::VerifierCommitmentKey; + using Transcript = Flavor::Transcript; + + public: + explicit {name}Verifier(std::shared_ptr verifier_key = nullptr); + {name}Verifier({name}Verifier&& other) noexcept; + {name}Verifier(const {name}Verifier& other) = delete; + + {name}Verifier& operator=(const {name}Verifier& other) = delete; + {name}Verifier& operator=({name}Verifier&& other) noexcept; + + bool verify_proof(const HonkProof& proof); + + std::shared_ptr key; + std::map commitments; + std::shared_ptr pcs_verification_key; + std::shared_ptr transcript; + }}; + + }} // namespace bb + + + " + ); + + self.write_file( + &self.prover, + &format!("{}_verifier.hpp", snake_case(name)), + &ver_hpp, + ); + } +} + +fn include_hpp(name: &str) -> String { + format!( + " +#pragma once +#include \"barretenberg/plonk/proof_system/types/proof.hpp\" +#include \"barretenberg/sumcheck/sumcheck.hpp\" +#include \"barretenberg/vm/generated/{name}_flavor.hpp\" +" + ) +} + +fn includes_cpp(name: &str) -> String { + format!( + " + #include \"./{name}_verifier.hpp\" + #include \"barretenberg/commitment_schemes/zeromorph/zeromorph.hpp\" + #include \"barretenberg/numeric/bitop/get_msb.hpp\" + #include \"barretenberg/transcript/transcript.hpp\" + " + ) +} diff --git a/bberg/src/vm_builder.rs b/bberg/src/vm_builder.rs new file mode 100644 index 0000000000..ee877a2342 --- /dev/null +++ b/bberg/src/vm_builder.rs @@ -0,0 +1,202 @@ +use ast::analyzed::Analyzed; + +use number::FieldElement; + +use crate::circuit_builder::CircuitBuilder; +use crate::composer_builder::ComposerBuilder; +use crate::file_writer::BBFiles; +use crate::flavor_builder::FlavorBuilder; +use crate::lookup_builder::get_counts_from_lookups; +use crate::lookup_builder::get_inverses_from_lookups; +use crate::lookup_builder::Lookup; +use crate::lookup_builder::LookupBuilder; +use crate::permutation_builder::get_inverses_from_permutations; +use crate::permutation_builder::Permutation; +use crate::permutation_builder::PermutationBuilder; +use crate::prover_builder::ProverBuilder; +use crate::relation_builder::RelationBuilder; +use crate::relation_builder::RelationOutput; +use crate::utils::collect_col; +use crate::utils::flatten; +use crate::utils::sanitize_name; +use crate::utils::sort_cols; +use crate::utils::transform_map; +use crate::verifier_builder::VerifierBuilder; + +/// All of the combinations of columns that are used in a bberg flavor file +struct ColumnGroups { + /// fixed or constant columns in pil -> will be found in vk + fixed: Vec, + /// witness or commit columns in pil -> will be found in proof + witness: Vec, + /// witness or commit columns in pil, with out the inverse columns + witnesses_without_inverses: Vec, + /// fixed + witness columns without lookup inverses + all_cols_without_inverses: Vec, + /// fixed + witness columns with lookup inverses + all_cols: Vec, + /// Columns that will not be shifted + unshifted: Vec, + /// Columns that will be shifted + to_be_shifted: Vec, + /// The shifts of the columns that will be shifted + shifted: Vec, + /// fixed + witness + shifted + all_cols_with_shifts: Vec, + /// Inverses from lookups and permuations + inverses: Vec, +} + +/// Analyzed to cpp +/// +/// Converts an analyzed pil AST into a set of cpp files that can be used to generate a proof +pub(crate) fn analyzed_to_cpp( + analyzed: &Analyzed, + fixed: &[(String, Vec)], + witness: &[(String, Vec)], + name: Option, +) { + // Sort fixed and witness to ensure consistent ordering + let fixed = &sort_cols(fixed); + let witness = &sort_cols(witness); + + let file_name: &str = &name.unwrap_or("Example".to_owned()); + let mut bb_files = BBFiles::default(file_name.to_owned()); + + // Inlining step to remove the intermediate poly definitions + let mut analyzed_identities = analyzed.identities_with_inlined_intermediate_polynomials(); + analyzed_identities.sort_by(|a, b| a.id.cmp(&b.id)); + + // ----------------------- Handle Standard Relation Identities ----------------------- + // We collect all references to shifts as we traverse all identities and create relation files + let RelationOutput { + relations, + shifted_polys, + } = bb_files.create_relations(file_name, &analyzed_identities); + + // ----------------------- Handle Lookup / Permutation Relation Identities ----------------------- + let permutations = bb_files.create_permutation_files(file_name, analyzed); + let lookups = bb_files.create_lookup_files(file_name, analyzed); + + // TODO: hack - this can be removed with some restructuring + let shifted_polys: Vec = shifted_polys + .clone() + .iter() + .map(|s| s.replace("_shift", "")) + .collect(); + + // Collect all column names and determine if they need a shift or not + let ColumnGroups { + fixed, + witness, + witnesses_without_inverses, + all_cols, + all_cols_without_inverses, + unshifted: _unshifted, + to_be_shifted, + shifted, + all_cols_with_shifts, + inverses, + } = get_all_col_names(fixed, witness, &shifted_polys, &permutations, &lookups); + + bb_files.create_declare_views(file_name, &all_cols_with_shifts); + + // ----------------------- Create the circuit builder file ----------------------- + bb_files.create_circuit_builder_hpp( + file_name, + &relations, + &inverses, + &all_cols_without_inverses, + &all_cols, + &to_be_shifted, + &all_cols_with_shifts, + ); + + // ----------------------- Create the flavor file ----------------------- + bb_files.create_flavor_hpp( + file_name, + &relations, + &inverses, + &fixed, + &witness, + &all_cols, + &to_be_shifted, + &shifted, + &all_cols_with_shifts, + ); + + // ----------------------- Create the composer files ----------------------- + bb_files.create_composer_cpp(file_name); + bb_files.create_composer_hpp(file_name); + + // ----------------------- Create the Verifier files ----------------------- + bb_files.create_verifier_cpp(file_name, &witnesses_without_inverses, &inverses); + bb_files.create_verifier_hpp(file_name); + + // ----------------------- Create the Prover files ----------------------- + bb_files.create_prover_cpp(file_name, &witnesses_without_inverses, &inverses); + bb_files.create_prover_hpp(file_name); +} + +/// Get all col names +/// +/// In the flavor file, there are a number of different groups of columns that we need to keep track of +/// This function will return all of the columns in the following groups: +/// - fixed +/// - witness +/// - all_cols +/// - unshifted +/// - to_be_shifted +/// - all_cols_with_shifts +fn get_all_col_names( + fixed: &[(String, Vec)], + witness: &[(String, Vec)], + to_be_shifted: &[String], + permutations: &[Permutation], + lookups: &[Lookup], +) -> ColumnGroups { + // Transformations + let sanitize = |(name, _): &(String, Vec)| sanitize_name(name).to_owned(); + let append_shift = |name: &String| format!("{}_shift", *name); + + let perm_inverses = get_inverses_from_permutations(permutations); + let lookup_inverses = get_inverses_from_lookups(lookups); + let lookup_counts = get_counts_from_lookups(lookups); + + // Gather sanitized column names + let fixed_names = collect_col(fixed, sanitize); + let witness_names = collect_col(witness, sanitize); + + let inverses = flatten(&[perm_inverses, lookup_inverses]); + let witnesses_without_inverses = flatten(&[witness_names.clone(), lookup_counts.clone()]); + let witnesses_with_inverses = flatten(&[witness_names, inverses.clone(), lookup_counts]); + + // Group columns by properties + let shifted = transform_map(to_be_shifted, append_shift); + let all_cols_without_inverses: Vec = + flatten(&[fixed_names.clone(), witnesses_without_inverses.clone()]); + let all_cols: Vec = flatten(&[fixed_names.clone(), witnesses_with_inverses.clone()]); + let unshifted: Vec = flatten(&[fixed_names.clone(), witnesses_with_inverses.clone()]) + .into_iter() + .filter(|name| !shifted.contains(name)) + .collect(); + + let all_cols_with_shifts: Vec = flatten(&[ + fixed_names.clone(), + witnesses_with_inverses.clone(), + shifted.clone(), + ]); + + ColumnGroups { + fixed: fixed_names, + witness: witnesses_with_inverses, + all_cols_without_inverses, + witnesses_without_inverses, + all_cols, + unshifted, + to_be_shifted: to_be_shifted.to_vec(), + shifted, + all_cols_with_shifts, + inverses, + } +} diff --git a/bberg_pil_cli/Cargo.toml b/bberg_pil_cli/Cargo.toml new file mode 100644 index 0000000000..78bf533024 --- /dev/null +++ b/bberg_pil_cli/Cargo.toml @@ -0,0 +1,32 @@ + +[package] +name = "bberg_bin_cli" +version = "0.1.0" +authors = ["Maddiaa"] +edition = "2021" + +[[bin]] +name = "bberg_pil" +path = "src/main.rs" + +[dependencies] +clap = { version = "^4.3", features = ["derive"] } +compiler = { path = "../compiler" } +num-bigint = "0.4.3" + +number = { path = "../number" } +pil_analyzer = { path = "../pil_analyzer" } +num-traits = "0.2.15" +num-integer = "0.1.45" +itertools = "^0.10" +log = "0.4.17" +rand = "0.8.5" +ast = { version = "0.1.0", path = "../ast" } + +[dev-dependencies] +importer = { path = "../importer" } +analysis = { path = "../analysis" } +executor = { path = "../executor" } +parser = { path = "../parser" } +linker = { path = "../linker" } + diff --git a/bberg_pil_cli/README.md b/bberg_pil_cli/README.md new file mode 100644 index 0000000000..9c6fd86059 --- /dev/null +++ b/bberg_pil_cli/README.md @@ -0,0 +1,3 @@ +## BBERG PIL CLI +A small wrapper around powdr pil that only implements the parts of powdr required for direct pil -> bberg codegen + diff --git a/bberg_pil_cli/src/main.rs b/bberg_pil_cli/src/main.rs new file mode 100644 index 0000000000..8b8e595566 --- /dev/null +++ b/bberg_pil_cli/src/main.rs @@ -0,0 +1,42 @@ +use std::{io, path::Path}; + +use clap::Parser; +use compiler::{compile_pil, inputs_to_query_callback, BackendType}; +use number::Bn254Field; + +#[derive(Parser)] +#[command(name = "bberg_pil", author, version, about, long_about = None)] +struct Cli { + /// Input file + file: String, + + /// Output directory for the PIL file, json file and fixed and witness column data. + #[arg(short, long)] + #[arg(default_value_t = String::from("."))] + output_directory: String, + + /// BBerg: Name of the output file for bberg + #[arg(long)] + name: Option, +} + +fn main() -> Result<(), io::Error> { + let args = Cli::parse(); + + let file_name = args.file; + let output_dir = Path::new(&args.output_directory); + let name = args.name; + let inputs: Vec = Vec::new(); + let prove_with = Some(BackendType::BBerg); + let external_witness_values = Vec::new(); + + compile_pil( + Path::new(&file_name), + output_dir, + inputs_to_query_callback(inputs), + prove_with, + external_witness_values, + name, + ); + Ok(()) +} diff --git a/compiler/src/lib.rs b/compiler/src/lib.rs index 39a81e5407..3396d33ee4 100644 --- a/compiler/src/lib.rs +++ b/compiler/src/lib.rs @@ -35,6 +35,7 @@ pub fn no_callback() -> Option Option> { /// Compiles a .pil or .asm file and runs witness generation. /// If the file ends in .asm, converts it to .pil first. /// Returns the compilation result if any compilation took place. +#[allow(clippy::too_many_arguments)] pub fn compile_pil_or_asm( file_name: &str, inputs: Vec, @@ -42,6 +43,7 @@ pub fn compile_pil_or_asm( force_overwrite: bool, prove_with: Option, external_witness_values: Vec<(&str, Vec)>, + bname: Option, ) -> Result>, Vec> { if file_name.ends_with(".asm") { compile_asm( @@ -51,6 +53,7 @@ pub fn compile_pil_or_asm( force_overwrite, prove_with, external_witness_values, + bname, ) } else { Ok(Some(compile_pil( @@ -59,6 +62,7 @@ pub fn compile_pil_or_asm( inputs_to_query_callback(inputs), prove_with, external_witness_values, + bname, ))) } } @@ -77,6 +81,7 @@ pub fn compile_pil>( query_callback: Q, prove_with: Option, external_witness_values: Vec<(&str, Vec)>, + bname: Option, ) -> CompilationResult { compile( pil_analyzer::analyze(pil_file), @@ -85,6 +90,7 @@ pub fn compile_pil>( query_callback, prove_with, external_witness_values, + bname, ) } @@ -97,6 +103,7 @@ pub fn compile_pil_ast>( query_callback: Q, prove_with: Option, external_witness_values: Vec<(&str, Vec)>, + bname: Option, ) -> CompilationResult { // TODO exporting this to string as a hack because the parser // is tied into the analyzer due to imports. @@ -107,6 +114,7 @@ pub fn compile_pil_ast>( query_callback, prove_with, external_witness_values, + bname, ) } @@ -120,6 +128,7 @@ pub fn compile_asm( force_overwrite: bool, prove_with: Option, external_witness_values: Vec<(&str, Vec)>, + bname: Option, ) -> Result>, Vec> { let contents = fs::read_to_string(file_name).unwrap(); Ok(compile_asm_string( @@ -131,6 +140,7 @@ pub fn compile_asm( force_overwrite, prove_with, external_witness_values, + bname, )? .1) } @@ -169,6 +179,7 @@ pub fn convert_analyzed_to_pil( force_overwrite: bool, prove_with: Option, external_witness_values: Vec<(&str, Vec)>, + bname: Option, ) -> Result<(PathBuf, Option>), Vec> { let constraints = convert_analyzed_to_pil_constraints(analyzed, monitor); log::debug!("Run airgen"); @@ -206,6 +217,7 @@ pub fn convert_analyzed_to_pil( inputs_to_query_callback(inputs), prove_with, external_witness_values, + bname, )), )) } @@ -220,6 +232,7 @@ pub fn convert_analyzed_to_pil_with_callback, external_witness_values: Vec<(&str, Vec)>, + bname: Option, ) -> Result<(PathBuf, Option>), Vec> { let constraints = convert_analyzed_to_pil_constraints(analyzed, monitor); log::debug!("Run airgen"); @@ -257,6 +270,7 @@ pub fn convert_analyzed_to_pil_with_callback( force_overwrite: bool, prove_with: Option, external_witness_values: Vec<(&str, Vec)>, + bname: Option, ) -> Result<(PathBuf, Option>), Vec> { let mut monitor = DiffMonitor::default(); let analyzed = compile_asm_string_to_analyzed_ast(file_name, contents, Some(&mut monitor))?; @@ -292,6 +307,7 @@ pub fn compile_asm_string( force_overwrite, prove_with, external_witness_values, + bname, ) } @@ -305,6 +321,7 @@ pub fn compile_asm_string_with_callback>( force_overwrite: bool, prove_with: Option, external_witness_values: Vec<(&str, Vec)>, + bname: Option, ) -> Result<(PathBuf, Option>), Vec> { let mut monitor = DiffMonitor::default(); let analyzed = compile_asm_string_to_analyzed_ast(file_name, contents, Some(&mut monitor))?; @@ -320,6 +337,7 @@ pub fn compile_asm_string_with_callback>( force_overwrite, prove_with, external_witness_values, + bname, ) } @@ -340,35 +358,45 @@ fn compile>( analyzed: Analyzed, file_name: &OsStr, output_dir: &Path, - query_callback: Q, + _query_callback: Q, prove_with: Option, - external_witness_values: Vec<(&str, Vec)>, + _external_witness_values: Vec<(&str, Vec)>, + bname: Option, ) -> CompilationResult { log::info!("Optimizing pil..."); let analyzed = pilopt::optimize(analyzed); + + // md: we inline intermediate polynomials here, as honk does not have a notion of an intermediate + let mut mut_analyzed = analyzed; + mut_analyzed.identities = mut_analyzed.identities_with_inlined_intermediate_polynomials(); + let optimized_pil_file_name = output_dir.join(format!( "{}_opt.pil", Path::new(file_name).file_stem().unwrap().to_str().unwrap() )); - fs::write(optimized_pil_file_name.clone(), format!("{analyzed}")).unwrap(); + fs::write(optimized_pil_file_name.clone(), format!("{mut_analyzed}")).unwrap(); log::info!("Wrote {}.", optimized_pil_file_name.to_str().unwrap()); let start = Instant::now(); log::info!("Evaluating fixed columns..."); - let constants = constant_evaluator::generate(&analyzed); + let constants = constant_evaluator::generate(&mut_analyzed); log::info!("Took {}", start.elapsed().as_secs_f32()); - let witness = (analyzed.constant_count() == constants.len()).then(|| { - log::info!("Deducing witness columns..."); - let commits = - executor::witgen::WitnessGenerator::new(&analyzed, &constants, query_callback) - .with_external_witness_values(external_witness_values) - .generate(); - - commits - .into_iter() - .map(|(name, c)| (name.to_string(), c)) - .collect::>() - }); + let witness_names = mut_analyzed + .committed_polys_in_source_order() + .into_iter() + .map(|(sym, _)| sym.absolute_name.clone()) + .collect::>(); + + // NOTE: temporarily just append a vector to the end such that it is in the expected form for the backend + let witness_in_powdr_form: Vec<(String, Vec)> = witness_names + .iter() + .map(|name| (name.clone(), vec![])) + .collect(); + + let constants = constants + .into_iter() + .map(|(name, c)| (name.to_string(), c)) + .collect::>(); let constants = constants .into_iter() @@ -379,13 +407,14 @@ fn compile>( // still output the constraint serialization. let (proof, constraints_serialization) = if let Some(backend) = prove_with { let factory = backend.factory::(); - let backend = factory.create(analyzed.degree()); + let backend = factory.create(mut_analyzed.degree()); backend.prove( - &analyzed, + &mut_analyzed, &constants, - witness.as_deref().unwrap_or_default(), + &witness_in_powdr_form, None, + bname, ) } else { (None, None) @@ -396,15 +425,9 @@ fn compile>( .map(|(name, c)| (name.to_owned(), c)) .collect(); - let witness = witness.map(|v| { - v.into_iter() - .map(|(name, c)| (name.to_owned(), c)) - .collect() - }); - CompilationResult { constants, - witness, + witness: None, proof, constraints_serialization, } diff --git a/compiler/src/verify.rs b/compiler/src/verify.rs index 218f1e6323..53b6881655 100644 --- a/compiler/src/verify.rs +++ b/compiler/src/verify.rs @@ -26,6 +26,7 @@ pub fn verify_asm_string( true, Some(BackendType::PilStarkCli), external_witness_values, + None, ) .unwrap(); diff --git a/compiler/tests/asm.rs b/compiler/tests/asm.rs index 0f00fc483c..cf8db2e8bf 100644 --- a/compiler/tests/asm.rs +++ b/compiler/tests/asm.rs @@ -34,6 +34,7 @@ fn gen_estark_proof(file_name: &str, inputs: Vec) { true, Some(backend::BackendType::EStark), vec![], + None, ) .unwrap(); } @@ -51,6 +52,7 @@ fn gen_halo2_proof(file_name: &str, inputs: Vec) { true, Some(backend::BackendType::Halo2), vec![], + None, ) .unwrap(); } diff --git a/compiler/tests/pil.rs b/compiler/tests/pil.rs index 56518d8e5b..3d1effc78f 100644 --- a/compiler/tests/pil.rs +++ b/compiler/tests/pil.rs @@ -30,6 +30,7 @@ pub fn verify_pil_with_external_witness( query_callback, Some(BackendType::PilStarkCli), external_witness_values, + None, ); compiler::write_constants_to_fs(&result.constants, &temp_dir); @@ -51,6 +52,7 @@ fn gen_estark_proof(file_name: &str, inputs: Vec) { true, Some(BackendType::EStark), vec![], + None, ) .unwrap(); } @@ -68,6 +70,7 @@ fn gen_halo2_proof(file_name: &str, inputs: Vec) { true, Some(BackendType::Halo2), vec![], + None, ) .unwrap(); } diff --git a/compiler/tests/powdr_std.rs b/compiler/tests/powdr_std.rs index 7f46d118aa..761dc0335a 100644 --- a/compiler/tests/powdr_std.rs +++ b/compiler/tests/powdr_std.rs @@ -26,6 +26,7 @@ fn gen_estark_proof(file_name: &str, inputs: Vec) { true, Some(backend::BackendType::EStark), vec![], + None, ) .unwrap(); } @@ -43,6 +44,7 @@ fn gen_halo2_proof(file_name: &str, inputs: Vec) { true, Some(backend::BackendType::Halo2Mock), vec![], + None, ) .unwrap(); } diff --git a/halo2/src/circuit_builder.rs b/halo2/src/circuit_builder.rs index f30770608e..3ca6177e78 100644 --- a/halo2/src/circuit_builder.rs +++ b/halo2/src/circuit_builder.rs @@ -117,6 +117,7 @@ pub(crate) fn analyzed_to_circuit( let identities = analyzed.identities_with_inlined_intermediate_polynomials(); for id in &identities { match id.kind { + // for the case of normal poly everything is in the left IdentityKind::Polynomial => { // polynomial identities. diff --git a/linker/src/lib.rs b/linker/src/lib.rs index a106b1a69d..093c357749 100644 --- a/linker/src/lib.rs +++ b/linker/src/lib.rs @@ -101,7 +101,7 @@ pub fn link(graph: PILGraph) -> Result, Vec( + " + #[attribute] + { f } is { g };", + ) + .unwrap(); + assert_eq!( + parsed, + PILFile(vec![PilStatement::PermutationIdentity( + 13, + Some("attribute".to_string()), SelectedExpressions { selector: None, expressions: vec![direct_reference("f")] diff --git a/parser/src/powdr.lalrpop b/parser/src/powdr.lalrpop index 4682c19661..763a5fd888 100644 --- a/parser/src/powdr.lalrpop +++ b/parser/src/powdr.lalrpop @@ -127,7 +127,7 @@ PolynomialCommitDeclaration: PilStatement = { } PolynomialIdentity: PilStatement = { - "=" => PilStatement::PolynomialIdentity(start, Expression::BinaryOperation(l, BinaryOperator::Sub, r)) + "=" => PilStatement::PolynomialIdentity(start, attr, Expression::BinaryOperation(l, BinaryOperator::Sub, r)) } PolynomialNameList: Vec> = { @@ -139,7 +139,7 @@ PolynomialName: PolynomialName = { } PlookupIdentity: PilStatement = { - <@L> "in" => PilStatement::PlookupIdentity(<>) + <@L> "in" => PilStatement::PlookupIdentity(<>) } SelectedExpressions: SelectedExpressions> = { @@ -147,8 +147,12 @@ SelectedExpressions: SelectedExpressions> = { Expression => SelectedExpressions{selector: None, expressions: vec![<>]}, } +Attribute: String = { + "#[" "]" => <>.to_string() +} + PermutationIdentity: PilStatement = { - <@L> "is" => PilStatement::PermutationIdentity(<>) + <@L> "is" => PilStatement::PermutationIdentity(<>) } ConnectIdentity: PilStatement = { diff --git a/pil_analyzer/src/condenser.rs b/pil_analyzer/src/condenser.rs index 0cd8c8edeb..6a8f56f677 100644 --- a/pil_analyzer/src/condenser.rs +++ b/pil_analyzer/src/condenser.rs @@ -119,6 +119,7 @@ impl Condenser { .map(|constraint| Identity { id: identity.id, kind: identity.kind, + attribute: identity.attribute.clone(), source: identity.source.clone(), left: SelectedExpressions { selector: Some(constraint), @@ -131,6 +132,7 @@ impl Condenser { vec![Identity { id: identity.id, kind: identity.kind, + attribute: identity.attribute.clone(), source: identity.source.clone(), left: self.condense_selected_expressions(&identity.left), right: self.condense_selected_expressions(&identity.right), diff --git a/pil_analyzer/src/statement_processor.rs b/pil_analyzer/src/statement_processor.rs index 42511d7b6f..5bb02bbd15 100644 --- a/pil_analyzer/src/statement_processor.rs +++ b/pil_analyzer/src/statement_processor.rs @@ -198,32 +198,45 @@ where } fn handle_identity_statement(&mut self, statement: PilStatement) -> Vec> { - let (start, kind, left, right) = match statement { - PilStatement::PolynomialIdentity(start, expression) - | PilStatement::Expression(start, expression) => ( + let (start, kind, attribute, left, right) = match statement { + PilStatement::PolynomialIdentity(start, attr, expression) => ( start, IdentityKind::Polynomial, + attr, SelectedExpressions { selector: Some(self.process_expression(expression)), expressions: vec![], }, SelectedExpressions::default(), ), - PilStatement::PlookupIdentity(start, key, haystack) => ( + PilStatement::Expression(start, expression) => ( + start, + IdentityKind::Polynomial, + None, + SelectedExpressions { + selector: Some(self.process_expression(expression)), + expressions: vec![], + }, + SelectedExpressions::default(), + ), + PilStatement::PlookupIdentity(start, attribute, key, haystack) => ( start, IdentityKind::Plookup, + attribute.clone(), self.process_selected_expressions(key), self.process_selected_expressions(haystack), ), - PilStatement::PermutationIdentity(start, left, right) => ( + PilStatement::PermutationIdentity(start, attribute, left, right) => ( start, IdentityKind::Permutation, + attribute.clone(), self.process_selected_expressions(left), self.process_selected_expressions(right), ), PilStatement::ConnectIdentity(start, left, right) => ( start, IdentityKind::Connect, + None, SelectedExpressions { selector: None, expressions: self.expression_processor().process_expressions(left), @@ -242,6 +255,7 @@ where vec![PILItem::Identity(Identity { id: self.counters.dispense_identity_id(kind), kind, + attribute, source: self.driver.source_position_to_source_ref(start), left, right, diff --git a/powdr_cli/src/main.rs b/powdr_cli/src/main.rs index f62b318eb8..bfc4943795 100644 --- a/powdr_cli/src/main.rs +++ b/powdr_cli/src/main.rs @@ -101,6 +101,10 @@ enum Commands { #[arg(value_parser = clap_enum_variants!(CsvRenderModeCLI))] csv_mode: CsvRenderModeCLI, + /// BBerg: Name of the output file for bberg + #[arg(long)] + bname: Option, + /// Just execute in the RISCV/Powdr executor #[arg(short, long)] #[arg(default_value_t = false)] @@ -422,6 +426,7 @@ fn run_command(command: Commands) { prove_with, export_csv, csv_mode, + bname, just_execute, continuations, } => match (just_execute, continuations) { @@ -452,7 +457,8 @@ fn run_command(command: Commands) { force, prove_with, export_csv, - csv_mode + csv_mode, + bname )) { Ok(()) => {} Err(errors) => { @@ -603,6 +609,7 @@ fn handle_riscv_asm( force_overwrite, prove_with, vec![], + None, )?; } } @@ -773,6 +780,7 @@ fn compile_with_csv_export( prove_with: Option, export_csv: bool, csv_mode: CsvRenderModeCLI, + bname: Option, ) -> Result<(), Vec> { let external_witness_values = witness_values .map(|csv_path| { @@ -794,6 +802,7 @@ fn compile_with_csv_export( force, prove_with.clone(), external_witness_values, + bname, )?; if let Some(ref compilation_result) = result { @@ -880,7 +889,7 @@ fn read_and_prove( }); let is_aggr = proof.is_some(); - let (proof, constraints_serialization) = backend.prove(&pil, &fixed.0, &witness.0, proof); + let (proof, constraints_serialization) = backend.prove(&pil, &fixed.0, &witness.0, proof, None); write_proving_results_to_fs(is_aggr, &proof, &constraints_serialization, dir); } @@ -975,6 +984,7 @@ mod test { prove_with: Some(BackendType::PilStarkCli), export_csv: true, csv_mode: CsvRenderModeCLI::Hex, + bname: Some("Example".into()), just_execute: false, continuations: false, }; diff --git a/riscv/tests/common/mod.rs b/riscv/tests/common/mod.rs index d34d062132..505b411f1f 100644 --- a/riscv/tests/common/mod.rs +++ b/riscv/tests/common/mod.rs @@ -29,6 +29,7 @@ pub fn verify_riscv_asm_string(file_name: &str, contents: &str, inputs: Vec 1, _ => 0, } }; + col fixed FIRST(i) { match i { + 0 => 1, + _ => 0, + } }; col witness x, y; - ISLAST * (y' - 1) = 0; - ISLAST * (x' - 1) = 0; + LAST * (y' - 1) = 0; + LAST * (x' - 1) = 0; + + (1-LAST) * (x' - y) = 0; + (1-LAST) * (y' - (x + y)) = 0; - (1-ISLAST) * (x' - y) = 0; - (1-ISLAST) * (y' - (x + y)) = 0; public out = y(%N-1); diff --git a/type_check/src/lib.rs b/type_check/src/lib.rs index 0616f93627..547d42cd1d 100644 --- a/type_check/src/lib.rs +++ b/type_check/src/lib.rs @@ -318,9 +318,14 @@ impl TypeChecker { let errors: Vec<_> = statements .iter() .filter_map(|s| match s { - ast::parsed::PilStatement::PolynomialIdentity(_, _) => None, - ast::parsed::PilStatement::PermutationIdentity(_, l, _) - | ast::parsed::PilStatement::PlookupIdentity(_, l, _) => l + ast::parsed::PilStatement::PolynomialIdentity(_, _, _) => None, + ast::parsed::PilStatement::PermutationIdentity( + _, // + _, // + l, + _, + ) + | ast::parsed::PilStatement::PlookupIdentity(_, _, l, _) => l .selector .is_some() .then_some(format!("LHS selector not yet supported in {s}.")),