From 3b2d87fd083e796d8d057ecac958e9dd7b50f503 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Thu, 9 Nov 2023 15:14:59 +0530 Subject: [PATCH 01/41] initial commit for risc0 hash benchmark --- hash/risc0/bench/.gitignore | 4 + hash/risc0/bench/.vscode/settings.json | 5 + hash/risc0/bench/Cargo.toml | 17 ++ hash/risc0/bench/LICENSE | 201 ++++++++++++++++++ hash/risc0/bench/README.md | 101 +++++++++ hash/risc0/bench/host/Cargo.toml | 21 ++ .../bench/host/benches/sha256_benchmarks.rs | 46 ++++ hash/risc0/bench/host/src/lib.rs | 71 +++++++ hash/risc0/bench/methods/Cargo.toml | 10 + hash/risc0/bench/methods/build.rs | 3 + hash/risc0/bench/methods/guest/Cargo.toml | 10 + hash/risc0/bench/methods/guest/src/main.rs | 24 +++ hash/risc0/bench/methods/src/lib.rs | 1 + hash/risc0/bench/rust-toolchain.toml | 4 + 14 files changed, 518 insertions(+) create mode 100644 hash/risc0/bench/.gitignore create mode 100644 hash/risc0/bench/.vscode/settings.json create mode 100644 hash/risc0/bench/Cargo.toml create mode 100644 hash/risc0/bench/LICENSE create mode 100644 hash/risc0/bench/README.md create mode 100644 hash/risc0/bench/host/Cargo.toml create mode 100644 hash/risc0/bench/host/benches/sha256_benchmarks.rs create mode 100644 hash/risc0/bench/host/src/lib.rs create mode 100644 hash/risc0/bench/methods/Cargo.toml create mode 100644 hash/risc0/bench/methods/build.rs create mode 100644 hash/risc0/bench/methods/guest/Cargo.toml create mode 100644 hash/risc0/bench/methods/guest/src/main.rs create mode 100644 hash/risc0/bench/methods/src/lib.rs create mode 100644 hash/risc0/bench/rust-toolchain.toml diff --git a/hash/risc0/bench/.gitignore b/hash/risc0/bench/.gitignore new file mode 100644 index 0000000..f4247e1 --- /dev/null +++ b/hash/risc0/bench/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +Cargo.lock +methods/guest/Cargo.lock +target/ diff --git a/hash/risc0/bench/.vscode/settings.json b/hash/risc0/bench/.vscode/settings.json new file mode 100644 index 0000000..4545fa6 --- /dev/null +++ b/hash/risc0/bench/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "rust-analyzer.linkedProjects": [ + "./methods/guest/Cargo.toml" + ] +} \ No newline at end of file diff --git a/hash/risc0/bench/Cargo.toml b/hash/risc0/bench/Cargo.toml new file mode 100644 index 0000000..5363877 --- /dev/null +++ b/hash/risc0/bench/Cargo.toml @@ -0,0 +1,17 @@ +[workspace] +resolver = "2" +members = ["host", "methods"] + +# Always optimize; building and running the guest takes much longer without optimization. +[profile.dev] +opt-level = 3 + +[profile.dev.build-override] +opt-level = 3 + +[profile.release] +debug = 1 +lto = true + +[profile.release.build-override] +opt-level = 3 diff --git a/hash/risc0/bench/LICENSE b/hash/risc0/bench/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/hash/risc0/bench/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hash/risc0/bench/README.md b/hash/risc0/bench/README.md new file mode 100644 index 0000000..f1d1022 --- /dev/null +++ b/hash/risc0/bench/README.md @@ -0,0 +1,101 @@ +# RISC Zero Rust Starter Template + +Welcome to the RISC Zero Rust Starter Template! This template is intended to +give you a starting point for building a project using the RISC Zero zkVM. +Throughout the template (including in this README), you'll find comments +labelled `TODO` in places where you'll need to make changes. To better +understand the concepts behind this template, check out the [zkVM +Overview][zkvm-overview]. + +## Quick Start + +First, make sure [rustup] is installed. The +[`rust-toolchain.toml`][rust-toolchain] file will be used by `cargo` to +automatically install the correct version. + +To build all methods and execute the method within the zkVM, run the following +command: + +```bash +cargo run +``` + +This is an empty template, and so there is no expected output (until you modify +the code). + +### Running proofs remotely on Bonsai + +_Note: The Bonsai proving service is still in early Alpha; an API key is +required for access. [Click here to request access][bonsai access]._ + +If you have access to the URL and API key to Bonsai you can run your proofs +remotely. To prove in Bonsai mode, invoke `cargo run` with two additional +environment variables: + +```bash +BONSAI_API_KEY="YOUR_API_KEY" BONSAI_API_URL="BONSAI_URL" cargo run +``` + +## How to create a project based on this template + +Search this template for the string `TODO`, and make the necessary changes to +implement the required feature described by the `TODO` comment. Some of these +changes will be complex, and so we have a number of instructional resources to +assist you in learning how to write your own code for the RISC Zero zkVM: + +- The [RISC Zero Developer Docs][dev-docs] is a great place to get started. +- Example projects are available in the [examples folder][examples] of + [`risc0`][risc0-repo] repository. +- Reference documentation is available at [https://docs.rs][docs.rs], including + [`risc0-zkvm`][risc0-zkvm], [`cargo-risczero`][cargo-risczero], + [`risc0-build`][risc0-build], and [others][crates]. + +## Directory Structure + +It is possible to organize the files for these components in various ways. +However, in this starter template we use a standard directory structure for zkVM +applications, which we think is a good starting point for your applications. + +```text +project_name +├── Cargo.toml +├── host +│ ├── Cargo.toml +│ └── src +│ └── main.rs <-- [Host code goes here] +└── methods + ├── Cargo.toml + ├── build.rs + ├── guest + │ ├── Cargo.toml + │ └── src + │ └── bin + │ └── method_name.rs <-- [Guest code goes here] + └── src + └── lib.rs +``` + +## Video Tutorial + +For a walk-through of how to build with this template, check out this [excerpt +from our workshop at ZK HACK III][zkhack-iii]. + +## Questions, Feedback, and Collaborations + +We'd love to hear from you on [Discord][discord] or [Twitter][twitter]. + +[bonsai access]: https://bonsai.xyz/apply +[cargo-risczero]: https://docs.rs/cargo-risczero +[crates]: https://github.com/risc0/risc0/blob/main/README.md#rust-binaries +[dev-docs]: https://dev.risczero.com +[discord]: https://discord.gg/risczero +[docs.rs]: https://docs.rs/releases/search?query=risc0 +[examples]: https://github.com/risc0/risc0/tree/main/examples +[risc0-build]: https://docs.rs/risc0-build +[risc0-repo]: https://www.github.com/risc0/risc0 +[risc0-zkvm]: https://docs.rs/risc0-zkvm +[rustup]: https://rustup.rs +[rust-toolchain]: rust-toolchain.toml +[twitter]: https://twitter.com/risczero +[zkvm-overview]: https://dev.risczero.com/zkvm +[zkhack-iii]: https://www.youtube.com/watch?v=Yg_BGqj_6lg&list=PLcPzhUaCxlCgig7ofeARMPwQ8vbuD6hC5&index=5 diff --git a/hash/risc0/bench/host/Cargo.toml b/hash/risc0/bench/host/Cargo.toml new file mode 100644 index 0000000..c28882c --- /dev/null +++ b/hash/risc0/bench/host/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "host" +version = "0.1.0" +edition = "2021" + +[dependencies] +methods = { path = "../methods" } +risc0-zkvm = { version = "0.19.0" } +serde = "1.0" +rand = "0.8.5" + +[dev-dependencies] +criterion = "0.5.1" + +[[bench]] +name = "sha256_benchmarks" +harness = false + +[[bin]] +name = "host" +path = "src/lib.rs" \ No newline at end of file diff --git a/hash/risc0/bench/host/benches/sha256_benchmarks.rs b/hash/risc0/bench/host/benches/sha256_benchmarks.rs new file mode 100644 index 0000000..fb0d9d5 --- /dev/null +++ b/hash/risc0/bench/host/benches/sha256_benchmarks.rs @@ -0,0 +1,46 @@ + +use host::sha_bench; +use criterion::{criterion_group, criterion_main, Criterion}; +use rand::RngCore; +fn sha256_1kb(c: &mut Criterion) { + c.bench_function("sha256_bench", |b| { + //generating 1kb of random data in a vector of u8 + let mut data = [0u8; 64]; + rand::thread_rng().fill_bytes(&mut data); + let input: Vec = data.to_vec(); + + // println!("{:?}", input); + b.iter(|| { + sha_bench(input.clone()); + // hasher.update(data); + // black_box(hasher.finalize()); + }); + }); + + c.bench_function("sha256_bench", |b| { + //generating 1kb of random data in a vector of u8 + let mut data = [0u8; 64]; + rand::thread_rng().fill_bytes(&mut data); + let input: Vec = data.to_vec(); + + // println!("{:?}", input); + b.iter(|| { + sha_bench(input.clone()); + // hasher.update(data); + // black_box(hasher.finalize()); + }); + }); + +} + +criterion_group!( + name = benches; + + // Setting the sample size to 10 for quick benchmarks + // Becuase running default number of samples(100) takes a lot of time + config = Criterion::default().sample_size(10); + targets = sha256_1kb +); + +// criterion_group!(benches, sha256_bench); +criterion_main!(benches); diff --git a/hash/risc0/bench/host/src/lib.rs b/hash/risc0/bench/host/src/lib.rs new file mode 100644 index 0000000..8ff50cd --- /dev/null +++ b/hash/risc0/bench/host/src/lib.rs @@ -0,0 +1,71 @@ +// These constants represent the RISC-V ELF and the image ID generated by risc0-build. +// The ELF is used for proving and the ID is used for verification. +use methods::{ + METHOD_ELF, METHOD_ID +}; +use risc0_zkvm::{default_prover, ExecutorEnv}; +use risc0_zkvm::{ sha}; + +pub fn sha_bench(input: Vec) { + // An executor environment describes the configurations for the zkVM + // including program inputs. + // An default ExecutorEnv can be created like so: + // `let env = ExecutorEnv::builder().build().unwrap();` + // However, this `env` does not have any inputs. + // + // To add add guest input to the executor environment, use + // ExecutorEnvBuilder::write(). + // To access this method, you'll need to use ExecutorEnv::builder(), which + // creates an ExecutorEnvBuilder. When you're done adding input, call + // ExecutorEnvBuilder::build(). + + // For example: + // let input: u32 = 15*2^27 + 1; + // let input: Vec = data.to_vec(); + let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); + + // Obtain the default prover. + let prover = default_prover(); + + // Produce a receipt by proving the specified ELF binary. + let receipt = prover.prove_elf(env, METHOD_ELF).unwrap(); + + // TODO: Implement code for retrieving receipt journal here. + + // For example: + let _output: sha::Digest = receipt.journal.decode().unwrap(); + // println!("output: {:?}", _output); + // Optional: Verify receipt to confirm that recipients will also be able to + // verify your receipt + // receipt.verify(METHOD_ID).unwrap(); +} + +fn main() { + sha_bench(vec![97, 98, 99, 100, 101, 102, 103, 104]); +} + +// #[cfg(test)] +// mod benches { +// extern crate criterion; + +// use criterion::{black_box, criterion_group, criterion_main, Criterion}; +// use crate::main as your_function_to_benchmark; +// // Your benchmark function + +// fn my_benchmark(c: &mut Criterion) { +// c.bench_function("my_function", |b| { +// b.iter(|| { +// // Code to benchmark +// let result = your_function_to_benchmark(); +// black_box(result); +// }); +// }); +// } + +// // Define other benchmark functions here + +// criterion_group!(benches, my_benchmark); +// criterion_main!(benches); +// } + + diff --git a/hash/risc0/bench/methods/Cargo.toml b/hash/risc0/bench/methods/Cargo.toml new file mode 100644 index 0000000..30d237a --- /dev/null +++ b/hash/risc0/bench/methods/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "methods" +version = "0.1.0" +edition = "2021" + +[build-dependencies] +risc0-build = { version = "0.19.0" } + +[package.metadata.risc0] +methods = ["guest"] diff --git a/hash/risc0/bench/methods/build.rs b/hash/risc0/bench/methods/build.rs new file mode 100644 index 0000000..08a8a4e --- /dev/null +++ b/hash/risc0/bench/methods/build.rs @@ -0,0 +1,3 @@ +fn main() { + risc0_build::embed_methods(); +} diff --git a/hash/risc0/bench/methods/guest/Cargo.toml b/hash/risc0/bench/methods/guest/Cargo.toml new file mode 100644 index 0000000..550f6bf --- /dev/null +++ b/hash/risc0/bench/methods/guest/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "method" +version = "0.1.0" +edition = "2021" + +[workspace] + +[dependencies] +# If you want to try (experimental) std support, add `features = [ "std" ]` to risc0-zkvm +risc0-zkvm = { version = "0.19.0", default-features = false, features = [ "std" ] } diff --git a/hash/risc0/bench/methods/guest/src/main.rs b/hash/risc0/bench/methods/guest/src/main.rs new file mode 100644 index 0000000..ceffa06 --- /dev/null +++ b/hash/risc0/bench/methods/guest/src/main.rs @@ -0,0 +1,24 @@ +#![no_main] +// If you want to try std support, also update the guest Cargo.toml file + + +use risc0_zkvm::{guest::env, sha, sha::Sha256}; + +risc0_zkvm::guest::entry!(main); + + +pub fn main() { + // // TODO: Implement your guest code here + + // // read the input + // let input: u32 = env::read(); + + // // TODO: do something with the input + + // // write public output to the journal + // env::commit(&input); + + let data: Vec = env::read(); + let hash = sha::Impl::hash_bytes(&data); + env::commit(&hash) +} diff --git a/hash/risc0/bench/methods/src/lib.rs b/hash/risc0/bench/methods/src/lib.rs new file mode 100644 index 0000000..1bdb308 --- /dev/null +++ b/hash/risc0/bench/methods/src/lib.rs @@ -0,0 +1 @@ +include!(concat!(env!("OUT_DIR"), "/methods.rs")); diff --git a/hash/risc0/bench/rust-toolchain.toml b/hash/risc0/bench/rust-toolchain.toml new file mode 100644 index 0000000..36614c3 --- /dev/null +++ b/hash/risc0/bench/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "stable" +components = ["rustfmt", "rust-src"] +profile = "minimal" From b2bdaac8b453e13eb7d66fc0f55923f441264289 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Thu, 9 Nov 2023 21:23:52 +0530 Subject: [PATCH 02/41] sha256 benchmark added --- .../bench/host/benches/sha256_benchmarks.rs | 68 ++++++++++++++++--- hash/risc0/bench/host/src/lib.rs | 29 +------- 2 files changed, 59 insertions(+), 38 deletions(-) diff --git a/hash/risc0/bench/host/benches/sha256_benchmarks.rs b/hash/risc0/bench/host/benches/sha256_benchmarks.rs index fb0d9d5..c695809 100644 --- a/hash/risc0/bench/host/benches/sha256_benchmarks.rs +++ b/hash/risc0/bench/host/benches/sha256_benchmarks.rs @@ -2,8 +2,8 @@ use host::sha_bench; use criterion::{criterion_group, criterion_main, Criterion}; use rand::RngCore; -fn sha256_1kb(c: &mut Criterion) { - c.bench_function("sha256_bench", |b| { +fn sha256_benchmarks(c: &mut Criterion) { + c.bench_function("Benchmarking sha256 on 1KB of random data:", |b| { //generating 1kb of random data in a vector of u8 let mut data = [0u8; 64]; rand::thread_rng().fill_bytes(&mut data); @@ -12,34 +12,80 @@ fn sha256_1kb(c: &mut Criterion) { // println!("{:?}", input); b.iter(|| { sha_bench(input.clone()); - // hasher.update(data); - // black_box(hasher.finalize()); }); }); - c.bench_function("sha256_bench", |b| { - //generating 1kb of random data in a vector of u8 - let mut data = [0u8; 64]; + c.bench_function("Benchmarking sha256 on 2KB of random data:", |b| { + //generating 2kb of random data in a vector of u8 + let mut data = [0u8; 128]; rand::thread_rng().fill_bytes(&mut data); let input: Vec = data.to_vec(); // println!("{:?}", input); b.iter(|| { sha_bench(input.clone()); - // hasher.update(data); - // black_box(hasher.finalize()); + + }); + }); + + c.bench_function("Benchmarking sha256 on 10KB of random data:", |b| { + //generating 10kb of random data in a vector of u8 + let mut data = [0u8; 1280]; + rand::thread_rng().fill_bytes(&mut data); + let input: Vec = data.to_vec(); + + b.iter(|| { + sha_bench(input.clone()); }); }); - } +// fn sha256_benchmarks_2(c: &mut Criterion) { +// c.bench_function("Benchmarking sha256 on 1KB of random data:", |b| { +// //generating 1kb of random data in a vector of u8 +// let mut data = [0u8; 64]; +// rand::thread_rng().fill_bytes(&mut data); +// let input: Vec = data.to_vec(); + +// // println!("{:?}", input); +// b.iter(|| { +// sha_bench(input.clone()); +// }); +// }); + +// // c.bench_function("Benchmarking sha256 on 2KB of random data:", |b| { +// // //generating 2kb of random data in a vector of u8 +// // let mut data = [0u8; 128]; +// // rand::thread_rng().fill_bytes(&mut data); +// // let input: Vec = data.to_vec(); + +// // // println!("{:?}", input); +// // b.iter(|| { +// // sha_bench(input.clone()); + +// // }); +// // }); + +// // c.bench_function("Benchmarking sha256 on 10KB of random data:", |b| { +// // //generating 10kb of random data in a vector of u8 +// // let mut data = [0u8; 1280]; +// // rand::thread_rng().fill_bytes(&mut data); +// // let input: Vec = data.to_vec(); + +// // b.iter(|| { +// // sha_bench(input.clone()); +// // }); +// // }); + +// } + criterion_group!( name = benches; // Setting the sample size to 10 for quick benchmarks // Becuase running default number of samples(100) takes a lot of time config = Criterion::default().sample_size(10); - targets = sha256_1kb + targets = sha256_benchmarks //, sha256_benchmarks_2 ); // criterion_group!(benches, sha256_bench); diff --git a/hash/risc0/bench/host/src/lib.rs b/hash/risc0/bench/host/src/lib.rs index 8ff50cd..2d48276 100644 --- a/hash/risc0/bench/host/src/lib.rs +++ b/hash/risc0/bench/host/src/lib.rs @@ -37,35 +37,10 @@ pub fn sha_bench(input: Vec) { // println!("output: {:?}", _output); // Optional: Verify receipt to confirm that recipients will also be able to // verify your receipt - // receipt.verify(METHOD_ID).unwrap(); + receipt.verify(METHOD_ID).unwrap(); } +#[allow(dead_code)] fn main() { sha_bench(vec![97, 98, 99, 100, 101, 102, 103, 104]); } - -// #[cfg(test)] -// mod benches { -// extern crate criterion; - -// use criterion::{black_box, criterion_group, criterion_main, Criterion}; -// use crate::main as your_function_to_benchmark; -// // Your benchmark function - -// fn my_benchmark(c: &mut Criterion) { -// c.bench_function("my_function", |b| { -// b.iter(|| { -// // Code to benchmark -// let result = your_function_to_benchmark(); -// black_box(result); -// }); -// }); -// } - -// // Define other benchmark functions here - -// criterion_group!(benches, my_benchmark); -// criterion_main!(benches); -// } - - From e564b28e8efb76e87e632f1a8e983c2c5272a101 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Thu, 9 Nov 2023 22:03:38 +0530 Subject: [PATCH 03/41] script for building & benchmark running added, code cleaning --- hash/risc0/bench/build.sh | 4 ++ .../bench/host/benches/sha256_benchmarks.rs | 42 +------------------ hash/risc0/bench/host/src/lib.rs | 25 ++--------- hash/risc0/bench/methods/guest/src/main.rs | 12 ------ hash/risc0/bench/run.sh | 4 ++ 5 files changed, 13 insertions(+), 74 deletions(-) create mode 100755 hash/risc0/bench/build.sh create mode 100755 hash/risc0/bench/run.sh diff --git a/hash/risc0/bench/build.sh b/hash/risc0/bench/build.sh new file mode 100755 index 0000000..6870477 --- /dev/null +++ b/hash/risc0/bench/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Run the 'cargo bench' command. +cargo build --release diff --git a/hash/risc0/bench/host/benches/sha256_benchmarks.rs b/hash/risc0/bench/host/benches/sha256_benchmarks.rs index c695809..c53e015 100644 --- a/hash/risc0/bench/host/benches/sha256_benchmarks.rs +++ b/hash/risc0/bench/host/benches/sha256_benchmarks.rs @@ -40,53 +40,13 @@ fn sha256_benchmarks(c: &mut Criterion) { }); } -// fn sha256_benchmarks_2(c: &mut Criterion) { -// c.bench_function("Benchmarking sha256 on 1KB of random data:", |b| { -// //generating 1kb of random data in a vector of u8 -// let mut data = [0u8; 64]; -// rand::thread_rng().fill_bytes(&mut data); -// let input: Vec = data.to_vec(); - -// // println!("{:?}", input); -// b.iter(|| { -// sha_bench(input.clone()); -// }); -// }); - -// // c.bench_function("Benchmarking sha256 on 2KB of random data:", |b| { -// // //generating 2kb of random data in a vector of u8 -// // let mut data = [0u8; 128]; -// // rand::thread_rng().fill_bytes(&mut data); -// // let input: Vec = data.to_vec(); - -// // // println!("{:?}", input); -// // b.iter(|| { -// // sha_bench(input.clone()); - -// // }); -// // }); - -// // c.bench_function("Benchmarking sha256 on 10KB of random data:", |b| { -// // //generating 10kb of random data in a vector of u8 -// // let mut data = [0u8; 1280]; -// // rand::thread_rng().fill_bytes(&mut data); -// // let input: Vec = data.to_vec(); - -// // b.iter(|| { -// // sha_bench(input.clone()); -// // }); -// // }); - -// } - criterion_group!( name = benches; // Setting the sample size to 10 for quick benchmarks // Becuase running default number of samples(100) takes a lot of time config = Criterion::default().sample_size(10); - targets = sha256_benchmarks //, sha256_benchmarks_2 + targets = sha256_benchmarks ); -// criterion_group!(benches, sha256_bench); criterion_main!(benches); diff --git a/hash/risc0/bench/host/src/lib.rs b/hash/risc0/bench/host/src/lib.rs index 2d48276..3db39b1 100644 --- a/hash/risc0/bench/host/src/lib.rs +++ b/hash/risc0/bench/host/src/lib.rs @@ -1,5 +1,3 @@ -// These constants represent the RISC-V ELF and the image ID generated by risc0-build. -// The ELF is used for proving and the ID is used for verification. use methods::{ METHOD_ELF, METHOD_ID }; @@ -7,21 +5,7 @@ use risc0_zkvm::{default_prover, ExecutorEnv}; use risc0_zkvm::{ sha}; pub fn sha_bench(input: Vec) { - // An executor environment describes the configurations for the zkVM - // including program inputs. - // An default ExecutorEnv can be created like so: - // `let env = ExecutorEnv::builder().build().unwrap();` - // However, this `env` does not have any inputs. - // - // To add add guest input to the executor environment, use - // ExecutorEnvBuilder::write(). - // To access this method, you'll need to use ExecutorEnv::builder(), which - // creates an ExecutorEnvBuilder. When you're done adding input, call - // ExecutorEnvBuilder::build(). - - // For example: - // let input: u32 = 15*2^27 + 1; - // let input: Vec = data.to_vec(); + // Build an executor environment with the input. let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); // Obtain the default prover. @@ -30,17 +14,16 @@ pub fn sha_bench(input: Vec) { // Produce a receipt by proving the specified ELF binary. let receipt = prover.prove_elf(env, METHOD_ELF).unwrap(); - // TODO: Implement code for retrieving receipt journal here. - // For example: let _output: sha::Digest = receipt.journal.decode().unwrap(); - // println!("output: {:?}", _output); - // Optional: Verify receipt to confirm that recipients will also be able to + // verify your receipt receipt.verify(METHOD_ID).unwrap(); } #[allow(dead_code)] fn main() { + // This is a dummy call for the sha256 execution. + // Benchmarking does not depend on this. sha_bench(vec![97, 98, 99, 100, 101, 102, 103, 104]); } diff --git a/hash/risc0/bench/methods/guest/src/main.rs b/hash/risc0/bench/methods/guest/src/main.rs index ceffa06..aa4473f 100644 --- a/hash/risc0/bench/methods/guest/src/main.rs +++ b/hash/risc0/bench/methods/guest/src/main.rs @@ -1,22 +1,10 @@ #![no_main] -// If you want to try std support, also update the guest Cargo.toml file - use risc0_zkvm::{guest::env, sha, sha::Sha256}; risc0_zkvm::guest::entry!(main); - pub fn main() { - // // TODO: Implement your guest code here - - // // read the input - // let input: u32 = env::read(); - - // // TODO: do something with the input - - // // write public output to the journal - // env::commit(&input); let data: Vec = env::read(); let hash = sha::Impl::hash_bytes(&data); diff --git a/hash/risc0/bench/run.sh b/hash/risc0/bench/run.sh new file mode 100755 index 0000000..fb14795 --- /dev/null +++ b/hash/risc0/bench/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Run the 'cargo bench' command. +cargo bench From 9fa3fe54f67859789d37b1e2bf722f76401ca46a Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Mon, 20 Nov 2023 14:35:03 +0530 Subject: [PATCH 04/41] passing cli argument added and run.sh modified accordingly --- hash/risc0/bench/host/Cargo.toml | 9 ++-- hash/risc0/bench/host/benches/bench_main.rs | 44 +++++++++++++++++++ .../bench/host/benches/benchmarks/mod.rs | 1 + .../{ => benchmarks}/sha256_benchmarks.rs | 36 +++++++-------- hash/risc0/bench/host/src/lib.rs | 7 +-- hash/risc0/bench/host/src/main.rs | 4 ++ hash/risc0/bench/run.sh | 15 ++++++- 7 files changed, 82 insertions(+), 34 deletions(-) create mode 100644 hash/risc0/bench/host/benches/bench_main.rs create mode 100644 hash/risc0/bench/host/benches/benchmarks/mod.rs rename hash/risc0/bench/host/benches/{ => benchmarks}/sha256_benchmarks.rs (53%) create mode 100644 hash/risc0/bench/host/src/main.rs diff --git a/hash/risc0/bench/host/Cargo.toml b/hash/risc0/bench/host/Cargo.toml index c28882c..1747bba 100644 --- a/hash/risc0/bench/host/Cargo.toml +++ b/hash/risc0/bench/host/Cargo.toml @@ -8,14 +8,11 @@ methods = { path = "../methods" } risc0-zkvm = { version = "0.19.0" } serde = "1.0" rand = "0.8.5" +clap = {version = "4.4.8", features = [ "derive" ]} [dev-dependencies] -criterion = "0.5.1" +criterion = {version ="0.5.1", default-features = false} [[bench]] -name = "sha256_benchmarks" +name = "bench_main" harness = false - -[[bin]] -name = "host" -path = "src/lib.rs" \ No newline at end of file diff --git a/hash/risc0/bench/host/benches/bench_main.rs b/hash/risc0/bench/host/benches/bench_main.rs new file mode 100644 index 0000000..f6b5634 --- /dev/null +++ b/hash/risc0/bench/host/benches/bench_main.rs @@ -0,0 +1,44 @@ +use criterion::Criterion; +// use clap::Parser; +// use std::env; +mod benchmarks; + +fn main() { + let mut criterion: criterion::Criterion<_> = (Criterion::default().sample_size(10)).configure_from_args(); + match std::env::args().skip(1).next() { + Some(arg) => { + match arg.as_str() { + "1" => benchmarks::sha256_benchmarks::sha256_benchmarks_1kb(&mut criterion), + "2" => benchmarks::sha256_benchmarks::sha256_benchmarks_2kb(&mut criterion), + "10" => benchmarks::sha256_benchmarks::sha256_benchmarks_10kb(&mut criterion), + _ => eprintln!("Invalid benchmark argument: {}", arg), + } + } + None => {eprintln!("No benchmark")} + } + + criterion::Criterion::default().configure_from_args().final_summary(); + } + + +// #[derive(Parser)] +// #[command(author, version, about, long_about = None)] +// struct Args { +// #[clap(long, short)] +// run_benchmark_function_one: bool, +// #[clap(long, short)] +// run_benchmark_function_two: bool, +// } + +// fn main(){ +// let args: Args = Args::parse(); +// let mut criterion: criterion::Criterion<_> = (Criterion::default().sample_size(10)).configure_from_args(); + +// if args.run_benchmark_function_one { +// benchmarks::sha256_benchmarks::sha256_benchmarks1(&mut criterion); +// } +// if args.run_benchmark_function_two { +// benchmarks::sha256_benchmarks22::sha256_benchmarks123(&mut criterion); +// } +// criterion::Criterion::default().configure_from_args().final_summary(); +// } diff --git a/hash/risc0/bench/host/benches/benchmarks/mod.rs b/hash/risc0/bench/host/benches/benchmarks/mod.rs new file mode 100644 index 0000000..006d0a4 --- /dev/null +++ b/hash/risc0/bench/host/benches/benchmarks/mod.rs @@ -0,0 +1 @@ +pub mod sha256_benchmarks; \ No newline at end of file diff --git a/hash/risc0/bench/host/benches/sha256_benchmarks.rs b/hash/risc0/bench/host/benches/benchmarks/sha256_benchmarks.rs similarity index 53% rename from hash/risc0/bench/host/benches/sha256_benchmarks.rs rename to hash/risc0/bench/host/benches/benchmarks/sha256_benchmarks.rs index c53e015..0bd640b 100644 --- a/hash/risc0/bench/host/benches/sha256_benchmarks.rs +++ b/hash/risc0/bench/host/benches/benchmarks/sha256_benchmarks.rs @@ -1,9 +1,9 @@ - use host::sha_bench; -use criterion::{criterion_group, criterion_main, Criterion}; +use criterion::Criterion; use rand::RngCore; -fn sha256_benchmarks(c: &mut Criterion) { - c.bench_function("Benchmarking sha256 on 1KB of random data:", |b| { + +pub fn sha256_benchmarks_1kb(c: &mut Criterion) { + c.bench_function(" sha256 on 1KB of random data:", |b| { //generating 1kb of random data in a vector of u8 let mut data = [0u8; 64]; rand::thread_rng().fill_bytes(&mut data); @@ -14,8 +14,11 @@ fn sha256_benchmarks(c: &mut Criterion) { sha_bench(input.clone()); }); }); +} - c.bench_function("Benchmarking sha256 on 2KB of random data:", |b| { +pub fn sha256_benchmarks_2kb(c: &mut Criterion) { + + c.bench_function(" sha256 on 2KB of random data:", |b| { //generating 2kb of random data in a vector of u8 let mut data = [0u8; 128]; rand::thread_rng().fill_bytes(&mut data); @@ -27,26 +30,19 @@ fn sha256_benchmarks(c: &mut Criterion) { }); }); +} - c.bench_function("Benchmarking sha256 on 10KB of random data:", |b| { - //generating 10kb of random data in a vector of u8 - let mut data = [0u8; 1280]; +pub fn sha256_benchmarks_10kb(c: &mut Criterion) { + + //generating 10kb of random data in a vector of u8 + let mut data = [0u8; 1280]; rand::thread_rng().fill_bytes(&mut data); let input: Vec = data.to_vec(); + c.bench_function(" sha256 on 10KB of random data:", |b| { + b.iter(|| { sha_bench(input.clone()); }); }); -} - -criterion_group!( - name = benches; - - // Setting the sample size to 10 for quick benchmarks - // Becuase running default number of samples(100) takes a lot of time - config = Criterion::default().sample_size(10); - targets = sha256_benchmarks -); - -criterion_main!(benches); +} \ No newline at end of file diff --git a/hash/risc0/bench/host/src/lib.rs b/hash/risc0/bench/host/src/lib.rs index 3db39b1..5a25047 100644 --- a/hash/risc0/bench/host/src/lib.rs +++ b/hash/risc0/bench/host/src/lib.rs @@ -21,9 +21,4 @@ pub fn sha_bench(input: Vec) { receipt.verify(METHOD_ID).unwrap(); } -#[allow(dead_code)] -fn main() { - // This is a dummy call for the sha256 execution. - // Benchmarking does not depend on this. - sha_bench(vec![97, 98, 99, 100, 101, 102, 103, 104]); -} + diff --git a/hash/risc0/bench/host/src/main.rs b/hash/risc0/bench/host/src/main.rs new file mode 100644 index 0000000..3033f62 --- /dev/null +++ b/hash/risc0/bench/host/src/main.rs @@ -0,0 +1,4 @@ + +fn main() { + +} diff --git a/hash/risc0/bench/run.sh b/hash/risc0/bench/run.sh index fb14795..b9fc453 100755 --- a/hash/risc0/bench/run.sh +++ b/hash/risc0/bench/run.sh @@ -1,4 +1,15 @@ #!/bin/bash -# Run the 'cargo bench' command. -cargo bench +# Check if ZKBENCH_INPUT_SIZE_KB is set, otherwise set a default value +ZKBENCH_INPUT_SIZE_KB=${ZKBENCH_INPUT_SIZE_KB:-"1"} # Default to 1 if not set + +# Run benchmarks with the specified input size +if [ "$ZKBENCH_INPUT_SIZE_KB" = "1" ]; then + cargo bench --bench bench_main -- 1 +elif [ "$ZKBENCH_INPUT_SIZE_KB" = "2" ]; then + cargo bench --bench bench_main -- 2 +elif [ "$ZKBENCH_INPUT_SIZE_KB" = "10" ]; then + cargo bench --bench bench_main -- 10 +else + echo "Invalid input size: $ZKBENCH_INPUT_SIZE_KB" +fi From ffb423610a0b9fbe72582c5b8310b0c1f1fda5f7 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Fri, 8 Dec 2023 12:52:19 +0530 Subject: [PATCH 05/41] criterion benchmarking removed, benchmarking using std::time --- hash/risc0/bench/.gitignore | 4 - hash/risc0/bench/.vscode/settings.json | 5 - hash/risc0/bench/Cargo.lock | 2029 +++++++++++++++++ hash/risc0/bench/host/Cargo.toml | 9 +- hash/risc0/bench/host/benches/bench_main.rs | 44 - .../bench/host/benches/benchmarks/mod.rs | 1 - .../benches/benchmarks/sha256_benchmarks.rs | 48 - hash/risc0/bench/host/src/lib.rs | 24 - hash/risc0/bench/host/src/main.rs | 45 +- hash/risc0/bench/methods/guest/Cargo.lock | 442 ++++ hash/risc0/bench/methods/guest/Cargo.toml | 4 + hash/risc0/bench/run.sh | 16 +- 12 files changed, 2525 insertions(+), 146 deletions(-) delete mode 100644 hash/risc0/bench/.gitignore delete mode 100644 hash/risc0/bench/.vscode/settings.json create mode 100644 hash/risc0/bench/Cargo.lock delete mode 100644 hash/risc0/bench/host/benches/bench_main.rs delete mode 100644 hash/risc0/bench/host/benches/benchmarks/mod.rs delete mode 100644 hash/risc0/bench/host/benches/benchmarks/sha256_benchmarks.rs delete mode 100644 hash/risc0/bench/host/src/lib.rs create mode 100644 hash/risc0/bench/methods/guest/Cargo.lock diff --git a/hash/risc0/bench/.gitignore b/hash/risc0/bench/.gitignore deleted file mode 100644 index f4247e1..0000000 --- a/hash/risc0/bench/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.DS_Store -Cargo.lock -methods/guest/Cargo.lock -target/ diff --git a/hash/risc0/bench/.vscode/settings.json b/hash/risc0/bench/.vscode/settings.json deleted file mode 100644 index 4545fa6..0000000 --- a/hash/risc0/bench/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "rust-analyzer.linkedProjects": [ - "./methods/guest/Cargo.toml" - ] -} \ No newline at end of file diff --git a/hash/risc0/bench/Cargo.lock b/hash/risc0/bench/Cargo.lock new file mode 100644 index 0000000..e6179f9 --- /dev/null +++ b/hash/risc0/bench/Cargo.lock @@ -0,0 +1,2029 @@ +# 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", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + +[[package]] +name = "anstyle" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "autotools" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8da1805e028a172334c3b680f93e71126f2327622faef2ec3d893c0a4ad77" +dependencies = [ + "cc", +] + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[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 = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bonsai-sdk" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "296de0c044ff3207f2252415ca3b5789de384e5d9a64185a003416bf11096ceb" +dependencies = [ + "reqwest", + "serde", + "thiserror", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +dependencies = [ + "serde", +] + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[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 = "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 = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" +dependencies = [ + "anstyle", + "clap_lex", +] + +[[package]] +name = "clap_lex" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" + +[[package]] +name = "const-oid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "cpufeatures" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +dependencies = [ + "libc", +] + +[[package]] +name = "criterion" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" +dependencies = [ + "anes", + "cast", + "ciborium", + "clap", + "criterion-plot", + "is-terminal", + "itertools 0.10.5", + "num-traits", + "once_cell", + "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-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "docker-generate" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elf" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6e7d85896690fe195447717af8eceae0593ac2196fd42fe88c184e904406ce" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[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 = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" + +[[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-core", + "futures-io", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + +[[package]] +name = "h2" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 1.9.3", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" + +[[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.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 = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "host" +version = "0.1.0" +dependencies = [ + "criterion", + "methods", + "rand", + "risc0-zkvm", + "serde", +] + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.4.10", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "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.2", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi", + "rustix", + "windows-sys", +] + +[[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.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[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 = "linux-raw-sys" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "memchr" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "methods" +version = "0.1.0" +dependencies = [ + "risc0-build", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +dependencies = [ + "libc", + "wasi", + "windows-sys", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[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.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "oorandom" +version = "11.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + +[[package]] +name = "openssl" +version = "0.10.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a257ad03cd8fb16ad4172fedf8094451e1af1c4b70097636ef2eac9a5f0cc33" +dependencies = [ + "bitflags 2.4.1", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[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 = "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 = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[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 = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fdd22f3b9c31b53c060df4a0613a1c7f062d4115a2b984dd15b1858f7e340d" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bdf592881d821b83d471f8af290226c8d51402259e9bb5be7f9f8bdebbb11ac" +dependencies = [ + "bytes", + "heck", + "itertools 0.11.0", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" +dependencies = [ + "prost", +] + +[[package]] +name = "protobuf-src" +version = "1.1.0+21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" +dependencies = [ + "autotools", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[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", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[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", + "crossbeam-utils", +] + +[[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 = "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", +] + +[[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", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "risc0-binfmt" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b008c7506a6acb15f14a87e7e57797fd901cdf2f4eb560a032df4e1fc12790" +dependencies = [ + "anyhow", + "elf", + "log", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", +] + +[[package]] +name = "risc0-build" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c44fdc4ad18c946a26dc42ed95ffc1cfa09a18973e68e394b83840724a5ca7ab" +dependencies = [ + "anyhow", + "cargo_metadata", + "docker-generate", + "risc0-binfmt", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "serde_json", + "tempfile", +] + +[[package]] +name = "risc0-circuit-recursion" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924bbd4f27070f04556e10565441fbf64e399763a3f244819f84dc645590bca1" +dependencies = [ + "anyhow", + "bytemuck", + "log", + "risc0-core", + "risc0-zkp", + "tracing", +] + +[[package]] +name = "risc0-circuit-rv32im" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ac44b6493d73638018d62eccec93f2797795d286c6201e2a79d842a16bbb43f" +dependencies = [ + "anyhow", + "log", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "tracing", +] + +[[package]] +name = "risc0-core" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8d9ff7ca4b8a9ecf63e4567dfc5ab73ea4c4c20618cdd36d5c0eb69be80cb2" +dependencies = [ + "bytemuck", + "rand_core", +] + +[[package]] +name = "risc0-zkp" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1b8f047ec52f645e5e1c46f69303658f9cca96f0a2dcb78b4e7cadef5c2ac3d" +dependencies = [ + "anyhow", + "blake2", + "bytemuck", + "digest", + "hex", + "log", + "paste", + "rand_core", + "risc0-core", + "risc0-zkvm-platform", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4b51d8aa8a4b0a350cca2deb9ead841989ed601ca3091e33a8ee8e6f2453048" +dependencies = [ + "anyhow", + "bincode", + "bonsai-sdk", + "bytemuck", + "bytes", + "cfg-if", + "getrandom", + "hex", + "log", + "num-derive", + "num-traits", + "prost", + "prost-build", + "protobuf-src", + "risc0-binfmt", + "risc0-circuit-recursion", + "risc0-circuit-rv32im", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "rrs-lib", + "semver", + "serde", + "tracing", +] + +[[package]] +name = "risc0-zkvm-platform" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59e9d18c75958239e91213a181e836e28dfbede913e4de66fa36e2ad1d70fcdc" +dependencies = [ + "bytemuck", + "getrandom", + "libm", +] + +[[package]] +name = "rrs-lib" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" +dependencies = [ + "downcast-rs", + "paste", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustix" +version = "0.38.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[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 = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.192" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.192" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[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 = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys", +] + +[[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", + "quote", + "syn", +] + +[[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" +version = "1.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2 0.5.5", + "windows-sys", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[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", + "quote", + "syn", +] + +[[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 = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[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 = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[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 = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[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.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" + +[[package]] +name = "web-sys" +version = "0.3.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[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.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[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_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[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_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[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_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys", +] diff --git a/hash/risc0/bench/host/Cargo.toml b/hash/risc0/bench/host/Cargo.toml index 1747bba..22fd27f 100644 --- a/hash/risc0/bench/host/Cargo.toml +++ b/hash/risc0/bench/host/Cargo.toml @@ -7,12 +7,7 @@ edition = "2021" methods = { path = "../methods" } risc0-zkvm = { version = "0.19.0" } serde = "1.0" -rand = "0.8.5" -clap = {version = "4.4.8", features = [ "derive" ]} +rand = "0.8.3" [dev-dependencies] -criterion = {version ="0.5.1", default-features = false} - -[[bench]] -name = "bench_main" -harness = false +criterion = "0.5.1" diff --git a/hash/risc0/bench/host/benches/bench_main.rs b/hash/risc0/bench/host/benches/bench_main.rs deleted file mode 100644 index f6b5634..0000000 --- a/hash/risc0/bench/host/benches/bench_main.rs +++ /dev/null @@ -1,44 +0,0 @@ -use criterion::Criterion; -// use clap::Parser; -// use std::env; -mod benchmarks; - -fn main() { - let mut criterion: criterion::Criterion<_> = (Criterion::default().sample_size(10)).configure_from_args(); - match std::env::args().skip(1).next() { - Some(arg) => { - match arg.as_str() { - "1" => benchmarks::sha256_benchmarks::sha256_benchmarks_1kb(&mut criterion), - "2" => benchmarks::sha256_benchmarks::sha256_benchmarks_2kb(&mut criterion), - "10" => benchmarks::sha256_benchmarks::sha256_benchmarks_10kb(&mut criterion), - _ => eprintln!("Invalid benchmark argument: {}", arg), - } - } - None => {eprintln!("No benchmark")} - } - - criterion::Criterion::default().configure_from_args().final_summary(); - } - - -// #[derive(Parser)] -// #[command(author, version, about, long_about = None)] -// struct Args { -// #[clap(long, short)] -// run_benchmark_function_one: bool, -// #[clap(long, short)] -// run_benchmark_function_two: bool, -// } - -// fn main(){ -// let args: Args = Args::parse(); -// let mut criterion: criterion::Criterion<_> = (Criterion::default().sample_size(10)).configure_from_args(); - -// if args.run_benchmark_function_one { -// benchmarks::sha256_benchmarks::sha256_benchmarks1(&mut criterion); -// } -// if args.run_benchmark_function_two { -// benchmarks::sha256_benchmarks22::sha256_benchmarks123(&mut criterion); -// } -// criterion::Criterion::default().configure_from_args().final_summary(); -// } diff --git a/hash/risc0/bench/host/benches/benchmarks/mod.rs b/hash/risc0/bench/host/benches/benchmarks/mod.rs deleted file mode 100644 index 006d0a4..0000000 --- a/hash/risc0/bench/host/benches/benchmarks/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod sha256_benchmarks; \ No newline at end of file diff --git a/hash/risc0/bench/host/benches/benchmarks/sha256_benchmarks.rs b/hash/risc0/bench/host/benches/benchmarks/sha256_benchmarks.rs deleted file mode 100644 index 0bd640b..0000000 --- a/hash/risc0/bench/host/benches/benchmarks/sha256_benchmarks.rs +++ /dev/null @@ -1,48 +0,0 @@ -use host::sha_bench; -use criterion::Criterion; -use rand::RngCore; - -pub fn sha256_benchmarks_1kb(c: &mut Criterion) { - c.bench_function(" sha256 on 1KB of random data:", |b| { - //generating 1kb of random data in a vector of u8 - let mut data = [0u8; 64]; - rand::thread_rng().fill_bytes(&mut data); - let input: Vec = data.to_vec(); - - // println!("{:?}", input); - b.iter(|| { - sha_bench(input.clone()); - }); - }); -} - -pub fn sha256_benchmarks_2kb(c: &mut Criterion) { - - c.bench_function(" sha256 on 2KB of random data:", |b| { - //generating 2kb of random data in a vector of u8 - let mut data = [0u8; 128]; - rand::thread_rng().fill_bytes(&mut data); - let input: Vec = data.to_vec(); - - // println!("{:?}", input); - b.iter(|| { - sha_bench(input.clone()); - - }); - }); -} - -pub fn sha256_benchmarks_10kb(c: &mut Criterion) { - - //generating 10kb of random data in a vector of u8 - let mut data = [0u8; 1280]; - rand::thread_rng().fill_bytes(&mut data); - let input: Vec = data.to_vec(); - - c.bench_function(" sha256 on 10KB of random data:", |b| { - - b.iter(|| { - sha_bench(input.clone()); - }); - }); -} \ No newline at end of file diff --git a/hash/risc0/bench/host/src/lib.rs b/hash/risc0/bench/host/src/lib.rs deleted file mode 100644 index 5a25047..0000000 --- a/hash/risc0/bench/host/src/lib.rs +++ /dev/null @@ -1,24 +0,0 @@ -use methods::{ - METHOD_ELF, METHOD_ID -}; -use risc0_zkvm::{default_prover, ExecutorEnv}; -use risc0_zkvm::{ sha}; - -pub fn sha_bench(input: Vec) { - // Build an executor environment with the input. - let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); - - // Obtain the default prover. - let prover = default_prover(); - - // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove_elf(env, METHOD_ELF).unwrap(); - - // For example: - let _output: sha::Digest = receipt.journal.decode().unwrap(); - - // verify your receipt - receipt.verify(METHOD_ID).unwrap(); -} - - diff --git a/hash/risc0/bench/host/src/main.rs b/hash/risc0/bench/host/src/main.rs index 3033f62..afab626 100644 --- a/hash/risc0/bench/host/src/main.rs +++ b/hash/risc0/bench/host/src/main.rs @@ -1,4 +1,47 @@ +use methods::{ + METHOD_ELF, METHOD_ID +}; +use risc0_zkvm::{default_prover, ExecutorEnv}; +use risc0_zkvm::{ sha}; +// use rand::RngCore; +use rand::Rng; +use std::time::Instant; + +fn generate_bytes(size: usize) -> Vec { + let mut rng = rand::thread_rng(); + (0..size).map(|_| rng.gen()).collect() +} + +pub fn sha_bench(input: Vec) { + + let start_time = Instant::now(); + + let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); + + // Obtain the default prover. + let prover = default_prover(); + + // Produce a receipt by proving the specified ELF binary. + let receipt = prover.prove_elf(env, METHOD_ELF).unwrap(); + + // TODO: Implement code for retrieving receipt journal here. + + // For example: + let _output: sha::Digest = receipt.journal.decode().unwrap(); + + // verify your receipt + receipt.verify(METHOD_ID).unwrap(); + + let elapsed_time = start_time.elapsed(); + eprintln!("Total time: {:?}", elapsed_time); +} fn main() { - + let args: Vec = std::env::args().collect(); + eprintln!("{:?}", &args[1]); + // eprintln!("{:?}", &args[2]); + let size_kb = args[1].parse::().unwrap(); + eprintln!("{:?}", size_kb); + let input = generate_bytes(size_kb); + sha_bench(input); } diff --git a/hash/risc0/bench/methods/guest/Cargo.lock b/hash/risc0/bench/methods/guest/Cargo.lock new file mode 100644 index 0000000..b817f44 --- /dev/null +++ b/hash/risc0/bench/methods/guest/Cargo.lock @@ -0,0 +1,442 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + +[[package]] +name = "cpufeatures" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "elf" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6e7d85896690fe195447717af8eceae0593ac2196fd42fe88c184e904406ce" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[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 = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "method" +version = "0.1.0" +dependencies = [ + "risc0-zkvm", +] + +[[package]] +name = "num-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "proc-macro2" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "risc0-binfmt" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b008c7506a6acb15f14a87e7e57797fd901cdf2f4eb560a032df4e1fc12790" +dependencies = [ + "anyhow", + "elf", + "log", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", +] + +[[package]] +name = "risc0-circuit-recursion" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924bbd4f27070f04556e10565441fbf64e399763a3f244819f84dc645590bca1" +dependencies = [ + "anyhow", + "bytemuck", + "log", + "risc0-core", + "risc0-zkp", + "tracing", +] + +[[package]] +name = "risc0-circuit-rv32im" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ac44b6493d73638018d62eccec93f2797795d286c6201e2a79d842a16bbb43f" +dependencies = [ + "anyhow", + "log", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "tracing", +] + +[[package]] +name = "risc0-core" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8d9ff7ca4b8a9ecf63e4567dfc5ab73ea4c4c20618cdd36d5c0eb69be80cb2" +dependencies = [ + "bytemuck", + "rand_core", +] + +[[package]] +name = "risc0-zkp" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1b8f047ec52f645e5e1c46f69303658f9cca96f0a2dcb78b4e7cadef5c2ac3d" +dependencies = [ + "anyhow", + "blake2", + "bytemuck", + "digest", + "hex", + "log", + "paste", + "rand_core", + "risc0-core", + "risc0-zkvm-platform", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4b51d8aa8a4b0a350cca2deb9ead841989ed601ca3091e33a8ee8e6f2453048" +dependencies = [ + "anyhow", + "bytemuck", + "cfg-if", + "getrandom", + "hex", + "log", + "num-derive", + "num-traits", + "risc0-binfmt", + "risc0-circuit-recursion", + "risc0-circuit-rv32im", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "rrs-lib", + "semver", + "serde", + "tracing", +] + +[[package]] +name = "risc0-zkvm-platform" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59e9d18c75958239e91213a181e836e28dfbede913e4de66fa36e2ad1d70fcdc" +dependencies = [ + "bytemuck", + "getrandom", + "libm", +] + +[[package]] +name = "rrs-lib" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" +dependencies = [ + "downcast-rs", + "paste", +] + +[[package]] +name = "semver" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" + +[[package]] +name = "serde" +version = "1.0.192" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.192" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[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", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/hash/risc0/bench/methods/guest/Cargo.toml b/hash/risc0/bench/methods/guest/Cargo.toml index 550f6bf..8bcb40f 100644 --- a/hash/risc0/bench/methods/guest/Cargo.toml +++ b/hash/risc0/bench/methods/guest/Cargo.toml @@ -8,3 +8,7 @@ edition = "2021" [dependencies] # If you want to try (experimental) std support, add `features = [ "std" ]` to risc0-zkvm risc0-zkvm = { version = "0.19.0", default-features = false, features = [ "std" ] } + +# [lib] +# name = "guest" +# path = "src/mod.rs" \ No newline at end of file diff --git a/hash/risc0/bench/run.sh b/hash/risc0/bench/run.sh index b9fc453..03e2842 100755 --- a/hash/risc0/bench/run.sh +++ b/hash/risc0/bench/run.sh @@ -1,15 +1,7 @@ #!/bin/bash -# Check if ZKBENCH_INPUT_SIZE_KB is set, otherwise set a default value -ZKBENCH_INPUT_SIZE_KB=${ZKBENCH_INPUT_SIZE_KB:-"1"} # Default to 1 if not set +# Set a default value if ZKBENCH_INPUT_SIZE_KB is not set +: ${ZKBENCH_INPUT_SIZE_KB:=1024} -# Run benchmarks with the specified input size -if [ "$ZKBENCH_INPUT_SIZE_KB" = "1" ]; then - cargo bench --bench bench_main -- 1 -elif [ "$ZKBENCH_INPUT_SIZE_KB" = "2" ]; then - cargo bench --bench bench_main -- 2 -elif [ "$ZKBENCH_INPUT_SIZE_KB" = "10" ]; then - cargo bench --bench bench_main -- 10 -else - echo "Invalid input size: $ZKBENCH_INPUT_SIZE_KB" -fi +# Run cargo run with the specified environment variable +cargo run $ZKBENCH_INPUT_SIZE_KB From 0318e180329f61fb02316c9e6979c4aa9819d592 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Mon, 11 Dec 2023 18:26:36 +0530 Subject: [PATCH 06/41] benchmark for sha256 and keccak --- hash/risc0/bench/Cargo.lock | 475 ++++-------------- hash/risc0/bench/Cargo.toml | 17 +- hash/risc0/bench/host/Cargo.toml | 13 - hash/risc0/bench/methods/guest/Cargo.lock | 20 + hash/risc0/bench/methods/guest/Cargo.toml | 5 +- .../bench/methods/guest/src/bin/blake2b.rs | 15 + .../bench/methods/guest/src/bin/blake3.rs | 15 + .../bench/methods/guest/src/bin/keccak.rs | 15 + .../guest/src/{main.rs => bin/sha256.rs} | 1 - hash/risc0/bench/run.sh | 5 +- hash/risc0/bench/src/benches/blake2b.rs | 33 ++ hash/risc0/bench/src/benches/blake3.rs | 33 ++ hash/risc0/bench/src/benches/keccak.rs | 33 ++ hash/risc0/bench/src/benches/mod.rs | 2 + .../src/main.rs => src/benches/sha256.rs} | 24 +- hash/risc0/bench/src/main.rs | 44 ++ 16 files changed, 327 insertions(+), 423 deletions(-) delete mode 100644 hash/risc0/bench/host/Cargo.toml create mode 100644 hash/risc0/bench/methods/guest/src/bin/blake2b.rs create mode 100644 hash/risc0/bench/methods/guest/src/bin/blake3.rs create mode 100644 hash/risc0/bench/methods/guest/src/bin/keccak.rs rename hash/risc0/bench/methods/guest/src/{main.rs => bin/sha256.rs} (99%) create mode 100644 hash/risc0/bench/src/benches/blake2b.rs create mode 100644 hash/risc0/bench/src/benches/blake3.rs create mode 100644 hash/risc0/bench/src/benches/keccak.rs create mode 100644 hash/risc0/bench/src/benches/mod.rs rename hash/risc0/bench/{host/src/main.rs => src/benches/sha256.rs} (55%) create mode 100644 hash/risc0/bench/src/main.rs diff --git a/hash/risc0/bench/Cargo.lock b/hash/risc0/bench/Cargo.lock index e6179f9..e6430ca 100644 --- a/hash/risc0/bench/Cargo.lock +++ b/hash/risc0/bench/Cargo.lock @@ -26,18 +26,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - -[[package]] -name = "anstyle" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" - [[package]] name = "anyhow" version = "1.0.75" @@ -80,6 +68,16 @@ version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +[[package]] +name = "benchmark" +version = "0.1.0" +dependencies = [ + "methods", + "rand", + "risc0-zkvm", + "serde", +] + [[package]] name = "bincode" version = "1.3.3" @@ -121,9 +119,9 @@ dependencies = [ [[package]] name = "bonsai-sdk" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "296de0c044ff3207f2252415ca3b5789de384e5d9a64185a003416bf11096ceb" +checksum = "441d1092e11977985946b6564251df91d80ae36982128e53be52a32548ad8762" dependencies = [ "reqwest", "serde", @@ -176,9 +174,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" +checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" dependencies = [ "serde", ] @@ -197,12 +195,6 @@ dependencies = [ "thiserror", ] -[[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" @@ -218,58 +210,6 @@ 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 = "4.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" -dependencies = [ - "clap_builder", -] - -[[package]] -name = "clap_builder" -version = "4.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" -dependencies = [ - "anstyle", - "clap_lex", -] - -[[package]] -name = "clap_lex" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" - [[package]] name = "const-oid" version = "0.9.5" @@ -278,9 +218,9 @@ checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -288,9 +228,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" @@ -301,75 +241,6 @@ dependencies = [ "libc", ] -[[package]] -name = "criterion" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" -dependencies = [ - "anes", - "cast", - "ciborium", - "clap", - "criterion-plot", - "is-terminal", - "itertools 0.10.5", - "num-traits", - "once_cell", - "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-deque" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -476,9 +347,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -554,15 +425,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "h2" -version = "0.3.21" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", @@ -570,30 +441,18 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap", "slab", "tokio", "tokio-util", "tracing", ] -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" @@ -622,22 +481,11 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "host" -version = "0.1.0" -dependencies = [ - "criterion", - "methods", - "rand", - "risc0-zkvm", - "serde", -] - [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -706,24 +554,14 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - [[package]] name = "indexmap" version = "2.1.0" @@ -731,7 +569,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown", ] [[package]] @@ -740,26 +578,6 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi", - "rustix", - "windows-sys", -] - -[[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" @@ -777,9 +595,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -820,15 +638,6 @@ version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - [[package]] name = "methods" version = "0.1.0" @@ -853,9 +662,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", @@ -927,21 +736,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.59" +version = "0.10.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a257ad03cd8fb16ad4172fedf8094451e1af1c4b70097636ef2eac9a5f0cc33" +checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" dependencies = [ "bitflags 2.4.1", "cfg-if", @@ -971,9 +774,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.95" +version = "0.9.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9" +checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" dependencies = [ "cc", "libc", @@ -989,9 +792,9 @@ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" @@ -1000,7 +803,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.1.0", + "indexmap", ] [[package]] @@ -1021,34 +824,6 @@ version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" -[[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 = "ppv-lite86" version = "0.2.17" @@ -1076,9 +851,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fdd22f3b9c31b53c060df4a0613a1c7f062d4115a2b984dd15b1858f7e340d" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ "bytes", "prost-derive", @@ -1086,13 +861,13 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bdf592881d821b83d471f8af290226c8d51402259e9bb5be7f9f8bdebbb11ac" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ "bytes", "heck", - "itertools 0.11.0", + "itertools", "log", "multimap", "once_cell", @@ -1108,12 +883,12 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", - "itertools 0.11.0", + "itertools", "proc-macro2", "quote", "syn", @@ -1121,9 +896,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" dependencies = [ "prost", ] @@ -1176,26 +951,6 @@ dependencies = [ "getrandom", ] -[[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", - "crossbeam-utils", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -1274,9 +1029,9 @@ dependencies = [ [[package]] name = "risc0-binfmt" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b008c7506a6acb15f14a87e7e57797fd901cdf2f4eb560a032df4e1fc12790" +checksum = "923c85a23cb9a9475b8cd4479ad3a06252604a361626e9ae7dc0dc635af22c22" dependencies = [ "anyhow", "elf", @@ -1288,9 +1043,9 @@ dependencies = [ [[package]] name = "risc0-build" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c44fdc4ad18c946a26dc42ed95ffc1cfa09a18973e68e394b83840724a5ca7ab" +checksum = "e58d4cc25e243e52d1ccd75d357b0aa55081736bf3052c65a823fdf169586843" dependencies = [ "anyhow", "cargo_metadata", @@ -1305,9 +1060,9 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "924bbd4f27070f04556e10565441fbf64e399763a3f244819f84dc645590bca1" +checksum = "97547e10e9fdaaab8b64ffb45dc158b31f023b1a68015c6ce9f12fe3e403012a" dependencies = [ "anyhow", "bytemuck", @@ -1319,9 +1074,9 @@ dependencies = [ [[package]] name = "risc0-circuit-rv32im" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac44b6493d73638018d62eccec93f2797795d286c6201e2a79d842a16bbb43f" +checksum = "1a269d01b18cba24ee1a08f68726fc3623e8705ed79d158377d12e9129dcde2e" dependencies = [ "anyhow", "log", @@ -1333,9 +1088,9 @@ dependencies = [ [[package]] name = "risc0-core" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8d9ff7ca4b8a9ecf63e4567dfc5ab73ea4c4c20618cdd36d5c0eb69be80cb2" +checksum = "477e0bb8d2ec0b7955088b521eb596901e652d0faa2ea73bda0b77e05af5c07d" dependencies = [ "bytemuck", "rand_core", @@ -1343,9 +1098,9 @@ dependencies = [ [[package]] name = "risc0-zkp" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1b8f047ec52f645e5e1c46f69303658f9cca96f0a2dcb78b4e7cadef5c2ac3d" +checksum = "d5abb1a0cf847d3f9aed1e563b76c358107e7ba66dbfab28f7144252c990bd82" dependencies = [ "anyhow", "blake2", @@ -1364,9 +1119,9 @@ dependencies = [ [[package]] name = "risc0-zkvm" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4b51d8aa8a4b0a350cca2deb9ead841989ed601ca3091e33a8ee8e6f2453048" +checksum = "3cf80df202c038efc2199be34fda8114b38bfc5b2b51c60cbbdf1f425b07b384" dependencies = [ "anyhow", "bincode", @@ -1396,9 +1151,9 @@ dependencies = [ [[package]] name = "risc0-zkvm-platform" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e9d18c75958239e91213a181e836e28dfbede913e4de66fa36e2ad1d70fcdc" +checksum = "2dcd6b66f7a4972001db0acf3f06d99b7851c8d9f0de1f7e0fb4496c66c5cd02" dependencies = [ "bytemuck", "getrandom", @@ -1440,15 +1195,6 @@ 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 = "schannel" version = "0.1.22" @@ -1458,12 +1204,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "security-framework" version = "2.9.2" @@ -1650,16 +1390,6 @@ dependencies = [ "syn", ] -[[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" @@ -1677,9 +1407,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", "bytes", @@ -1754,9 +1484,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" @@ -1766,9 +1496,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-ident" @@ -1787,9 +1517,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -1808,16 +1538,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[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 = "want" version = "0.3.1" @@ -1835,9 +1555,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1845,9 +1565,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", @@ -1860,9 +1580,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" dependencies = [ "cfg-if", "js-sys", @@ -1872,9 +1592,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1882,9 +1602,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", @@ -1895,15 +1615,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ "js-sys", "wasm-bindgen", @@ -1937,15 +1657,6 @@ 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" diff --git a/hash/risc0/bench/Cargo.toml b/hash/risc0/bench/Cargo.toml index 5363877..6299669 100644 --- a/hash/risc0/bench/Cargo.toml +++ b/hash/risc0/bench/Cargo.toml @@ -1,6 +1,13 @@ +[package] +name = "benchmark" +version = "0.1.0" +edition = "2021" + [workspace] -resolver = "2" -members = ["host", "methods"] +members = ["methods"] + +[workspace.dependencies] +methods = { path = "methods" } # Always optimize; building and running the guest takes much longer without optimization. [profile.dev] @@ -15,3 +22,9 @@ lto = true [profile.release.build-override] opt-level = 3 + +[dependencies] +risc0-zkvm = { version = "0.19.0" } +serde = "1.0" +rand = "0.8.3" +methods = { workspace = true } \ No newline at end of file diff --git a/hash/risc0/bench/host/Cargo.toml b/hash/risc0/bench/host/Cargo.toml deleted file mode 100644 index 22fd27f..0000000 --- a/hash/risc0/bench/host/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "host" -version = "0.1.0" -edition = "2021" - -[dependencies] -methods = { path = "../methods" } -risc0-zkvm = { version = "0.19.0" } -serde = "1.0" -rand = "0.8.3" - -[dev-dependencies] -criterion = "0.5.1" diff --git a/hash/risc0/bench/methods/guest/Cargo.lock b/hash/risc0/bench/methods/guest/Cargo.lock index b817f44..bbf6d2f 100644 --- a/hash/risc0/bench/methods/guest/Cargo.lock +++ b/hash/risc0/bench/methods/guest/Cargo.lock @@ -134,6 +134,15 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "keccak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", +] + [[package]] name = "libc" version = "0.2.150" @@ -157,6 +166,7 @@ name = "method" version = "0.1.0" dependencies = [ "risc0-zkvm", + "sha3", ] [[package]] @@ -372,6 +382,16 @@ dependencies = [ "digest", ] +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "subtle" version = "2.5.0" diff --git a/hash/risc0/bench/methods/guest/Cargo.toml b/hash/risc0/bench/methods/guest/Cargo.toml index 8bcb40f..fb613e6 100644 --- a/hash/risc0/bench/methods/guest/Cargo.toml +++ b/hash/risc0/bench/methods/guest/Cargo.toml @@ -8,7 +8,4 @@ edition = "2021" [dependencies] # If you want to try (experimental) std support, add `features = [ "std" ]` to risc0-zkvm risc0-zkvm = { version = "0.19.0", default-features = false, features = [ "std" ] } - -# [lib] -# name = "guest" -# path = "src/mod.rs" \ No newline at end of file +sha3 = "0.10.8" \ No newline at end of file diff --git a/hash/risc0/bench/methods/guest/src/bin/blake2b.rs b/hash/risc0/bench/methods/guest/src/bin/blake2b.rs new file mode 100644 index 0000000..c28e7e0 --- /dev/null +++ b/hash/risc0/bench/methods/guest/src/bin/blake2b.rs @@ -0,0 +1,15 @@ +#![no_main] + +use risc0_zkvm::{guest::env, sha::Digest}; +use sha3::{Digest as _, Keccak256}; + +risc0_zkvm::guest::entry!(main); + +pub fn main() { + + let data: Vec = env::read(); + let hash: [u8;32] = Keccak256::digest(data).into(); + let digest = Digest::try_from(hash).unwrap(); + env::commit(&digest) + +} diff --git a/hash/risc0/bench/methods/guest/src/bin/blake3.rs b/hash/risc0/bench/methods/guest/src/bin/blake3.rs new file mode 100644 index 0000000..c28e7e0 --- /dev/null +++ b/hash/risc0/bench/methods/guest/src/bin/blake3.rs @@ -0,0 +1,15 @@ +#![no_main] + +use risc0_zkvm::{guest::env, sha::Digest}; +use sha3::{Digest as _, Keccak256}; + +risc0_zkvm::guest::entry!(main); + +pub fn main() { + + let data: Vec = env::read(); + let hash: [u8;32] = Keccak256::digest(data).into(); + let digest = Digest::try_from(hash).unwrap(); + env::commit(&digest) + +} diff --git a/hash/risc0/bench/methods/guest/src/bin/keccak.rs b/hash/risc0/bench/methods/guest/src/bin/keccak.rs new file mode 100644 index 0000000..c28e7e0 --- /dev/null +++ b/hash/risc0/bench/methods/guest/src/bin/keccak.rs @@ -0,0 +1,15 @@ +#![no_main] + +use risc0_zkvm::{guest::env, sha::Digest}; +use sha3::{Digest as _, Keccak256}; + +risc0_zkvm::guest::entry!(main); + +pub fn main() { + + let data: Vec = env::read(); + let hash: [u8;32] = Keccak256::digest(data).into(); + let digest = Digest::try_from(hash).unwrap(); + env::commit(&digest) + +} diff --git a/hash/risc0/bench/methods/guest/src/main.rs b/hash/risc0/bench/methods/guest/src/bin/sha256.rs similarity index 99% rename from hash/risc0/bench/methods/guest/src/main.rs rename to hash/risc0/bench/methods/guest/src/bin/sha256.rs index aa4473f..9b47e39 100644 --- a/hash/risc0/bench/methods/guest/src/main.rs +++ b/hash/risc0/bench/methods/guest/src/bin/sha256.rs @@ -1,7 +1,6 @@ #![no_main] use risc0_zkvm::{guest::env, sha, sha::Sha256}; - risc0_zkvm::guest::entry!(main); pub fn main() { diff --git a/hash/risc0/bench/run.sh b/hash/risc0/bench/run.sh index 03e2842..35ba62a 100755 --- a/hash/risc0/bench/run.sh +++ b/hash/risc0/bench/run.sh @@ -3,5 +3,8 @@ # Set a default value if ZKBENCH_INPUT_SIZE_KB is not set : ${ZKBENCH_INPUT_SIZE_KB:=1024} +# Set a default value if ZKBENCH_INPUT_SIZE_KB is not set +: ${WHICH:="all"} + # Run cargo run with the specified environment variable -cargo run $ZKBENCH_INPUT_SIZE_KB +cargo run $WHICH $ZKBENCH_INPUT_SIZE_KB diff --git a/hash/risc0/bench/src/benches/blake2b.rs b/hash/risc0/bench/src/benches/blake2b.rs new file mode 100644 index 0000000..71c6ff5 --- /dev/null +++ b/hash/risc0/bench/src/benches/blake2b.rs @@ -0,0 +1,33 @@ +use methods::{ + KECCAK_ELF, KECCAK_ID +}; +use risc0_zkvm::{default_prover, ExecutorEnv}; +use risc0_zkvm::{ sha}; +// use rand::RngCore; +use std::time::Instant; + +pub fn keccak_bench(input: Vec) { + + let start_time = Instant::now(); + + let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); + + // Obtain the default prover. + let prover = default_prover(); + + // Produce a receipt by proving the specified ELF binary. + let receipt = prover.prove_elf(env, KECCAK_ELF).unwrap(); + + // For example: + let _output: sha::Digest = receipt.journal.decode().unwrap(); + + let elapsed_time1 = start_time.elapsed(); + // verify your receipt + receipt.verify(KECCAK_ID).unwrap(); + + let elapsed_time2 = start_time.elapsed(); + + eprintln!("Total time: {:?}", elapsed_time2); + eprintln!("verification time: {:?}", elapsed_time2 - elapsed_time1); + +} \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/blake3.rs b/hash/risc0/bench/src/benches/blake3.rs new file mode 100644 index 0000000..71c6ff5 --- /dev/null +++ b/hash/risc0/bench/src/benches/blake3.rs @@ -0,0 +1,33 @@ +use methods::{ + KECCAK_ELF, KECCAK_ID +}; +use risc0_zkvm::{default_prover, ExecutorEnv}; +use risc0_zkvm::{ sha}; +// use rand::RngCore; +use std::time::Instant; + +pub fn keccak_bench(input: Vec) { + + let start_time = Instant::now(); + + let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); + + // Obtain the default prover. + let prover = default_prover(); + + // Produce a receipt by proving the specified ELF binary. + let receipt = prover.prove_elf(env, KECCAK_ELF).unwrap(); + + // For example: + let _output: sha::Digest = receipt.journal.decode().unwrap(); + + let elapsed_time1 = start_time.elapsed(); + // verify your receipt + receipt.verify(KECCAK_ID).unwrap(); + + let elapsed_time2 = start_time.elapsed(); + + eprintln!("Total time: {:?}", elapsed_time2); + eprintln!("verification time: {:?}", elapsed_time2 - elapsed_time1); + +} \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/keccak.rs b/hash/risc0/bench/src/benches/keccak.rs new file mode 100644 index 0000000..71c6ff5 --- /dev/null +++ b/hash/risc0/bench/src/benches/keccak.rs @@ -0,0 +1,33 @@ +use methods::{ + KECCAK_ELF, KECCAK_ID +}; +use risc0_zkvm::{default_prover, ExecutorEnv}; +use risc0_zkvm::{ sha}; +// use rand::RngCore; +use std::time::Instant; + +pub fn keccak_bench(input: Vec) { + + let start_time = Instant::now(); + + let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); + + // Obtain the default prover. + let prover = default_prover(); + + // Produce a receipt by proving the specified ELF binary. + let receipt = prover.prove_elf(env, KECCAK_ELF).unwrap(); + + // For example: + let _output: sha::Digest = receipt.journal.decode().unwrap(); + + let elapsed_time1 = start_time.elapsed(); + // verify your receipt + receipt.verify(KECCAK_ID).unwrap(); + + let elapsed_time2 = start_time.elapsed(); + + eprintln!("Total time: {:?}", elapsed_time2); + eprintln!("verification time: {:?}", elapsed_time2 - elapsed_time1); + +} \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/mod.rs b/hash/risc0/bench/src/benches/mod.rs new file mode 100644 index 0000000..3007ce6 --- /dev/null +++ b/hash/risc0/bench/src/benches/mod.rs @@ -0,0 +1,2 @@ +pub mod sha256; +pub mod keccak; \ No newline at end of file diff --git a/hash/risc0/bench/host/src/main.rs b/hash/risc0/bench/src/benches/sha256.rs similarity index 55% rename from hash/risc0/bench/host/src/main.rs rename to hash/risc0/bench/src/benches/sha256.rs index afab626..169244a 100644 --- a/hash/risc0/bench/host/src/main.rs +++ b/hash/risc0/bench/src/benches/sha256.rs @@ -1,17 +1,11 @@ use methods::{ - METHOD_ELF, METHOD_ID + SHA256_ELF, SHA256_ID }; use risc0_zkvm::{default_prover, ExecutorEnv}; use risc0_zkvm::{ sha}; // use rand::RngCore; -use rand::Rng; use std::time::Instant; -fn generate_bytes(size: usize) -> Vec { - let mut rng = rand::thread_rng(); - (0..size).map(|_| rng.gen()).collect() -} - pub fn sha_bench(input: Vec) { let start_time = Instant::now(); @@ -22,7 +16,7 @@ pub fn sha_bench(input: Vec) { let prover = default_prover(); // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove_elf(env, METHOD_ELF).unwrap(); + let receipt = prover.prove_elf(env, SHA256_ELF).unwrap(); // TODO: Implement code for retrieving receipt journal here. @@ -30,18 +24,8 @@ pub fn sha_bench(input: Vec) { let _output: sha::Digest = receipt.journal.decode().unwrap(); // verify your receipt - receipt.verify(METHOD_ID).unwrap(); + receipt.verify(SHA256_ID).unwrap(); let elapsed_time = start_time.elapsed(); eprintln!("Total time: {:?}", elapsed_time); -} - -fn main() { - let args: Vec = std::env::args().collect(); - eprintln!("{:?}", &args[1]); - // eprintln!("{:?}", &args[2]); - let size_kb = args[1].parse::().unwrap(); - eprintln!("{:?}", size_kb); - let input = generate_bytes(size_kb); - sha_bench(input); -} +} \ No newline at end of file diff --git a/hash/risc0/bench/src/main.rs b/hash/risc0/bench/src/main.rs new file mode 100644 index 0000000..8a64580 --- /dev/null +++ b/hash/risc0/bench/src/main.rs @@ -0,0 +1,44 @@ +mod benches; +use benches::sha256::sha_bench; +use benches::keccak::keccak_bench; +use rand::Rng; + + +fn generate_bytes(size: usize) -> Vec { + let mut rng = rand::thread_rng(); + (0..size).map(|_| rng.gen()).collect() +} + + + +fn main() { + let args: Vec = std::env::args().collect(); + + let mut flag = 0; + + let hash_type = &args[1]; + let size_kb = args[2].parse::().unwrap(); + + eprintln!("data size(bytes): {:?}", size_kb); + let input = generate_bytes(size_kb); + + if hash_type == "all" || hash_type == "sha256" { + println!("SHA256 Benchmarking: "); + sha_bench(input.clone()); + println!(""); + flag = 1; + } + + if hash_type == "all" || hash_type == "keccak" { + println!("KECCAK Benchmarking: "); + keccak_bench(input.clone()); + println!(""); + flag = 1; + } + + if flag == 0 { + println!("Wrong Benchmarking Name"); + } + println!("All Done!"); + +} From d14c0f827e8f7381d0533ffa36700f86e1a4b047 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Wed, 13 Dec 2023 19:16:31 +0530 Subject: [PATCH 07/41] benchmark for blake2b, blake3, cfg file added --- hash/risc0/bench/Cargo.lock | 13 +++- hash/risc0/bench/Cargo.toml | 1 + hash/risc0/bench/bench.cfg | 12 ++++ hash/risc0/bench/build.sh | 1 - hash/risc0/bench/methods/guest/Cargo.lock | 67 +++++++++++++++++-- hash/risc0/bench/methods/guest/Cargo.toml | 5 +- .../bench/methods/guest/src/bin/blake2b.rs | 6 +- .../bench/methods/guest/src/bin/blake3.rs | 6 +- .../bench/methods/guest/src/bin/sha256.rs | 15 +++++ hash/risc0/bench/run.sh | 27 ++++++-- hash/risc0/bench/src/benches/blake2b.rs | 11 ++- hash/risc0/bench/src/benches/blake3.rs | 11 +-- hash/risc0/bench/src/benches/mod.rs | 4 +- hash/risc0/bench/src/benches/sha256.rs | 11 +-- hash/risc0/bench/src/main.rs | 47 ++++++++----- 15 files changed, 180 insertions(+), 57 deletions(-) create mode 100644 hash/risc0/bench/bench.cfg diff --git a/hash/risc0/bench/Cargo.lock b/hash/risc0/bench/Cargo.lock index e6430ca..a61040b 100644 --- a/hash/risc0/bench/Cargo.lock +++ b/hash/risc0/bench/Cargo.lock @@ -76,6 +76,7 @@ dependencies = [ "rand", "risc0-zkvm", "serde", + "sha2 0.10.6", ] [[package]] @@ -1113,7 +1114,7 @@ dependencies = [ "risc0-core", "risc0-zkvm-platform", "serde", - "sha2", + "sha2 0.10.8", "tracing", ] @@ -1279,6 +1280,16 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.6" +source = "git+https://github.com/risc0/RustCrypto-hashes?tag=sha2-v0.10.6-risczero.0#7fd6900c4f637bd15ee2642dfa77110f8f1ad065" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2" version = "0.10.8" diff --git a/hash/risc0/bench/Cargo.toml b/hash/risc0/bench/Cargo.toml index 6299669..176fdde 100644 --- a/hash/risc0/bench/Cargo.toml +++ b/hash/risc0/bench/Cargo.toml @@ -27,4 +27,5 @@ opt-level = 3 risc0-zkvm = { version = "0.19.0" } serde = "1.0" rand = "0.8.3" +sha2 ={ git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.6-risczero.0" } methods = { workspace = true } \ No newline at end of file diff --git a/hash/risc0/bench/bench.cfg b/hash/risc0/bench/bench.cfg new file mode 100644 index 0000000..d5adade --- /dev/null +++ b/hash/risc0/bench/bench.cfg @@ -0,0 +1,12 @@ +name: "Hashes benchmarking using risc0 prover" +author: +timeout: 100 +params: + [ PROVER: [ risc0 ] + , INPUT_SIZE: [ 256, 512, 1024, 2048 ] + , WHICH: [ LINEAR ] + ] +tags: CPU, SHA256, KECCAK, BLAKE2B, BLAKE3 +comments: + The benchmarks includes for sha256, keccak, blake2b, blake3. + the hashing is done inside the guest and receipt is received which is verified. diff --git a/hash/risc0/bench/build.sh b/hash/risc0/bench/build.sh index 6870477..26156ef 100755 --- a/hash/risc0/bench/build.sh +++ b/hash/risc0/bench/build.sh @@ -1,4 +1,3 @@ #!/bin/bash -# Run the 'cargo bench' command. cargo build --release diff --git a/hash/risc0/bench/methods/guest/Cargo.lock b/hash/risc0/bench/methods/guest/Cargo.lock index bbf6d2f..d98b978 100644 --- a/hash/risc0/bench/methods/guest/Cargo.lock +++ b/hash/risc0/bench/methods/guest/Cargo.lock @@ -8,6 +8,18 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "autocfg" version = "1.1.0" @@ -23,6 +35,19 @@ dependencies = [ "digest", ] +[[package]] +name = "blake3" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -52,6 +77,15 @@ dependencies = [ "syn", ] +[[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 = "1.0.0" @@ -64,6 +98,12 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + [[package]] name = "cpufeatures" version = "0.2.11" @@ -165,7 +205,10 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" name = "method" version = "0.1.0" dependencies = [ + "blake3", + "risc0-zkp", "risc0-zkvm", + "sha2 0.10.6", "sha3", ] @@ -269,9 +312,9 @@ dependencies = [ [[package]] name = "risc0-core" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8d9ff7ca4b8a9ecf63e4567dfc5ab73ea4c4c20618cdd36d5c0eb69be80cb2" +checksum = "477e0bb8d2ec0b7955088b521eb596901e652d0faa2ea73bda0b77e05af5c07d" dependencies = [ "bytemuck", "rand_core", @@ -279,9 +322,9 @@ dependencies = [ [[package]] name = "risc0-zkp" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1b8f047ec52f645e5e1c46f69303658f9cca96f0a2dcb78b4e7cadef5c2ac3d" +checksum = "d5abb1a0cf847d3f9aed1e563b76c358107e7ba66dbfab28f7144252c990bd82" dependencies = [ "anyhow", "blake2", @@ -294,7 +337,7 @@ dependencies = [ "risc0-core", "risc0-zkvm-platform", "serde", - "sha2", + "sha2 0.10.8", "tracing", ] @@ -326,9 +369,9 @@ dependencies = [ [[package]] name = "risc0-zkvm-platform" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e9d18c75958239e91213a181e836e28dfbede913e4de66fa36e2ad1d70fcdc" +checksum = "2dcd6b66f7a4972001db0acf3f06d99b7851c8d9f0de1f7e0fb4496c66c5cd02" dependencies = [ "bytemuck", "getrandom", @@ -371,6 +414,16 @@ dependencies = [ "syn", ] +[[package]] +name = "sha2" +version = "0.10.6" +source = "git+https://github.com/risc0/RustCrypto-hashes?tag=sha2-v0.10.6-risczero.0#7fd6900c4f637bd15ee2642dfa77110f8f1ad065" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2" version = "0.10.8" diff --git a/hash/risc0/bench/methods/guest/Cargo.toml b/hash/risc0/bench/methods/guest/Cargo.toml index fb613e6..4f8e376 100644 --- a/hash/risc0/bench/methods/guest/Cargo.toml +++ b/hash/risc0/bench/methods/guest/Cargo.toml @@ -8,4 +8,7 @@ edition = "2021" [dependencies] # If you want to try (experimental) std support, add `features = [ "std" ]` to risc0-zkvm risc0-zkvm = { version = "0.19.0", default-features = false, features = [ "std" ] } -sha3 = "0.10.8" \ No newline at end of file +sha3 = "0.10.8" +sha2 ={ git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.6-risczero.0" } +risc0-zkp = "0.19.1" +blake3 = "1.5.0" \ No newline at end of file diff --git a/hash/risc0/bench/methods/guest/src/bin/blake2b.rs b/hash/risc0/bench/methods/guest/src/bin/blake2b.rs index c28e7e0..4d6c3e5 100644 --- a/hash/risc0/bench/methods/guest/src/bin/blake2b.rs +++ b/hash/risc0/bench/methods/guest/src/bin/blake2b.rs @@ -1,15 +1,15 @@ #![no_main] use risc0_zkvm::{guest::env, sha::Digest}; -use sha3::{Digest as _, Keccak256}; +use risc0_zkp::core::hash::blake2b::{Blake2b, Blake2bCpuImpl}; risc0_zkvm::guest::entry!(main); pub fn main() { let data: Vec = env::read(); - let hash: [u8;32] = Keccak256::digest(data).into(); - let digest = Digest::try_from(hash).unwrap(); + let hash = Blake2bCpuImpl::blake2b(&data); + let digest: Digest = hash.into(); env::commit(&digest) } diff --git a/hash/risc0/bench/methods/guest/src/bin/blake3.rs b/hash/risc0/bench/methods/guest/src/bin/blake3.rs index c28e7e0..fc78b7a 100644 --- a/hash/risc0/bench/methods/guest/src/bin/blake3.rs +++ b/hash/risc0/bench/methods/guest/src/bin/blake3.rs @@ -1,15 +1,15 @@ #![no_main] use risc0_zkvm::{guest::env, sha::Digest}; -use sha3::{Digest as _, Keccak256}; +use blake3::hash; risc0_zkvm::guest::entry!(main); pub fn main() { let data: Vec = env::read(); - let hash: [u8;32] = Keccak256::digest(data).into(); - let digest = Digest::try_from(hash).unwrap(); + let result = hash(&data); + let digest = Digest::try_from(*result.as_bytes()).unwrap(); env::commit(&digest) } diff --git a/hash/risc0/bench/methods/guest/src/bin/sha256.rs b/hash/risc0/bench/methods/guest/src/bin/sha256.rs index 9b47e39..f133700 100644 --- a/hash/risc0/bench/methods/guest/src/bin/sha256.rs +++ b/hash/risc0/bench/methods/guest/src/bin/sha256.rs @@ -9,3 +9,18 @@ pub fn main() { let hash = sha::Impl::hash_bytes(&data); env::commit(&hash) } + +// accelerated sha2 crate +// #![no_main] + +// use risc0_zkvm::{guest::env}; +// use sha2::{Sha256, Digest}; +// // use base16ct::lower::encode_str; +// risc0_zkvm::guest::entry!(main); + +// pub fn main() { + +// let data: Vec = env::read(); +// let result: [u8;32] = Sha256::digest(data).into(); +// env::commit(&result) +// } diff --git a/hash/risc0/bench/run.sh b/hash/risc0/bench/run.sh index 35ba62a..a8a4e62 100755 --- a/hash/risc0/bench/run.sh +++ b/hash/risc0/bench/run.sh @@ -1,10 +1,25 @@ #!/bin/bash +if [ -z ${ZKBENCH_HASH_TYPE} ]; then +ZKBENCH_HASH_TYPE="sha256" +fi -# Set a default value if ZKBENCH_INPUT_SIZE_KB is not set -: ${ZKBENCH_INPUT_SIZE_KB:=1024} +if [ -z ${ZKBENCH_WHICH} ]; then +ZKBENCH_WHICH="LINEAR" +fi -# Set a default value if ZKBENCH_INPUT_SIZE_KB is not set -: ${WHICH:="all"} +if [ -z ${ZKBENCH_NTHREADS} ]; then +ZKBENCH_NTHREADS=1 +fi -# Run cargo run with the specified environment variable -cargo run $WHICH $ZKBENCH_INPUT_SIZE_KB +if [ -z ${ZKBENCH_INPUT_SIZE_KB} ]; then +ZKBENCH_INPUT_SIZE_KB=1024 +fi + +echo "Running benchmarks with the following configurations:" +echo "HASH = $ZKBENCH_HASH_TYPE" +echo "WHICH = $ZKBENCH_WHICH" +echo "NTHREADS = $ZKBENCH_NTHREADS" +echo "Input Size (KB) = $ZKBENCH_INPUT_SIZE_KB" + +# Run the benchmarks using cargo run +CARGO_BUILD_JOBS=$ZKBENCH_NTHREADS cargo run $ZKBENCH_HASH_TYPE $ZKBENCH_INPUT_SIZE_KB diff --git a/hash/risc0/bench/src/benches/blake2b.rs b/hash/risc0/bench/src/benches/blake2b.rs index 71c6ff5..c5d7f32 100644 --- a/hash/risc0/bench/src/benches/blake2b.rs +++ b/hash/risc0/bench/src/benches/blake2b.rs @@ -1,29 +1,28 @@ use methods::{ - KECCAK_ELF, KECCAK_ID + BLAKE2B_ELF, BLAKE2B_ID }; use risc0_zkvm::{default_prover, ExecutorEnv}; use risc0_zkvm::{ sha}; // use rand::RngCore; use std::time::Instant; -pub fn keccak_bench(input: Vec) { +pub fn blake2b_bench(input: Vec) { - let start_time = Instant::now(); - let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); // Obtain the default prover. let prover = default_prover(); + let start_time = Instant::now(); // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove_elf(env, KECCAK_ELF).unwrap(); + let receipt = prover.prove_elf(env, BLAKE2B_ELF).unwrap(); // For example: let _output: sha::Digest = receipt.journal.decode().unwrap(); let elapsed_time1 = start_time.elapsed(); // verify your receipt - receipt.verify(KECCAK_ID).unwrap(); + receipt.verify(BLAKE2B_ID).unwrap(); let elapsed_time2 = start_time.elapsed(); diff --git a/hash/risc0/bench/src/benches/blake3.rs b/hash/risc0/bench/src/benches/blake3.rs index 71c6ff5..204c3a3 100644 --- a/hash/risc0/bench/src/benches/blake3.rs +++ b/hash/risc0/bench/src/benches/blake3.rs @@ -1,29 +1,30 @@ use methods::{ - KECCAK_ELF, KECCAK_ID + BLAKE3_ELF, BLAKE3_ID }; use risc0_zkvm::{default_prover, ExecutorEnv}; use risc0_zkvm::{ sha}; // use rand::RngCore; use std::time::Instant; -pub fn keccak_bench(input: Vec) { +pub fn blake3_bench(input: Vec) { - let start_time = Instant::now(); + let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); // Obtain the default prover. let prover = default_prover(); + let start_time = Instant::now(); // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove_elf(env, KECCAK_ELF).unwrap(); + let receipt = prover.prove_elf(env, BLAKE3_ELF).unwrap(); // For example: let _output: sha::Digest = receipt.journal.decode().unwrap(); let elapsed_time1 = start_time.elapsed(); // verify your receipt - receipt.verify(KECCAK_ID).unwrap(); + receipt.verify(BLAKE3_ID).unwrap(); let elapsed_time2 = start_time.elapsed(); diff --git a/hash/risc0/bench/src/benches/mod.rs b/hash/risc0/bench/src/benches/mod.rs index 3007ce6..fbc1943 100644 --- a/hash/risc0/bench/src/benches/mod.rs +++ b/hash/risc0/bench/src/benches/mod.rs @@ -1,2 +1,4 @@ pub mod sha256; -pub mod keccak; \ No newline at end of file +pub mod keccak; +pub mod blake2b; +pub mod blake3; \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/sha256.rs b/hash/risc0/bench/src/benches/sha256.rs index 169244a..553623f 100644 --- a/hash/risc0/bench/src/benches/sha256.rs +++ b/hash/risc0/bench/src/benches/sha256.rs @@ -3,29 +3,30 @@ use methods::{ }; use risc0_zkvm::{default_prover, ExecutorEnv}; use risc0_zkvm::{ sha}; +// use sha2; // use rand::RngCore; use std::time::Instant; pub fn sha_bench(input: Vec) { - let start_time = Instant::now(); let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); // Obtain the default prover. let prover = default_prover(); + let start_time = Instant::now(); // Produce a receipt by proving the specified ELF binary. let receipt = prover.prove_elf(env, SHA256_ELF).unwrap(); - - // TODO: Implement code for retrieving receipt journal here. + let elapsed_time = start_time.elapsed(); // For example: let _output: sha::Digest = receipt.journal.decode().unwrap(); - + // verify your receipt receipt.verify(SHA256_ID).unwrap(); - let elapsed_time = start_time.elapsed(); + eprintln!("Total time: {:?}", elapsed_time); + eprintln!("Hash: {:?}", _output); } \ No newline at end of file diff --git a/hash/risc0/bench/src/main.rs b/hash/risc0/bench/src/main.rs index 8a64580..243a0e0 100644 --- a/hash/risc0/bench/src/main.rs +++ b/hash/risc0/bench/src/main.rs @@ -1,6 +1,10 @@ mod benches; -use benches::sha256::sha_bench; -use benches::keccak::keccak_bench; +use benches::{ + sha256::sha_bench, + keccak::keccak_bench, + blake2b::blake2b_bench, + blake3::blake3_bench, +}; use rand::Rng; @@ -14,7 +18,7 @@ fn generate_bytes(size: usize) -> Vec { fn main() { let args: Vec = std::env::args().collect(); - let mut flag = 0; + // let mut flag = 0; let hash_type = &args[1]; let size_kb = args[2].parse::().unwrap(); @@ -22,23 +26,30 @@ fn main() { eprintln!("data size(bytes): {:?}", size_kb); let input = generate_bytes(size_kb); - if hash_type == "all" || hash_type == "sha256" { - println!("SHA256 Benchmarking: "); - sha_bench(input.clone()); - println!(""); - flag = 1; + match hash_type.as_str() { + "sha256" => { + println!("SHA256 Benchmarking: "); + sha_bench(input.clone()); + } + "keccak" => { + println!("KECCAK Benchmarking: "); + keccak_bench(input.clone()); + } + + "blake2b" => { + println!("Blake2b Benchmarking: "); + blake2b_bench(input.clone()); + } + + "blake3" => { + println!("Blake3 Benchmarking: "); + blake3_bench(input.clone()); + } + _ => { + println!("Wrong Benchmark Name!"); + } } - if hash_type == "all" || hash_type == "keccak" { - println!("KECCAK Benchmarking: "); - keccak_bench(input.clone()); - println!(""); - flag = 1; - } - - if flag == 0 { - println!("Wrong Benchmarking Name"); - } println!("All Done!"); } From ad841ce04d7afc37a021e0fadb13f8792518ee2b Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Mon, 18 Dec 2023 23:56:55 +0530 Subject: [PATCH 08/41] poseidon2 benchmark over bn128(merkle) and baby_bear --- hash/risc0/bench/.vscode/settings.json | 5 + hash/risc0/bench/Cargo.lock | 510 +++++++++++++++++- hash/risc0/bench/Cargo.toml | 6 +- hash/risc0/bench/methods/guest/Cargo.lock | 495 ++++++++++++++++- hash/risc0/bench/methods/guest/Cargo.toml | 4 +- .../guest/src/bin/poseidon2_babybear.rs | 42 ++ .../methods/guest/src/bin/poseidon2_bn128.rs | 42 ++ hash/risc0/bench/run.sh | 16 +- hash/risc0/bench/src/benches/mod.rs | 4 +- .../bench/src/benches/poseidon2_babybear.rs | 105 ++++ .../bench/src/benches/poseidon2_bn128.rs | 97 ++++ hash/risc0/bench/src/main.rs | 28 +- 12 files changed, 1328 insertions(+), 26 deletions(-) create mode 100644 hash/risc0/bench/.vscode/settings.json create mode 100644 hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs create mode 100644 hash/risc0/bench/methods/guest/src/bin/poseidon2_bn128.rs create mode 100644 hash/risc0/bench/src/benches/poseidon2_babybear.rs create mode 100644 hash/risc0/bench/src/benches/poseidon2_bn128.rs diff --git a/hash/risc0/bench/.vscode/settings.json b/hash/risc0/bench/.vscode/settings.json new file mode 100644 index 0000000..4545fa6 --- /dev/null +++ b/hash/risc0/bench/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "rust-analyzer.linkedProjects": [ + "./methods/guest/Cargo.toml" + ] +} \ No newline at end of file diff --git a/hash/risc0/bench/Cargo.lock b/hash/risc0/bench/Cargo.lock index a61040b..e8cd0fd 100644 --- a/hash/risc0/bench/Cargo.lock +++ b/hash/risc0/bench/Cargo.lock @@ -32,6 +32,82 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[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", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "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", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "autocfg" version = "1.1.0" @@ -72,11 +148,15 @@ checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" name = "benchmark" version = "0.1.0" dependencies = [ + "ark-ff", + "ark-serialize", + "hex", "methods", "rand", "risc0-zkvm", "serde", "sha2 0.10.6", + "zkhash", ] [[package]] @@ -100,6 +180,18 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + [[package]] name = "blake2" version = "0.10.6" @@ -109,6 +201,17 @@ dependencies = [ "digest", ] +[[package]] +name = "blake2b_simd" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -118,6 +221,19 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bls12_381" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3c196a77437e7cc2fb515ce413a6401291578b5afc8ecb29a3c7ab957f05941" +dependencies = [ + "ff 0.12.1", + "group 0.12.1", + "pairing", + "rand_core", + "subtle", +] + [[package]] name = "bonsai-sdk" version = "0.5.1" @@ -152,9 +268,15 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] +[[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" @@ -217,6 +339,12 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + [[package]] name = "core-foundation" version = "0.9.4" @@ -242,6 +370,38 @@ dependencies = [ "libc", ] +[[package]] +name = "crossbeam-deque" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" +dependencies = [ + "cfg-if", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -252,6 +412,17 @@ dependencies = [ "typenum", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "digest" version = "0.10.7" @@ -319,6 +490,28 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "bitvec", + "rand_core", + "subtle", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "bitvec", + "rand_core", + "subtle", +] + [[package]] name = "fixedbitset" version = "0.4.2" @@ -355,6 +548,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + [[package]] name = "futures-channel" version = "0.3.29" @@ -430,6 +629,29 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "memuse", + "rand_core", + "subtle", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff 0.13.0", + "rand_core", + "subtle", +] + [[package]] name = "h2" version = "0.3.22" @@ -449,6 +671,29 @@ dependencies = [ "tracing", ] +[[package]] +name = "halo2" +version = "0.1.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a23c779b38253fe1538102da44ad5bd5378495a61d2c4ee18d64eaa61ae5995" +dependencies = [ + "halo2_proofs", +] + +[[package]] +name = "halo2_proofs" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e925780549adee8364c7f2b685c753f6f3df23bde520c67416e93bf615933760" +dependencies = [ + "blake2b_simd", + "ff 0.12.1", + "group 0.12.1", + "pasta_curves 0.4.1", + "rand_core", + "rayon", +] + [[package]] name = "hashbrown" version = "0.14.3" @@ -579,6 +824,15 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[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" @@ -603,11 +857,37 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jubjub" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a575df5f985fe1cd5b2b05664ff6accfc46559032b954529fd225a2168d27b0f" +dependencies = [ + "bitvec", + "bls12_381", + "ff 0.12.1", + "group 0.12.1", + "rand_core", + "subtle", +] + +[[package]] +name = "keccak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", +] + [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] [[package]] name = "libc" @@ -639,6 +919,21 @@ version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memuse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2145869435ace5ea6ea3d35f59be559317ec9a0d04e1812d5f185a87b6d36f1a" + [[package]] name = "methods" version = "0.1.0" @@ -696,6 +991,17 @@ dependencies = [ "tempfile", ] +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-derive" version = "0.4.1" @@ -704,7 +1010,17 @@ checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", ] [[package]] @@ -764,7 +1080,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -785,6 +1101,45 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "pairing" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135590d8bdba2b31346f9cd1fb2a912329f5135e832a4f422942eb6ead8b6b3b" +dependencies = [ + "group 0.12.1", +] + +[[package]] +name = "pasta_curves" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc65faf8e7313b4b1fbaa9f7ca917a0eed499a9663be71477f87993604341d8" +dependencies = [ + "blake2b_simd", + "ff 0.12.1", + "group 0.12.1", + "lazy_static", + "rand", + "static_assertions", + "subtle", +] + +[[package]] +name = "pasta_curves" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" +dependencies = [ + "blake2b_simd", + "ff 0.13.0", + "group 0.13.0", + "lazy_static", + "rand", + "static_assertions", + "subtle", +] + [[package]] name = "paste" version = "1.0.14" @@ -838,7 +1193,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn", + "syn 2.0.39", ] [[package]] @@ -868,7 +1223,7 @@ checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ "bytes", "heck", - "itertools", + "itertools 0.11.0", "log", "multimap", "once_cell", @@ -877,7 +1232,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn", + "syn 2.0.39", "tempfile", "which", ] @@ -889,10 +1244,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", - "itertools", + "itertools 0.11.0", "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -922,6 +1277,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + [[package]] name = "rand" version = "0.8.5" @@ -952,6 +1313,26 @@ dependencies = [ "getrandom", ] +[[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", + "crossbeam-utils", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -1177,6 +1558,15 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + [[package]] name = "rustix" version = "0.38.21" @@ -1254,7 +1644,7 @@ checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -1301,6 +1691,16 @@ dependencies = [ "digest", ] +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "slab" version = "0.4.9" @@ -1330,12 +1730,35 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "subtle" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.39" @@ -1368,6 +1791,12 @@ dependencies = [ "libc", ] +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "tempfile" version = "3.8.1" @@ -1398,7 +1827,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -1481,7 +1910,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -1585,7 +2014,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.39", "wasm-bindgen-shared", ] @@ -1619,7 +2048,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1749,3 +2178,58 @@ dependencies = [ "cfg-if", "windows-sys", ] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[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", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "zkhash" +version = "0.2.0" +source = "git+https://github.com/HorizenLabs/poseidon2.git#bb476b9ca38198cf5092487283c8b8c5d4317c4e" +dependencies = [ + "ark-ff", + "ark-std", + "bitvec", + "blake2", + "bls12_381", + "byteorder", + "cfg-if", + "group 0.12.1", + "group 0.13.0", + "halo2", + "hex", + "jubjub", + "lazy_static", + "pasta_curves 0.5.1", + "rand", + "serde", + "sha2 0.10.8", + "sha3", + "subtle", +] diff --git a/hash/risc0/bench/Cargo.toml b/hash/risc0/bench/Cargo.toml index 176fdde..8d484c5 100644 --- a/hash/risc0/bench/Cargo.toml +++ b/hash/risc0/bench/Cargo.toml @@ -28,4 +28,8 @@ risc0-zkvm = { version = "0.19.0" } serde = "1.0" rand = "0.8.3" sha2 ={ git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.6-risczero.0" } -methods = { workspace = true } \ No newline at end of file +methods = { workspace = true } +zkhash = { git = "https://github.com/HorizenLabs/poseidon2.git"} +ark-ff = "0.4.2" +hex = "0.4.3" +ark-serialize = "0.4" \ No newline at end of file diff --git a/hash/risc0/bench/methods/guest/Cargo.lock b/hash/risc0/bench/methods/guest/Cargo.lock index d98b978..7469794 100644 --- a/hash/risc0/bench/methods/guest/Cargo.lock +++ b/hash/risc0/bench/methods/guest/Cargo.lock @@ -8,6 +8,70 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[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", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "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", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + [[package]] name = "arrayref" version = "0.3.7" @@ -26,6 +90,18 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + [[package]] name = "blake2" version = "0.10.6" @@ -35,6 +111,17 @@ dependencies = [ "digest", ] +[[package]] +name = "blake2b_simd" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq", +] + [[package]] name = "blake3" version = "1.5.0" @@ -57,6 +144,19 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bls12_381" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3c196a77437e7cc2fb515ce413a6401291578b5afc8ecb29a3c7ab957f05941" +dependencies = [ + "ff 0.12.1", + "group 0.12.1", + "pairing", + "rand_core", + "subtle", +] + [[package]] name = "bytemuck" version = "1.14.0" @@ -74,9 +174,15 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "cc" version = "1.0.83" @@ -113,6 +219,38 @@ dependencies = [ "libc", ] +[[package]] +name = "crossbeam-deque" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" +dependencies = [ + "cfg-if", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -123,6 +261,17 @@ dependencies = [ "typenum", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "digest" version = "0.10.7" @@ -141,12 +290,46 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + [[package]] name = "elf" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6e7d85896690fe195447717af8eceae0593ac2196fd42fe88c184e904406ce" +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "bitvec", + "rand_core", + "subtle", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "bitvec", + "rand_core", + "subtle", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + [[package]] name = "generic-array" version = "0.14.7" @@ -168,12 +351,81 @@ dependencies = [ "wasi", ] +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "memuse", + "rand_core", + "subtle", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff 0.13.0", + "rand_core", + "subtle", +] + +[[package]] +name = "halo2" +version = "0.1.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a23c779b38253fe1538102da44ad5bd5378495a61d2c4ee18d64eaa61ae5995" +dependencies = [ + "halo2_proofs", +] + +[[package]] +name = "halo2_proofs" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e925780549adee8364c7f2b685c753f6f3df23bde520c67416e93bf615933760" +dependencies = [ + "blake2b_simd", + "ff 0.12.1", + "group 0.12.1", + "pasta_curves 0.4.1", + "rand_core", + "rayon", +] + [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "jubjub" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a575df5f985fe1cd5b2b05664ff6accfc46559032b954529fd225a2168d27b0f" +dependencies = [ + "bitvec", + "bls12_381", + "ff 0.12.1", + "group 0.12.1", + "rand_core", + "subtle", +] + [[package]] name = "keccak" version = "0.1.4" @@ -183,6 +435,15 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] + [[package]] name = "libc" version = "0.2.150" @@ -201,15 +462,43 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memuse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2145869435ace5ea6ea3d35f59be559317ec9a0d04e1812d5f185a87b6d36f1a" + [[package]] name = "method" version = "0.1.0" dependencies = [ + "ark-serialize", "blake3", "risc0-zkp", "risc0-zkvm", "sha2 0.10.6", "sha3", + "zkhash", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", ] [[package]] @@ -220,7 +509,17 @@ checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", ] [[package]] @@ -232,6 +531,45 @@ dependencies = [ "autocfg", ] +[[package]] +name = "pairing" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135590d8bdba2b31346f9cd1fb2a912329f5135e832a4f422942eb6ead8b6b3b" +dependencies = [ + "group 0.12.1", +] + +[[package]] +name = "pasta_curves" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc65faf8e7313b4b1fbaa9f7ca917a0eed499a9663be71477f87993604341d8" +dependencies = [ + "blake2b_simd", + "ff 0.12.1", + "group 0.12.1", + "lazy_static", + "rand", + "static_assertions", + "subtle", +] + +[[package]] +name = "pasta_curves" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" +dependencies = [ + "blake2b_simd", + "ff 0.13.0", + "group 0.13.0", + "lazy_static", + "rand", + "static_assertions", + "subtle", +] + [[package]] name = "paste" version = "1.0.14" @@ -244,6 +582,12 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + [[package]] name = "proc-macro2" version = "1.0.69" @@ -262,11 +606,61 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[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", +] + [[package]] name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[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", + "crossbeam-utils", +] [[package]] name = "risc0-binfmt" @@ -388,6 +782,15 @@ dependencies = [ "paste", ] +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + [[package]] name = "semver" version = "1.0.20" @@ -411,7 +814,7 @@ checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -445,12 +848,35 @@ dependencies = [ "keccak", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "subtle" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.39" @@ -462,6 +888,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "tracing" version = "0.1.40" @@ -481,7 +913,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -513,3 +945,58 @@ name = "wasi" version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[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", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "zkhash" +version = "0.2.0" +source = "git+https://github.com/HorizenLabs/poseidon2.git#bb476b9ca38198cf5092487283c8b8c5d4317c4e" +dependencies = [ + "ark-ff", + "ark-std", + "bitvec", + "blake2", + "bls12_381", + "byteorder", + "cfg-if", + "group 0.12.1", + "group 0.13.0", + "halo2", + "hex", + "jubjub", + "lazy_static", + "pasta_curves 0.5.1", + "rand", + "serde", + "sha2 0.10.8", + "sha3", + "subtle", +] diff --git a/hash/risc0/bench/methods/guest/Cargo.toml b/hash/risc0/bench/methods/guest/Cargo.toml index 4f8e376..7ea1c24 100644 --- a/hash/risc0/bench/methods/guest/Cargo.toml +++ b/hash/risc0/bench/methods/guest/Cargo.toml @@ -11,4 +11,6 @@ risc0-zkvm = { version = "0.19.0", default-features = false, features = [ "std" sha3 = "0.10.8" sha2 ={ git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.6-risczero.0" } risc0-zkp = "0.19.1" -blake3 = "1.5.0" \ No newline at end of file +blake3 = "1.5.0" +zkhash = { git = "https://github.com/HorizenLabs/poseidon2.git"} +ark-serialize = "0.4" \ No newline at end of file diff --git a/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs b/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs new file mode 100644 index 0000000..58928eb --- /dev/null +++ b/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs @@ -0,0 +1,42 @@ +#![no_main] +#![allow(non_snake_case)] +use risc0_zkvm::{guest::env/* , sha::Digest*/}; +// use sha3::{Digest as _, Keccak256}; +use zkhash::poseidon2::poseidon2; +use zkhash::poseidon2::poseidon2_instance_babybear::{POSEIDON2_BABYBEAR_16_PARAMS/* , POSEIDON2_BABYBEAR_24_PARAMS*/}; +use zkhash::fields::babybear::FpBabyBear; +use ark_serialize::{CanonicalSerialize, CanonicalDeserialize}; + +risc0_zkvm::guest::entry!(main); + +pub fn main() { + + let data: Vec> = env::read(); + let cycles1 = env::get_cycle_count(); + let mut hash_data: Vec = Vec::new(); + for i in 0..data.len() { + let a_uncompressed = FpBabyBear::deserialize_uncompressed(&**data.get(i).unwrap()).unwrap(); + hash_data.push(a_uncompressed); + } + let cycles2 = env::get_cycle_count(); + + let permutation = poseidon2::Poseidon2::new(&POSEIDON2_BABYBEAR_16_PARAMS); + let perm: Vec = permutation.permutation(&hash_data); + + let cycles4 = env::get_cycle_count(); + + let mut perm_seralised: Vec> = Vec::new(); + for i in 0..data.len() { + let mut temp: Vec = Vec::new(); + perm.get(i).unwrap().serialize_uncompressed(&mut temp).unwrap(); + perm_seralised.push(temp); + } + let cycles6 = env::get_cycle_count(); + + env::commit(&perm_seralised); + + eprintln!("number of cycles for input builder: {:?}", cycles2 - cycles1); + eprintln!("number of cycles for hash permutation builder: {:?}", cycles4 - cycles2); + eprintln!("number of cycles for permutation seralisation: {:?}", cycles6 - cycles4); + +} diff --git a/hash/risc0/bench/methods/guest/src/bin/poseidon2_bn128.rs b/hash/risc0/bench/methods/guest/src/bin/poseidon2_bn128.rs new file mode 100644 index 0000000..d83669e --- /dev/null +++ b/hash/risc0/bench/methods/guest/src/bin/poseidon2_bn128.rs @@ -0,0 +1,42 @@ +#![no_main] +use risc0_zkvm::{guest::env/* , sha::Digest*/}; +// use sha3::{Digest as _, Keccak256}; +use zkhash::poseidon2::poseidon2; +use zkhash::poseidon2::poseidon2_instance_bn256::POSEIDON2_BN256_PARAMS; +use zkhash::merkle_tree::merkle_tree_fp::MerkleTree; +use zkhash::fields::bn256::FpBN256; +use ark_serialize::{CanonicalSerialize, CanonicalDeserialize}; + +risc0_zkvm::guest::entry!(main); + +pub fn main() { + + let data: Vec> = env::read(); + let cycles1 = env::get_cycle_count(); + let mut hash_data: Vec = Vec::new(); + for i in 0..data.len() { + let a_uncompressed = FpBN256::deserialize_uncompressed(&**data.get(i).unwrap()).unwrap(); + hash_data.push(a_uncompressed); + } + let cycles2 = env::get_cycle_count(); + + let permutation = poseidon2::Poseidon2::new(&POSEIDON2_BN256_PARAMS); + let mut merkle_tree = MerkleTree::new(permutation.clone()); + let cycles4 = env::get_cycle_count(); + let hash_final = merkle_tree.accumulate(&hash_data); + let cycles5 = env::get_cycle_count(); + + + let mut hash_bytes: Vec = Vec::new(); + hash_final.serialize_uncompressed(&mut hash_bytes).unwrap(); + + let cycles6 = env::get_cycle_count(); + + env::commit(&hash_bytes); + + eprintln!("number of cycles for input builder: {:?}", cycles2 - cycles1); + eprintln!("number of cycles for hash builder: {:?}", cycles4 - cycles2); + eprintln!("number of cycles for hash calculation: {:?}", cycles5 - cycles4); + eprintln!("number of cycles for hash serealisation: {:?}", cycles6 - cycles5); + +} diff --git a/hash/risc0/bench/run.sh b/hash/risc0/bench/run.sh index a8a4e62..e51695a 100755 --- a/hash/risc0/bench/run.sh +++ b/hash/risc0/bench/run.sh @@ -15,11 +15,23 @@ if [ -z ${ZKBENCH_INPUT_SIZE_KB} ]; then ZKBENCH_INPUT_SIZE_KB=1024 fi +if [ -z ${ZKBENCH_TREE_DEPTH} ]; then +ZKBENCH_TREE_DEPTH=4 +fi + + echo "Running benchmarks with the following configurations:" echo "HASH = $ZKBENCH_HASH_TYPE" -echo "WHICH = $ZKBENCH_WHICH" +# echo "WHICH = $ZKBENCH_WHICH" echo "NTHREADS = $ZKBENCH_NTHREADS" echo "Input Size (KB) = $ZKBENCH_INPUT_SIZE_KB" # Run the benchmarks using cargo run -CARGO_BUILD_JOBS=$ZKBENCH_NTHREADS cargo run $ZKBENCH_HASH_TYPE $ZKBENCH_INPUT_SIZE_KB +# Check if the environment variable is set to "poseidon2_bn128" +if [ "$ZKBENCH_HASH_TYPE" == "poseidon2_bn128" ]; then + # echo "Running Poseidon2 benchmark over bn128 field" + CARGO_BUILD_JOBS=$ZKBENCH_NTHREADS cargo run $ZKBENCH_HASH_TYPE $ZKBENCH_TREE_DEPTH +else + CARGO_BUILD_JOBS=$ZKBENCH_NTHREADS cargo run $ZKBENCH_HASH_TYPE $ZKBENCH_INPUT_SIZE_KB + +fi \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/mod.rs b/hash/risc0/bench/src/benches/mod.rs index fbc1943..d3382cf 100644 --- a/hash/risc0/bench/src/benches/mod.rs +++ b/hash/risc0/bench/src/benches/mod.rs @@ -1,4 +1,6 @@ pub mod sha256; pub mod keccak; pub mod blake2b; -pub mod blake3; \ No newline at end of file +pub mod blake3; +pub mod poseidon2_bn128; +pub mod poseidon2_babybear; \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/poseidon2_babybear.rs b/hash/risc0/bench/src/benches/poseidon2_babybear.rs new file mode 100644 index 0000000..f8c6558 --- /dev/null +++ b/hash/risc0/bench/src/benches/poseidon2_babybear.rs @@ -0,0 +1,105 @@ +#![allow(non_snake_case)] +use methods::{ + POSEIDON2_BABYBEAR_ELF, POSEIDON2_BABYBEAR_ID +}; +use risc0_zkvm::{default_prover, ExecutorEnv}; +use zkhash::{fields::{babybear::FpBabyBear, utils::random_scalar}/* , poseidon2::poseidon2_instance_bn256::POSEIDON2_BN256_PARAMS*/}; +// use zkhash::poseidon2::poseidon2::Poseidon2; +// use std::convert::TryFrom; +use std::time::Instant; +// use zkhash::merkle_tree::merkle_tree_fp::MerkleTree; +// use std::convert::TryInto; +// use hex::encode_to_slice; +use ark_serialize::{CanonicalSerialize, CanonicalDeserialize}; + + +pub fn poseidon2_babybear_bench(mtDepth: usize) { + + type Scalar = FpBabyBear; + + let mut input_scalar: Vec> = Vec::new(); + let number_of_leaves: u32 = 1 << mtDepth; + for _ in 0..number_of_leaves { + let mut uncompressed_bytes = Vec::new(); + let a: Scalar = random_scalar(); + a.serialize_uncompressed(&mut uncompressed_bytes).unwrap(); + input_scalar.push(uncompressed_bytes); + } + + let env = ExecutorEnv::builder().write(&input_scalar).unwrap().build().unwrap(); + + // Obtain the default prover. + let prover = default_prover(); + + let start_time = Instant::now(); + // Produce a receipt by proving the specified ELF binary. + let receipt = prover.prove_elf(env, POSEIDON2_BABYBEAR_ELF).unwrap(); + let elapsed_time = start_time.elapsed(); + + // For example: + let output: Vec> = receipt.journal.decode().unwrap(); + + let mut output_deseralised: Vec = Vec::new(); + + for i in 0..output.len() { + output_deseralised.push(Scalar::deserialize_uncompressed(&**output.get(i).unwrap()).unwrap()); + } + + eprintln!("size: {:?}", output_deseralised); + // let hash_final = FpBabyBear::deserialize_uncompressed(&*output).unwrap(); + + // verify your receipt + receipt.verify(POSEIDON2_BABYBEAR_ID).unwrap(); + + + eprintln!("Total time: {:?}", elapsed_time); + // eprintln!("Hash: {:?}", hash_final); + + + + + + // let input2:[Scalar;16] = [Scalar::from(1), Scalar::from(2), Scalar::from(3), Scalar::from(4),Scalar::from(5), Scalar::from(6), Scalar::from(7), Scalar::from(8),Scalar::from(9), Scalar::from(10), Scalar::from(11), Scalar::from(12), Scalar::from(13), Scalar::from(14), Scalar::from(15), Scalar::from(16)]; + // let hash = merkle_tree.accumulate(&input2); + + // let hash_string = hash.0.to_string(); + // // eprintln!("merkle hash: {:?}",hex::encode(hash_string)); + // eprintln!("merkle hash: {:?}", hash_string); + + // let x = hash.0.0; + // eprintln!("from: {:x}{:x}{:x}{:x}", x[0],x[1], x[2], x[3]); + // eprintln!("scalar: {:?}", Scalar::from(4)); + + // let a = Scalar::from(4); + // let mut uncompressed_bytes = Vec::new(); + // a.serialize_uncompressed(&mut uncompressed_bytes).unwrap(); + // eprintln!("compress: {:?}", uncompressed_bytes); + + // let a_uncompressed = Scalar::deserialize_uncompressed(&*uncompressed_bytes).unwrap(); + // eprintln!("uncompress: {:?}", a_uncompressed); + + // let t = poseidon2.get_t(); + // let input1: Vec = (0..t).map(|_| random_scalar()).collect(); + // let perm = poseidon2.permutation(&input1); + // eprintln!("output: {:?}", perm); + + // let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); + + // Obtain the default prover. + // let prover = default_prover(); + + // let start_time = Instant::now(); + // // Produce a receipt by proving the specified ELF binary. + // let receipt = prover.prove_elf(env, POSEIDON2_BN128_ELF).unwrap(); + // let elapsed_time = start_time.elapsed(); + + // // For example: + // let _output: sha::Digest = receipt.journal.decode().unwrap(); + + // // verify your receipt + // receipt.verify(POSEIDON2_BN128_ID).unwrap(); + + + // eprintln!("Total time: {:?}", elapsed_time); + // eprintln!("Hash: {:?}", _output); +} \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/poseidon2_bn128.rs b/hash/risc0/bench/src/benches/poseidon2_bn128.rs new file mode 100644 index 0000000..db28ed6 --- /dev/null +++ b/hash/risc0/bench/src/benches/poseidon2_bn128.rs @@ -0,0 +1,97 @@ +use methods::{ + POSEIDON2_BN128_ELF, POSEIDON2_BN128_ID +}; +use risc0_zkvm::{default_prover, ExecutorEnv}; +use zkhash::{fields::{bn256::FpBN256, utils::random_scalar}/* , poseidon2::poseidon2_instance_bn256::POSEIDON2_BN256_PARAMS*/}; +// use zkhash::poseidon2::poseidon2::Poseidon2; +// use std::convert::TryFrom; +use std::time::Instant; +// use zkhash::merkle_tree::merkle_tree_fp::MerkleTree; +// use std::convert::TryInto; +// use hex::encode_to_slice; +use ark_serialize::{CanonicalSerialize, CanonicalDeserialize}; + + +pub fn poseidon2_bn128_bench(mt_depth: usize) { + + type Scalar = FpBN256; + + let mut input_scalar: Vec> = Vec::new(); + let number_of_leaves: u32 = 1 << mt_depth; + for _ in 0..number_of_leaves { + let mut uncompressed_bytes = Vec::new(); + let a: Scalar = random_scalar(); + a.serialize_uncompressed(&mut uncompressed_bytes).unwrap(); + input_scalar.push(uncompressed_bytes); + } + + let env = ExecutorEnv::builder().write(&input_scalar).unwrap().build().unwrap(); + + // Obtain the default prover. + let prover = default_prover(); + + let start_time = Instant::now(); + // Produce a receipt by proving the specified ELF binary. + let receipt = prover.prove_elf(env, POSEIDON2_BN128_ELF).unwrap(); + let elapsed_time = start_time.elapsed(); + + // For example: + let output: Vec = receipt.journal.decode().unwrap(); + + let hash_final = Scalar::deserialize_uncompressed(&*output).unwrap(); + + // verify your receipt + receipt.verify(POSEIDON2_BN128_ID).unwrap(); + + + eprintln!("Total time: {:?}", elapsed_time); + eprintln!("Hash: {:?}", hash_final); + + + + + + // let input2:[Scalar;16] = [Scalar::from(1), Scalar::from(2), Scalar::from(3), Scalar::from(4),Scalar::from(5), Scalar::from(6), Scalar::from(7), Scalar::from(8),Scalar::from(9), Scalar::from(10), Scalar::from(11), Scalar::from(12), Scalar::from(13), Scalar::from(14), Scalar::from(15), Scalar::from(16)]; + // let hash = merkle_tree.accumulate(&input2); + + // let hash_string = hash.0.to_string(); + // // eprintln!("merkle hash: {:?}",hex::encode(hash_string)); + // eprintln!("merkle hash: {:?}", hash_string); + + // let x = hash.0.0; + // eprintln!("from: {:x}{:x}{:x}{:x}", x[0],x[1], x[2], x[3]); + // eprintln!("scalar: {:?}", Scalar::from(4)); + + // let a = Scalar::from(4); + // let mut uncompressed_bytes = Vec::new(); + // a.serialize_uncompressed(&mut uncompressed_bytes).unwrap(); + // eprintln!("compress: {:?}", uncompressed_bytes); + + // let a_uncompressed = Scalar::deserialize_uncompressed(&*uncompressed_bytes).unwrap(); + // eprintln!("uncompress: {:?}", a_uncompressed); + + // let t = poseidon2.get_t(); + // let input1: Vec = (0..t).map(|_| random_scalar()).collect(); + // let perm = poseidon2.permutation(&input1); + // eprintln!("output: {:?}", perm); + + // let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); + + // Obtain the default prover. + // let prover = default_prover(); + + // let start_time = Instant::now(); + // // Produce a receipt by proving the specified ELF binary. + // let receipt = prover.prove_elf(env, POSEIDON2_BN128_ELF).unwrap(); + // let elapsed_time = start_time.elapsed(); + + // // For example: + // let _output: sha::Digest = receipt.journal.decode().unwrap(); + + // // verify your receipt + // receipt.verify(POSEIDON2_BN128_ID).unwrap(); + + + // eprintln!("Total time: {:?}", elapsed_time); + // eprintln!("Hash: {:?}", _output); +} \ No newline at end of file diff --git a/hash/risc0/bench/src/main.rs b/hash/risc0/bench/src/main.rs index 243a0e0..266a65f 100644 --- a/hash/risc0/bench/src/main.rs +++ b/hash/risc0/bench/src/main.rs @@ -4,6 +4,8 @@ use benches::{ keccak::keccak_bench, blake2b::blake2b_bench, blake3::blake3_bench, + poseidon2_bn128::poseidon2_bn128_bench, + poseidon2_babybear::poseidon2_babybear_bench, }; use rand::Rng; @@ -23,33 +25,51 @@ fn main() { let hash_type = &args[1]; let size_kb = args[2].parse::().unwrap(); - eprintln!("data size(bytes): {:?}", size_kb); - let input = generate_bytes(size_kb); - match hash_type.as_str() { "sha256" => { println!("SHA256 Benchmarking: "); + eprintln!("data size(bytes): {:?}", size_kb); + let input = generate_bytes(size_kb); sha_bench(input.clone()); } "keccak" => { println!("KECCAK Benchmarking: "); + eprintln!("data size(bytes): {:?}", size_kb); + let input = generate_bytes(size_kb); keccak_bench(input.clone()); } "blake2b" => { println!("Blake2b Benchmarking: "); + eprintln!("data size(bytes): {:?}", size_kb); + let input = generate_bytes(size_kb); blake2b_bench(input.clone()); } "blake3" => { println!("Blake3 Benchmarking: "); + eprintln!("data size(bytes): {:?}", size_kb); + let input = generate_bytes(size_kb); blake3_bench(input.clone()); } + + "poseidon2_bn128" => { + println!("Poseidon2 Benchmarking on the BN128 field: "); + eprintln!("Tree Depth: {:?}", size_kb); + poseidon2_bn128_bench(size_kb); + } + + "poseidon2_babybear" => { + println!("Poseidon2 Benchmarking on the BabyBear field: "); + eprintln!("number of inputs {:?}", size_kb); + poseidon2_babybear_bench(size_kb); + } + _ => { println!("Wrong Benchmark Name!"); } } - + println!("All Done!"); } From 882a55557ef1471911115c6f8d88f621a3ffa687 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Wed, 20 Dec 2023 16:10:14 +0530 Subject: [PATCH 09/41] merkle hahsing over babybear(ark-ff) testing --- hash/risc0/bench/methods/guest/Cargo.lock | 21 +- hash/risc0/bench/methods/guest/Cargo.toml | 5 +- .../guest/src/bin/poseidon2_babybear.rs | 614 +++++++++++++++++- .../bench/src/benches/poseidon2_babybear.rs | 14 +- hash/risc0/bench/src/main.rs | 9 +- 5 files changed, 641 insertions(+), 22 deletions(-) diff --git a/hash/risc0/bench/methods/guest/Cargo.lock b/hash/risc0/bench/methods/guest/Cargo.lock index 7469794..3f2b808 100644 --- a/hash/risc0/bench/methods/guest/Cargo.lock +++ b/hash/risc0/bench/methods/guest/Cargo.lock @@ -481,8 +481,11 @@ checksum = "2145869435ace5ea6ea3d35f59be559317ec9a0d04e1812d5f185a87b6d36f1a" name = "method" version = "0.1.0" dependencies = [ + "ark-ff", "ark-serialize", "blake3", + "lazy_static", + "risc0-core 0.18.0", "risc0-zkp", "risc0-zkvm", "sha2 0.10.6", @@ -685,7 +688,7 @@ dependencies = [ "anyhow", "bytemuck", "log", - "risc0-core", + "risc0-core 0.19.1", "risc0-zkp", "tracing", ] @@ -698,12 +701,22 @@ checksum = "4ac44b6493d73638018d62eccec93f2797795d286c6201e2a79d842a16bbb43f" dependencies = [ "anyhow", "log", - "risc0-core", + "risc0-core 0.19.1", "risc0-zkp", "risc0-zkvm-platform", "tracing", ] +[[package]] +name = "risc0-core" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08605aec93ea22ed83f7f81f42e2d7287a5b0c749d8671f94de9d5994020045c" +dependencies = [ + "bytemuck", + "rand_core", +] + [[package]] name = "risc0-core" version = "0.19.1" @@ -728,7 +741,7 @@ dependencies = [ "log", "paste", "rand_core", - "risc0-core", + "risc0-core 0.19.1", "risc0-zkvm-platform", "serde", "sha2 0.10.8", @@ -752,7 +765,7 @@ dependencies = [ "risc0-binfmt", "risc0-circuit-recursion", "risc0-circuit-rv32im", - "risc0-core", + "risc0-core 0.19.1", "risc0-zkp", "risc0-zkvm-platform", "rrs-lib", diff --git a/hash/risc0/bench/methods/guest/Cargo.toml b/hash/risc0/bench/methods/guest/Cargo.toml index 7ea1c24..ea206a8 100644 --- a/hash/risc0/bench/methods/guest/Cargo.toml +++ b/hash/risc0/bench/methods/guest/Cargo.toml @@ -13,4 +13,7 @@ sha2 ={ git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.6- risc0-zkp = "0.19.1" blake3 = "1.5.0" zkhash = { git = "https://github.com/HorizenLabs/poseidon2.git"} -ark-serialize = "0.4" \ No newline at end of file +ark-serialize = "0.4" +ark-ff = "0.4.2" +risc0-core = "0.18.0" +lazy_static = "1.4" \ No newline at end of file diff --git a/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs b/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs index 58928eb..141814f 100644 --- a/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs +++ b/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs @@ -1,17 +1,594 @@ #![no_main] #![allow(non_snake_case)] +use ark_ff::Field; use risc0_zkvm::{guest::env/* , sha::Digest*/}; // use sha3::{Digest as _, Keccak256}; use zkhash::poseidon2::poseidon2; -use zkhash::poseidon2::poseidon2_instance_babybear::{POSEIDON2_BABYBEAR_16_PARAMS/* , POSEIDON2_BABYBEAR_24_PARAMS*/}; +use zkhash::poseidon2::poseidon2::Poseidon2; +use zkhash::poseidon2::poseidon2_instance_babybear::{/*POSEIDON2_BABYBEAR_16_PARAMS , */POSEIDON2_BABYBEAR_24_PARAMS}; use zkhash::fields::babybear::FpBabyBear; use ark_serialize::{CanonicalSerialize, CanonicalDeserialize}; +// use zkhash::merkle_tree::merkle_tree_fp::MerkleTreeHash; +use risc0_core::field::Elem; + +use std::sync::Arc; +use std::marker::PhantomData; +use risc0_core::field::baby_bear::BabyBear; +use lazy_static::lazy_static; + +// #[derive(Clone, Debug)] +// pub struct Poseidon2Params { +// pub(crate) t: usize, // statesize +// pub(crate) d: usize, // sbox degree +// pub(crate) rounds_f_beginning: usize, +// pub(crate) rounds_p: usize, +// #[allow(dead_code)] +// pub(crate) rounds_f_end: usize, +// pub(crate) rounds: usize, +// pub(crate) mat_internal_diag_m_1: Vec, +// pub(crate) _mat_internal: Vec>, +// pub(crate) round_constants: Vec>, +// } + +// pub fn mat_inverse(mat: &[Vec]) -> Vec> { +// let n = mat.len(); +// assert!(mat[0].len() == n); + +// let mut m = mat.to_owned(); +// let mut inv = vec![vec![F::ZERO; n]; n]; +// for (i, invi) in inv.iter_mut().enumerate() { +// invi[i] = F::ONE; +// } + +// // upper triangle +// for row in 0..n { +// for j in 0..row { +// // subtract from these rows +// let el = m[row][j]; +// for col in 0..n { +// // do subtraction for each col +// if col < j { +// m[row][col] = F::ZERO; +// } else { +// let mut tmp = m[j][col]; +// tmp.mul_assign(el); +// m[row][col].sub_assign(tmp); +// } +// if col > row { +// inv[row][col] = F::ZERO; +// } else { +// let mut tmp = inv[j][col]; +// tmp.mul_assign(el); +// inv[row][col].sub_assign(tmp); +// } +// } +// } +// // make 1 in diag +// let el_inv = m[row][row].inv(); +// for col in 0..n { +// match col.cmp(&row) { +// std::cmp::Ordering::Less => inv[row][col].mul_assign(el_inv), +// std::cmp::Ordering::Equal => { +// m[row][col] = F::ONE; +// inv[row][col].mul_assign(el_inv) +// } +// std::cmp::Ordering::Greater => m[row][col].mul_assign(el_inv), +// } +// } +// } + +// // upper triangle +// for row in (0..n).rev() { +// for j in (row + 1..n).rev() { +// // subtract from these rows +// let el = m[row][j]; +// for col in 0..n { +// // do subtraction for each col + +// #[cfg(debug_assertions)] +// { +// if col >= j { +// m[row][col] = F::ZERO; +// } +// } +// let mut tmp = inv[j][col]; +// tmp.mul_assign(el); +// inv[row][col].sub_assign(tmp); +// } +// } +// } + +// #[cfg(debug_assertions)] +// { +// for (row, mrow) in m.iter().enumerate() { +// for (col, v) in mrow.iter().enumerate() { +// if row == col { +// debug_assert!(*v == F::ONE); +// } else { +// debug_assert!(*v == F::ZERO); +// } +// } +// } +// } + +// inv +// } + +// impl Poseidon2Params { +// #[allow(clippy::too_many_arguments)] + +// pub const INIT_SHAKE: &'static str = "Poseidon2"; + +// pub fn new( +// t: usize, +// d: usize, +// rounds_f: usize, +// rounds_p: usize, +// mat_internal_diag_m_1: &[F], +// mat_internal: &[Vec], +// round_constants: &[Vec], +// ) -> Self { +// assert!(d == 3 || d == 5 || d == 7 || d == 11); +// assert_eq!(rounds_f % 2, 0); +// let r = rounds_f / 2; +// let rounds = rounds_f + rounds_p; + +// Poseidon2Params { +// t, +// d, +// rounds_f_beginning: r, +// rounds_p, +// rounds_f_end: r, +// rounds, +// mat_internal_diag_m_1: mat_internal_diag_m_1.to_owned(), +// _mat_internal: mat_internal.to_owned(), +// round_constants: round_constants.to_owned(), +// } +// } + + +// // Unused +// pub fn equivalent_round_constants( +// round_constants: &[Vec], +// mat_internal: &[Vec], +// rounds_f_beginning: usize, +// rounds_p: usize, +// ) -> Vec> { +// let mut opt = vec![Vec::new(); rounds_p + 1]; +// let mat_internal_inv = mat_inverse(mat_internal); + +// let p_end = rounds_f_beginning + rounds_p - 1; +// let mut tmp = round_constants[p_end].clone(); +// for i in (0..rounds_p - 1).rev() { +// let inv_cip = Self::mat_vec_mul(&mat_internal_inv, &tmp); +// opt[i + 1] = vec![inv_cip[0]]; +// tmp = round_constants[rounds_f_beginning + i].clone(); +// for i in 1..inv_cip.len() { +// tmp[i].add_assign(inv_cip[i]); +// } +// } +// opt[0] = tmp; +// opt[rounds_p] = vec![F::ZERO; opt[0].len()]; // opt[0].len() = t + +// opt +// } + +// pub fn mat_vec_mul(mat: &[Vec], input: &[F]) -> Vec { +// let t = mat.len(); +// debug_assert!(t == input.len()); +// let mut out = vec![F::ZERO; t]; +// for row in 0..t { +// for (col, inp) in input.iter().enumerate() { +// let mut tmp = mat[row][col]; +// tmp.mul_assign(*inp); +// out[row].add_assign(tmp); +// } +// } +// out +// } + +// } + +// #[derive(Clone, Debug)] +// pub struct Poseidon2 { +// pub(crate) params: Arc>, +// } + +// impl Poseidon2 { +// pub fn new(params: &Arc>) -> Self { +// Poseidon2 { +// params: Arc::clone(params), +// } +// } + +// pub fn get_t(&self) -> usize { +// self.params.t +// } + +// pub fn permutation(&self, input: &[F]) -> Vec { +// let t = self.params.t; +// assert_eq!(input.len(), t); + +// let mut current_state = input.to_owned(); + +// // Linear layer at beginning +// self.matmul_external(&mut current_state); + +// for r in 0..self.params.rounds_f_beginning { +// current_state = self.add_rc(¤t_state, &self.params.round_constants[r]); +// current_state = self.sbox(¤t_state); +// self.matmul_external(&mut current_state); +// } + +// let p_end = self.params.rounds_f_beginning + self.params.rounds_p; +// for r in self.params.rounds_f_beginning..p_end { +// current_state[0].add_assign(self.params.round_constants[r][0]); +// current_state[0] = self.sbox_p(¤t_state[0]); +// self.matmul_internal(&mut current_state, &self.params.mat_internal_diag_m_1); +// } + +// for r in p_end..self.params.rounds { +// current_state = self.add_rc(¤t_state, &self.params.round_constants[r]); +// current_state = self.sbox(¤t_state); +// self.matmul_external(&mut current_state); +// } +// current_state +// } + +// fn sbox(&self, input: &[F]) -> Vec { +// input.iter().map(|el| self.sbox_p(el)).collect() +// } + +// fn sbox_p(&self, input: &F) -> F { +// let mut input2 = *input; +// input2.mul_assign(input2); + +// match self.params.d { +// 3 => { +// let mut out = input2; +// out.mul_assign(*input); +// out +// } +// 5 => { +// let mut out = input2; +// out.mul_assign(out); +// out.mul_assign(*input); +// out +// } +// 7 => { +// let mut out = input2; +// out.mul_assign(out); +// out.mul_assign(input2); +// out.mul_assign(*input); +// out +// } +// _ => { +// panic!() +// } +// } +// } + +// fn matmul_m4(&self, input: &mut[F]) { +// let t = self.params.t; +// let t4 = t / 4; +// for i in 0..t4 { +// let start_index = i * 4; +// let mut t_0 = input[start_index]; +// t_0.add_assign(input[start_index + 1]); +// let mut t_1 = input[start_index + 2]; +// t_1.add_assign(input[start_index + 3]); +// let mut t_2 = input[start_index + 1]; +// t_2.add_assign(t_2); +// t_2.add_assign(t_1); +// let mut t_3 = input[start_index + 3]; +// t_3.add_assign(t_3); +// t_3.add_assign(t_0); +// let mut t_4 = t_1; +// t_4.add_assign(t_4); +// t_4.add_assign(t_4); +// t_4.add_assign(t_3); +// let mut t_5 = t_0; +// t_5.add_assign(t_5); +// t_5.add_assign(t_5); +// t_5.add_assign(t_2); +// let mut t_6 = t_3; +// t_6.add_assign(t_5); +// let mut t_7 = t_2; +// t_7.add_assign(t_4); +// input[start_index] = t_6; +// input[start_index + 1] = t_5; +// input[start_index + 2] = t_7; +// input[start_index + 3] = t_4; +// } +// } + +// fn matmul_external(&self, input: &mut[F]) { +// let t = self.params.t; +// match t { +// 2 => { +// // Matrix circ(2, 1) +// let mut sum = input[0]; +// sum.add_assign(input[1]); +// input[0].add_assign(sum); +// input[1].add_assign(sum); +// } +// 3 => { +// // Matrix circ(2, 1, 1) +// let mut sum = input[0]; +// sum.add_assign(input[1]); +// sum.add_assign(input[2]); +// input[0].add_assign(sum); +// input[1].add_assign(sum); +// input[2].add_assign(sum); +// } +// 4 => { +// // Applying cheap 4x4 MDS matrix to each 4-element part of the state +// self.matmul_m4(input); +// } +// 8 | 12 | 16 | 20 | 24 => { +// // Applying cheap 4x4 MDS matrix to each 4-element part of the state +// self.matmul_m4(input); + +// // Applying second cheap matrix for t > 4 +// let t4 = t / 4; +// let mut stored = [F::ZERO; 4]; +// for l in 0..4 { +// stored[l] = input[l]; +// for j in 1..t4 { +// stored[l].add_assign(input[4 * j + l]); +// } +// } +// for i in 0..input.len() { +// input[i].add_assign(stored[i % 4]); +// } +// } +// _ => { +// panic!() +// } +// } +// } + +// fn matmul_internal(&self, input: &mut[F], mat_internal_diag_m_1: &[F]) { +// let t = self.params.t; + +// match t { +// 2 => { +// // [2, 1] +// // [1, 3] +// let mut sum = input[0]; +// sum.add_assign(input[1]); +// input[0].add_assign(sum); +// input[1].add_assign(input[1]); +// input[1].add_assign(sum); +// } +// 3 => { +// // [2, 1, 1] +// // [1, 2, 1] +// // [1, 1, 3] +// let mut sum = input[0]; +// sum.add_assign(input[1]); +// sum.add_assign(input[2]); +// input[0].add_assign(sum); +// input[1].add_assign(sum); +// input[2].add_assign(input[2]); +// input[2].add_assign(sum); +// } +// 4 | 8 | 12 | 16 | 20 | 24 => { +// // Compute input sum +// let mut sum = input[0]; +// input +// .iter() +// .skip(1) +// .take(t-1) +// .for_each(|el| sum.add_assign(*el)); +// // Add sum + diag entry * element to each element +// for i in 0..input.len() { +// input[i].mul_assign(mat_internal_diag_m_1[i]); +// input[i].add_assign(sum); +// } +// } +// _ => { +// panic!() +// } +// } +// } + +// fn add_rc(&self, input: &[F], rc: &[F]) -> Vec { +// input +// .iter() +// .zip(rc.iter()) +// .map(|(a, b)| { +// let mut r = *a; +// r.add_assign(*b); +// r +// }) +// .collect() +// } +// } + +// pub trait MerkleTreeHash { +// fn compress(&self, input: &[&F]) -> Vec; +// } + +// #[derive(Clone, Debug)] +// pub struct MerkleTree> { +// perm: P, +// field: PhantomData, +// } + +// impl> MerkleTree { +// pub fn new(perm: P) -> Self { +// MerkleTree { +// perm, +// field: PhantomData, +// } +// } + +// fn round_up_pow_n(input: usize, n: usize) -> usize { +// debug_assert!(n >= 1); +// let mut res = 1; +// // try powers, starting from n +// loop { +// res *= n; +// if res >= input { +// break; +// } +// } +// res +// } + +// // pub fn accumulate(&mut self, set: &[F]) -> F { +// // let set_size = set.len(); +// // let mut bound = Self::round_up_pow_n(set_size, 2); +// // loop { +// // if bound >= 2 { +// // break; +// // } +// // bound *= 2; +// // } +// // let mut nodes: Vec = Vec::with_capacity(bound); +// // for s in set { +// // nodes.push(s.to_owned()); +// // } +// // // pad +// // for _ in nodes.len()..bound { +// // nodes.push(nodes[set_size - 1].to_owned()); +// // } + +// // while nodes.len() > 1 { +// // let new_len = nodes.len() / 2; +// // let mut new_nodes: Vec = Vec::with_capacity(new_len); +// // for i in (0..nodes.len()).step_by(2) { +// // let inp = [&nodes[i], &nodes[i + 1]]; +// // let dig = self.perm.compress(&inp); +// // new_nodes.push(dig); +// // } +// // nodes = new_nodes; +// // } +// // nodes[0].to_owned() +// // } + +// pub fn accumulate(&mut self, set: &[F]) -> Vec { +// let set_size = set.len(); +// let mut bound = Self::round_up_pow_n(set_size, 2); +// loop { +// if bound >= 16 { +// break; +// } +// bound *= 2; +// } + +// let mut nodes: Vec = Vec::with_capacity(bound); + +// // Populate nodes with set elements +// for s in set { +// nodes.push(s.to_owned()); +// } + +// // Pad nodes to reach the required size +// while nodes.len() < bound { +// nodes.push(nodes[set_size - 1].to_owned()); +// } + +// // Compress pairs of 8 elements until a single set of 8 elements is left +// while nodes.len() > 8 { +// let new_len = nodes.len() / 2; +// let mut new_nodes: Vec = Vec::with_capacity(new_len); + +// // Compress pairs of 8 elements at a time +// for i in (0..nodes.len()).step_by(16) { +// let inp: Vec<_> = nodes[i..i + 16].iter().collect(); +// let dig = self.perm.compress(&inp); +// new_nodes.push(dig[0]); +// new_nodes.push(dig[1]); +// new_nodes.push(dig[2]); +// new_nodes.push(dig[3]); +// new_nodes.push(dig[4]); +// new_nodes.push(dig[5]); +// new_nodes.push(dig[6]); +// new_nodes.push(dig[7]); +// } + +// nodes = new_nodes; +// } + +// nodes +// } + +// } + +// impl MerkleTreeHash for Poseidon2 { +// fn compress(&self, input: &[&F]) -> Vec { +// let res = self.permutation(&[ +// input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), +// input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), +// F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO]); + +// vec![res[0], res[1], res[2], res[3], res[4], res[5], res[6], res[7] ] +// } +// } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +// for POSEIDON2_BABYBEAR_24_PARAMS only +pub fn compress(perm: Poseidon2, input: Vec) -> Vec{ + let p = perm.permutation( + &[ + *input.get(0).unwrap(), *input.get(1).unwrap(), *input.get(2).unwrap(), *input.get(3).unwrap(), *input.get(4).unwrap(), *input.get(5).unwrap(), *input.get(6).unwrap(), *input.get(7).unwrap(), + *input.get(8).unwrap(), *input.get(9).unwrap(), *input.get(10).unwrap(), *input.get(11).unwrap(), *input.get(12).unwrap(), *input.get(13).unwrap(), *input.get(14).unwrap(), *input.get(15).unwrap(), + FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0) + ] + ); + vec![p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7] ] +} + + risc0_zkvm::guest::entry!(main); pub fn main() { let data: Vec> = env::read(); + let cycles1 = env::get_cycle_count(); let mut hash_data: Vec = Vec::new(); for i in 0..data.len() { @@ -20,15 +597,42 @@ pub fn main() { } let cycles2 = env::get_cycle_count(); - let permutation = poseidon2::Poseidon2::new(&POSEIDON2_BABYBEAR_16_PARAMS); - let perm: Vec = permutation.permutation(&hash_data); + let permutation = poseidon2::Poseidon2::new(&POSEIDON2_BABYBEAR_24_PARAMS); + // let perm: Vec = permutation.permutation(&hash_data); + let input1: [FpBabyBear;24] = [ + *hash_data.get(0).unwrap(), *hash_data.get(1).unwrap(), *hash_data.get(2).unwrap(), *hash_data.get(3).unwrap(), *hash_data.get(4).unwrap(), *hash_data.get(5).unwrap(), *hash_data.get(6).unwrap(), *hash_data.get(7).unwrap(), + *hash_data.get(8).unwrap(), *hash_data.get(9).unwrap(), *hash_data.get(10).unwrap(), *hash_data.get(11).unwrap(), *hash_data.get(12).unwrap(), *hash_data.get(13).unwrap(), *hash_data.get(14).unwrap(), *hash_data.get(15).unwrap(), + FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0) + ]; + + let input2: [FpBabyBear;24] = [ + *hash_data.get(16).unwrap(), *hash_data.get(17).unwrap(), *hash_data.get(18).unwrap(), *hash_data.get(19).unwrap(), *hash_data.get(20).unwrap(), *hash_data.get(21).unwrap(), *hash_data.get(22).unwrap(), *hash_data.get(23).unwrap(), + *hash_data.get(24).unwrap(), *hash_data.get(25).unwrap(), *hash_data.get(26).unwrap(), *hash_data.get(27).unwrap(), *hash_data.get(28).unwrap(), *hash_data.get(29).unwrap(), *hash_data.get(30).unwrap(), *hash_data.get(31).unwrap(), + FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0) + ]; + + let output1 = compress(permutation.clone(), input1.into()); + let output2 = compress(permutation.clone(), input2.into()); + + let input3 = vec![ + output1[0], output1[1], output1[2], output1[3], output1[4], output1[5], output1[6], output1[7], + output2[0], output2[1], output2[2], output2[3], output2[4], output2[5], output2[6], output2[7], + FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0) + ]; + let output_final = compress(permutation.clone(), input3); + + + // // let mut merkle_tree = MerkleTree::new(permutation.clone()); + // let cycles4 = env::get_cycle_count(); + // // let hash_final = merkle_tree.accumulate(&hash_data); + // let cycles5 = env::get_cycle_count(); let cycles4 = env::get_cycle_count(); let mut perm_seralised: Vec> = Vec::new(); - for i in 0..data.len() { + for i in 0..8 { let mut temp: Vec = Vec::new(); - perm.get(i).unwrap().serialize_uncompressed(&mut temp).unwrap(); + output_final.get(i).unwrap().serialize_uncompressed(&mut temp).unwrap(); perm_seralised.push(temp); } let cycles6 = env::get_cycle_count(); diff --git a/hash/risc0/bench/src/benches/poseidon2_babybear.rs b/hash/risc0/bench/src/benches/poseidon2_babybear.rs index f8c6558..382f34b 100644 --- a/hash/risc0/bench/src/benches/poseidon2_babybear.rs +++ b/hash/risc0/bench/src/benches/poseidon2_babybear.rs @@ -3,8 +3,8 @@ use methods::{ POSEIDON2_BABYBEAR_ELF, POSEIDON2_BABYBEAR_ID }; use risc0_zkvm::{default_prover, ExecutorEnv}; -use zkhash::{fields::{babybear::FpBabyBear, utils::random_scalar}/* , poseidon2::poseidon2_instance_bn256::POSEIDON2_BN256_PARAMS*/}; -// use zkhash::poseidon2::poseidon2::Poseidon2; +use zkhash::{fields::{babybear::FpBabyBear, utils::random_scalar} , poseidon2::poseidon2_instance_babybear::POSEIDON2_BABYBEAR_24_PARAMS}; +use zkhash::poseidon2::poseidon2::Poseidon2; // use std::convert::TryFrom; use std::time::Instant; // use zkhash::merkle_tree::merkle_tree_fp::MerkleTree; @@ -13,13 +13,15 @@ use std::time::Instant; use ark_serialize::{CanonicalSerialize, CanonicalDeserialize}; -pub fn poseidon2_babybear_bench(mtDepth: usize) { +pub fn poseidon2_babybear_bench() { type Scalar = FpBabyBear; - + let permutation = Poseidon2::new(&POSEIDON2_BABYBEAR_24_PARAMS); + // let t = permutation.get_t(); + let t = 32; let mut input_scalar: Vec> = Vec::new(); - let number_of_leaves: u32 = 1 << mtDepth; - for _ in 0..number_of_leaves { + + for _ in 0..t { let mut uncompressed_bytes = Vec::new(); let a: Scalar = random_scalar(); a.serialize_uncompressed(&mut uncompressed_bytes).unwrap(); diff --git a/hash/risc0/bench/src/main.rs b/hash/risc0/bench/src/main.rs index 266a65f..140db08 100644 --- a/hash/risc0/bench/src/main.rs +++ b/hash/risc0/bench/src/main.rs @@ -9,7 +9,6 @@ use benches::{ }; use rand::Rng; - fn generate_bytes(size: usize) -> Vec { let mut rng = rand::thread_rng(); (0..size).map(|_| rng.gen()).collect() @@ -19,9 +18,7 @@ fn generate_bytes(size: usize) -> Vec { fn main() { let args: Vec = std::env::args().collect(); - - // let mut flag = 0; - + let hash_type = &args[1]; let size_kb = args[2].parse::().unwrap(); @@ -61,8 +58,8 @@ fn main() { "poseidon2_babybear" => { println!("Poseidon2 Benchmarking on the BabyBear field: "); - eprintln!("number of inputs {:?}", size_kb); - poseidon2_babybear_bench(size_kb); + eprintln!("number of inputs {:?}", 32); + poseidon2_babybear_bench(); } _ => { From d5193cce6e822340fab6c13ea7f178e541ab53ae Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Tue, 2 Jan 2024 13:37:38 +0530 Subject: [PATCH 10/41] rust-crypto accelerated sha and poseidon2 over babybear(ark-ff) benchmarking --- hash/risc0/bench/bench.cfg | 4 +- .../guest/src/bin/poseidon2_babybear.rs | 690 +++--------------- .../bench/methods/guest/src/bin/sha256.rs | 1 + .../guest/src/bin/sha256_accelerated.rs | 20 + hash/risc0/bench/run.sh | 2 +- .../bench/src/benches/poseidon2_babybear.rs | 76 +- hash/risc0/bench/src/benches/sha256.rs | 24 +- hash/risc0/bench/src/main.rs | 5 +- 8 files changed, 154 insertions(+), 668 deletions(-) create mode 100644 hash/risc0/bench/methods/guest/src/bin/sha256_accelerated.rs diff --git a/hash/risc0/bench/bench.cfg b/hash/risc0/bench/bench.cfg index d5adade..5e47ea2 100644 --- a/hash/risc0/bench/bench.cfg +++ b/hash/risc0/bench/bench.cfg @@ -6,7 +6,7 @@ params: , INPUT_SIZE: [ 256, 512, 1024, 2048 ] , WHICH: [ LINEAR ] ] -tags: CPU, SHA256, KECCAK, BLAKE2B, BLAKE3 +tags: CPU, SHA256, KECCAK, BLAKE2B, BLAKE3, POSEIDON2, BN128, BABYBEAR comments: - The benchmarks includes for sha256, keccak, blake2b, blake3. + The benchmarks includes for sha256, keccak, blake2b, blake3 & poseidon2(merkle hashing). the hashing is done inside the guest and receipt is received which is verified. diff --git a/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs b/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs index 141814f..a00e7ad 100644 --- a/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs +++ b/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs @@ -1,587 +1,97 @@ #![no_main] #![allow(non_snake_case)] -use ark_ff::Field; -use risc0_zkvm::{guest::env/* , sha::Digest*/}; -// use sha3::{Digest as _, Keccak256}; +use risc0_zkvm::guest::env; use zkhash::poseidon2::poseidon2; use zkhash::poseidon2::poseidon2::Poseidon2; use zkhash::poseidon2::poseidon2_instance_babybear::{/*POSEIDON2_BABYBEAR_16_PARAMS , */POSEIDON2_BABYBEAR_24_PARAMS}; use zkhash::fields::babybear::FpBabyBear; use ark_serialize::{CanonicalSerialize, CanonicalDeserialize}; -// use zkhash::merkle_tree::merkle_tree_fp::MerkleTreeHash; -use risc0_core::field::Elem; - -use std::sync::Arc; use std::marker::PhantomData; -use risc0_core::field::baby_bear::BabyBear; -use lazy_static::lazy_static; -// #[derive(Clone, Debug)] -// pub struct Poseidon2Params { -// pub(crate) t: usize, // statesize -// pub(crate) d: usize, // sbox degree -// pub(crate) rounds_f_beginning: usize, -// pub(crate) rounds_p: usize, -// #[allow(dead_code)] -// pub(crate) rounds_f_end: usize, -// pub(crate) rounds: usize, -// pub(crate) mat_internal_diag_m_1: Vec, -// pub(crate) _mat_internal: Vec>, -// pub(crate) round_constants: Vec>, -// } +use ark_ff::PrimeField; -// pub fn mat_inverse(mat: &[Vec]) -> Vec> { -// let n = mat.len(); -// assert!(mat[0].len() == n); - -// let mut m = mat.to_owned(); -// let mut inv = vec![vec![F::ZERO; n]; n]; -// for (i, invi) in inv.iter_mut().enumerate() { -// invi[i] = F::ONE; -// } - -// // upper triangle -// for row in 0..n { -// for j in 0..row { -// // subtract from these rows -// let el = m[row][j]; -// for col in 0..n { -// // do subtraction for each col -// if col < j { -// m[row][col] = F::ZERO; -// } else { -// let mut tmp = m[j][col]; -// tmp.mul_assign(el); -// m[row][col].sub_assign(tmp); -// } -// if col > row { -// inv[row][col] = F::ZERO; -// } else { -// let mut tmp = inv[j][col]; -// tmp.mul_assign(el); -// inv[row][col].sub_assign(tmp); -// } -// } -// } -// // make 1 in diag -// let el_inv = m[row][row].inv(); -// for col in 0..n { -// match col.cmp(&row) { -// std::cmp::Ordering::Less => inv[row][col].mul_assign(el_inv), -// std::cmp::Ordering::Equal => { -// m[row][col] = F::ONE; -// inv[row][col].mul_assign(el_inv) -// } -// std::cmp::Ordering::Greater => m[row][col].mul_assign(el_inv), -// } -// } -// } - -// // upper triangle -// for row in (0..n).rev() { -// for j in (row + 1..n).rev() { -// // subtract from these rows -// let el = m[row][j]; -// for col in 0..n { -// // do subtraction for each col - -// #[cfg(debug_assertions)] -// { -// if col >= j { -// m[row][col] = F::ZERO; -// } -// } -// let mut tmp = inv[j][col]; -// tmp.mul_assign(el); -// inv[row][col].sub_assign(tmp); -// } -// } -// } - -// #[cfg(debug_assertions)] -// { -// for (row, mrow) in m.iter().enumerate() { -// for (col, v) in mrow.iter().enumerate() { -// if row == col { -// debug_assert!(*v == F::ONE); -// } else { -// debug_assert!(*v == F::ZERO); -// } -// } -// } -// } - -// inv -// } - -// impl Poseidon2Params { -// #[allow(clippy::too_many_arguments)] - -// pub const INIT_SHAKE: &'static str = "Poseidon2"; - -// pub fn new( -// t: usize, -// d: usize, -// rounds_f: usize, -// rounds_p: usize, -// mat_internal_diag_m_1: &[F], -// mat_internal: &[Vec], -// round_constants: &[Vec], -// ) -> Self { -// assert!(d == 3 || d == 5 || d == 7 || d == 11); -// assert_eq!(rounds_f % 2, 0); -// let r = rounds_f / 2; -// let rounds = rounds_f + rounds_p; - -// Poseidon2Params { -// t, -// d, -// rounds_f_beginning: r, -// rounds_p, -// rounds_f_end: r, -// rounds, -// mat_internal_diag_m_1: mat_internal_diag_m_1.to_owned(), -// _mat_internal: mat_internal.to_owned(), -// round_constants: round_constants.to_owned(), -// } -// } - - -// // Unused -// pub fn equivalent_round_constants( -// round_constants: &[Vec], -// mat_internal: &[Vec], -// rounds_f_beginning: usize, -// rounds_p: usize, -// ) -> Vec> { -// let mut opt = vec![Vec::new(); rounds_p + 1]; -// let mat_internal_inv = mat_inverse(mat_internal); - -// let p_end = rounds_f_beginning + rounds_p - 1; -// let mut tmp = round_constants[p_end].clone(); -// for i in (0..rounds_p - 1).rev() { -// let inv_cip = Self::mat_vec_mul(&mat_internal_inv, &tmp); -// opt[i + 1] = vec![inv_cip[0]]; -// tmp = round_constants[rounds_f_beginning + i].clone(); -// for i in 1..inv_cip.len() { -// tmp[i].add_assign(inv_cip[i]); -// } -// } -// opt[0] = tmp; -// opt[rounds_p] = vec![F::ZERO; opt[0].len()]; // opt[0].len() = t - -// opt -// } - -// pub fn mat_vec_mul(mat: &[Vec], input: &[F]) -> Vec { -// let t = mat.len(); -// debug_assert!(t == input.len()); -// let mut out = vec![F::ZERO; t]; -// for row in 0..t { -// for (col, inp) in input.iter().enumerate() { -// let mut tmp = mat[row][col]; -// tmp.mul_assign(*inp); -// out[row].add_assign(tmp); -// } -// } -// out -// } - -// } - -// #[derive(Clone, Debug)] -// pub struct Poseidon2 { -// pub(crate) params: Arc>, -// } - -// impl Poseidon2 { -// pub fn new(params: &Arc>) -> Self { -// Poseidon2 { -// params: Arc::clone(params), -// } -// } - -// pub fn get_t(&self) -> usize { -// self.params.t -// } - -// pub fn permutation(&self, input: &[F]) -> Vec { -// let t = self.params.t; -// assert_eq!(input.len(), t); - -// let mut current_state = input.to_owned(); - -// // Linear layer at beginning -// self.matmul_external(&mut current_state); - -// for r in 0..self.params.rounds_f_beginning { -// current_state = self.add_rc(¤t_state, &self.params.round_constants[r]); -// current_state = self.sbox(¤t_state); -// self.matmul_external(&mut current_state); -// } - -// let p_end = self.params.rounds_f_beginning + self.params.rounds_p; -// for r in self.params.rounds_f_beginning..p_end { -// current_state[0].add_assign(self.params.round_constants[r][0]); -// current_state[0] = self.sbox_p(¤t_state[0]); -// self.matmul_internal(&mut current_state, &self.params.mat_internal_diag_m_1); -// } - -// for r in p_end..self.params.rounds { -// current_state = self.add_rc(¤t_state, &self.params.round_constants[r]); -// current_state = self.sbox(¤t_state); -// self.matmul_external(&mut current_state); -// } -// current_state -// } - -// fn sbox(&self, input: &[F]) -> Vec { -// input.iter().map(|el| self.sbox_p(el)).collect() -// } - -// fn sbox_p(&self, input: &F) -> F { -// let mut input2 = *input; -// input2.mul_assign(input2); - -// match self.params.d { -// 3 => { -// let mut out = input2; -// out.mul_assign(*input); -// out -// } -// 5 => { -// let mut out = input2; -// out.mul_assign(out); -// out.mul_assign(*input); -// out -// } -// 7 => { -// let mut out = input2; -// out.mul_assign(out); -// out.mul_assign(input2); -// out.mul_assign(*input); -// out -// } -// _ => { -// panic!() -// } -// } -// } - -// fn matmul_m4(&self, input: &mut[F]) { -// let t = self.params.t; -// let t4 = t / 4; -// for i in 0..t4 { -// let start_index = i * 4; -// let mut t_0 = input[start_index]; -// t_0.add_assign(input[start_index + 1]); -// let mut t_1 = input[start_index + 2]; -// t_1.add_assign(input[start_index + 3]); -// let mut t_2 = input[start_index + 1]; -// t_2.add_assign(t_2); -// t_2.add_assign(t_1); -// let mut t_3 = input[start_index + 3]; -// t_3.add_assign(t_3); -// t_3.add_assign(t_0); -// let mut t_4 = t_1; -// t_4.add_assign(t_4); -// t_4.add_assign(t_4); -// t_4.add_assign(t_3); -// let mut t_5 = t_0; -// t_5.add_assign(t_5); -// t_5.add_assign(t_5); -// t_5.add_assign(t_2); -// let mut t_6 = t_3; -// t_6.add_assign(t_5); -// let mut t_7 = t_2; -// t_7.add_assign(t_4); -// input[start_index] = t_6; -// input[start_index + 1] = t_5; -// input[start_index + 2] = t_7; -// input[start_index + 3] = t_4; -// } -// } - -// fn matmul_external(&self, input: &mut[F]) { -// let t = self.params.t; -// match t { -// 2 => { -// // Matrix circ(2, 1) -// let mut sum = input[0]; -// sum.add_assign(input[1]); -// input[0].add_assign(sum); -// input[1].add_assign(sum); -// } -// 3 => { -// // Matrix circ(2, 1, 1) -// let mut sum = input[0]; -// sum.add_assign(input[1]); -// sum.add_assign(input[2]); -// input[0].add_assign(sum); -// input[1].add_assign(sum); -// input[2].add_assign(sum); -// } -// 4 => { -// // Applying cheap 4x4 MDS matrix to each 4-element part of the state -// self.matmul_m4(input); -// } -// 8 | 12 | 16 | 20 | 24 => { -// // Applying cheap 4x4 MDS matrix to each 4-element part of the state -// self.matmul_m4(input); - -// // Applying second cheap matrix for t > 4 -// let t4 = t / 4; -// let mut stored = [F::ZERO; 4]; -// for l in 0..4 { -// stored[l] = input[l]; -// for j in 1..t4 { -// stored[l].add_assign(input[4 * j + l]); -// } -// } -// for i in 0..input.len() { -// input[i].add_assign(stored[i % 4]); -// } -// } -// _ => { -// panic!() -// } -// } -// } - -// fn matmul_internal(&self, input: &mut[F], mat_internal_diag_m_1: &[F]) { -// let t = self.params.t; - -// match t { -// 2 => { -// // [2, 1] -// // [1, 3] -// let mut sum = input[0]; -// sum.add_assign(input[1]); -// input[0].add_assign(sum); -// input[1].add_assign(input[1]); -// input[1].add_assign(sum); -// } -// 3 => { -// // [2, 1, 1] -// // [1, 2, 1] -// // [1, 1, 3] -// let mut sum = input[0]; -// sum.add_assign(input[1]); -// sum.add_assign(input[2]); -// input[0].add_assign(sum); -// input[1].add_assign(sum); -// input[2].add_assign(input[2]); -// input[2].add_assign(sum); -// } -// 4 | 8 | 12 | 16 | 20 | 24 => { -// // Compute input sum -// let mut sum = input[0]; -// input -// .iter() -// .skip(1) -// .take(t-1) -// .for_each(|el| sum.add_assign(*el)); -// // Add sum + diag entry * element to each element -// for i in 0..input.len() { -// input[i].mul_assign(mat_internal_diag_m_1[i]); -// input[i].add_assign(sum); -// } -// } -// _ => { -// panic!() -// } -// } -// } - -// fn add_rc(&self, input: &[F], rc: &[F]) -> Vec { -// input -// .iter() -// .zip(rc.iter()) -// .map(|(a, b)| { -// let mut r = *a; -// r.add_assign(*b); -// r -// }) -// .collect() -// } -// } - -// pub trait MerkleTreeHash { -// fn compress(&self, input: &[&F]) -> Vec; -// } - -// #[derive(Clone, Debug)] -// pub struct MerkleTree> { -// perm: P, -// field: PhantomData, -// } - -// impl> MerkleTree { -// pub fn new(perm: P) -> Self { -// MerkleTree { -// perm, -// field: PhantomData, -// } -// } - -// fn round_up_pow_n(input: usize, n: usize) -> usize { -// debug_assert!(n >= 1); -// let mut res = 1; -// // try powers, starting from n -// loop { -// res *= n; -// if res >= input { -// break; -// } -// } -// res -// } - -// // pub fn accumulate(&mut self, set: &[F]) -> F { -// // let set_size = set.len(); -// // let mut bound = Self::round_up_pow_n(set_size, 2); -// // loop { -// // if bound >= 2 { -// // break; -// // } -// // bound *= 2; -// // } -// // let mut nodes: Vec = Vec::with_capacity(bound); -// // for s in set { -// // nodes.push(s.to_owned()); -// // } -// // // pad -// // for _ in nodes.len()..bound { -// // nodes.push(nodes[set_size - 1].to_owned()); -// // } - -// // while nodes.len() > 1 { -// // let new_len = nodes.len() / 2; -// // let mut new_nodes: Vec = Vec::with_capacity(new_len); -// // for i in (0..nodes.len()).step_by(2) { -// // let inp = [&nodes[i], &nodes[i + 1]]; -// // let dig = self.perm.compress(&inp); -// // new_nodes.push(dig); -// // } -// // nodes = new_nodes; -// // } -// // nodes[0].to_owned() -// // } - -// pub fn accumulate(&mut self, set: &[F]) -> Vec { -// let set_size = set.len(); -// let mut bound = Self::round_up_pow_n(set_size, 2); -// loop { -// if bound >= 16 { -// break; -// } -// bound *= 2; -// } - -// let mut nodes: Vec = Vec::with_capacity(bound); - -// // Populate nodes with set elements -// for s in set { -// nodes.push(s.to_owned()); -// } - -// // Pad nodes to reach the required size -// while nodes.len() < bound { -// nodes.push(nodes[set_size - 1].to_owned()); -// } - -// // Compress pairs of 8 elements until a single set of 8 elements is left -// while nodes.len() > 8 { -// let new_len = nodes.len() / 2; -// let mut new_nodes: Vec = Vec::with_capacity(new_len); - -// // Compress pairs of 8 elements at a time -// for i in (0..nodes.len()).step_by(16) { -// let inp: Vec<_> = nodes[i..i + 16].iter().collect(); -// let dig = self.perm.compress(&inp); -// new_nodes.push(dig[0]); -// new_nodes.push(dig[1]); -// new_nodes.push(dig[2]); -// new_nodes.push(dig[3]); -// new_nodes.push(dig[4]); -// new_nodes.push(dig[5]); -// new_nodes.push(dig[6]); -// new_nodes.push(dig[7]); -// } - -// nodes = new_nodes; -// } - -// nodes -// } - -// } - -// impl MerkleTreeHash for Poseidon2 { -// fn compress(&self, input: &[&F]) -> Vec { -// let res = self.permutation(&[ -// input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), -// input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), input[0].to_owned(), -// F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO]); - -// vec![res[0], res[1], res[2], res[3], res[4], res[5], res[6], res[7] ] -// } -// } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// for POSEIDON2_BABYBEAR_24_PARAMS only -pub fn compress(perm: Poseidon2, input: Vec) -> Vec{ - let p = perm.permutation( - &[ - *input.get(0).unwrap(), *input.get(1).unwrap(), *input.get(2).unwrap(), *input.get(3).unwrap(), *input.get(4).unwrap(), *input.get(5).unwrap(), *input.get(6).unwrap(), *input.get(7).unwrap(), - *input.get(8).unwrap(), *input.get(9).unwrap(), *input.get(10).unwrap(), *input.get(11).unwrap(), *input.get(12).unwrap(), *input.get(13).unwrap(), *input.get(14).unwrap(), *input.get(15).unwrap(), - FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0) - ] - ); - vec![p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7] ] +pub trait MerkleTreeHash { + fn compress(&self, input: &[&F]) -> Vec; } +#[derive(Clone, Debug)] +pub struct MerkleTree> { + perm: P, + field: PhantomData, +} +impl> MerkleTree { + pub fn new(perm: P) -> Self { + MerkleTree { + perm, + field: PhantomData, + } + } + + fn round_up_pow_n(input: usize, n: usize) -> usize { + debug_assert!(n >= 1); + let mut res = 1; + // try powers, starting from n + loop { + res *= n; + if res >= input { + break; + } + } + res + } + + pub fn accumulate(&mut self, set: &[F]) -> Vec { + assert!(set.len()%8 == 0); + let set_size = set.len() / 8; + let mut bound = Self::round_up_pow_n(set_size, 2); + loop { + if bound >= 2 { + break; + } + bound *= 2; + } + let mut nodes: Vec = Vec::with_capacity(bound * 8); + for s in set { + nodes.push(s.to_owned()); + } + // pad + for _ in nodes.len()..bound { + nodes.push(nodes[set_size * 8 - 1].to_owned()); + } + + while nodes.len() > 8 { + let new_len = nodes.len() / 2; + let mut new_nodes: Vec = Vec::with_capacity(new_len); + for i in (0..nodes.len()).step_by(16) { + let inp = [ + &nodes[i], &nodes[i + 1], &nodes[i + 2], &nodes[i + 3], &nodes[i + 4], &nodes[i + 5], &nodes[i + 6], &nodes[i + 7], + &nodes[i + 8], &nodes[i + 9], &nodes[i + 10], &nodes[i + 11], &nodes[i + 12], &nodes[i + 13], &nodes[i + 14], &nodes[i + 15] + ]; + let dig = self.perm.compress(&inp); + + for j in 0..8 { + new_nodes.push(dig[j]); + } + + } + nodes = new_nodes; + } + vec![nodes[0].to_owned(), nodes[1].to_owned(), nodes[2].to_owned(), nodes[3].to_owned(), nodes[4].to_owned(), nodes[5].to_owned(), nodes[6].to_owned(), nodes[7].to_owned()] + } +} + +impl MerkleTreeHash for Poseidon2 { + fn compress(&self, input: &[&F]) -> Vec { + let p = self.permutation(&[ + input[0].to_owned(), input[1].to_owned(),input[2].to_owned(), input[3].to_owned(),input[4].to_owned(), input[5].to_owned(),input[6].to_owned(), input[7].to_owned(), + input[8].to_owned(), input[9].to_owned(),input[10].to_owned(), input[11].to_owned(),input[12].to_owned(), input[13].to_owned(),input[14].to_owned(), input[15].to_owned(), + F::zero(), F::zero(), F::zero(), F::zero(), F::zero(), F::zero(), F::zero(), F::zero() + ]); + + vec![p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]] + } +} risc0_zkvm::guest::entry!(main); @@ -597,42 +107,18 @@ pub fn main() { } let cycles2 = env::get_cycle_count(); + let permutation = poseidon2::Poseidon2::new(&POSEIDON2_BABYBEAR_24_PARAMS); - // let perm: Vec = permutation.permutation(&hash_data); - let input1: [FpBabyBear;24] = [ - *hash_data.get(0).unwrap(), *hash_data.get(1).unwrap(), *hash_data.get(2).unwrap(), *hash_data.get(3).unwrap(), *hash_data.get(4).unwrap(), *hash_data.get(5).unwrap(), *hash_data.get(6).unwrap(), *hash_data.get(7).unwrap(), - *hash_data.get(8).unwrap(), *hash_data.get(9).unwrap(), *hash_data.get(10).unwrap(), *hash_data.get(11).unwrap(), *hash_data.get(12).unwrap(), *hash_data.get(13).unwrap(), *hash_data.get(14).unwrap(), *hash_data.get(15).unwrap(), - FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0) - ]; - - let input2: [FpBabyBear;24] = [ - *hash_data.get(16).unwrap(), *hash_data.get(17).unwrap(), *hash_data.get(18).unwrap(), *hash_data.get(19).unwrap(), *hash_data.get(20).unwrap(), *hash_data.get(21).unwrap(), *hash_data.get(22).unwrap(), *hash_data.get(23).unwrap(), - *hash_data.get(24).unwrap(), *hash_data.get(25).unwrap(), *hash_data.get(26).unwrap(), *hash_data.get(27).unwrap(), *hash_data.get(28).unwrap(), *hash_data.get(29).unwrap(), *hash_data.get(30).unwrap(), *hash_data.get(31).unwrap(), - FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0) - ]; - - let output1 = compress(permutation.clone(), input1.into()); - let output2 = compress(permutation.clone(), input2.into()); - - let input3 = vec![ - output1[0], output1[1], output1[2], output1[3], output1[4], output1[5], output1[6], output1[7], - output2[0], output2[1], output2[2], output2[3], output2[4], output2[5], output2[6], output2[7], - FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0), FpBabyBear::from(0) - ]; - let output_final = compress(permutation.clone(), input3); - - - // // let mut merkle_tree = MerkleTree::new(permutation.clone()); - // let cycles4 = env::get_cycle_count(); - // // let hash_final = merkle_tree.accumulate(&hash_data); - // let cycles5 = env::get_cycle_count(); + let mut merkle_tree = MerkleTree::new(permutation.clone()); + let cycles3 = env::get_cycle_count(); + let hash_final = merkle_tree.accumulate(&hash_data); let cycles4 = env::get_cycle_count(); let mut perm_seralised: Vec> = Vec::new(); for i in 0..8 { let mut temp: Vec = Vec::new(); - output_final.get(i).unwrap().serialize_uncompressed(&mut temp).unwrap(); + hash_final.get(i).unwrap().serialize_uncompressed(&mut temp).unwrap(); perm_seralised.push(temp); } let cycles6 = env::get_cycle_count(); @@ -640,7 +126,9 @@ pub fn main() { env::commit(&perm_seralised); eprintln!("number of cycles for input builder: {:?}", cycles2 - cycles1); - eprintln!("number of cycles for hash permutation builder: {:?}", cycles4 - cycles2); + eprintln!("number of cycles for hash permutation builder: {:?}", cycles3 - cycles2); + eprintln!("number of cycles for hash accumulation: {:?}", cycles4 - cycles3); + eprintln!("number of cycles for permutation seralisation: {:?}", cycles6 - cycles4); } diff --git a/hash/risc0/bench/methods/guest/src/bin/sha256.rs b/hash/risc0/bench/methods/guest/src/bin/sha256.rs index f133700..d67a766 100644 --- a/hash/risc0/bench/methods/guest/src/bin/sha256.rs +++ b/hash/risc0/bench/methods/guest/src/bin/sha256.rs @@ -7,6 +7,7 @@ pub fn main() { let data: Vec = env::read(); let hash = sha::Impl::hash_bytes(&data); + eprintln!("total cycle count for hashing: {:?}",env::get_cycle_count()); env::commit(&hash) } diff --git a/hash/risc0/bench/methods/guest/src/bin/sha256_accelerated.rs b/hash/risc0/bench/methods/guest/src/bin/sha256_accelerated.rs new file mode 100644 index 0000000..91d7e9c --- /dev/null +++ b/hash/risc0/bench/methods/guest/src/bin/sha256_accelerated.rs @@ -0,0 +1,20 @@ + +// accelerated sha2 crate +#![no_main] + +use risc0_zkvm::guest::env; +use sha2::{Sha256, Digest}; +// use base16ct::lower::encode_str; +risc0_zkvm::guest::entry!(main); + +pub fn main() { + + let data: Vec = env::read(); + let result = Sha256::digest(data); + let c1 = env::get_cycle_count(); + eprintln!("total cycle count for hashing: {:?}",c1); + let result_bytes: [u8;32] = result.into(); + let c2 = env::get_cycle_count(); + eprintln!("cycle count to convert into bytes array: {:?}",c2-c1); + env::commit(&result_bytes) +} diff --git a/hash/risc0/bench/run.sh b/hash/risc0/bench/run.sh index e51695a..3a91834 100755 --- a/hash/risc0/bench/run.sh +++ b/hash/risc0/bench/run.sh @@ -28,7 +28,7 @@ echo "Input Size (KB) = $ZKBENCH_INPUT_SIZE_KB" # Run the benchmarks using cargo run # Check if the environment variable is set to "poseidon2_bn128" -if [ "$ZKBENCH_HASH_TYPE" == "poseidon2_bn128" ]; then +if [[ "$ZKBENCH_HASH_TYPE" == "poseidon2_bn128" || "$ZKBENCH_HASH_TYPE" == "poseidon2_babybear" ]]; then # echo "Running Poseidon2 benchmark over bn128 field" CARGO_BUILD_JOBS=$ZKBENCH_NTHREADS cargo run $ZKBENCH_HASH_TYPE $ZKBENCH_TREE_DEPTH else diff --git a/hash/risc0/bench/src/benches/poseidon2_babybear.rs b/hash/risc0/bench/src/benches/poseidon2_babybear.rs index 382f34b..d2ede50 100644 --- a/hash/risc0/bench/src/benches/poseidon2_babybear.rs +++ b/hash/risc0/bench/src/benches/poseidon2_babybear.rs @@ -1,24 +1,28 @@ #![allow(non_snake_case)] use methods::{ - POSEIDON2_BABYBEAR_ELF, POSEIDON2_BABYBEAR_ID + POSEIDON2_BABYBEAR_ELF, + POSEIDON2_BABYBEAR_ID }; -use risc0_zkvm::{default_prover, ExecutorEnv}; -use zkhash::{fields::{babybear::FpBabyBear, utils::random_scalar} , poseidon2::poseidon2_instance_babybear::POSEIDON2_BABYBEAR_24_PARAMS}; -use zkhash::poseidon2::poseidon2::Poseidon2; -// use std::convert::TryFrom; +use risc0_zkvm::{ + default_prover, + ExecutorEnv +}; +use zkhash::fields::{ + babybear::FpBabyBear, + utils::random_scalar + }; use std::time::Instant; -// use zkhash::merkle_tree::merkle_tree_fp::MerkleTree; -// use std::convert::TryInto; -// use hex::encode_to_slice; -use ark_serialize::{CanonicalSerialize, CanonicalDeserialize}; +use ark_serialize::{ + CanonicalSerialize, + CanonicalDeserialize +}; -pub fn poseidon2_babybear_bench() { +pub fn poseidon2_babybear_bench(mt_depth: usize) { type Scalar = FpBabyBear; - let permutation = Poseidon2::new(&POSEIDON2_BABYBEAR_24_PARAMS); - // let t = permutation.get_t(); - let t = 32; + + let t = (1 << mt_depth) * 8; let mut input_scalar: Vec> = Vec::new(); for _ in 0..t { @@ -58,50 +62,4 @@ pub fn poseidon2_babybear_bench() { // eprintln!("Hash: {:?}", hash_final); - - - - // let input2:[Scalar;16] = [Scalar::from(1), Scalar::from(2), Scalar::from(3), Scalar::from(4),Scalar::from(5), Scalar::from(6), Scalar::from(7), Scalar::from(8),Scalar::from(9), Scalar::from(10), Scalar::from(11), Scalar::from(12), Scalar::from(13), Scalar::from(14), Scalar::from(15), Scalar::from(16)]; - // let hash = merkle_tree.accumulate(&input2); - - // let hash_string = hash.0.to_string(); - // // eprintln!("merkle hash: {:?}",hex::encode(hash_string)); - // eprintln!("merkle hash: {:?}", hash_string); - - // let x = hash.0.0; - // eprintln!("from: {:x}{:x}{:x}{:x}", x[0],x[1], x[2], x[3]); - // eprintln!("scalar: {:?}", Scalar::from(4)); - - // let a = Scalar::from(4); - // let mut uncompressed_bytes = Vec::new(); - // a.serialize_uncompressed(&mut uncompressed_bytes).unwrap(); - // eprintln!("compress: {:?}", uncompressed_bytes); - - // let a_uncompressed = Scalar::deserialize_uncompressed(&*uncompressed_bytes).unwrap(); - // eprintln!("uncompress: {:?}", a_uncompressed); - - // let t = poseidon2.get_t(); - // let input1: Vec = (0..t).map(|_| random_scalar()).collect(); - // let perm = poseidon2.permutation(&input1); - // eprintln!("output: {:?}", perm); - - // let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); - - // Obtain the default prover. - // let prover = default_prover(); - - // let start_time = Instant::now(); - // // Produce a receipt by proving the specified ELF binary. - // let receipt = prover.prove_elf(env, POSEIDON2_BN128_ELF).unwrap(); - // let elapsed_time = start_time.elapsed(); - - // // For example: - // let _output: sha::Digest = receipt.journal.decode().unwrap(); - - // // verify your receipt - // receipt.verify(POSEIDON2_BN128_ID).unwrap(); - - - // eprintln!("Total time: {:?}", elapsed_time); - // eprintln!("Hash: {:?}", _output); } \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/sha256.rs b/hash/risc0/bench/src/benches/sha256.rs index 553623f..46a0489 100644 --- a/hash/risc0/bench/src/benches/sha256.rs +++ b/hash/risc0/bench/src/benches/sha256.rs @@ -1,5 +1,5 @@ use methods::{ - SHA256_ELF, SHA256_ID + SHA256_ELF, SHA256_ID, SHA256_ACCELERATED_ELF, SHA256_ACCELERATED_ID }; use risc0_zkvm::{default_prover, ExecutorEnv}; use risc0_zkvm::{ sha}; @@ -14,7 +14,7 @@ pub fn sha_bench(input: Vec) { // Obtain the default prover. let prover = default_prover(); - + eprintln!("------risc0_zkvm sha hashing------"); let start_time = Instant::now(); // Produce a receipt by proving the specified ELF binary. let receipt = prover.prove_elf(env, SHA256_ELF).unwrap(); @@ -26,7 +26,25 @@ pub fn sha_bench(input: Vec) { // verify your receipt receipt.verify(SHA256_ID).unwrap(); - + eprintln!("Total time: {:?}", elapsed_time); + eprintln!("Hash: {:?}", _output); + + let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); + eprintln!("------RustCrypto sha hashing------"); + // Obtain the default prover. + let prover = default_prover(); + + let start_time = Instant::now(); + // Produce a receipt by proving the specified ELF binary. + let receipt = prover.prove_elf(env, SHA256_ACCELERATED_ELF).unwrap(); + let elapsed_time = start_time.elapsed(); + + // For example: + let _output: [u8;32] = receipt.journal.decode().unwrap(); + + // verify your receipt + receipt.verify(SHA256_ACCELERATED_ID).unwrap(); + eprintln!("Total time: {:?}", elapsed_time); eprintln!("Hash: {:?}", _output); } \ No newline at end of file diff --git a/hash/risc0/bench/src/main.rs b/hash/risc0/bench/src/main.rs index 140db08..25bfce0 100644 --- a/hash/risc0/bench/src/main.rs +++ b/hash/risc0/bench/src/main.rs @@ -58,8 +58,9 @@ fn main() { "poseidon2_babybear" => { println!("Poseidon2 Benchmarking on the BabyBear field: "); - eprintln!("number of inputs {:?}", 32); - poseidon2_babybear_bench(); + eprintln!("Tree Depth: {:?}", size_kb); + eprintln!("number of inputs {:?}", (1 << size_kb) * 8); + poseidon2_babybear_bench(size_kb); } _ => { From ac71b3f2a7fe588f89fba6f5d4bf07d792c918f9 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Wed, 3 Jan 2024 21:07:56 +0530 Subject: [PATCH 11/41] poseidon2 over risc0's native babybear --- hash/risc0/bench/Cargo.lock | 19 +- hash/risc0/bench/Cargo.toml | 3 +- hash/risc0/bench/methods/guest/Cargo.lock | 17 + hash/risc0/bench/methods/guest/Cargo.toml | 4 +- .../src/bin/poseidon2_babybear_native.rs | 1761 +++++++++++++++++ hash/risc0/bench/run.sh | 2 +- hash/risc0/bench/src/benches/mod.rs | 3 +- .../bench/src/benches/poseidon2_babybear.rs | 3 +- .../src/benches/poseidon2_babybear_native.rs | 56 + .../bench/src/benches/poseidon2_bn128.rs | 52 - hash/risc0/bench/src/main.rs | 8 + 11 files changed, 1866 insertions(+), 62 deletions(-) create mode 100644 hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear_native.rs create mode 100644 hash/risc0/bench/src/benches/poseidon2_babybear_native.rs diff --git a/hash/risc0/bench/Cargo.lock b/hash/risc0/bench/Cargo.lock index e8cd0fd..2135879 100644 --- a/hash/risc0/bench/Cargo.lock +++ b/hash/risc0/bench/Cargo.lock @@ -153,6 +153,7 @@ dependencies = [ "hex", "methods", "rand", + "risc0-core 0.18.0", "risc0-zkvm", "serde", "sha2 0.10.6", @@ -1449,7 +1450,7 @@ dependencies = [ "anyhow", "bytemuck", "log", - "risc0-core", + "risc0-core 0.19.1", "risc0-zkp", "tracing", ] @@ -1462,12 +1463,22 @@ checksum = "1a269d01b18cba24ee1a08f68726fc3623e8705ed79d158377d12e9129dcde2e" dependencies = [ "anyhow", "log", - "risc0-core", + "risc0-core 0.19.1", "risc0-zkp", "risc0-zkvm-platform", "tracing", ] +[[package]] +name = "risc0-core" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08605aec93ea22ed83f7f81f42e2d7287a5b0c749d8671f94de9d5994020045c" +dependencies = [ + "bytemuck", + "rand_core", +] + [[package]] name = "risc0-core" version = "0.19.1" @@ -1492,7 +1503,7 @@ dependencies = [ "log", "paste", "rand_core", - "risc0-core", + "risc0-core 0.19.1", "risc0-zkvm-platform", "serde", "sha2 0.10.8", @@ -1522,7 +1533,7 @@ dependencies = [ "risc0-binfmt", "risc0-circuit-recursion", "risc0-circuit-rv32im", - "risc0-core", + "risc0-core 0.19.1", "risc0-zkp", "risc0-zkvm-platform", "rrs-lib", diff --git a/hash/risc0/bench/Cargo.toml b/hash/risc0/bench/Cargo.toml index 8d484c5..554d145 100644 --- a/hash/risc0/bench/Cargo.toml +++ b/hash/risc0/bench/Cargo.toml @@ -32,4 +32,5 @@ methods = { workspace = true } zkhash = { git = "https://github.com/HorizenLabs/poseidon2.git"} ark-ff = "0.4.2" hex = "0.4.3" -ark-serialize = "0.4" \ No newline at end of file +ark-serialize = "0.4" +risc0-core = "0.18.0" diff --git a/hash/risc0/bench/methods/guest/Cargo.lock b/hash/risc0/bench/methods/guest/Cargo.lock index 3f2b808..7b5d163 100644 --- a/hash/risc0/bench/methods/guest/Cargo.lock +++ b/hash/risc0/bench/methods/guest/Cargo.lock @@ -485,8 +485,10 @@ dependencies = [ "ark-serialize", "blake3", "lazy_static", + "rand", "risc0-core 0.18.0", "risc0-zkp", + "risc0-zkp-core", "risc0-zkvm", "sha2 0.10.6", "sha3", @@ -748,6 +750,21 @@ dependencies = [ "tracing", ] +[[package]] +name = "risc0-zkp-core" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfd3bb0b4f2a4250d7332c3d647418502449e773b176552aae869537c4a96bf" +dependencies = [ + "anyhow", + "bytemuck", + "paste", + "rand", + "rand_core", + "serde", + "sha2 0.10.8", +] + [[package]] name = "risc0-zkvm" version = "0.19.0" diff --git a/hash/risc0/bench/methods/guest/Cargo.toml b/hash/risc0/bench/methods/guest/Cargo.toml index ea206a8..8529584 100644 --- a/hash/risc0/bench/methods/guest/Cargo.toml +++ b/hash/risc0/bench/methods/guest/Cargo.toml @@ -16,4 +16,6 @@ zkhash = { git = "https://github.com/HorizenLabs/poseidon2.git"} ark-serialize = "0.4" ark-ff = "0.4.2" risc0-core = "0.18.0" -lazy_static = "1.4" \ No newline at end of file +lazy_static = "1.4" +risc0-zkp-core = "0.10.0" +rand = "0.8.5" \ No newline at end of file diff --git a/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear_native.rs b/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear_native.rs new file mode 100644 index 0000000..79cd4a6 --- /dev/null +++ b/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear_native.rs @@ -0,0 +1,1761 @@ +#![no_main] +#![allow(non_snake_case)] +use risc0_core::field::baby_bear::BabyBearElem; +use risc0_zkvm::guest::env; +use std::marker::PhantomData; +use std::sync::Arc; +use risc0_core::field::Elem; +use lazy_static::lazy_static; + +// This code is adapted from https://github.com/HorizenLabs/poseidon2/tree/main +#[derive(Clone, Debug)] +pub struct Poseidon2Params { + pub(crate) t: usize, // statesize + pub(crate) d: usize, // sbox degree + pub(crate) rounds_f_beginning: usize, + pub(crate) rounds_p: usize, + #[allow(dead_code)] + pub(crate) rounds_f_end: usize, + pub(crate) rounds: usize, + pub(crate) mat_internal_diag_m_1: Vec, + pub(crate) _mat_internal: Vec>, + pub(crate) round_constants: Vec>, +} + +impl Poseidon2Params { + #[allow(clippy::too_many_arguments)] + + pub const INIT_SHAKE: &'static str = "Poseidon2"; + + pub fn new( + t: usize, + d: usize, + rounds_f: usize, + rounds_p: usize, + mat_internal_diag_m_1: &[F], + mat_internal: &[Vec], + round_constants: &[Vec], + ) -> Self { + assert!(d == 3 || d == 5 || d == 7 || d == 11); + assert_eq!(rounds_f % 2, 0); + let r = rounds_f / 2; + let rounds = rounds_f + rounds_p; + + Poseidon2Params { + t, + d, + rounds_f_beginning: r, + rounds_p, + rounds_f_end: r, + rounds, + mat_internal_diag_m_1: mat_internal_diag_m_1.to_owned(), + _mat_internal: mat_internal.to_owned(), + round_constants: round_constants.to_owned(), + } + } +} +#[derive(Clone, Debug)] +pub struct Poseidon2 { + pub(crate) params: Arc>, +} + +impl Poseidon2 { + pub fn new(params: &Arc>) -> Self { + Poseidon2 { + params: Arc::clone(params), + } + } + + pub fn get_t(&self) -> usize { + self.params.t + } + + pub fn permutation(&self, input: &[F]) -> Vec { + let t = self.params.t; + assert_eq!(input.len(), t); + + let mut current_state = input.to_owned(); + + // Linear layer at beginning + self.matmul_external(&mut current_state); + + for r in 0..self.params.rounds_f_beginning { + current_state = self.add_rc(¤t_state, &self.params.round_constants[r]); + current_state = self.sbox(¤t_state); + self.matmul_external(&mut current_state); + } + + let p_end = self.params.rounds_f_beginning + self.params.rounds_p; + for r in self.params.rounds_f_beginning..p_end { + current_state[0].add_assign(self.params.round_constants[r][0]); + current_state[0] = self.sbox_p(¤t_state[0]); + self.matmul_internal(&mut current_state, &self.params.mat_internal_diag_m_1); + } + + for r in p_end..self.params.rounds { + current_state = self.add_rc(¤t_state, &self.params.round_constants[r]); + current_state = self.sbox(¤t_state); + self.matmul_external(&mut current_state); + } + current_state + } + + fn sbox(&self, input: &[F]) -> Vec { + input.iter().map(|el| self.sbox_p(el)).collect() + } + + fn sbox_p(&self, input: &F) -> F { + let mut input2 = *input; + input2.mul_assign(input2); + + match self.params.d { + 3 => { + let mut out = input2; + out.mul_assign(*input); + out + } + 5 => { + let mut out = input2; + out.mul_assign(out); + out.mul_assign(*input); + out + } + 7 => { + let mut out = input2; + out.mul_assign(out); + out.mul_assign(input2); + out.mul_assign(*input); + out + } + _ => { + panic!() + } + } + } + + fn matmul_m4(&self, input: &mut[F]) { + let t = self.params.t; + let t4 = t / 4; + for i in 0..t4 { + let start_index = i * 4; + let mut t_0 = input[start_index]; + t_0.add_assign(input[start_index + 1]); + let mut t_1 = input[start_index + 2]; + t_1.add_assign(input[start_index + 3]); + let mut t_2 = input[start_index + 1]; + t_2.add_assign(t_2); + t_2.add_assign(t_1); + let mut t_3 = input[start_index + 3]; + t_3.add_assign(t_3); + t_3.add_assign(t_0); + let mut t_4 = t_1; + t_4.add_assign(t_4); + t_4.add_assign(t_4); + t_4.add_assign(t_3); + let mut t_5 = t_0; + t_5.add_assign(t_5); + t_5.add_assign(t_5); + t_5.add_assign(t_2); + let mut t_6 = t_3; + t_6.add_assign(t_5); + let mut t_7 = t_2; + t_7.add_assign(t_4); + input[start_index] = t_6; + input[start_index + 1] = t_5; + input[start_index + 2] = t_7; + input[start_index + 3] = t_4; + } + } + + fn matmul_external(&self, input: &mut[F]) { + let t = self.params.t; + match t { + 2 => { + // Matrix circ(2, 1) + let mut sum = input[0]; + sum.add_assign(input[1]); + input[0].add_assign(sum); + input[1].add_assign(sum); + } + 3 => { + // Matrix circ(2, 1, 1) + let mut sum = input[0]; + sum.add_assign(input[1]); + sum.add_assign(input[2]); + input[0].add_assign(sum); + input[1].add_assign(sum); + input[2].add_assign(sum); + } + 4 => { + // Applying cheap 4x4 MDS matrix to each 4-element part of the state + self.matmul_m4(input); + } + 8 | 12 | 16 | 20 | 24 => { + // Applying cheap 4x4 MDS matrix to each 4-element part of the state + self.matmul_m4(input); + + // Applying second cheap matrix for t > 4 + let t4 = t / 4; + let mut stored = [F::ZERO; 4]; + for l in 0..4 { + stored[l] = input[l]; + for j in 1..t4 { + stored[l].add_assign(input[4 * j + l]); + } + } + for i in 0..input.len() { + input[i].add_assign(stored[i % 4]); + } + } + _ => { + panic!() + } + } + } + + fn matmul_internal(&self, input: &mut[F], mat_internal_diag_m_1: &[F]) { + let t = self.params.t; + + match t { + 2 => { + // [2, 1] + // [1, 3] + let mut sum = input[0]; + sum.add_assign(input[1]); + input[0].add_assign(sum); + input[1].add_assign(input[1]); + input[1].add_assign(sum); + } + 3 => { + // [2, 1, 1] + // [1, 2, 1] + // [1, 1, 3] + let mut sum = input[0]; + sum.add_assign(input[1]); + sum.add_assign(input[2]); + input[0].add_assign(sum); + input[1].add_assign(sum); + input[2].add_assign(input[2]); + input[2].add_assign(sum); + } + 4 | 8 | 12 | 16 | 20 | 24 => { + // Compute input sum + let mut sum = input[0]; + input + .iter() + .skip(1) + .take(t-1) + .for_each(|el| sum.add_assign(*el)); + // Add sum + diag entry * element to each element + for i in 0..input.len() { + input[i].mul_assign(mat_internal_diag_m_1[i]); + input[i].add_assign(sum); + } + } + _ => { + panic!() + } + } + } + + fn add_rc(&self, input: &[F], rc: &[F]) -> Vec { + input + .iter() + .zip(rc.iter()) + .map(|(a, b)| { + let mut r = *a; + r.add_assign(*b); + r + }) + .collect() + } +} + + +//merkle tree +pub trait MerkleTreeHash { + fn compress(&self, input: &[&F]) -> Vec; +} + +#[derive(Clone, Debug)] +pub struct MerkleTree> { + perm: P, + field: PhantomData, +} + +impl> MerkleTree { + pub fn new(perm: P) -> Self { + MerkleTree { + perm, + field: PhantomData, + } + } + + fn round_up_pow_n(input: usize, n: usize) -> usize { + debug_assert!(n >= 1); + let mut res = 1; + // try powers, starting from n + loop { + res *= n; + if res >= input { + break; + } + } + res + } + + pub fn accumulate(&mut self, set: &[F]) -> Vec { + assert!(set.len()%8 == 0); + let set_size = set.len() / 8; + let mut bound = Self::round_up_pow_n(set_size, 2); + loop { + if bound >= 2 { + break; + } + bound *= 2; + } + let mut nodes: Vec = Vec::with_capacity(bound * 8); + for s in set { + nodes.push(s.to_owned()); + } + // pad + for _ in nodes.len()..bound { + nodes.push(nodes[set_size * 8 - 1].to_owned()); + } + + while nodes.len() > 8 { + let new_len = nodes.len() / 2; + let mut new_nodes: Vec = Vec::with_capacity(new_len); + for i in (0..nodes.len()).step_by(16) { + let inp = [ + &nodes[i], &nodes[i + 1], &nodes[i + 2], &nodes[i + 3], &nodes[i + 4], &nodes[i + 5], &nodes[i + 6], &nodes[i + 7], + &nodes[i + 8], &nodes[i + 9], &nodes[i + 10], &nodes[i + 11], &nodes[i + 12], &nodes[i + 13], &nodes[i + 14], &nodes[i + 15] + ]; + let dig = self.perm.compress(&inp); + + for j in 0..8 { + new_nodes.push(dig[j]); + } + + } + nodes = new_nodes; + } + vec![nodes[0].to_owned(), nodes[1].to_owned(), nodes[2].to_owned(), nodes[3].to_owned(), nodes[4].to_owned(), nodes[5].to_owned(), nodes[6].to_owned(), nodes[7].to_owned()] + } +} + +impl MerkleTreeHash for Poseidon2 { + fn compress(&self, input: &[&F]) -> Vec { + let p = self.permutation(&[ + input[0].to_owned(), input[1].to_owned(),input[2].to_owned(), input[3].to_owned(),input[4].to_owned(), input[5].to_owned(),input[6].to_owned(), input[7].to_owned(), + input[8].to_owned(), input[9].to_owned(),input[10].to_owned(), input[11].to_owned(),input[12].to_owned(), input[13].to_owned(),input[14].to_owned(), input[15].to_owned(), + F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO + ]); + + vec![p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]] + } +} + +//--------------------- +lazy_static!{ +pub static ref MAT_DIAG24_M_1: Vec = vec![ + BabyBearElem::from(0x409133f0 as u32), + BabyBearElem::from(0x1667a8a1 as u32), + BabyBearElem::from(0x06a6c7b6 as u32), + BabyBearElem::from(0x6f53160e as u32), + BabyBearElem::from(0x273b11d1 as u32), + BabyBearElem::from(0x03176c5d as u32), + BabyBearElem::from(0x72f9bbf9 as u32), + BabyBearElem::from(0x73ceba91 as u32), + BabyBearElem::from(0x5cdef81d as u32), + BabyBearElem::from(0x01393285 as u32), + BabyBearElem::from(0x46daee06 as u32), + BabyBearElem::from(0x065d7ba6 as u32), + BabyBearElem::from(0x52d72d6f as u32), + BabyBearElem::from(0x05dd05e0 as u32), + BabyBearElem::from(0x3bab4b63 as u32), + BabyBearElem::from(0x6ada3842 as u32), + BabyBearElem::from(0x2fc5fbec as u32), + BabyBearElem::from(0x770d61b0 as u32), + BabyBearElem::from(0x5715aae9 as u32), + BabyBearElem::from(0x03ef0e90 as u32), + BabyBearElem::from(0x75b6c770 as u32), + BabyBearElem::from(0x242adf5f as u32), + BabyBearElem::from(0x00d0ca4c as u32), + BabyBearElem::from(0x36c0e388 as u32), + ]; + + pub static ref MAT_INTERNAL24: Vec> = vec![ + vec![BabyBearElem::from(0x409133f1 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x1667a8a2 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x06a6c7b7 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x6f53160f as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x273b11d2 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x03176c5e as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x72f9bbfa as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x73ceba92 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x5cdef81e as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x01393286 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x46daee07 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x065d7ba7 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x52d72d70 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x05dd05e1 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x3bab4b64 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x6ada3843 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x2fc5fbed as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x770d61b1 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x5715aaea as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x03ef0e91 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x75b6c771 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x242adf60 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00d0ca4d as u32), + BabyBearElem::from(0x00000001 as u32), + ], + vec![BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x00000001 as u32), + BabyBearElem::from(0x36c0e389 as u32), + ], + ]; + + pub static ref RC24: Vec> = vec![ + vec![BabyBearElem::from(0x0fa20c37 as u32), + BabyBearElem::from(0x0795bb97 as u32), + BabyBearElem::from(0x12c60b9c as u32), + BabyBearElem::from(0x0eabd88e as u32), + BabyBearElem::from(0x096485ca as u32), + BabyBearElem::from(0x07093527 as u32), + BabyBearElem::from(0x1b1d4e50 as u32), + BabyBearElem::from(0x30a01ace as u32), + BabyBearElem::from(0x3bd86f5a as u32), + BabyBearElem::from(0x69af7c28 as u32), + BabyBearElem::from(0x3f94775f as u32), + BabyBearElem::from(0x731560e8 as u32), + BabyBearElem::from(0x465a0ecd as u32), + BabyBearElem::from(0x574ef807 as u32), + BabyBearElem::from(0x62fd4870 as u32), + BabyBearElem::from(0x52ccfe44 as u32), + BabyBearElem::from(0x14772b14 as u32), + BabyBearElem::from(0x4dedf371 as u32), + BabyBearElem::from(0x260acd7c as u32), + BabyBearElem::from(0x1f51dc58 as u32), + BabyBearElem::from(0x75125532 as u32), + BabyBearElem::from(0x686a4d7b as u32), + BabyBearElem::from(0x54bac179 as u32), + BabyBearElem::from(0x31947706 as u32), + ], + vec![BabyBearElem::from(0x29799d3b as u32), + BabyBearElem::from(0x6e01ae90 as u32), + BabyBearElem::from(0x203a7a64 as u32), + BabyBearElem::from(0x4f7e25be as u32), + BabyBearElem::from(0x72503f77 as u32), + BabyBearElem::from(0x45bd3b69 as u32), + BabyBearElem::from(0x769bd6b4 as u32), + BabyBearElem::from(0x5a867f08 as u32), + BabyBearElem::from(0x4fdba082 as u32), + BabyBearElem::from(0x251c4318 as u32), + BabyBearElem::from(0x28f06201 as u32), + BabyBearElem::from(0x6788c43a as u32), + BabyBearElem::from(0x4c6d6a99 as u32), + BabyBearElem::from(0x357784a8 as u32), + BabyBearElem::from(0x2abaf051 as u32), + BabyBearElem::from(0x770f7de6 as u32), + BabyBearElem::from(0x1794b784 as u32), + BabyBearElem::from(0x4796c57a as u32), + BabyBearElem::from(0x724b7a10 as u32), + BabyBearElem::from(0x449989a7 as u32), + BabyBearElem::from(0x64935cf1 as u32), + BabyBearElem::from(0x59e14aac as u32), + BabyBearElem::from(0x0e620bb8 as u32), + BabyBearElem::from(0x3af5a33b as u32), + ], + vec![BabyBearElem::from(0x4465cc0e as u32), + BabyBearElem::from(0x019df68f as u32), + BabyBearElem::from(0x4af8d068 as u32), + BabyBearElem::from(0x08784f82 as u32), + BabyBearElem::from(0x0cefdeae as u32), + BabyBearElem::from(0x6337a467 as u32), + BabyBearElem::from(0x32fa7a16 as u32), + BabyBearElem::from(0x486f62d6 as u32), + BabyBearElem::from(0x386a7480 as u32), + BabyBearElem::from(0x20f17c4a as u32), + BabyBearElem::from(0x54e50da8 as u32), + BabyBearElem::from(0x2012cf03 as u32), + BabyBearElem::from(0x5fe52950 as u32), + BabyBearElem::from(0x09afb6cd as u32), + BabyBearElem::from(0x2523044e as u32), + BabyBearElem::from(0x5c54d0ef as u32), + BabyBearElem::from(0x71c01f3c as u32), + BabyBearElem::from(0x60b2c4fb as u32), + BabyBearElem::from(0x4050b379 as u32), + BabyBearElem::from(0x5e6a70a5 as u32), + BabyBearElem::from(0x418543f5 as u32), + BabyBearElem::from(0x71debe56 as u32), + BabyBearElem::from(0x1aad2994 as u32), + BabyBearElem::from(0x3368a483 as u32), + ], + vec![BabyBearElem::from(0x07a86f3a as u32), + BabyBearElem::from(0x5ea43ff1 as u32), + BabyBearElem::from(0x2443780e as u32), + BabyBearElem::from(0x4ce444f7 as u32), + BabyBearElem::from(0x146f9882 as u32), + BabyBearElem::from(0x3132b089 as u32), + BabyBearElem::from(0x197ea856 as u32), + BabyBearElem::from(0x667030c3 as u32), + BabyBearElem::from(0x2317d5dc as u32), + BabyBearElem::from(0x0c2c48a7 as u32), + BabyBearElem::from(0x56b2df66 as u32), + BabyBearElem::from(0x67bd81e9 as u32), + BabyBearElem::from(0x4fcdfb19 as u32), + BabyBearElem::from(0x4baaef32 as u32), + BabyBearElem::from(0x0328d30a as u32), + BabyBearElem::from(0x6235760d as u32), + BabyBearElem::from(0x12432912 as u32), + BabyBearElem::from(0x0a49e258 as u32), + BabyBearElem::from(0x030e1b70 as u32), + BabyBearElem::from(0x48caeb03 as u32), + BabyBearElem::from(0x49e4d9e9 as u32), + BabyBearElem::from(0x1051b5c6 as u32), + BabyBearElem::from(0x6a36dbbe as u32), + BabyBearElem::from(0x4cff27a5 as u32), + ], + vec![BabyBearElem::from(0x1da78ec2 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x730b0924 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x3eb56cf3 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x5bd93073 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x37204c97 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x51642d89 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x66e943e8 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x1a3e72de as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x70beb1e9 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x30ff3b3f as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x4240d1c4 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x12647b8d as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x65d86965 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x49ef4d7c as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x47785697 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x46b3969f as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x5c7b7a0e as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x7078fc60 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x4f22d482 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x482a9aee as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x6beb839d as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + BabyBearElem::from(0x00000000 as u32), + ], + vec![BabyBearElem::from(0x032959ad as u32), + BabyBearElem::from(0x2b18af6a as u32), + BabyBearElem::from(0x55d3dc8c as u32), + BabyBearElem::from(0x43bd26c8 as u32), + BabyBearElem::from(0x0c41595f as u32), + BabyBearElem::from(0x7048d2e2 as u32), + BabyBearElem::from(0x00db8983 as u32), + BabyBearElem::from(0x2af563d7 as u32), + BabyBearElem::from(0x6e84758f as u32), + BabyBearElem::from(0x611d64e1 as u32), + BabyBearElem::from(0x1f9977e2 as u32), + BabyBearElem::from(0x64163a0a as u32), + BabyBearElem::from(0x5c5fc27b as u32), + BabyBearElem::from(0x02e22561 as u32), + BabyBearElem::from(0x3a2d75db as u32), + BabyBearElem::from(0x1ba7b71a as u32), + BabyBearElem::from(0x34343f64 as u32), + BabyBearElem::from(0x7406b35d as u32), + BabyBearElem::from(0x19df8299 as u32), + BabyBearElem::from(0x6ff4480a as u32), + BabyBearElem::from(0x514a81c8 as u32), + BabyBearElem::from(0x57ab52ce as u32), + BabyBearElem::from(0x6ad69f52 as u32), + BabyBearElem::from(0x3e0c0e0d as u32), + ], + vec![BabyBearElem::from(0x48126114 as u32), + BabyBearElem::from(0x2a9d62cc as u32), + BabyBearElem::from(0x17441f23 as u32), + BabyBearElem::from(0x485762bb as u32), + BabyBearElem::from(0x2f218674 as u32), + BabyBearElem::from(0x06fdc64a as u32), + BabyBearElem::from(0x0861b7f2 as u32), + BabyBearElem::from(0x3b36eee6 as u32), + BabyBearElem::from(0x70a11040 as u32), + BabyBearElem::from(0x04b31737 as u32), + BabyBearElem::from(0x3722a872 as u32), + BabyBearElem::from(0x2a351c63 as u32), + BabyBearElem::from(0x623560dc as u32), + BabyBearElem::from(0x62584ab2 as u32), + BabyBearElem::from(0x382c7c04 as u32), + BabyBearElem::from(0x3bf9edc7 as u32), + BabyBearElem::from(0x0e38fe51 as u32), + BabyBearElem::from(0x376f3b10 as u32), + BabyBearElem::from(0x5381e178 as u32), + BabyBearElem::from(0x3afc61c7 as u32), + BabyBearElem::from(0x5c1bcb4d as u32), + BabyBearElem::from(0x6643ce1f as u32), + BabyBearElem::from(0x2d0af1c1 as u32), + BabyBearElem::from(0x08f583cc as u32), + ], + vec![BabyBearElem::from(0x5d6ff60f as u32), + BabyBearElem::from(0x6324c1e5 as u32), + BabyBearElem::from(0x74412fb7 as u32), + BabyBearElem::from(0x70c0192e as u32), + BabyBearElem::from(0x0b72f141 as u32), + BabyBearElem::from(0x4067a111 as u32), + BabyBearElem::from(0x57388c4f as u32), + BabyBearElem::from(0x351009ec as u32), + BabyBearElem::from(0x0974c159 as u32), + BabyBearElem::from(0x539a58b3 as u32), + BabyBearElem::from(0x038c0cff as u32), + BabyBearElem::from(0x476c0392 as u32), + BabyBearElem::from(0x3f7bc15f as u32), + BabyBearElem::from(0x4491dd2c as u32), + BabyBearElem::from(0x4d1fef55 as u32), + BabyBearElem::from(0x04936ae3 as u32), + BabyBearElem::from(0x58214dd4 as u32), + BabyBearElem::from(0x683c6aad as u32), + BabyBearElem::from(0x1b42f16b as u32), + BabyBearElem::from(0x6dc79135 as u32), + BabyBearElem::from(0x2d4e71ec as u32), + BabyBearElem::from(0x3e2946ea as u32), + BabyBearElem::from(0x59dce8db as u32), + BabyBearElem::from(0x6cee892a as u32), + ], + vec![BabyBearElem::from(0x47f07350 as u32), + BabyBearElem::from(0x7106ce93 as u32), + BabyBearElem::from(0x3bd4a7a9 as u32), + BabyBearElem::from(0x2bfe636a as u32), + BabyBearElem::from(0x430011e9 as u32), + BabyBearElem::from(0x001cd66a as u32), + BabyBearElem::from(0x307faf5b as u32), + BabyBearElem::from(0x0d9ef3fe as u32), + BabyBearElem::from(0x6d40043a as u32), + BabyBearElem::from(0x2e8f470c as u32), + BabyBearElem::from(0x1b6865e8 as u32), + BabyBearElem::from(0x0c0e6c01 as u32), + BabyBearElem::from(0x4d41981f as u32), + BabyBearElem::from(0x423b9d3d as u32), + BabyBearElem::from(0x410408cc as u32), + BabyBearElem::from(0x263f0884 as u32), + BabyBearElem::from(0x5311bbd0 as u32), + BabyBearElem::from(0x4dae58d8 as u32), + BabyBearElem::from(0x30401cea as u32), + BabyBearElem::from(0x09afa575 as u32), + BabyBearElem::from(0x4b3d5b42 as u32), + BabyBearElem::from(0x63ac0b37 as u32), + BabyBearElem::from(0x5fe5bb14 as u32), + BabyBearElem::from(0x5244e9d4 as u32), + ], + ]; + + pub static ref POSEIDON2_BABYBEAR_24_PARAMS: Arc> = Arc::new(Poseidon2Params::new(24, 7, 8, 21, &MAT_DIAG24_M_1, &MAT_INTERNAL24, &RC24)); + +} + +risc0_zkvm::guest::entry!(main); + +pub fn main() { + + let data: Vec = env::read(); + + let cycles1 = env::get_cycle_count(); + let mut hash_data: Vec = Vec::new(); + for i in 0..data.len() { + let a_uncompressed = BabyBearElem::from(*data.get(i).unwrap()); + hash_data.push(a_uncompressed); + } + let cycles2 = env::get_cycle_count(); + + + let permutation = Poseidon2::new(&POSEIDON2_BABYBEAR_24_PARAMS); + let mut merkle_tree = MerkleTree::new(permutation.clone()); + let cycles3 = env::get_cycle_count(); + let hash_final = merkle_tree.accumulate(&hash_data); + + let cycles4 = env::get_cycle_count(); + + let mut perm_seralised: Vec = Vec::new(); + for i in 0..8 { + let temp: u32 = hash_final.get(i).unwrap().into(); + perm_seralised.push(temp); + + } + let cycles6 = env::get_cycle_count(); + + env::commit(&perm_seralised); + + eprintln!("number of cycles for input builder: {:?}", cycles2 - cycles1); + eprintln!("number of cycles for hash permutation builder: {:?}", cycles3 - cycles2); + eprintln!("number of cycles for hash accumulation: {:?}", cycles4 - cycles3); + + eprintln!("number of cycles for permutation seralisation: {:?}", cycles6 - cycles4); + +} diff --git a/hash/risc0/bench/run.sh b/hash/risc0/bench/run.sh index 3a91834..b3e6f11 100755 --- a/hash/risc0/bench/run.sh +++ b/hash/risc0/bench/run.sh @@ -28,7 +28,7 @@ echo "Input Size (KB) = $ZKBENCH_INPUT_SIZE_KB" # Run the benchmarks using cargo run # Check if the environment variable is set to "poseidon2_bn128" -if [[ "$ZKBENCH_HASH_TYPE" == "poseidon2_bn128" || "$ZKBENCH_HASH_TYPE" == "poseidon2_babybear" ]]; then +if [[ "$ZKBENCH_HASH_TYPE" == "poseidon2_bn128" || "$ZKBENCH_HASH_TYPE" == "poseidon2_babybear" || "$ZKBENCH_HASH_TYPE" == "poseidon2_babybear_native" ]]; then # echo "Running Poseidon2 benchmark over bn128 field" CARGO_BUILD_JOBS=$ZKBENCH_NTHREADS cargo run $ZKBENCH_HASH_TYPE $ZKBENCH_TREE_DEPTH else diff --git a/hash/risc0/bench/src/benches/mod.rs b/hash/risc0/bench/src/benches/mod.rs index d3382cf..c5bbdea 100644 --- a/hash/risc0/bench/src/benches/mod.rs +++ b/hash/risc0/bench/src/benches/mod.rs @@ -3,4 +3,5 @@ pub mod keccak; pub mod blake2b; pub mod blake3; pub mod poseidon2_bn128; -pub mod poseidon2_babybear; \ No newline at end of file +pub mod poseidon2_babybear; +pub mod poseidon2_babybear_native; \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/poseidon2_babybear.rs b/hash/risc0/bench/src/benches/poseidon2_babybear.rs index d2ede50..73cf58b 100644 --- a/hash/risc0/bench/src/benches/poseidon2_babybear.rs +++ b/hash/risc0/bench/src/benches/poseidon2_babybear.rs @@ -51,8 +51,7 @@ pub fn poseidon2_babybear_bench(mt_depth: usize) { output_deseralised.push(Scalar::deserialize_uncompressed(&**output.get(i).unwrap()).unwrap()); } - eprintln!("size: {:?}", output_deseralised); - // let hash_final = FpBabyBear::deserialize_uncompressed(&*output).unwrap(); + eprintln!("hash: {:?}", output_deseralised); // verify your receipt receipt.verify(POSEIDON2_BABYBEAR_ID).unwrap(); diff --git a/hash/risc0/bench/src/benches/poseidon2_babybear_native.rs b/hash/risc0/bench/src/benches/poseidon2_babybear_native.rs new file mode 100644 index 0000000..d1c7a61 --- /dev/null +++ b/hash/risc0/bench/src/benches/poseidon2_babybear_native.rs @@ -0,0 +1,56 @@ +#![allow(non_snake_case)] +use methods::{ + POSEIDON2_BABYBEAR_NATIVE_ELF, + POSEIDON2_BABYBEAR_NATIVE_ID +}; +use risc0_zkvm::{ + default_prover, + ExecutorEnv +}; +use std::time::Instant; +// use risc0_core::field::baby_bear::BabyBearElem; +use rand::Rng; + +pub fn poseidon2_babybear_native_bench(mt_depth: usize) { + + let t = (1 << mt_depth) * 8; + let mut input: Vec = Vec::new(); + + for _ in 0..t { + + let mut rng = rand::thread_rng(); + let random_u32: u32 = rng.gen(); + input.push(random_u32); + } + + let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); + + // Obtain the default prover. + let prover = default_prover(); + + let start_time = Instant::now(); + // Produce a receipt by proving the specified ELF binary. + let receipt = prover.prove_elf(env, POSEIDON2_BABYBEAR_NATIVE_ELF).unwrap(); + let elapsed_time = start_time.elapsed(); + + // For example: + let output: Vec = receipt.journal.decode().unwrap(); + + // let mut output_deseralised: Vec = Vec::new(); + + // for i in 0..output.len() { + // output_deseralised.push(Scalar::deserialize_uncompressed(&**output.get(i).unwrap()).unwrap()); + // } + + eprintln!("hash: {:?}", output); + // let hash_final = FpBabyBear::deserialize_uncompressed(&*output).unwrap(); + + // verify your receipt + receipt.verify(POSEIDON2_BABYBEAR_NATIVE_ID).unwrap(); + + + eprintln!("Total time: {:?}", elapsed_time); + // eprintln!("Hash: {:?}", hash_final); + + +} \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/poseidon2_bn128.rs b/hash/risc0/bench/src/benches/poseidon2_bn128.rs index db28ed6..9583eec 100644 --- a/hash/risc0/bench/src/benches/poseidon2_bn128.rs +++ b/hash/risc0/bench/src/benches/poseidon2_bn128.rs @@ -3,12 +3,7 @@ use methods::{ }; use risc0_zkvm::{default_prover, ExecutorEnv}; use zkhash::{fields::{bn256::FpBN256, utils::random_scalar}/* , poseidon2::poseidon2_instance_bn256::POSEIDON2_BN256_PARAMS*/}; -// use zkhash::poseidon2::poseidon2::Poseidon2; -// use std::convert::TryFrom; use std::time::Instant; -// use zkhash::merkle_tree::merkle_tree_fp::MerkleTree; -// use std::convert::TryInto; -// use hex::encode_to_slice; use ark_serialize::{CanonicalSerialize, CanonicalDeserialize}; @@ -47,51 +42,4 @@ pub fn poseidon2_bn128_bench(mt_depth: usize) { eprintln!("Total time: {:?}", elapsed_time); eprintln!("Hash: {:?}", hash_final); - - - - - // let input2:[Scalar;16] = [Scalar::from(1), Scalar::from(2), Scalar::from(3), Scalar::from(4),Scalar::from(5), Scalar::from(6), Scalar::from(7), Scalar::from(8),Scalar::from(9), Scalar::from(10), Scalar::from(11), Scalar::from(12), Scalar::from(13), Scalar::from(14), Scalar::from(15), Scalar::from(16)]; - // let hash = merkle_tree.accumulate(&input2); - - // let hash_string = hash.0.to_string(); - // // eprintln!("merkle hash: {:?}",hex::encode(hash_string)); - // eprintln!("merkle hash: {:?}", hash_string); - - // let x = hash.0.0; - // eprintln!("from: {:x}{:x}{:x}{:x}", x[0],x[1], x[2], x[3]); - // eprintln!("scalar: {:?}", Scalar::from(4)); - - // let a = Scalar::from(4); - // let mut uncompressed_bytes = Vec::new(); - // a.serialize_uncompressed(&mut uncompressed_bytes).unwrap(); - // eprintln!("compress: {:?}", uncompressed_bytes); - - // let a_uncompressed = Scalar::deserialize_uncompressed(&*uncompressed_bytes).unwrap(); - // eprintln!("uncompress: {:?}", a_uncompressed); - - // let t = poseidon2.get_t(); - // let input1: Vec = (0..t).map(|_| random_scalar()).collect(); - // let perm = poseidon2.permutation(&input1); - // eprintln!("output: {:?}", perm); - - // let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); - - // Obtain the default prover. - // let prover = default_prover(); - - // let start_time = Instant::now(); - // // Produce a receipt by proving the specified ELF binary. - // let receipt = prover.prove_elf(env, POSEIDON2_BN128_ELF).unwrap(); - // let elapsed_time = start_time.elapsed(); - - // // For example: - // let _output: sha::Digest = receipt.journal.decode().unwrap(); - - // // verify your receipt - // receipt.verify(POSEIDON2_BN128_ID).unwrap(); - - - // eprintln!("Total time: {:?}", elapsed_time); - // eprintln!("Hash: {:?}", _output); } \ No newline at end of file diff --git a/hash/risc0/bench/src/main.rs b/hash/risc0/bench/src/main.rs index 25bfce0..801e862 100644 --- a/hash/risc0/bench/src/main.rs +++ b/hash/risc0/bench/src/main.rs @@ -6,6 +6,7 @@ use benches::{ blake3::blake3_bench, poseidon2_bn128::poseidon2_bn128_bench, poseidon2_babybear::poseidon2_babybear_bench, + poseidon2_babybear_native::poseidon2_babybear_native_bench, }; use rand::Rng; @@ -63,6 +64,13 @@ fn main() { poseidon2_babybear_bench(size_kb); } + "poseidon2_babybear_native" => { + println!("Poseidon2 Benchmarking on the BabyBear field: "); + eprintln!("Tree Depth: {:?}", size_kb); + eprintln!("number of inputs {:?}", (1 << size_kb) * 8); + poseidon2_babybear_native_bench(size_kb); + } + _ => { println!("Wrong Benchmark Name!"); } From 8e0eaa92fb944fb35c311cf5c4ebf45db9bbedf1 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Mon, 8 Jan 2024 22:53:37 +0530 Subject: [PATCH 12/41] different .cfg & .sh file for merkle hashing and linear hashing, check for enough argument added and running from executable build from cargo build --- hash/risc0/bench/README.md | 103 ++---------------- hash/risc0/bench/bench.cfg | 11 +- hash/risc0/bench/bench_tree.cfg | 11 ++ hash/risc0/bench/build.sh | 6 +- .../bench/methods/guest/src/bin/sha256.rs | 14 --- hash/risc0/bench/run.sh | 32 +----- hash/risc0/bench/run_tree.sh | 15 +++ .../bench/src/benches/poseidon2_babybear.rs | 12 +- .../src/benches/poseidon2_babybear_native.rs | 23 ++-- .../bench/src/benches/poseidon2_bn128.rs | 13 ++- hash/risc0/bench/src/benches/sha256.rs | 34 +++--- hash/risc0/bench/src/main.rs | 41 ++++--- 12 files changed, 113 insertions(+), 202 deletions(-) create mode 100644 hash/risc0/bench/bench_tree.cfg create mode 100755 hash/risc0/bench/run_tree.sh diff --git a/hash/risc0/bench/README.md b/hash/risc0/bench/README.md index f1d1022..936cb1a 100644 --- a/hash/risc0/bench/README.md +++ b/hash/risc0/bench/README.md @@ -1,101 +1,12 @@ -# RISC Zero Rust Starter Template +Benchmarking different hashes inside risc'0 zkvm +----------------------------------------------- -Welcome to the RISC Zero Rust Starter Template! This template is intended to -give you a starting point for building a project using the RISC Zero zkVM. -Throughout the template (including in this README), you'll find comments -labelled `TODO` in places where you'll need to make changes. To better -understand the concepts behind this template, check out the [zkVM -Overview][zkvm-overview]. +The benchmark is defined by the following shell scripts: -## Quick Start +- `build.sh` - build the code. you can set the number of threads by setting the environment variable `CARGO_BUILD_JOBS` otherwise the code will build using default number of threads. -First, make sure [rustup] is installed. The -[`rust-toolchain.toml`][rust-toolchain] file will be used by `cargo` to -automatically install the correct version. +- `run.sh` and `run2.sh` - run the benchmark itself (`run.sh` for sha256, keccak, blake2b, blake3 and `run2.sh` for poseidon2 over bn128 and babybear) -To build all methods and execute the method within the zkVM, run the following -command: +Benchmarks can be parameterized using environment variables. By convention, we start the names of these environment variables with the `ZKBENCH_` prefix. -```bash -cargo run -``` - -This is an empty template, and so there is no expected output (until you modify -the code). - -### Running proofs remotely on Bonsai - -_Note: The Bonsai proving service is still in early Alpha; an API key is -required for access. [Click here to request access][bonsai access]._ - -If you have access to the URL and API key to Bonsai you can run your proofs -remotely. To prove in Bonsai mode, invoke `cargo run` with two additional -environment variables: - -```bash -BONSAI_API_KEY="YOUR_API_KEY" BONSAI_API_URL="BONSAI_URL" cargo run -``` - -## How to create a project based on this template - -Search this template for the string `TODO`, and make the necessary changes to -implement the required feature described by the `TODO` comment. Some of these -changes will be complex, and so we have a number of instructional resources to -assist you in learning how to write your own code for the RISC Zero zkVM: - -- The [RISC Zero Developer Docs][dev-docs] is a great place to get started. -- Example projects are available in the [examples folder][examples] of - [`risc0`][risc0-repo] repository. -- Reference documentation is available at [https://docs.rs][docs.rs], including - [`risc0-zkvm`][risc0-zkvm], [`cargo-risczero`][cargo-risczero], - [`risc0-build`][risc0-build], and [others][crates]. - -## Directory Structure - -It is possible to organize the files for these components in various ways. -However, in this starter template we use a standard directory structure for zkVM -applications, which we think is a good starting point for your applications. - -```text -project_name -├── Cargo.toml -├── host -│ ├── Cargo.toml -│ └── src -│ └── main.rs <-- [Host code goes here] -└── methods - ├── Cargo.toml - ├── build.rs - ├── guest - │ ├── Cargo.toml - │ └── src - │ └── bin - │ └── method_name.rs <-- [Guest code goes here] - └── src - └── lib.rs -``` - -## Video Tutorial - -For a walk-through of how to build with this template, check out this [excerpt -from our workshop at ZK HACK III][zkhack-iii]. - -## Questions, Feedback, and Collaborations - -We'd love to hear from you on [Discord][discord] or [Twitter][twitter]. - -[bonsai access]: https://bonsai.xyz/apply -[cargo-risczero]: https://docs.rs/cargo-risczero -[crates]: https://github.com/risc0/risc0/blob/main/README.md#rust-binaries -[dev-docs]: https://dev.risczero.com -[discord]: https://discord.gg/risczero -[docs.rs]: https://docs.rs/releases/search?query=risc0 -[examples]: https://github.com/risc0/risc0/tree/main/examples -[risc0-build]: https://docs.rs/risc0-build -[risc0-repo]: https://www.github.com/risc0/risc0 -[risc0-zkvm]: https://docs.rs/risc0-zkvm -[rustup]: https://rustup.rs -[rust-toolchain]: rust-toolchain.toml -[twitter]: https://twitter.com/risczero -[zkvm-overview]: https://dev.risczero.com/zkvm -[zkhack-iii]: https://www.youtube.com/watch?v=Yg_BGqj_6lg&list=PLcPzhUaCxlCgig7ofeARMPwQ8vbuD6hC5&index=5 +Additional files `bench.cfg` and `bench_tree.cfg` specifies the configurations and parameters. diff --git a/hash/risc0/bench/bench.cfg b/hash/risc0/bench/bench.cfg index 5e47ea2..a5a366f 100644 --- a/hash/risc0/bench/bench.cfg +++ b/hash/risc0/bench/bench.cfg @@ -1,12 +1,11 @@ name: "Hashes benchmarking using risc0 prover" author: -timeout: 100 +timeout: 200 params: - [ PROVER: [ risc0 ] - , INPUT_SIZE: [ 256, 512, 1024, 2048 ] - , WHICH: [ LINEAR ] + [ HASH_TYPE: [ "sha256", "keccak", "blake2b", "blake3"] + , INPUT_SIZE_BYTES: [ 256, 512, 1024, 2048 ] ] -tags: CPU, SHA256, KECCAK, BLAKE2B, BLAKE3, POSEIDON2, BN128, BABYBEAR +tags: risc0, $HASH_TYPE comments: - The benchmarks includes for sha256, keccak, blake2b, blake3 & poseidon2(merkle hashing). + The benchmarks includes for sha256, keccak, blake2b, blake3. the hashing is done inside the guest and receipt is received which is verified. diff --git a/hash/risc0/bench/bench_tree.cfg b/hash/risc0/bench/bench_tree.cfg new file mode 100644 index 0000000..529f0fb --- /dev/null +++ b/hash/risc0/bench/bench_tree.cfg @@ -0,0 +1,11 @@ +name: "Hashes benchmarking using risc0 prover" +author: +timeout: 1000 +params: + [ HASH_TYPE: [ "poseidon2_babybear", "poseidon2_babybear_native", "poseidon2_bn128"] + , TREE_DEPTH: [ 2, 4, 8, 16 ] + ] +tags: risc0, $HASH_TYPE +comments: + The benchmarks includes for poseidon2(merkle hashing) over bn128 and babybear. + the hashing is done inside the guest and receipt is received which is verified. diff --git a/hash/risc0/bench/build.sh b/hash/risc0/bench/build.sh index 26156ef..d1cf927 100755 --- a/hash/risc0/bench/build.sh +++ b/hash/risc0/bench/build.sh @@ -1,3 +1,7 @@ #!/bin/bash -cargo build --release +if [ -z ${ZKBENCH_NTHREADS} ]; then +ZKBENCH_NTHREADS="default" # https://doc.rust-lang.org/cargo/reference/config.html#buildjobs +fi + +CARGO_BUILD_JOBS=$ZKBENCH_NTHREADS cargo build --release diff --git a/hash/risc0/bench/methods/guest/src/bin/sha256.rs b/hash/risc0/bench/methods/guest/src/bin/sha256.rs index d67a766..d13074c 100644 --- a/hash/risc0/bench/methods/guest/src/bin/sha256.rs +++ b/hash/risc0/bench/methods/guest/src/bin/sha256.rs @@ -11,17 +11,3 @@ pub fn main() { env::commit(&hash) } -// accelerated sha2 crate -// #![no_main] - -// use risc0_zkvm::{guest::env}; -// use sha2::{Sha256, Digest}; -// // use base16ct::lower::encode_str; -// risc0_zkvm::guest::entry!(main); - -// pub fn main() { - -// let data: Vec = env::read(); -// let result: [u8;32] = Sha256::digest(data).into(); -// env::commit(&result) -// } diff --git a/hash/risc0/bench/run.sh b/hash/risc0/bench/run.sh index b3e6f11..79b7df8 100755 --- a/hash/risc0/bench/run.sh +++ b/hash/risc0/bench/run.sh @@ -3,35 +3,13 @@ if [ -z ${ZKBENCH_HASH_TYPE} ]; then ZKBENCH_HASH_TYPE="sha256" fi -if [ -z ${ZKBENCH_WHICH} ]; then -ZKBENCH_WHICH="LINEAR" +if [ -z ${ZKBENCH_INPUT_SIZE_BYTES} ]; then +ZKBENCH_INPUT_SIZE_BYTES=1024 fi -if [ -z ${ZKBENCH_NTHREADS} ]; then -ZKBENCH_NTHREADS=1 -fi - -if [ -z ${ZKBENCH_INPUT_SIZE_KB} ]; then -ZKBENCH_INPUT_SIZE_KB=1024 -fi - -if [ -z ${ZKBENCH_TREE_DEPTH} ]; then -ZKBENCH_TREE_DEPTH=4 -fi - - echo "Running benchmarks with the following configurations:" echo "HASH = $ZKBENCH_HASH_TYPE" -# echo "WHICH = $ZKBENCH_WHICH" -echo "NTHREADS = $ZKBENCH_NTHREADS" -echo "Input Size (KB) = $ZKBENCH_INPUT_SIZE_KB" +echo "Input Size (Bytes) = $ZKBENCH_INPUT_SIZE_BYTES" -# Run the benchmarks using cargo run -# Check if the environment variable is set to "poseidon2_bn128" -if [[ "$ZKBENCH_HASH_TYPE" == "poseidon2_bn128" || "$ZKBENCH_HASH_TYPE" == "poseidon2_babybear" || "$ZKBENCH_HASH_TYPE" == "poseidon2_babybear_native" ]]; then - # echo "Running Poseidon2 benchmark over bn128 field" - CARGO_BUILD_JOBS=$ZKBENCH_NTHREADS cargo run $ZKBENCH_HASH_TYPE $ZKBENCH_TREE_DEPTH -else - CARGO_BUILD_JOBS=$ZKBENCH_NTHREADS cargo run $ZKBENCH_HASH_TYPE $ZKBENCH_INPUT_SIZE_KB - -fi \ No newline at end of file +# Run the benchmarks +./target/release/benchmark $ZKBENCH_HASH_TYPE $ZKBENCH_INPUT_SIZE_BYTES \ No newline at end of file diff --git a/hash/risc0/bench/run_tree.sh b/hash/risc0/bench/run_tree.sh new file mode 100755 index 0000000..cdd865e --- /dev/null +++ b/hash/risc0/bench/run_tree.sh @@ -0,0 +1,15 @@ +#!/bin/bash +if [ -z ${ZKBENCH_HASH_TYPE} ]; then +ZKBENCH_HASH_TYPE="poseidon2_babybear_native" +fi + +if [ -z ${ZKBENCH_TREE_DEPTH} ]; then +ZKBENCH_TREE_DEPTH=2 +fi + +echo "Running benchmarks with the following configurations:" +echo "HASH = $ZKBENCH_HASH_TYPE" +echo "Tree Depth = $ZKBENCH_TREE_DEPTH" + +# Run the benchmarks +./target/release/benchmark $ZKBENCH_HASH_TYPE $ZKBENCH_TREE_DEPTH \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/poseidon2_babybear.rs b/hash/risc0/bench/src/benches/poseidon2_babybear.rs index 73cf58b..b3ae1f1 100644 --- a/hash/risc0/bench/src/benches/poseidon2_babybear.rs +++ b/hash/risc0/bench/src/benches/poseidon2_babybear.rs @@ -42,6 +42,11 @@ pub fn poseidon2_babybear_bench(mt_depth: usize) { let receipt = prover.prove_elf(env, POSEIDON2_BABYBEAR_ELF).unwrap(); let elapsed_time = start_time.elapsed(); + // verify your receipt + receipt.verify(POSEIDON2_BABYBEAR_ID).unwrap(); + + let elapsed_time2 = start_time.elapsed(); + // For example: let output: Vec> = receipt.journal.decode().unwrap(); @@ -52,12 +57,9 @@ pub fn poseidon2_babybear_bench(mt_depth: usize) { } eprintln!("hash: {:?}", output_deseralised); + eprintln!("Total time: {:?}", elapsed_time2); + eprintln!("Verification time: {:?}", elapsed_time2 - elapsed_time); - // verify your receipt - receipt.verify(POSEIDON2_BABYBEAR_ID).unwrap(); - - - eprintln!("Total time: {:?}", elapsed_time); // eprintln!("Hash: {:?}", hash_final); diff --git a/hash/risc0/bench/src/benches/poseidon2_babybear_native.rs b/hash/risc0/bench/src/benches/poseidon2_babybear_native.rs index d1c7a61..9b92da3 100644 --- a/hash/risc0/bench/src/benches/poseidon2_babybear_native.rs +++ b/hash/risc0/bench/src/benches/poseidon2_babybear_native.rs @@ -8,7 +8,6 @@ use risc0_zkvm::{ ExecutorEnv }; use std::time::Instant; -// use risc0_core::field::baby_bear::BabyBearElem; use rand::Rng; pub fn poseidon2_babybear_native_bench(mt_depth: usize) { @@ -33,24 +32,16 @@ pub fn poseidon2_babybear_native_bench(mt_depth: usize) { let receipt = prover.prove_elf(env, POSEIDON2_BABYBEAR_NATIVE_ELF).unwrap(); let elapsed_time = start_time.elapsed(); - // For example: - let output: Vec = receipt.journal.decode().unwrap(); - - // let mut output_deseralised: Vec = Vec::new(); - - // for i in 0..output.len() { - // output_deseralised.push(Scalar::deserialize_uncompressed(&**output.get(i).unwrap()).unwrap()); - // } - - eprintln!("hash: {:?}", output); - // let hash_final = FpBabyBear::deserialize_uncompressed(&*output).unwrap(); - // verify your receipt receipt.verify(POSEIDON2_BABYBEAR_NATIVE_ID).unwrap(); - - eprintln!("Total time: {:?}", elapsed_time); - // eprintln!("Hash: {:?}", hash_final); + let elapsed_time2 = start_time.elapsed(); + let output: Vec = receipt.journal.decode().unwrap(); + + eprintln!("hash: {:?}", output); + + eprintln!("Total time: {:?}", elapsed_time2); + eprintln!("Verification time: {:?}", elapsed_time2 - elapsed_time); } \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/poseidon2_bn128.rs b/hash/risc0/bench/src/benches/poseidon2_bn128.rs index 9583eec..8bb4b25 100644 --- a/hash/risc0/bench/src/benches/poseidon2_bn128.rs +++ b/hash/risc0/bench/src/benches/poseidon2_bn128.rs @@ -30,16 +30,19 @@ pub fn poseidon2_bn128_bench(mt_depth: usize) { let receipt = prover.prove_elf(env, POSEIDON2_BN128_ELF).unwrap(); let elapsed_time = start_time.elapsed(); + + // verify your receipt + receipt.verify(POSEIDON2_BN128_ID).unwrap(); + + let elapsed_time2 = start_time.elapsed(); + // For example: let output: Vec = receipt.journal.decode().unwrap(); let hash_final = Scalar::deserialize_uncompressed(&*output).unwrap(); - // verify your receipt - receipt.verify(POSEIDON2_BN128_ID).unwrap(); - - - eprintln!("Total time: {:?}", elapsed_time); eprintln!("Hash: {:?}", hash_final); + eprintln!("Total time: {:?}", elapsed_time2); + eprintln!("Verification time: {:?}", elapsed_time2 - elapsed_time); } \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/sha256.rs b/hash/risc0/bench/src/benches/sha256.rs index 46a0489..44527ea 100644 --- a/hash/risc0/bench/src/benches/sha256.rs +++ b/hash/risc0/bench/src/benches/sha256.rs @@ -3,34 +3,35 @@ use methods::{ }; use risc0_zkvm::{default_prover, ExecutorEnv}; use risc0_zkvm::{ sha}; -// use sha2; -// use rand::RngCore; use std::time::Instant; - +use hex::encode; pub fn sha_bench(input: Vec) { - let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); // Obtain the default prover. let prover = default_prover(); - eprintln!("------risc0_zkvm sha hashing------"); + eprintln!("\n------risc0_zkvm sha hashing------\n"); + let start_time = Instant::now(); // Produce a receipt by proving the specified ELF binary. let receipt = prover.prove_elf(env, SHA256_ELF).unwrap(); let elapsed_time = start_time.elapsed(); - // For example: - let _output: sha::Digest = receipt.journal.decode().unwrap(); - // verify your receipt receipt.verify(SHA256_ID).unwrap(); - eprintln!("Total time: {:?}", elapsed_time); + let elapsed_time2 = start_time.elapsed(); + + let _output: sha::Digest = receipt.journal.decode().unwrap(); + + eprintln!("Total time: {:?}", elapsed_time2); + eprintln!("Verification time: {:?}", elapsed_time2 - elapsed_time); + eprintln!("Hash: {:?}", _output); let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); - eprintln!("------RustCrypto sha hashing------"); + eprintln!("\n------RustCrypto sha hashing(accelerated)------\n"); // Obtain the default prover. let prover = default_prover(); @@ -39,12 +40,15 @@ pub fn sha_bench(input: Vec) { let receipt = prover.prove_elf(env, SHA256_ACCELERATED_ELF).unwrap(); let elapsed_time = start_time.elapsed(); - // For example: - let _output: [u8;32] = receipt.journal.decode().unwrap(); - // verify your receipt receipt.verify(SHA256_ACCELERATED_ID).unwrap(); - eprintln!("Total time: {:?}", elapsed_time); - eprintln!("Hash: {:?}", _output); + let elapsed_time2 = start_time.elapsed(); + + let _output: [u8;32] = receipt.journal.decode().unwrap(); + let hash = encode(_output); + eprintln!("Total time: {:?}", elapsed_time2); + eprintln!("Verification time: {:?}", elapsed_time2 - elapsed_time); + + eprintln!("Hash: {:?}", hash); } \ No newline at end of file diff --git a/hash/risc0/bench/src/main.rs b/hash/risc0/bench/src/main.rs index 801e862..bee3f3a 100644 --- a/hash/risc0/bench/src/main.rs +++ b/hash/risc0/bench/src/main.rs @@ -9,6 +9,7 @@ use benches::{ poseidon2_babybear_native::poseidon2_babybear_native_bench, }; use rand::Rng; +use std::process; fn generate_bytes(size: usize) -> Vec { let mut rng = rand::thread_rng(); @@ -19,56 +20,62 @@ fn generate_bytes(size: usize) -> Vec { fn main() { let args: Vec = std::env::args().collect(); + + if args.len() != 3 { + println!("Wrong number of arguments"); + // Exit the program with a non-zero exit code + process::exit(1); + } let hash_type = &args[1]; - let size_kb = args[2].parse::().unwrap(); + let size = args[2].parse::().unwrap(); match hash_type.as_str() { "sha256" => { println!("SHA256 Benchmarking: "); - eprintln!("data size(bytes): {:?}", size_kb); - let input = generate_bytes(size_kb); + eprintln!("data size(bytes): {:?}", size); + let input = generate_bytes(size); sha_bench(input.clone()); } "keccak" => { println!("KECCAK Benchmarking: "); - eprintln!("data size(bytes): {:?}", size_kb); - let input = generate_bytes(size_kb); + eprintln!("data size(bytes): {:?}", size); + let input = generate_bytes(size); keccak_bench(input.clone()); } "blake2b" => { println!("Blake2b Benchmarking: "); - eprintln!("data size(bytes): {:?}", size_kb); - let input = generate_bytes(size_kb); + eprintln!("data size(bytes): {:?}", size); + let input = generate_bytes(size); blake2b_bench(input.clone()); } "blake3" => { println!("Blake3 Benchmarking: "); - eprintln!("data size(bytes): {:?}", size_kb); - let input = generate_bytes(size_kb); + eprintln!("data size(bytes): {:?}", size); + let input = generate_bytes(size); blake3_bench(input.clone()); } "poseidon2_bn128" => { println!("Poseidon2 Benchmarking on the BN128 field: "); - eprintln!("Tree Depth: {:?}", size_kb); - poseidon2_bn128_bench(size_kb); + eprintln!("Tree Depth: {:?}", size); + poseidon2_bn128_bench(size); } "poseidon2_babybear" => { println!("Poseidon2 Benchmarking on the BabyBear field: "); - eprintln!("Tree Depth: {:?}", size_kb); - eprintln!("number of inputs {:?}", (1 << size_kb) * 8); - poseidon2_babybear_bench(size_kb); + eprintln!("Tree Depth: {:?}", size); + eprintln!("number of inputs {:?}", (1 << size) * 8); + poseidon2_babybear_bench(size); } "poseidon2_babybear_native" => { println!("Poseidon2 Benchmarking on the BabyBear field: "); - eprintln!("Tree Depth: {:?}", size_kb); - eprintln!("number of inputs {:?}", (1 << size_kb) * 8); - poseidon2_babybear_native_bench(size_kb); + eprintln!("Tree Depth: {:?}", size); + eprintln!("number of inputs {:?}", (1 << size) * 8); + poseidon2_babybear_native_bench(size); } _ => { From e38c4cf72a5d3c93a109970aae970e4ee819083c Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Thu, 11 Jan 2024 20:27:58 +0530 Subject: [PATCH 13/41] minor changes --- hash/risc0/bench/README.md | 2 +- hash/risc0/bench/build.sh | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/hash/risc0/bench/README.md b/hash/risc0/bench/README.md index 936cb1a..d0bf8ae 100644 --- a/hash/risc0/bench/README.md +++ b/hash/risc0/bench/README.md @@ -3,7 +3,7 @@ Benchmarking different hashes inside risc'0 zkvm The benchmark is defined by the following shell scripts: -- `build.sh` - build the code. you can set the number of threads by setting the environment variable `CARGO_BUILD_JOBS` otherwise the code will build using default number of threads. +- `build.sh` - build the code. - `run.sh` and `run2.sh` - run the benchmark itself (`run.sh` for sha256, keccak, blake2b, blake3 and `run2.sh` for poseidon2 over bn128 and babybear) diff --git a/hash/risc0/bench/build.sh b/hash/risc0/bench/build.sh index d1cf927..0dfa161 100755 --- a/hash/risc0/bench/build.sh +++ b/hash/risc0/bench/build.sh @@ -1,7 +1,3 @@ #!/bin/bash -if [ -z ${ZKBENCH_NTHREADS} ]; then -ZKBENCH_NTHREADS="default" # https://doc.rust-lang.org/cargo/reference/config.html#buildjobs -fi - -CARGO_BUILD_JOBS=$ZKBENCH_NTHREADS cargo build --release + cargo build --release From 3dcd604b5f2f898995233150cc90274732717375 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Fri, 19 Jan 2024 14:39:55 +0530 Subject: [PATCH 14/41] proof composition initial commit, risc0 added as a submodule, changes done according to pre-release version 0.20.0-rc.2 --- .gitmodules | 4 + hash/cpu/external/Blake3 | 2 +- hash/cpu/external/constantine | 2 +- hash/cpu/external/zikkurat-algebra | 2 +- hash/risc0/bench/Cargo.lock | 469 +-- hash/risc0/bench/Cargo.toml | 26 +- hash/risc0/bench/methods/Cargo.toml | 4 +- hash/risc0/bench/methods/guest/Cargo.lock | 259 +- hash/risc0/bench/methods/guest/Cargo.toml | 8 +- .../guest/src/bin/poseidon2_babybear.rs | 11 +- .../src/bin/poseidon2_babybear_native.rs | 11 +- .../methods/guest/src/bin/poseidon2_bn128.rs | 11 +- .../bench/methods/guest/src/bin/sha256.rs | 3 +- .../guest/src/bin/sha256_accelerated.rs | 5 +- hash/risc0/bench/src/benches/blake2b.rs | 4 +- hash/risc0/bench/src/benches/blake3.rs | 4 +- hash/risc0/bench/src/benches/keccak.rs | 4 +- .../bench/src/benches/poseidon2_babybear.rs | 4 +- .../src/benches/poseidon2_babybear_native.rs | 4 +- .../bench/src/benches/poseidon2_bn128.rs | 4 +- hash/risc0/bench/src/benches/sha256.rs | 6 +- hash/risc0/composition/Cargo.lock | 2795 +++++++++++++++++ hash/risc0/composition/Cargo.toml | 16 + hash/risc0/composition/methods/Cargo.toml | 10 + hash/risc0/composition/methods/build.rs | 17 + .../composition/methods/guest/Cargo.lock | 1100 +++++++ .../composition/methods/guest/Cargo.toml | 11 + .../composition/methods/guest/src/main.rs | 26 + hash/risc0/composition/methods/src/lib.rs | 15 + hash/risc0/composition/src/main.rs | 38 + hash/risc0/external/risc0 | 1 + hash/risc0/inner_proof/Cargo.lock | 2778 ++++++++++++++++ hash/risc0/inner_proof/Cargo.toml | 17 + hash/risc0/inner_proof/methods/Cargo.toml | 10 + hash/risc0/inner_proof/methods/build.rs | 17 + .../inner_proof/methods/guest/Cargo.lock | 791 +++++ .../inner_proof/methods/guest/Cargo.toml | 9 + .../inner_proof/methods/guest/src/main.rs | 27 + hash/risc0/inner_proof/methods/src/lib.rs | 15 + hash/risc0/inner_proof/src/lib.rs | 47 + hash/risc0/inner_proof/src/main.rs | 26 + hash/snark/external/hash-circuits | 2 +- 42 files changed, 8309 insertions(+), 306 deletions(-) create mode 100644 hash/risc0/composition/Cargo.lock create mode 100644 hash/risc0/composition/Cargo.toml create mode 100644 hash/risc0/composition/methods/Cargo.toml create mode 100644 hash/risc0/composition/methods/build.rs create mode 100644 hash/risc0/composition/methods/guest/Cargo.lock create mode 100644 hash/risc0/composition/methods/guest/Cargo.toml create mode 100644 hash/risc0/composition/methods/guest/src/main.rs create mode 100644 hash/risc0/composition/methods/src/lib.rs create mode 100644 hash/risc0/composition/src/main.rs create mode 160000 hash/risc0/external/risc0 create mode 100644 hash/risc0/inner_proof/Cargo.lock create mode 100644 hash/risc0/inner_proof/Cargo.toml create mode 100644 hash/risc0/inner_proof/methods/Cargo.toml create mode 100644 hash/risc0/inner_proof/methods/build.rs create mode 100644 hash/risc0/inner_proof/methods/guest/Cargo.lock create mode 100644 hash/risc0/inner_proof/methods/guest/Cargo.toml create mode 100644 hash/risc0/inner_proof/methods/guest/src/main.rs create mode 100644 hash/risc0/inner_proof/methods/src/lib.rs create mode 100644 hash/risc0/inner_proof/src/lib.rs create mode 100644 hash/risc0/inner_proof/src/main.rs diff --git a/.gitmodules b/.gitmodules index 0545ce4..27593ef 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,7 @@ [submodule "hash/snark/src/hash-circuits"] path = hash/snark/external/hash-circuits url = https://github.com/faulhornlabs/hash-circuits +[submodule "hash/risc0/external/risc0"] + path = hash/risc0/external/risc0 + url = https://github.com/risc0/risc0.git + branch = release-0.20 diff --git a/hash/cpu/external/Blake3 b/hash/cpu/external/Blake3 index dd30dcb..4d32708 160000 --- a/hash/cpu/external/Blake3 +++ b/hash/cpu/external/Blake3 @@ -1 +1 @@ -Subproject commit dd30dcb00221591db3a983e0215b81d86cff941d +Subproject commit 4d32708f511fd85c6b0fb131295cc73224246738 diff --git a/hash/cpu/external/constantine b/hash/cpu/external/constantine index 4dd0a02..dbd2630 160000 --- a/hash/cpu/external/constantine +++ b/hash/cpu/external/constantine @@ -1 +1 @@ -Subproject commit 4dd0a02f1afd338f5207e40a47cac6705196b490 +Subproject commit dbd2630daa6d599a9e78ad247e6858baf41664da diff --git a/hash/cpu/external/zikkurat-algebra b/hash/cpu/external/zikkurat-algebra index 96e3497..0fb198a 160000 --- a/hash/cpu/external/zikkurat-algebra +++ b/hash/cpu/external/zikkurat-algebra @@ -1 +1 @@ -Subproject commit 96e349786bd004e64a9cf50e0122f89863b24e92 +Subproject commit 0fb198a9087531f32bb00bd13d4feaf813bc473a diff --git a/hash/risc0/bench/Cargo.lock b/hash/risc0/bench/Cargo.lock index 2135879..4ab16e5 100644 --- a/hash/risc0/bench/Cargo.lock +++ b/hash/risc0/bench/Cargo.lock @@ -17,6 +17,18 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.2" @@ -32,6 +44,52 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[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-crypto-primitives" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-snark", + "ark-std", + "blake2", + "derivative", + "digest", + "sha2 0.10.8", +] + +[[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" @@ -75,17 +133,81 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-groth16" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +dependencies = [ + "ark-crypto-primitives", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[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-relations" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +dependencies = [ + "ark-ff", + "ark-std", + "tracing", + "tracing-subscriber", +] + [[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", "num-bigint", ] +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-snark" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +dependencies = [ + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-std", +] + [[package]] name = "ark-std" version = "0.4.0" @@ -150,16 +272,23 @@ version = "0.1.0" dependencies = [ "ark-ff", "ark-serialize", + "benchmark_methods", "hex", - "methods", "rand", - "risc0-core 0.18.0", + "risc0-core", "risc0-zkvm", "serde", "sha2 0.10.6", "zkhash", ] +[[package]] +name = "benchmark_methods" +version = "0.1.0" +dependencies = [ + "risc0-build", +] + [[package]] name = "bincode" version = "1.3.3" @@ -237,9 +366,7 @@ dependencies = [ [[package]] name = "bonsai-sdk" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "441d1092e11977985946b6564251df91d80ae36982128e53be52a32548ad8762" +version = "0.6.0-rc.2" dependencies = [ "reqwest", "serde", @@ -525,21 +652,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -695,6 +807,15 @@ dependencies = [ "rayon", ] +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + [[package]] name = "hashbrown" version = "0.14.3" @@ -762,6 +883,12 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "human-repr" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" + [[package]] name = "hyper" version = "0.14.27" @@ -787,16 +914,17 @@ dependencies = [ ] [[package]] -name = "hyper-tls" -version = "0.5.0" +name = "hyper-rustls" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ - "bytes", + "futures-util", + "http", "hyper", - "native-tls", + "rustls", "tokio", - "tokio-native-tls", + "tokio-rustls", ] [[package]] @@ -816,7 +944,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.14.3", ] [[package]] @@ -887,7 +1015,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin", + "spin 0.5.2", ] [[package]] @@ -935,13 +1063,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2145869435ace5ea6ea3d35f59be559317ec9a0d04e1812d5f185a87b6d36f1a" -[[package]] -name = "methods" -version = "0.1.0" -dependencies = [ - "risc0-build", -] - [[package]] name = "mime" version = "0.3.17" @@ -974,24 +1095,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "num-bigint" version = "0.4.4" @@ -1058,50 +1161,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" -dependencies = [ - "bitflags 2.4.1", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.97" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "pairing" version = "0.22.0" @@ -1175,12 +1234,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1387,48 +1440,60 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-tls", + "hyper-rustls", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "rustls", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "winreg", ] [[package]] -name = "risc0-binfmt" -version = "0.19.1" +name = "ring" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "923c85a23cb9a9475b8cd4479ad3a06252604a361626e9ae7dc0dc635af22c22" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted", + "windows-sys", +] + +[[package]] +name = "risc0-binfmt" +version = "0.20.0-rc.2" dependencies = [ "anyhow", "elf", - "log", "risc0-zkp", "risc0-zkvm-platform", "serde", + "tracing", ] [[package]] name = "risc0-build" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e58d4cc25e243e52d1ccd75d357b0aa55081736bf3052c65a823fdf169586843" +version = "0.20.0-rc.2" dependencies = [ "anyhow", "cargo_metadata", @@ -1443,27 +1508,21 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97547e10e9fdaaab8b64ffb45dc158b31f023b1a68015c6ce9f12fe3e403012a" +version = "0.20.0-rc.2" dependencies = [ "anyhow", "bytemuck", - "log", - "risc0-core 0.19.1", + "risc0-core", "risc0-zkp", "tracing", ] [[package]] name = "risc0-circuit-rv32im" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a269d01b18cba24ee1a08f68726fc3623e8705ed79d158377d12e9129dcde2e" +version = "0.20.0-rc.2" dependencies = [ "anyhow", - "log", - "risc0-core 0.19.1", + "risc0-core", "risc0-zkp", "risc0-zkvm-platform", "tracing", @@ -1471,19 +1530,7 @@ dependencies = [ [[package]] name = "risc0-core" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08605aec93ea22ed83f7f81f42e2d7287a5b0c749d8671f94de9d5994020045c" -dependencies = [ - "bytemuck", - "rand_core", -] - -[[package]] -name = "risc0-core" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "477e0bb8d2ec0b7955088b521eb596901e652d0faa2ea73bda0b77e05af5c07d" +version = "0.20.0-rc.2" dependencies = [ "bytemuck", "rand_core", @@ -1491,19 +1538,16 @@ dependencies = [ [[package]] name = "risc0-zkp" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5abb1a0cf847d3f9aed1e563b76c358107e7ba66dbfab28f7144252c990bd82" +version = "0.20.0-rc.2" dependencies = [ "anyhow", "blake2", "bytemuck", "digest", "hex", - "log", "paste", "rand_core", - "risc0-core 0.19.1", + "risc0-core", "risc0-zkvm-platform", "serde", "sha2 0.10.8", @@ -1512,11 +1556,12 @@ dependencies = [ [[package]] name = "risc0-zkvm" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf80df202c038efc2199be34fda8114b38bfc5b2b51c60cbbdf1f425b07b384" +version = "0.20.0-rc.2" dependencies = [ "anyhow", + "ark-bn254", + "ark-groth16", + "ark-serialize", "bincode", "bonsai-sdk", "bytemuck", @@ -1524,7 +1569,8 @@ dependencies = [ "cfg-if", "getrandom", "hex", - "log", + "human-repr", + "num-bigint", "num-derive", "num-traits", "prost", @@ -1533,20 +1579,19 @@ dependencies = [ "risc0-binfmt", "risc0-circuit-recursion", "risc0-circuit-rv32im", - "risc0-core 0.19.1", + "risc0-core", "risc0-zkp", "risc0-zkvm-platform", "rrs-lib", "semver", "serde", + "sha2 0.10.8", "tracing", ] [[package]] name = "risc0-zkvm-platform" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dcd6b66f7a4972001db0acf3f06d99b7851c8d9f0de1f7e0fb4496c66c5cd02" +version = "0.20.0-rc.2" dependencies = [ "bytemuck", "getrandom", @@ -1591,6 +1636,37 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "ryu" version = "1.0.15" @@ -1598,35 +1674,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] -name = "schannel" -version = "0.1.22" +name = "sct" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "windows-sys", -] - -[[package]] -name = "security-framework" -version = "2.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" -dependencies = [ - "core-foundation-sys", - "libc", + "ring", + "untrusted", ] [[package]] @@ -1747,6 +1801,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "static_assertions" version = "1.1.0" @@ -1873,12 +1933,12 @@ dependencies = [ ] [[package]] -name = "tokio-native-tls" -version = "0.3.1" +name = "tokio-rustls" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "native-tls", + "rustls", "tokio", ] @@ -1908,6 +1968,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1931,6 +1992,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "tracing-core", ] [[package]] @@ -1966,6 +2037,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.5.0" @@ -1978,10 +2055,10 @@ dependencies = [ ] [[package]] -name = "vcpkg" -version = "0.2.15" +name = "valuable" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "version_check" @@ -2080,6 +2157,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" + [[package]] name = "which" version = "4.4.2" @@ -2199,6 +2282,26 @@ dependencies = [ "tap", ] +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "zeroize" version = "1.7.0" diff --git a/hash/risc0/bench/Cargo.toml b/hash/risc0/bench/Cargo.toml index 554d145..f4f93e0 100644 --- a/hash/risc0/bench/Cargo.toml +++ b/hash/risc0/bench/Cargo.toml @@ -3,34 +3,14 @@ name = "benchmark" version = "0.1.0" edition = "2021" -[workspace] -members = ["methods"] - -[workspace.dependencies] -methods = { path = "methods" } - -# Always optimize; building and running the guest takes much longer without optimization. -[profile.dev] -opt-level = 3 - -[profile.dev.build-override] -opt-level = 3 - -[profile.release] -debug = 1 -lto = true - -[profile.release.build-override] -opt-level = 3 - [dependencies] -risc0-zkvm = { version = "0.19.0" } +risc0-zkvm = { path = "../external/risc0/risc0/zkvm" } serde = "1.0" rand = "0.8.3" sha2 ={ git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.6-risczero.0" } -methods = { workspace = true } +benchmark_methods = { path = "methods" } zkhash = { git = "https://github.com/HorizenLabs/poseidon2.git"} ark-ff = "0.4.2" hex = "0.4.3" ark-serialize = "0.4" -risc0-core = "0.18.0" +risc0-core = { path = "../external/risc0/risc0/core" } diff --git a/hash/risc0/bench/methods/Cargo.toml b/hash/risc0/bench/methods/Cargo.toml index 30d237a..f391ce6 100644 --- a/hash/risc0/bench/methods/Cargo.toml +++ b/hash/risc0/bench/methods/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "methods" +name = "benchmark_methods" version = "0.1.0" edition = "2021" [build-dependencies] -risc0-build = { version = "0.19.0" } +risc0-build = { path = "../../external/risc0/risc0/build" } [package.metadata.risc0] methods = ["guest"] diff --git a/hash/risc0/bench/methods/guest/Cargo.lock b/hash/risc0/bench/methods/guest/Cargo.lock index 7b5d163..e1880c4 100644 --- a/hash/risc0/bench/methods/guest/Cargo.lock +++ b/hash/risc0/bench/methods/guest/Cargo.lock @@ -2,12 +2,70 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "anyhow" version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[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-crypto-primitives" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-snark", + "ark-std", + "blake2", + "derivative", + "digest", + "sha2 0.10.8", +] + +[[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", + "itertools", + "num-traits", + "zeroize", +] + [[package]] name = "ark-ff" version = "0.4.2" @@ -51,17 +109,81 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-groth16" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +dependencies = [ + "ark-crypto-primitives", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[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", +] + +[[package]] +name = "ark-relations" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +dependencies = [ + "ark-ff", + "ark-std", + "tracing", + "tracing-subscriber", +] + [[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", "num-bigint", ] +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-snark" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +dependencies = [ + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-std", +] + [[package]] name = "ark-std" version = "0.4.0" @@ -397,12 +519,27 @@ dependencies = [ "rayon", ] +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "human-repr" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" + [[package]] name = "itertools" version = "0.10.5" @@ -486,9 +623,8 @@ dependencies = [ "blake3", "lazy_static", "rand", - "risc0-core 0.18.0", + "risc0-core", "risc0-zkp", - "risc0-zkp-core", "risc0-zkvm", "sha2 0.10.6", "sha3", @@ -536,6 +672,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + [[package]] name = "pairing" version = "0.22.0" @@ -669,41 +811,33 @@ dependencies = [ [[package]] name = "risc0-binfmt" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b008c7506a6acb15f14a87e7e57797fd901cdf2f4eb560a032df4e1fc12790" +version = "0.20.0-rc.2" dependencies = [ "anyhow", "elf", - "log", "risc0-zkp", "risc0-zkvm-platform", "serde", + "tracing", ] [[package]] name = "risc0-circuit-recursion" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "924bbd4f27070f04556e10565441fbf64e399763a3f244819f84dc645590bca1" +version = "0.20.0-rc.2" dependencies = [ "anyhow", "bytemuck", - "log", - "risc0-core 0.19.1", + "risc0-core", "risc0-zkp", "tracing", ] [[package]] name = "risc0-circuit-rv32im" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac44b6493d73638018d62eccec93f2797795d286c6201e2a79d842a16bbb43f" +version = "0.20.0-rc.2" dependencies = [ "anyhow", - "log", - "risc0-core 0.19.1", + "risc0-core", "risc0-zkp", "risc0-zkvm-platform", "tracing", @@ -711,19 +845,7 @@ dependencies = [ [[package]] name = "risc0-core" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08605aec93ea22ed83f7f81f42e2d7287a5b0c749d8671f94de9d5994020045c" -dependencies = [ - "bytemuck", - "rand_core", -] - -[[package]] -name = "risc0-core" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "477e0bb8d2ec0b7955088b521eb596901e652d0faa2ea73bda0b77e05af5c07d" +version = "0.20.0-rc.2" dependencies = [ "bytemuck", "rand_core", @@ -731,71 +853,54 @@ dependencies = [ [[package]] name = "risc0-zkp" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5abb1a0cf847d3f9aed1e563b76c358107e7ba66dbfab28f7144252c990bd82" +version = "0.20.0-rc.2" dependencies = [ "anyhow", "blake2", "bytemuck", "digest", "hex", - "log", "paste", "rand_core", - "risc0-core 0.19.1", + "risc0-core", "risc0-zkvm-platform", "serde", "sha2 0.10.8", "tracing", ] -[[package]] -name = "risc0-zkp-core" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dfd3bb0b4f2a4250d7332c3d647418502449e773b176552aae869537c4a96bf" -dependencies = [ - "anyhow", - "bytemuck", - "paste", - "rand", - "rand_core", - "serde", - "sha2 0.10.8", -] - [[package]] name = "risc0-zkvm" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4b51d8aa8a4b0a350cca2deb9ead841989ed601ca3091e33a8ee8e6f2453048" +version = "0.20.0-rc.2" dependencies = [ "anyhow", + "ark-bn254", + "ark-groth16", + "ark-serialize", "bytemuck", "cfg-if", "getrandom", "hex", - "log", + "human-repr", + "num-bigint", "num-derive", "num-traits", "risc0-binfmt", "risc0-circuit-recursion", "risc0-circuit-rv32im", - "risc0-core 0.19.1", + "risc0-core", "risc0-zkp", "risc0-zkvm-platform", "rrs-lib", "semver", "serde", + "sha2 0.10.8", "tracing", ] [[package]] name = "risc0-zkvm-platform" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dcd6b66f7a4972001db0acf3f06d99b7851c8d9f0de1f7e0fb4496c66c5cd02" +version = "0.20.0-rc.2" dependencies = [ "bytemuck", "getrandom", @@ -930,6 +1035,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -951,6 +1057,19 @@ name = "tracing-core" version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "tracing-core", +] [[package]] name = "typenum" @@ -964,6 +1083,12 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[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" @@ -985,6 +1110,26 @@ dependencies = [ "tap", ] +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "zeroize" version = "1.7.0" diff --git a/hash/risc0/bench/methods/guest/Cargo.toml b/hash/risc0/bench/methods/guest/Cargo.toml index 8529584..6d495bb 100644 --- a/hash/risc0/bench/methods/guest/Cargo.toml +++ b/hash/risc0/bench/methods/guest/Cargo.toml @@ -7,15 +7,15 @@ edition = "2021" [dependencies] # If you want to try (experimental) std support, add `features = [ "std" ]` to risc0-zkvm -risc0-zkvm = { version = "0.19.0", default-features = false, features = [ "std" ] } +risc0-zkvm = { path = "../../../external/risc0/risc0/zkvm", default-features = false,features = ["std"] } sha3 = "0.10.8" sha2 ={ git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.6-risczero.0" } -risc0-zkp = "0.19.1" +risc0-zkp = {path = "../../../external/risc0/risc0/zkp"} blake3 = "1.5.0" zkhash = { git = "https://github.com/HorizenLabs/poseidon2.git"} ark-serialize = "0.4" ark-ff = "0.4.2" -risc0-core = "0.18.0" +risc0-core = {path = "../../../external/risc0/risc0/core"} lazy_static = "1.4" -risc0-zkp-core = "0.10.0" +# risc0-zkp-core = "0.10.0" rand = "0.8.5" \ No newline at end of file diff --git a/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs b/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs index a00e7ad..3577d02 100644 --- a/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs +++ b/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs @@ -7,6 +7,7 @@ use zkhash::poseidon2::poseidon2_instance_babybear::{/*POSEIDON2_BABYBEAR_16_PAR use zkhash::fields::babybear::FpBabyBear; use ark_serialize::{CanonicalSerialize, CanonicalDeserialize}; use std::marker::PhantomData; +use risc0_zkvm::guest::env::cycle_count; use ark_ff::PrimeField; @@ -99,21 +100,21 @@ pub fn main() { let data: Vec> = env::read(); - let cycles1 = env::get_cycle_count(); + let cycles1 = cycle_count(); let mut hash_data: Vec = Vec::new(); for i in 0..data.len() { let a_uncompressed = FpBabyBear::deserialize_uncompressed(&**data.get(i).unwrap()).unwrap(); hash_data.push(a_uncompressed); } - let cycles2 = env::get_cycle_count(); + let cycles2 = cycle_count(); let permutation = poseidon2::Poseidon2::new(&POSEIDON2_BABYBEAR_24_PARAMS); let mut merkle_tree = MerkleTree::new(permutation.clone()); - let cycles3 = env::get_cycle_count(); + let cycles3 = cycle_count(); let hash_final = merkle_tree.accumulate(&hash_data); - let cycles4 = env::get_cycle_count(); + let cycles4 = cycle_count(); let mut perm_seralised: Vec> = Vec::new(); for i in 0..8 { @@ -121,7 +122,7 @@ pub fn main() { hash_final.get(i).unwrap().serialize_uncompressed(&mut temp).unwrap(); perm_seralised.push(temp); } - let cycles6 = env::get_cycle_count(); + let cycles6 = cycle_count(); env::commit(&perm_seralised); diff --git a/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear_native.rs b/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear_native.rs index 79cd4a6..9b47b7b 100644 --- a/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear_native.rs +++ b/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear_native.rs @@ -6,6 +6,7 @@ use std::marker::PhantomData; use std::sync::Arc; use risc0_core::field::Elem; use lazy_static::lazy_static; +use risc0_zkvm::guest::env::cycle_count; // This code is adapted from https://github.com/HorizenLabs/poseidon2/tree/main #[derive(Clone, Debug)] @@ -1726,21 +1727,21 @@ pub fn main() { let data: Vec = env::read(); - let cycles1 = env::get_cycle_count(); + let cycles1 = cycle_count(); let mut hash_data: Vec = Vec::new(); for i in 0..data.len() { let a_uncompressed = BabyBearElem::from(*data.get(i).unwrap()); hash_data.push(a_uncompressed); } - let cycles2 = env::get_cycle_count(); + let cycles2 = cycle_count(); let permutation = Poseidon2::new(&POSEIDON2_BABYBEAR_24_PARAMS); let mut merkle_tree = MerkleTree::new(permutation.clone()); - let cycles3 = env::get_cycle_count(); + let cycles3 = cycle_count(); let hash_final = merkle_tree.accumulate(&hash_data); - let cycles4 = env::get_cycle_count(); + let cycles4 = cycle_count(); let mut perm_seralised: Vec = Vec::new(); for i in 0..8 { @@ -1748,7 +1749,7 @@ pub fn main() { perm_seralised.push(temp); } - let cycles6 = env::get_cycle_count(); + let cycles6 = cycle_count(); env::commit(&perm_seralised); diff --git a/hash/risc0/bench/methods/guest/src/bin/poseidon2_bn128.rs b/hash/risc0/bench/methods/guest/src/bin/poseidon2_bn128.rs index d83669e..e6bc443 100644 --- a/hash/risc0/bench/methods/guest/src/bin/poseidon2_bn128.rs +++ b/hash/risc0/bench/methods/guest/src/bin/poseidon2_bn128.rs @@ -6,31 +6,32 @@ use zkhash::poseidon2::poseidon2_instance_bn256::POSEIDON2_BN256_PARAMS; use zkhash::merkle_tree::merkle_tree_fp::MerkleTree; use zkhash::fields::bn256::FpBN256; use ark_serialize::{CanonicalSerialize, CanonicalDeserialize}; +use risc0_zkvm::guest::env::cycle_count; risc0_zkvm::guest::entry!(main); pub fn main() { let data: Vec> = env::read(); - let cycles1 = env::get_cycle_count(); + let cycles1 = cycle_count(); let mut hash_data: Vec = Vec::new(); for i in 0..data.len() { let a_uncompressed = FpBN256::deserialize_uncompressed(&**data.get(i).unwrap()).unwrap(); hash_data.push(a_uncompressed); } - let cycles2 = env::get_cycle_count(); + let cycles2 = cycle_count(); let permutation = poseidon2::Poseidon2::new(&POSEIDON2_BN256_PARAMS); let mut merkle_tree = MerkleTree::new(permutation.clone()); - let cycles4 = env::get_cycle_count(); + let cycles4 = cycle_count(); let hash_final = merkle_tree.accumulate(&hash_data); - let cycles5 = env::get_cycle_count(); + let cycles5 = cycle_count(); let mut hash_bytes: Vec = Vec::new(); hash_final.serialize_uncompressed(&mut hash_bytes).unwrap(); - let cycles6 = env::get_cycle_count(); + let cycles6 = cycle_count(); env::commit(&hash_bytes); diff --git a/hash/risc0/bench/methods/guest/src/bin/sha256.rs b/hash/risc0/bench/methods/guest/src/bin/sha256.rs index d13074c..185a9d7 100644 --- a/hash/risc0/bench/methods/guest/src/bin/sha256.rs +++ b/hash/risc0/bench/methods/guest/src/bin/sha256.rs @@ -2,12 +2,13 @@ use risc0_zkvm::{guest::env, sha, sha::Sha256}; risc0_zkvm::guest::entry!(main); +use risc0_zkvm::guest::env::cycle_count; pub fn main() { let data: Vec = env::read(); let hash = sha::Impl::hash_bytes(&data); - eprintln!("total cycle count for hashing: {:?}",env::get_cycle_count()); + eprintln!("total cycle count for hashing: {:?}",cycle_count()); env::commit(&hash) } diff --git a/hash/risc0/bench/methods/guest/src/bin/sha256_accelerated.rs b/hash/risc0/bench/methods/guest/src/bin/sha256_accelerated.rs index 91d7e9c..2162da4 100644 --- a/hash/risc0/bench/methods/guest/src/bin/sha256_accelerated.rs +++ b/hash/risc0/bench/methods/guest/src/bin/sha256_accelerated.rs @@ -4,6 +4,7 @@ use risc0_zkvm::guest::env; use sha2::{Sha256, Digest}; +use risc0_zkvm::guest::env::cycle_count; // use base16ct::lower::encode_str; risc0_zkvm::guest::entry!(main); @@ -11,10 +12,10 @@ pub fn main() { let data: Vec = env::read(); let result = Sha256::digest(data); - let c1 = env::get_cycle_count(); + let c1 = cycle_count(); eprintln!("total cycle count for hashing: {:?}",c1); let result_bytes: [u8;32] = result.into(); - let c2 = env::get_cycle_count(); + let c2 = cycle_count(); eprintln!("cycle count to convert into bytes array: {:?}",c2-c1); env::commit(&result_bytes) } diff --git a/hash/risc0/bench/src/benches/blake2b.rs b/hash/risc0/bench/src/benches/blake2b.rs index c5d7f32..75bbf05 100644 --- a/hash/risc0/bench/src/benches/blake2b.rs +++ b/hash/risc0/bench/src/benches/blake2b.rs @@ -1,4 +1,4 @@ -use methods::{ +use benchmark_methods::{ BLAKE2B_ELF, BLAKE2B_ID }; use risc0_zkvm::{default_prover, ExecutorEnv}; @@ -15,7 +15,7 @@ pub fn blake2b_bench(input: Vec) { let start_time = Instant::now(); // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove_elf(env, BLAKE2B_ELF).unwrap(); + let receipt = prover.prove(env, BLAKE2B_ELF).unwrap(); // For example: let _output: sha::Digest = receipt.journal.decode().unwrap(); diff --git a/hash/risc0/bench/src/benches/blake3.rs b/hash/risc0/bench/src/benches/blake3.rs index 204c3a3..2f12a7f 100644 --- a/hash/risc0/bench/src/benches/blake3.rs +++ b/hash/risc0/bench/src/benches/blake3.rs @@ -1,4 +1,4 @@ -use methods::{ +use benchmark_methods::{ BLAKE3_ELF, BLAKE3_ID }; use risc0_zkvm::{default_prover, ExecutorEnv}; @@ -17,7 +17,7 @@ pub fn blake3_bench(input: Vec) { let start_time = Instant::now(); // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove_elf(env, BLAKE3_ELF).unwrap(); + let receipt = prover.prove(env, BLAKE3_ELF).unwrap(); // For example: let _output: sha::Digest = receipt.journal.decode().unwrap(); diff --git a/hash/risc0/bench/src/benches/keccak.rs b/hash/risc0/bench/src/benches/keccak.rs index 71c6ff5..73c8506 100644 --- a/hash/risc0/bench/src/benches/keccak.rs +++ b/hash/risc0/bench/src/benches/keccak.rs @@ -1,4 +1,4 @@ -use methods::{ +use benchmark_methods::{ KECCAK_ELF, KECCAK_ID }; use risc0_zkvm::{default_prover, ExecutorEnv}; @@ -16,7 +16,7 @@ pub fn keccak_bench(input: Vec) { let prover = default_prover(); // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove_elf(env, KECCAK_ELF).unwrap(); + let receipt = prover.prove(env, KECCAK_ELF).unwrap(); // For example: let _output: sha::Digest = receipt.journal.decode().unwrap(); diff --git a/hash/risc0/bench/src/benches/poseidon2_babybear.rs b/hash/risc0/bench/src/benches/poseidon2_babybear.rs index b3ae1f1..7e7a391 100644 --- a/hash/risc0/bench/src/benches/poseidon2_babybear.rs +++ b/hash/risc0/bench/src/benches/poseidon2_babybear.rs @@ -1,5 +1,5 @@ #![allow(non_snake_case)] -use methods::{ +use benchmark_methods::{ POSEIDON2_BABYBEAR_ELF, POSEIDON2_BABYBEAR_ID }; @@ -39,7 +39,7 @@ pub fn poseidon2_babybear_bench(mt_depth: usize) { let start_time = Instant::now(); // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove_elf(env, POSEIDON2_BABYBEAR_ELF).unwrap(); + let receipt = prover.prove(env, POSEIDON2_BABYBEAR_ELF).unwrap(); let elapsed_time = start_time.elapsed(); // verify your receipt diff --git a/hash/risc0/bench/src/benches/poseidon2_babybear_native.rs b/hash/risc0/bench/src/benches/poseidon2_babybear_native.rs index 9b92da3..d630f7f 100644 --- a/hash/risc0/bench/src/benches/poseidon2_babybear_native.rs +++ b/hash/risc0/bench/src/benches/poseidon2_babybear_native.rs @@ -1,5 +1,5 @@ #![allow(non_snake_case)] -use methods::{ +use benchmark_methods::{ POSEIDON2_BABYBEAR_NATIVE_ELF, POSEIDON2_BABYBEAR_NATIVE_ID }; @@ -29,7 +29,7 @@ pub fn poseidon2_babybear_native_bench(mt_depth: usize) { let start_time = Instant::now(); // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove_elf(env, POSEIDON2_BABYBEAR_NATIVE_ELF).unwrap(); + let receipt = prover.prove(env, POSEIDON2_BABYBEAR_NATIVE_ELF).unwrap(); let elapsed_time = start_time.elapsed(); // verify your receipt diff --git a/hash/risc0/bench/src/benches/poseidon2_bn128.rs b/hash/risc0/bench/src/benches/poseidon2_bn128.rs index 8bb4b25..3ceb77c 100644 --- a/hash/risc0/bench/src/benches/poseidon2_bn128.rs +++ b/hash/risc0/bench/src/benches/poseidon2_bn128.rs @@ -1,4 +1,4 @@ -use methods::{ +use benchmark_methods::{ POSEIDON2_BN128_ELF, POSEIDON2_BN128_ID }; use risc0_zkvm::{default_prover, ExecutorEnv}; @@ -27,7 +27,7 @@ pub fn poseidon2_bn128_bench(mt_depth: usize) { let start_time = Instant::now(); // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove_elf(env, POSEIDON2_BN128_ELF).unwrap(); + let receipt = prover.prove(env, POSEIDON2_BN128_ELF).unwrap(); let elapsed_time = start_time.elapsed(); diff --git a/hash/risc0/bench/src/benches/sha256.rs b/hash/risc0/bench/src/benches/sha256.rs index 44527ea..cae5b79 100644 --- a/hash/risc0/bench/src/benches/sha256.rs +++ b/hash/risc0/bench/src/benches/sha256.rs @@ -1,4 +1,4 @@ -use methods::{ +use benchmark_methods::{ SHA256_ELF, SHA256_ID, SHA256_ACCELERATED_ELF, SHA256_ACCELERATED_ID }; use risc0_zkvm::{default_prover, ExecutorEnv}; @@ -15,7 +15,7 @@ pub fn sha_bench(input: Vec) { let start_time = Instant::now(); // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove_elf(env, SHA256_ELF).unwrap(); + let receipt = prover.prove(env, SHA256_ELF).unwrap(); let elapsed_time = start_time.elapsed(); // verify your receipt @@ -37,7 +37,7 @@ pub fn sha_bench(input: Vec) { let start_time = Instant::now(); // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove_elf(env, SHA256_ACCELERATED_ELF).unwrap(); + let receipt = prover.prove(env, SHA256_ACCELERATED_ELF).unwrap(); let elapsed_time = start_time.elapsed(); // verify your receipt diff --git a/hash/risc0/composition/Cargo.lock b/hash/risc0/composition/Cargo.lock new file mode 100644 index 0000000..9e5e2c8 --- /dev/null +++ b/hash/risc0/composition/Cargo.lock @@ -0,0 +1,2795 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addchain" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2e69442aa5628ea6951fa33e24efe8313f4321a91bd729fc2f75bdfc858570" +dependencies = [ + "num-bigint 0.3.3", + "num-integer", + "num-traits", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "cpp_demangle", + "fallible-iterator", + "gimli", + "memmap2", + "object", + "rustc-demangle", + "smallvec", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "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 = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +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-crypto-primitives" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-snark", + "ark-std", + "blake2", + "derivative", + "digest", + "sha2", +] + +[[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", + "itertools 0.10.5", + "num-bigint 0.4.4", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "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", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-groth16" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +dependencies = [ + "ark-crypto-primitives", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[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-relations" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +dependencies = [ + "ark-ff", + "ark-std", + "tracing", + "tracing-subscriber", +] + +[[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", + "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", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-snark" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +dependencies = [ + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "autotools" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8da1805e028a172334c3b680f93e71126f2327622faef2ec3d893c0a4ad77" +dependencies = [ + "cc", +] + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bonsai-sdk" +version = "0.6.0-rc.2" +dependencies = [ + "reqwest", + "serde", + "thiserror", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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" +dependencies = [ + "serde", +] + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "jobserver", + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "composition" +version = "0.1.0" +dependencies = [ + "composition-methods", + "inner_proof", + "risc0-zkvm", + "serde", +] + +[[package]] +name = "composition-methods" +version = "0.1.0" +dependencies = [ + "risc0-build", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + +[[package]] +name = "cpp_demangle" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cust" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6cc71911e179f12483b9734120b45bd00bf64fab085cc4818428523eedd469" +dependencies = [ + "bitflags 1.3.2", + "bytemuck", + "cust_core", + "cust_derive", + "cust_raw", + "find_cuda_helper", +] + +[[package]] +name = "cust_core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "039f79662cb8f890cbf335e818cd522d6e3a53fe63f61d1aaaf859cd3d975f06" +dependencies = [ + "cust_derive", + "glam", + "mint", + "vek", +] + +[[package]] +name = "cust_derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3bc95fe629aed92b2423de6ccff9e40174b21d19cb6ee6281a4d04ac72f66" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cust_raw" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf40d6ade12cb9828bbc844b9875c7b93d25e67a3c9bf61c7aa3ae09e402bf8" +dependencies = [ + "find_cuda_helper", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "directories" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "docker-generate" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "downloader" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05213e96f184578b5f70105d4d0a644a168e99e12d7bea0b200c15d67b5c182" +dependencies = [ + "digest", + "futures", + "rand", + "reqwest", + "thiserror", + "tokio", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elf" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "erased-serde" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55d05712b2d8d88102bc9868020c9e5c7a1f5527c452b9b97450a1d006140ba7" +dependencies = [ + "serde", +] + +[[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 = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[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", + "byteorder", + "ff_derive", + "rand_core", + "subtle", +] + +[[package]] +name = "ff_derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f54704be45ed286151c5e11531316eaef5b8f5af7d597b806fdb8af108d84a" +dependencies = [ + "addchain", + "cfg-if", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "find_cuda_helper" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f9e65c593dd01ac77daad909ea4ad17f0d6d1776193fc8ea766356177abdad" +dependencies = [ + "glob", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator", + "stable_deref_trait", +] + +[[package]] +name = "glam" +version = "0.20.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43e957e744be03f5801a55472f593d43fabdebf25a4585db250f04d86b1675f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "h2" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[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.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "http" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "human-repr" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[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 = "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 = "inner_proof" +version = "0.1.0" +dependencies = [ + "inner_proof-methods", + "rand", + "risc0-zkvm", + "serde", +] + +[[package]] +name = "inner_proof-methods" +version = "0.1.0" +dependencies = [ + "risc0-build", +] + +[[package]] +name = "inventory" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8573b2b1fb643a372c73b23f4da5f888677feef3305146d68a539250a9bccc7" + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "jobserver" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy-regex" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d12be4595afdf58bd19e4a9f4e24187da2a66700786ff660a418e9059937a4c" +dependencies = [ + "lazy-regex-proc_macros", + "once_cell", + "regex", +] + +[[package]] +name = "lazy-regex-proc_macros" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44bcd58e6c97a7fcbaffcdc95728b393b8d98933bfadad49ed4097845b57ef0b" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 2.0.48", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[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.2", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "matrixmultiply" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "metal" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "550b24b0cd4cf923f36bae78eca457b3a10d8a6a14a9c84cb2687b527e6a84af" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", + "paste", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mint" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff" + +[[package]] +name = "mio" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "ndarray" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +dependencies = [ + "matrixmultiply", + "num-complex", + "num-integer", + "num-traits", + "rawpointer", + "rayon", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "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", + "num-integer", + "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-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "flate2", + "memchr", + "ruzstd", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[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 = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +dependencies = [ + "proc-macro2", + "syn 2.0.48", +] + +[[package]] +name = "proc-macro2" +version = "1.0.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" +dependencies = [ + "bytes", + "heck", + "itertools 0.11.0", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 2.0.48", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "prost-types" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +dependencies = [ + "prost", +] + +[[package]] +name = "protobuf-src" +version = "1.1.0+21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" +dependencies = [ + "autotools", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[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", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[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", + "libredox", + "thiserror", +] + +[[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", +] + +[[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", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "system-configuration", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.48.0", +] + +[[package]] +name = "risc0-binfmt" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "elf", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "tracing", +] + +[[package]] +name = "risc0-build" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "cargo_metadata", + "docker-generate", + "risc0-binfmt", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "serde_json", + "tempfile", +] + +[[package]] +name = "risc0-build-kernel" +version = "0.20.0-rc.2" +dependencies = [ + "cc", + "directories", + "hex", + "sha2", + "tempfile", +] + +[[package]] +name = "risc0-circuit-recursion" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "bytemuck", + "cust", + "downloader", + "metal", + "rand", + "rayon", + "risc0-circuit-recursion-sys", + "risc0-core", + "risc0-zkp", + "sha2", + "tracing", + "zip", +] + +[[package]] +name = "risc0-circuit-recursion-sys" +version = "0.20.0-rc.2" +dependencies = [ + "glob", + "risc0-build-kernel", + "risc0-core", +] + +[[package]] +name = "risc0-circuit-rv32im" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "cust", + "metal", + "rand", + "rayon", + "risc0-circuit-rv32im-sys", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "tracing", +] + +[[package]] +name = "risc0-circuit-rv32im-sys" +version = "0.20.0-rc.2" +dependencies = [ + "glob", + "risc0-build-kernel", + "risc0-core", +] + +[[package]] +name = "risc0-core" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "rand_core", +] + +[[package]] +name = "risc0-sppark" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be1d1ff7fe501c9f420654bc1ff7461909b85e7f8fb3698a8812c0a8a787306" +dependencies = [ + "cc", + "which", +] + +[[package]] +name = "risc0-sys" +version = "0.20.0-rc.2" +dependencies = [ + "cc", + "cust", + "risc0-build-kernel", + "risc0-sppark", +] + +[[package]] +name = "risc0-zkp" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "blake2", + "bytemuck", + "cust", + "digest", + "ff", + "hex", + "lazy_static", + "metal", + "ndarray", + "paste", + "rand", + "rand_core", + "rayon", + "risc0-core", + "risc0-sys", + "risc0-zkvm-platform", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm" +version = "0.20.0-rc.2" +dependencies = [ + "addr2line", + "anyhow", + "ark-bn254", + "ark-groth16", + "ark-serialize", + "bincode", + "bonsai-sdk", + "bytemuck", + "bytes", + "cfg-if", + "crypto-bigint", + "elf", + "getrandom", + "hex", + "human-repr", + "lazy-regex", + "num-bigint 0.4.4", + "num-derive", + "num-traits", + "prost", + "prost-build", + "protobuf-src", + "rayon", + "risc0-binfmt", + "risc0-circuit-recursion", + "risc0-circuit-rv32im", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "rrs-lib", + "rustc-demangle", + "semver", + "serde", + "sha2", + "tempfile", + "tracing", + "typetag", +] + +[[package]] +name = "risc0-zkvm-platform" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "getrandom", + "libm", +] + +[[package]] +name = "rrs-lib" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" +dependencies = [ + "downcast-rs", + "paste", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more", + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "semver" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "serde_json" +version = "1.0.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b187f0231d56fe41bfb12034819dd2bf336422a5866de41bc3fec4b2e3883e8" + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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" +version = "1.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "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", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "tracing-core", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "typetag" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43148481c7b66502c48f35b8eef38b6ccdc7a9f04bd4cc294226d901ccc9bc7" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291db8a81af4840c10d636e047cac67664e343be44e24dfdbd1492df9a5d3390" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[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 = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vek" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8085882662f9bc47fc8b0cdafa5e19df8f592f650c02b9083da8d45ac9eebd17" +dependencies = [ + "approx", + "num-integer", + "num-traits", + "rustc_version", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[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.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" + +[[package]] +name = "web-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[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.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.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.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.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.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 = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "byteorder", + "crc32fast", + "crossbeam-utils", + "flate2", +] diff --git a/hash/risc0/composition/Cargo.toml b/hash/risc0/composition/Cargo.toml new file mode 100644 index 0000000..9dd76d2 --- /dev/null +++ b/hash/risc0/composition/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "composition" +version = "0.1.0" +edition = "2021" + +[dependencies] +composition-methods = { path = "methods" } +inner_proof = { path = "../inner_proof" } +risc0-zkvm = { path = "../external/risc0/risc0/zkvm" } +serde = "1.0" + +[features] +cuda = ["risc0-zkvm/cuda"] +default = [] +metal = ["risc0-zkvm/metal"] +prove = ["risc0-zkvm/prove"] diff --git a/hash/risc0/composition/methods/Cargo.toml b/hash/risc0/composition/methods/Cargo.toml new file mode 100644 index 0000000..be6e230 --- /dev/null +++ b/hash/risc0/composition/methods/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "composition-methods" +version = "0.1.0" +edition = "2021" + +[build-dependencies] +risc0-build = { path = "../../external/risc0/risc0/build" } + +[package.metadata.risc0] +methods = ["guest"] diff --git a/hash/risc0/composition/methods/build.rs b/hash/risc0/composition/methods/build.rs new file mode 100644 index 0000000..a4aa256 --- /dev/null +++ b/hash/risc0/composition/methods/build.rs @@ -0,0 +1,17 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +fn main() { + risc0_build::embed_methods(); +} diff --git a/hash/risc0/composition/methods/guest/Cargo.lock b/hash/risc0/composition/methods/guest/Cargo.lock new file mode 100644 index 0000000..4077f62 --- /dev/null +++ b/hash/risc0/composition/methods/guest/Cargo.lock @@ -0,0 +1,1100 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "anyhow" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" + +[[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-crypto-primitives" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-snark", + "ark-std", + "blake2", + "derivative", + "digest", + "sha2", +] + +[[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", + "itertools", + "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", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.107", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "ark-groth16" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +dependencies = [ + "ark-crypto-primitives", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[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", +] + +[[package]] +name = "ark-relations" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +dependencies = [ + "ark-ff", + "ark-std", + "tracing", + "tracing-subscriber", +] + +[[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", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "ark-snark" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +dependencies = [ + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[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 = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "composition-method" +version = "0.1.0" +dependencies = [ + "bytemuck", + "inner_proof-methods", + "risc0-zkvm", +] + +[[package]] +name = "const-oid" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "docker-generate" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elf" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2b183d6ce6ca4cf30e3db37abf5b52568b5f9015c97d9fbdd7026aa5dcdd758" + +[[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 = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "human-repr" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" + +[[package]] +name = "inner_proof-methods" +version = "0.1.0" +dependencies = [ + "risc0-build", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "libc" +version = "0.2.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" + +[[package]] +name = "libm" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" + +[[package]] +name = "linux-raw-sys" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "paste" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[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", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[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 = "risc0-binfmt" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "elf", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "tracing", +] + +[[package]] +name = "risc0-build" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "cargo_metadata", + "docker-generate", + "risc0-binfmt", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "serde_json", + "tempfile", +] + +[[package]] +name = "risc0-circuit-recursion" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "bytemuck", + "risc0-core", + "risc0-zkp", + "tracing", +] + +[[package]] +name = "risc0-circuit-rv32im" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "tracing", +] + +[[package]] +name = "risc0-core" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "rand_core", +] + +[[package]] +name = "risc0-zkp" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "blake2", + "bytemuck", + "digest", + "hex", + "paste", + "rand_core", + "risc0-core", + "risc0-zkvm-platform", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "ark-bn254", + "ark-groth16", + "ark-serialize", + "bytemuck", + "cfg-if", + "getrandom", + "hex", + "human-repr", + "num-bigint", + "num-derive", + "num-traits", + "risc0-binfmt", + "risc0-circuit-recursion", + "risc0-circuit-rv32im", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "rrs-lib", + "semver", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm-platform" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "getrandom", + "libm", +] + +[[package]] +name = "rrs-lib" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" +dependencies = [ + "downcast-rs", + "paste", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "semver" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" +dependencies = [ + "serde", +] + +[[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_derive" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +dependencies = [ + "proc-macro2", + "quote", + "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.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "thiserror" +version = "1.0.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "tracing-core", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[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 = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[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.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.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.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.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.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 = "zerocopy" +version = "0.7.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" +dependencies = [ + "proc-macro2", + "quote", + "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", + "quote", + "syn 2.0.39", +] diff --git a/hash/risc0/composition/methods/guest/Cargo.toml b/hash/risc0/composition/methods/guest/Cargo.toml new file mode 100644 index 0000000..6dd09c0 --- /dev/null +++ b/hash/risc0/composition/methods/guest/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "composition-method" +version = "0.1.0" +edition = "2021" + +[workspace] + +[dependencies] +risc0-zkvm = { path = "../../../external/risc0/risc0/zkvm", features = ["std"], default-features = false } +inner_proof-methods = { path = "../../../inner_proof/methods" } +bytemuck = "1.14" diff --git a/hash/risc0/composition/methods/guest/src/main.rs b/hash/risc0/composition/methods/guest/src/main.rs new file mode 100644 index 0000000..3d2cecf --- /dev/null +++ b/hash/risc0/composition/methods/guest/src/main.rs @@ -0,0 +1,26 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use inner_proof_methods::INNER_PROOF_METHOD_ID; +use risc0_zkvm::{guest::env, serde}; +use risc0_zkvm::sha; +fn main() { + + let hash: sha::Digest = env::read(); + + env::verify(INNER_PROOF_METHOD_ID, &serde::to_vec(&hash).unwrap()).unwrap(); + + env::commit(&hash); +} + diff --git a/hash/risc0/composition/methods/src/lib.rs b/hash/risc0/composition/methods/src/lib.rs new file mode 100644 index 0000000..ae9d61e --- /dev/null +++ b/hash/risc0/composition/methods/src/lib.rs @@ -0,0 +1,15 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +include!(concat!(env!("OUT_DIR"), "/methods.rs")); diff --git a/hash/risc0/composition/src/main.rs b/hash/risc0/composition/src/main.rs new file mode 100644 index 0000000..7195a9d --- /dev/null +++ b/hash/risc0/composition/src/main.rs @@ -0,0 +1,38 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use composition_methods::{COMPOSITION_METHOD_ELF, COMPOSITION_METHOD_ID}; +use inner_proof::sha_bench; +use risc0_zkvm::{default_prover, ExecutorEnv}; +use risc0_zkvm::sha; +fn main() { + + let (hash_receipt, hash) = sha_bench(32); + + let env = ExecutorEnv::builder() + // add_assumption makes the receipt to be verified available to the prover. + .add_assumption(hash_receipt) + .write(&hash) + .unwrap() + .build() + .unwrap(); + + let receipt = default_prover().prove(env, COMPOSITION_METHOD_ELF).unwrap(); + + receipt.verify(COMPOSITION_METHOD_ID).unwrap(); + + let hash: sha::Digest = receipt.journal.decode().unwrap(); + eprintln!("hash: {:?}", hash); + +} diff --git a/hash/risc0/external/risc0 b/hash/risc0/external/risc0 new file mode 160000 index 0000000..a4d2b5d --- /dev/null +++ b/hash/risc0/external/risc0 @@ -0,0 +1 @@ +Subproject commit a4d2b5d95685554ee34a39d60b40fa2c5deff57a diff --git a/hash/risc0/inner_proof/Cargo.lock b/hash/risc0/inner_proof/Cargo.lock new file mode 100644 index 0000000..943cc8f --- /dev/null +++ b/hash/risc0/inner_proof/Cargo.lock @@ -0,0 +1,2778 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addchain" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2e69442aa5628ea6951fa33e24efe8313f4321a91bd729fc2f75bdfc858570" +dependencies = [ + "num-bigint 0.3.3", + "num-integer", + "num-traits", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "cpp_demangle", + "fallible-iterator", + "gimli", + "memmap2", + "object", + "rustc-demangle", + "smallvec", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "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 = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +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-crypto-primitives" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-snark", + "ark-std", + "blake2", + "derivative", + "digest", + "sha2", +] + +[[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", + "itertools 0.10.5", + "num-bigint 0.4.4", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "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", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-groth16" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +dependencies = [ + "ark-crypto-primitives", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[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-relations" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +dependencies = [ + "ark-ff", + "ark-std", + "tracing", + "tracing-subscriber", +] + +[[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", + "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", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-snark" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +dependencies = [ + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "autotools" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8da1805e028a172334c3b680f93e71126f2327622faef2ec3d893c0a4ad77" +dependencies = [ + "cc", +] + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bonsai-sdk" +version = "0.6.0-rc.2" +dependencies = [ + "reqwest", + "serde", + "thiserror", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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" +dependencies = [ + "serde", +] + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "jobserver", + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + +[[package]] +name = "cpp_demangle" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cust" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6cc71911e179f12483b9734120b45bd00bf64fab085cc4818428523eedd469" +dependencies = [ + "bitflags 1.3.2", + "bytemuck", + "cust_core", + "cust_derive", + "cust_raw", + "find_cuda_helper", +] + +[[package]] +name = "cust_core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "039f79662cb8f890cbf335e818cd522d6e3a53fe63f61d1aaaf859cd3d975f06" +dependencies = [ + "cust_derive", + "glam", + "mint", + "vek", +] + +[[package]] +name = "cust_derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3bc95fe629aed92b2423de6ccff9e40174b21d19cb6ee6281a4d04ac72f66" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cust_raw" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf40d6ade12cb9828bbc844b9875c7b93d25e67a3c9bf61c7aa3ae09e402bf8" +dependencies = [ + "find_cuda_helper", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "directories" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "docker-generate" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "downloader" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05213e96f184578b5f70105d4d0a644a168e99e12d7bea0b200c15d67b5c182" +dependencies = [ + "digest", + "futures", + "rand", + "reqwest", + "thiserror", + "tokio", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elf" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "erased-serde" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55d05712b2d8d88102bc9868020c9e5c7a1f5527c452b9b97450a1d006140ba7" +dependencies = [ + "serde", +] + +[[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 = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[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", + "byteorder", + "ff_derive", + "rand_core", + "subtle", +] + +[[package]] +name = "ff_derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f54704be45ed286151c5e11531316eaef5b8f5af7d597b806fdb8af108d84a" +dependencies = [ + "addchain", + "cfg-if", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "find_cuda_helper" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f9e65c593dd01ac77daad909ea4ad17f0d6d1776193fc8ea766356177abdad" +dependencies = [ + "glob", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator", + "stable_deref_trait", +] + +[[package]] +name = "glam" +version = "0.20.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43e957e744be03f5801a55472f593d43fabdebf25a4585db250f04d86b1675f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "h2" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[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.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "http" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "human-repr" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[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 = "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 = "inner_proof" +version = "0.1.0" +dependencies = [ + "inner_proof-methods", + "rand", + "risc0-zkvm", + "serde", +] + +[[package]] +name = "inner_proof-methods" +version = "0.1.0" +dependencies = [ + "risc0-build", +] + +[[package]] +name = "inventory" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8573b2b1fb643a372c73b23f4da5f888677feef3305146d68a539250a9bccc7" + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "jobserver" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy-regex" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d12be4595afdf58bd19e4a9f4e24187da2a66700786ff660a418e9059937a4c" +dependencies = [ + "lazy-regex-proc_macros", + "once_cell", + "regex", +] + +[[package]] +name = "lazy-regex-proc_macros" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44bcd58e6c97a7fcbaffcdc95728b393b8d98933bfadad49ed4097845b57ef0b" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 2.0.48", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[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.2", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "matrixmultiply" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "metal" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "550b24b0cd4cf923f36bae78eca457b3a10d8a6a14a9c84cb2687b527e6a84af" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", + "paste", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mint" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff" + +[[package]] +name = "mio" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "ndarray" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +dependencies = [ + "matrixmultiply", + "num-complex", + "num-integer", + "num-traits", + "rawpointer", + "rayon", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "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", + "num-integer", + "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-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "flate2", + "memchr", + "ruzstd", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[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 = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +dependencies = [ + "proc-macro2", + "syn 2.0.48", +] + +[[package]] +name = "proc-macro2" +version = "1.0.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" +dependencies = [ + "bytes", + "heck", + "itertools 0.11.0", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 2.0.48", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "prost-types" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +dependencies = [ + "prost", +] + +[[package]] +name = "protobuf-src" +version = "1.1.0+21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" +dependencies = [ + "autotools", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[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", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[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", + "libredox", + "thiserror", +] + +[[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", +] + +[[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", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "system-configuration", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.48.0", +] + +[[package]] +name = "risc0-binfmt" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "elf", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "tracing", +] + +[[package]] +name = "risc0-build" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "cargo_metadata", + "docker-generate", + "risc0-binfmt", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "serde_json", + "tempfile", +] + +[[package]] +name = "risc0-build-kernel" +version = "0.20.0-rc.2" +dependencies = [ + "cc", + "directories", + "hex", + "sha2", + "tempfile", +] + +[[package]] +name = "risc0-circuit-recursion" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "bytemuck", + "cust", + "downloader", + "metal", + "rand", + "rayon", + "risc0-circuit-recursion-sys", + "risc0-core", + "risc0-zkp", + "sha2", + "tracing", + "zip", +] + +[[package]] +name = "risc0-circuit-recursion-sys" +version = "0.20.0-rc.2" +dependencies = [ + "glob", + "risc0-build-kernel", + "risc0-core", +] + +[[package]] +name = "risc0-circuit-rv32im" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "cust", + "metal", + "rand", + "rayon", + "risc0-circuit-rv32im-sys", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "tracing", +] + +[[package]] +name = "risc0-circuit-rv32im-sys" +version = "0.20.0-rc.2" +dependencies = [ + "glob", + "risc0-build-kernel", + "risc0-core", +] + +[[package]] +name = "risc0-core" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "rand_core", +] + +[[package]] +name = "risc0-sppark" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be1d1ff7fe501c9f420654bc1ff7461909b85e7f8fb3698a8812c0a8a787306" +dependencies = [ + "cc", + "which", +] + +[[package]] +name = "risc0-sys" +version = "0.20.0-rc.2" +dependencies = [ + "cc", + "cust", + "risc0-build-kernel", + "risc0-sppark", +] + +[[package]] +name = "risc0-zkp" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "blake2", + "bytemuck", + "cust", + "digest", + "ff", + "hex", + "lazy_static", + "metal", + "ndarray", + "paste", + "rand", + "rand_core", + "rayon", + "risc0-core", + "risc0-sys", + "risc0-zkvm-platform", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm" +version = "0.20.0-rc.2" +dependencies = [ + "addr2line", + "anyhow", + "ark-bn254", + "ark-groth16", + "ark-serialize", + "bincode", + "bonsai-sdk", + "bytemuck", + "bytes", + "cfg-if", + "crypto-bigint", + "elf", + "getrandom", + "hex", + "human-repr", + "lazy-regex", + "num-bigint 0.4.4", + "num-derive", + "num-traits", + "prost", + "prost-build", + "protobuf-src", + "rayon", + "risc0-binfmt", + "risc0-circuit-recursion", + "risc0-circuit-rv32im", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "rrs-lib", + "rustc-demangle", + "semver", + "serde", + "sha2", + "tempfile", + "tracing", + "typetag", +] + +[[package]] +name = "risc0-zkvm-platform" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "getrandom", + "libm", +] + +[[package]] +name = "rrs-lib" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" +dependencies = [ + "downcast-rs", + "paste", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more", + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "semver" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "serde_json" +version = "1.0.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b187f0231d56fe41bfb12034819dd2bf336422a5866de41bc3fec4b2e3883e8" + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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" +version = "1.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "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", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "tracing-core", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "typetag" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43148481c7b66502c48f35b8eef38b6ccdc7a9f04bd4cc294226d901ccc9bc7" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291db8a81af4840c10d636e047cac67664e343be44e24dfdbd1492df9a5d3390" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[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 = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vek" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8085882662f9bc47fc8b0cdafa5e19df8f592f650c02b9083da8d45ac9eebd17" +dependencies = [ + "approx", + "num-integer", + "num-traits", + "rustc_version", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[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.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" + +[[package]] +name = "web-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[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.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.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.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.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.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 = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "byteorder", + "crc32fast", + "crossbeam-utils", + "flate2", +] diff --git a/hash/risc0/inner_proof/Cargo.toml b/hash/risc0/inner_proof/Cargo.toml new file mode 100644 index 0000000..c935ed6 --- /dev/null +++ b/hash/risc0/inner_proof/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "inner_proof" +version = "0.1.0" +edition = "2021" + +[dependencies] +inner_proof-methods = { path = "methods" } +risc0-zkvm = { path = "../external/risc0/risc0/zkvm" } +serde = "1.0" +rand = "0.8.3" + + +[features] +cuda = ["risc0-zkvm/cuda"] +default = [] +metal = ["risc0-zkvm/metal"] +prove = ["risc0-zkvm/prove"] diff --git a/hash/risc0/inner_proof/methods/Cargo.toml b/hash/risc0/inner_proof/methods/Cargo.toml new file mode 100644 index 0000000..b187021 --- /dev/null +++ b/hash/risc0/inner_proof/methods/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "inner_proof-methods" +version = "0.1.0" +edition = "2021" + +[build-dependencies] +risc0-build = { path = "../../external/risc0/risc0/build" } + +[package.metadata.risc0] +methods = ["guest"] diff --git a/hash/risc0/inner_proof/methods/build.rs b/hash/risc0/inner_proof/methods/build.rs new file mode 100644 index 0000000..a4aa256 --- /dev/null +++ b/hash/risc0/inner_proof/methods/build.rs @@ -0,0 +1,17 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +fn main() { + risc0_build::embed_methods(); +} diff --git a/hash/risc0/inner_proof/methods/guest/Cargo.lock b/hash/risc0/inner_proof/methods/guest/Cargo.lock new file mode 100644 index 0000000..da9ea78 --- /dev/null +++ b/hash/risc0/inner_proof/methods/guest/Cargo.lock @@ -0,0 +1,791 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "anyhow" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" + +[[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-crypto-primitives" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-snark", + "ark-std", + "blake2", + "derivative", + "digest", + "sha2", +] + +[[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", + "itertools", + "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", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.107", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "ark-groth16" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +dependencies = [ + "ark-crypto-primitives", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[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", +] + +[[package]] +name = "ark-relations" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +dependencies = [ + "ark-ff", + "ark-std", + "tracing", + "tracing-subscriber", +] + +[[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", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "ark-snark" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +dependencies = [ + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bytemuck" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c041d3eab048880cb0b86b256447da3f18859a163c3b8d8893f4e6368abe6393" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elf" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2b183d6ce6ca4cf30e3db37abf5b52568b5f9015c97d9fbdd7026aa5dcdd758" + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "human-repr" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" + +[[package]] +name = "inner_proof_method" +version = "0.1.0" +dependencies = [ + "risc0-zkvm", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "libc" +version = "0.2.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" + +[[package]] +name = "libm" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "paste" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[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", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "risc0-binfmt" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "elf", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "tracing", +] + +[[package]] +name = "risc0-circuit-recursion" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "bytemuck", + "risc0-core", + "risc0-zkp", + "tracing", +] + +[[package]] +name = "risc0-circuit-rv32im" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "tracing", +] + +[[package]] +name = "risc0-core" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "rand_core", +] + +[[package]] +name = "risc0-zkp" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "blake2", + "bytemuck", + "digest", + "hex", + "paste", + "rand_core", + "risc0-core", + "risc0-zkvm-platform", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "ark-bn254", + "ark-groth16", + "ark-serialize", + "bytemuck", + "cfg-if", + "getrandom", + "hex", + "human-repr", + "num-bigint", + "num-derive", + "num-traits", + "risc0-binfmt", + "risc0-circuit-recursion", + "risc0-circuit-rv32im", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "rrs-lib", + "semver", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm-platform" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "getrandom", + "libm", +] + +[[package]] +name = "rrs-lib" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" +dependencies = [ + "downcast-rs", + "paste", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "semver" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" + +[[package]] +name = "serde" +version = "1.0.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "tracing-core", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[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 = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "zerocopy" +version = "0.7.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" +dependencies = [ + "proc-macro2", + "quote", + "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", + "quote", + "syn 2.0.39", +] diff --git a/hash/risc0/inner_proof/methods/guest/Cargo.toml b/hash/risc0/inner_proof/methods/guest/Cargo.toml new file mode 100644 index 0000000..faac96e --- /dev/null +++ b/hash/risc0/inner_proof/methods/guest/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "inner_proof_method" +version = "0.1.0" +edition = "2021" + +[workspace] + +[dependencies] +risc0-zkvm = { path = "../../../external/risc0/risc0/zkvm", default-features = false, features = ["std"]} diff --git a/hash/risc0/inner_proof/methods/guest/src/main.rs b/hash/risc0/inner_proof/methods/guest/src/main.rs new file mode 100644 index 0000000..024da98 --- /dev/null +++ b/hash/risc0/inner_proof/methods/guest/src/main.rs @@ -0,0 +1,27 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#![no_main] + +use risc0_zkvm::{guest::env, sha, sha::Sha256}; + +risc0_zkvm::guest::entry!(main); + +fn main() { + let data: Vec = env::read(); + let hash = sha::Impl::hash_bytes(&data); + env::commit(&hash) +} + + diff --git a/hash/risc0/inner_proof/methods/src/lib.rs b/hash/risc0/inner_proof/methods/src/lib.rs new file mode 100644 index 0000000..ae9d61e --- /dev/null +++ b/hash/risc0/inner_proof/methods/src/lib.rs @@ -0,0 +1,15 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +include!(concat!(env!("OUT_DIR"), "/methods.rs")); diff --git a/hash/risc0/inner_proof/src/lib.rs b/hash/risc0/inner_proof/src/lib.rs new file mode 100644 index 0000000..1421d60 --- /dev/null +++ b/hash/risc0/inner_proof/src/lib.rs @@ -0,0 +1,47 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use inner_proof_methods::INNER_PROOF_METHOD_ELF; +use risc0_zkvm::{default_prover, ExecutorEnv, Receipt}; +use risc0_zkvm::{ sha}; +use rand::Rng; + + +pub fn generate_bytes(size: u32) -> Vec { + let mut rng = rand::thread_rng(); + (0..size).map(|_| rng.gen()).collect() +} + +pub fn sha_bench(size: u32) -> (Receipt, sha::Digest) { + + let input = generate_bytes(size); + + let env = ExecutorEnv::builder() + .write(&input) + .unwrap() + .build() + .unwrap(); + + // Obtain the default prover. + let prover = default_prover(); + + // Produce a receipt by proving the specified ELF binary. + let receipt = prover.prove(env, INNER_PROOF_METHOD_ELF).unwrap(); + + let _output: sha::Digest = receipt.journal.decode().expect( + "cannot deserialise", + ); + + (receipt, _output) +} \ No newline at end of file diff --git a/hash/risc0/inner_proof/src/main.rs b/hash/risc0/inner_proof/src/main.rs new file mode 100644 index 0000000..40a3668 --- /dev/null +++ b/hash/risc0/inner_proof/src/main.rs @@ -0,0 +1,26 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use inner_proof::sha_bench; +use inner_proof_methods::INNER_PROOF_METHOD_ID; + + +fn main() { + let (receipt, _) = sha_bench(32); + + // Verify receipt, panic if it's wrong + receipt.verify(INNER_PROOF_METHOD_ID).expect( + "cannot verify", + ); +} diff --git a/hash/snark/external/hash-circuits b/hash/snark/external/hash-circuits index e6b99b2..3ae1517 160000 --- a/hash/snark/external/hash-circuits +++ b/hash/snark/external/hash-circuits @@ -1 +1 @@ -Subproject commit e6b99b20f038f27390f590313ce7de227d6dd42a +Subproject commit 3ae1517526f1061a8d37a159270cc15727e6b503 From 5d2d0fc2e9d448a5ed204686d1d8034878fb1177 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Mon, 22 Jan 2024 11:38:40 +0530 Subject: [PATCH 15/41] composition removed --- hash/risc0/composition/Cargo.lock | 2795 ----------------- hash/risc0/composition/Cargo.toml | 16 - hash/risc0/composition/methods/Cargo.toml | 10 - hash/risc0/composition/methods/build.rs | 17 - .../composition/methods/guest/Cargo.lock | 1100 ------- .../composition/methods/guest/Cargo.toml | 11 - .../composition/methods/guest/src/main.rs | 26 - hash/risc0/composition/methods/src/lib.rs | 15 - hash/risc0/composition/src/main.rs | 38 - hash/risc0/inner_proof/Cargo.lock | 2778 ---------------- hash/risc0/inner_proof/Cargo.toml | 17 - hash/risc0/inner_proof/methods/Cargo.toml | 10 - hash/risc0/inner_proof/methods/build.rs | 17 - .../inner_proof/methods/guest/Cargo.lock | 791 ----- .../inner_proof/methods/guest/Cargo.toml | 9 - .../inner_proof/methods/guest/src/main.rs | 27 - hash/risc0/inner_proof/methods/src/lib.rs | 15 - hash/risc0/inner_proof/src/lib.rs | 47 - hash/risc0/inner_proof/src/main.rs | 26 - 19 files changed, 7765 deletions(-) delete mode 100644 hash/risc0/composition/Cargo.lock delete mode 100644 hash/risc0/composition/Cargo.toml delete mode 100644 hash/risc0/composition/methods/Cargo.toml delete mode 100644 hash/risc0/composition/methods/build.rs delete mode 100644 hash/risc0/composition/methods/guest/Cargo.lock delete mode 100644 hash/risc0/composition/methods/guest/Cargo.toml delete mode 100644 hash/risc0/composition/methods/guest/src/main.rs delete mode 100644 hash/risc0/composition/methods/src/lib.rs delete mode 100644 hash/risc0/composition/src/main.rs delete mode 100644 hash/risc0/inner_proof/Cargo.lock delete mode 100644 hash/risc0/inner_proof/Cargo.toml delete mode 100644 hash/risc0/inner_proof/methods/Cargo.toml delete mode 100644 hash/risc0/inner_proof/methods/build.rs delete mode 100644 hash/risc0/inner_proof/methods/guest/Cargo.lock delete mode 100644 hash/risc0/inner_proof/methods/guest/Cargo.toml delete mode 100644 hash/risc0/inner_proof/methods/guest/src/main.rs delete mode 100644 hash/risc0/inner_proof/methods/src/lib.rs delete mode 100644 hash/risc0/inner_proof/src/lib.rs delete mode 100644 hash/risc0/inner_proof/src/main.rs diff --git a/hash/risc0/composition/Cargo.lock b/hash/risc0/composition/Cargo.lock deleted file mode 100644 index 9e5e2c8..0000000 --- a/hash/risc0/composition/Cargo.lock +++ /dev/null @@ -1,2795 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addchain" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2e69442aa5628ea6951fa33e24efe8313f4321a91bd729fc2f75bdfc858570" -dependencies = [ - "num-bigint 0.3.3", - "num-integer", - "num-traits", -] - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "cpp_demangle", - "fallible-iterator", - "gimli", - "memmap2", - "object", - "rustc-demangle", - "smallvec", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "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 = "anyhow" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" - -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -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-crypto-primitives" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "blake2", - "derivative", - "digest", - "sha2", -] - -[[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", - "itertools 0.10.5", - "num-bigint 0.4.4", - "num-traits", - "paste", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "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", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-groth16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" -dependencies = [ - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[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-relations" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" -dependencies = [ - "ark-ff", - "ark-std", - "tracing", - "tracing-subscriber", -] - -[[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", - "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", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-snark" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" -dependencies = [ - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "autotools" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8da1805e028a172334c3b680f93e71126f2327622faef2ec3d893c0a4ad77" -dependencies = [ - "cc", -] - -[[package]] -name = "backtrace" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[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.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest", -] - -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bonsai-sdk" -version = "0.6.0-rc.2" -dependencies = [ - "reqwest", - "serde", - "thiserror", -] - -[[package]] -name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - -[[package]] -name = "bytemuck" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[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" -dependencies = [ - "serde", -] - -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "jobserver", - "libc", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "composition" -version = "0.1.0" -dependencies = [ - "composition-methods", - "inner_proof", - "risc0-zkvm", - "serde", -] - -[[package]] -name = "composition-methods" -version = "0.1.0" -dependencies = [ - "risc0-build", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "core-graphics-types" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "libc", -] - -[[package]] -name = "cpp_demangle" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "rand_core", - "subtle", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "cust" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6cc71911e179f12483b9734120b45bd00bf64fab085cc4818428523eedd469" -dependencies = [ - "bitflags 1.3.2", - "bytemuck", - "cust_core", - "cust_derive", - "cust_raw", - "find_cuda_helper", -] - -[[package]] -name = "cust_core" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "039f79662cb8f890cbf335e818cd522d6e3a53fe63f61d1aaaf859cd3d975f06" -dependencies = [ - "cust_derive", - "glam", - "mint", - "vek", -] - -[[package]] -name = "cust_derive" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a3bc95fe629aed92b2423de6ccff9e40174b21d19cb6ee6281a4d04ac72f66" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "cust_raw" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf40d6ade12cb9828bbc844b9875c7b93d25e67a3c9bf61c7aa3ae09e402bf8" -dependencies = [ - "find_cuda_helper", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "directories" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - -[[package]] -name = "docker-generate" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "downloader" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05213e96f184578b5f70105d4d0a644a168e99e12d7bea0b200c15d67b5c182" -dependencies = [ - "digest", - "futures", - "rand", - "reqwest", - "thiserror", - "tokio", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "elf" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" - -[[package]] -name = "encoding_rs" -version = "0.8.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "erased-serde" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55d05712b2d8d88102bc9868020c9e5c7a1f5527c452b9b97450a1d006140ba7" -dependencies = [ - "serde", -] - -[[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 = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - -[[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", - "byteorder", - "ff_derive", - "rand_core", - "subtle", -] - -[[package]] -name = "ff_derive" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f54704be45ed286151c5e11531316eaef5b8f5af7d597b806fdb8af108d84a" -dependencies = [ - "addchain", - "cfg-if", - "num-bigint 0.3.3", - "num-integer", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "find_cuda_helper" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f9e65c593dd01ac77daad909ea4ad17f0d6d1776193fc8ea766356177abdad" -dependencies = [ - "glob", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flate2" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" -dependencies = [ - "foreign-types-macros", - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-macros" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "foreign-types-shared" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -dependencies = [ - "fallible-iterator", - "stable_deref_trait", -] - -[[package]] -name = "glam" -version = "0.20.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43e957e744be03f5801a55472f593d43fabdebf25a4585db250f04d86b1675f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "h2" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[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.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "http" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "human-repr" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" - -[[package]] -name = "hyper" -version = "0.14.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http", - "hyper", - "rustls", - "tokio", - "tokio-rustls", -] - -[[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 = "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 = "inner_proof" -version = "0.1.0" -dependencies = [ - "inner_proof-methods", - "rand", - "risc0-zkvm", - "serde", -] - -[[package]] -name = "inner_proof-methods" -version = "0.1.0" -dependencies = [ - "risc0-build", -] - -[[package]] -name = "inventory" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8573b2b1fb643a372c73b23f4da5f888677feef3305146d68a539250a9bccc7" - -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[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.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "jobserver" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "lazy-regex" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d12be4595afdf58bd19e4a9f4e24187da2a66700786ff660a418e9059937a4c" -dependencies = [ - "lazy-regex-proc_macros", - "once_cell", - "regex", -] - -[[package]] -name = "lazy-regex-proc_macros" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bcd58e6c97a7fcbaffcdc95728b393b8d98933bfadad49ed4097845b57ef0b" -dependencies = [ - "proc-macro2", - "quote", - "regex", - "syn 2.0.48", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.152" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" - -[[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.2", - "libc", - "redox_syscall", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - -[[package]] -name = "matrixmultiply" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" -dependencies = [ - "autocfg", - "rawpointer", -] - -[[package]] -name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - -[[package]] -name = "metal" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "550b24b0cd4cf923f36bae78eca457b3a10d8a6a14a9c84cb2687b527e6a84af" -dependencies = [ - "bitflags 1.3.2", - "block", - "core-graphics-types", - "foreign-types", - "log", - "objc", - "paste", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "mint" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff" - -[[package]] -name = "mio" -version = "0.8.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.48.0", -] - -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - -[[package]] -name = "ndarray" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" -dependencies = [ - "matrixmultiply", - "num-complex", - "num-integer", - "num-traits", - "rawpointer", - "rayon", -] - -[[package]] -name = "num-bigint" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" -dependencies = [ - "autocfg", - "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", - "num-integer", - "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-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", - "objc_exception", -] - -[[package]] -name = "objc_exception" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" -dependencies = [ - "cc", -] - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "flate2", - "memchr", - "ruzstd", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[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 = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "prettyplease" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" -dependencies = [ - "proc-macro2", - "syn 2.0.48", -] - -[[package]] -name = "proc-macro2" -version = "1.0.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prost" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" -dependencies = [ - "bytes", - "heck", - "itertools 0.11.0", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn 2.0.48", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" -dependencies = [ - "anyhow", - "itertools 0.11.0", - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "prost-types" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" -dependencies = [ - "prost", -] - -[[package]] -name = "protobuf-src" -version = "1.1.0+21.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" -dependencies = [ - "autotools", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[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", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - -[[package]] -name = "rayon" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[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", - "libredox", - "thiserror", -] - -[[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", -] - -[[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", -] - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "reqwest" -version = "0.11.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" -dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "system-configuration", - "tokio", - "tokio-rustls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots", - "winreg", -] - -[[package]] -name = "ring" -version = "0.17.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" -dependencies = [ - "cc", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.48.0", -] - -[[package]] -name = "risc0-binfmt" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "elf", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "tracing", -] - -[[package]] -name = "risc0-build" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "cargo_metadata", - "docker-generate", - "risc0-binfmt", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "serde_json", - "tempfile", -] - -[[package]] -name = "risc0-build-kernel" -version = "0.20.0-rc.2" -dependencies = [ - "cc", - "directories", - "hex", - "sha2", - "tempfile", -] - -[[package]] -name = "risc0-circuit-recursion" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "bytemuck", - "cust", - "downloader", - "metal", - "rand", - "rayon", - "risc0-circuit-recursion-sys", - "risc0-core", - "risc0-zkp", - "sha2", - "tracing", - "zip", -] - -[[package]] -name = "risc0-circuit-recursion-sys" -version = "0.20.0-rc.2" -dependencies = [ - "glob", - "risc0-build-kernel", - "risc0-core", -] - -[[package]] -name = "risc0-circuit-rv32im" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "cust", - "metal", - "rand", - "rayon", - "risc0-circuit-rv32im-sys", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "tracing", -] - -[[package]] -name = "risc0-circuit-rv32im-sys" -version = "0.20.0-rc.2" -dependencies = [ - "glob", - "risc0-build-kernel", - "risc0-core", -] - -[[package]] -name = "risc0-core" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "rand_core", -] - -[[package]] -name = "risc0-sppark" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be1d1ff7fe501c9f420654bc1ff7461909b85e7f8fb3698a8812c0a8a787306" -dependencies = [ - "cc", - "which", -] - -[[package]] -name = "risc0-sys" -version = "0.20.0-rc.2" -dependencies = [ - "cc", - "cust", - "risc0-build-kernel", - "risc0-sppark", -] - -[[package]] -name = "risc0-zkp" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "blake2", - "bytemuck", - "cust", - "digest", - "ff", - "hex", - "lazy_static", - "metal", - "ndarray", - "paste", - "rand", - "rand_core", - "rayon", - "risc0-core", - "risc0-sys", - "risc0-zkvm-platform", - "serde", - "sha2", - "tracing", -] - -[[package]] -name = "risc0-zkvm" -version = "0.20.0-rc.2" -dependencies = [ - "addr2line", - "anyhow", - "ark-bn254", - "ark-groth16", - "ark-serialize", - "bincode", - "bonsai-sdk", - "bytemuck", - "bytes", - "cfg-if", - "crypto-bigint", - "elf", - "getrandom", - "hex", - "human-repr", - "lazy-regex", - "num-bigint 0.4.4", - "num-derive", - "num-traits", - "prost", - "prost-build", - "protobuf-src", - "rayon", - "risc0-binfmt", - "risc0-circuit-recursion", - "risc0-circuit-rv32im", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "rrs-lib", - "rustc-demangle", - "semver", - "serde", - "sha2", - "tempfile", - "tracing", - "typetag", -] - -[[package]] -name = "risc0-zkvm-platform" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "getrandom", - "libm", -] - -[[package]] -name = "rrs-lib" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" -dependencies = [ - "downcast-rs", - "paste", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.38.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" -dependencies = [ - "bitflags 2.4.2", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.21.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" -dependencies = [ - "log", - "ring", - "rustls-webpki", - "sct", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "ruzstd" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" -dependencies = [ - "byteorder", - "derive_more", - "twox-hash", -] - -[[package]] -name = "ryu" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "semver" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.195" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.195" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "serde_json" -version = "1.0.111" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b187f0231d56fe41bfb12034819dd2bf336422a5866de41bc3fec4b2e3883e8" - -[[package]] -name = "socket2" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tempfile" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys 0.52.0", -] - -[[package]] -name = "thiserror" -version = "1.0.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[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" -version = "1.35.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "pin-project-lite", - "socket2", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "log", - "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", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "tracing-core", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "static_assertions", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "typetag" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43148481c7b66502c48f35b8eef38b6ccdc7a9f04bd4cc294226d901ccc9bc7" -dependencies = [ - "erased-serde", - "inventory", - "once_cell", - "serde", - "typetag-impl", -] - -[[package]] -name = "typetag-impl" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291db8a81af4840c10d636e047cac67664e343be44e24dfdbd1492df9a5d3390" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[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 = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vek" -version = "0.15.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8085882662f9bc47fc8b0cdafa5e19df8f592f650c02b9083da8d45ac9eebd17" -dependencies = [ - "approx", - "num-integer", - "num-traits", - "rustc_version", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[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.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.48", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" - -[[package]] -name = "web-sys" -version = "0.3.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" - -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - -[[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.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.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.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.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.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 = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[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", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "byteorder", - "crc32fast", - "crossbeam-utils", - "flate2", -] diff --git a/hash/risc0/composition/Cargo.toml b/hash/risc0/composition/Cargo.toml deleted file mode 100644 index 9dd76d2..0000000 --- a/hash/risc0/composition/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "composition" -version = "0.1.0" -edition = "2021" - -[dependencies] -composition-methods = { path = "methods" } -inner_proof = { path = "../inner_proof" } -risc0-zkvm = { path = "../external/risc0/risc0/zkvm" } -serde = "1.0" - -[features] -cuda = ["risc0-zkvm/cuda"] -default = [] -metal = ["risc0-zkvm/metal"] -prove = ["risc0-zkvm/prove"] diff --git a/hash/risc0/composition/methods/Cargo.toml b/hash/risc0/composition/methods/Cargo.toml deleted file mode 100644 index be6e230..0000000 --- a/hash/risc0/composition/methods/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "composition-methods" -version = "0.1.0" -edition = "2021" - -[build-dependencies] -risc0-build = { path = "../../external/risc0/risc0/build" } - -[package.metadata.risc0] -methods = ["guest"] diff --git a/hash/risc0/composition/methods/build.rs b/hash/risc0/composition/methods/build.rs deleted file mode 100644 index a4aa256..0000000 --- a/hash/risc0/composition/methods/build.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -fn main() { - risc0_build::embed_methods(); -} diff --git a/hash/risc0/composition/methods/guest/Cargo.lock b/hash/risc0/composition/methods/guest/Cargo.lock deleted file mode 100644 index 4077f62..0000000 --- a/hash/risc0/composition/methods/guest/Cargo.lock +++ /dev/null @@ -1,1100 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "anyhow" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" - -[[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-crypto-primitives" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "blake2", - "derivative", - "digest", - "sha2", -] - -[[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", - "itertools", - "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", - "itertools", - "num-bigint", - "num-traits", - "paste", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "syn 1.0.107", -] - -[[package]] -name = "ark-ff-macros" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "ark-groth16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" -dependencies = [ - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[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", -] - -[[package]] -name = "ark-relations" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" -dependencies = [ - "ark-ff", - "ark-std", - "tracing", - "tracing-subscriber", -] - -[[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", - "num-bigint", -] - -[[package]] -name = "ark-serialize-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "ark-snark" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" -dependencies = [ - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[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 = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest", -] - -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bytemuck" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "composition-method" -version = "0.1.0" -dependencies = [ - "bytemuck", - "inner_proof-methods", - "risc0-zkvm", -] - -[[package]] -name = "const-oid" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "docker-generate" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "elf" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b183d6ce6ca4cf30e3db37abf5b52568b5f9015c97d9fbdd7026aa5dcdd758" - -[[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 = "fastrand" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "human-repr" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" - -[[package]] -name = "inner_proof-methods" -version = "0.1.0" -dependencies = [ - "risc0-build", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "libc" -version = "0.2.151" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" - -[[package]] -name = "libm" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" - -[[package]] -name = "linux-raw-sys" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "num-bigint" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "paste" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro2" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "rand_chacha", - "rand_core", -] - -[[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", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[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 = "risc0-binfmt" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "elf", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "tracing", -] - -[[package]] -name = "risc0-build" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "cargo_metadata", - "docker-generate", - "risc0-binfmt", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "serde_json", - "tempfile", -] - -[[package]] -name = "risc0-circuit-recursion" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "bytemuck", - "risc0-core", - "risc0-zkp", - "tracing", -] - -[[package]] -name = "risc0-circuit-rv32im" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "tracing", -] - -[[package]] -name = "risc0-core" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "rand_core", -] - -[[package]] -name = "risc0-zkp" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "blake2", - "bytemuck", - "digest", - "hex", - "paste", - "rand_core", - "risc0-core", - "risc0-zkvm-platform", - "serde", - "sha2", - "tracing", -] - -[[package]] -name = "risc0-zkvm" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "ark-bn254", - "ark-groth16", - "ark-serialize", - "bytemuck", - "cfg-if", - "getrandom", - "hex", - "human-repr", - "num-bigint", - "num-derive", - "num-traits", - "risc0-binfmt", - "risc0-circuit-recursion", - "risc0-circuit-rv32im", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "rrs-lib", - "semver", - "serde", - "sha2", - "tracing", -] - -[[package]] -name = "risc0-zkvm-platform" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "getrandom", - "libm", -] - -[[package]] -name = "rrs-lib" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" -dependencies = [ - "downcast-rs", - "paste", -] - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.38.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" -dependencies = [ - "bitflags 2.4.1", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "ryu" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "semver" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" -dependencies = [ - "serde", -] - -[[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_derive" -version = "1.0.193" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" -dependencies = [ - "proc-macro2", - "quote", - "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.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys 0.48.0", -] - -[[package]] -name = "thiserror" -version = "1.0.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "tracing" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "tracing-core" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "tracing-core", -] - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[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 = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[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.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.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.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.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.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 = "zerocopy" -version = "0.7.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" -dependencies = [ - "proc-macro2", - "quote", - "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", - "quote", - "syn 2.0.39", -] diff --git a/hash/risc0/composition/methods/guest/Cargo.toml b/hash/risc0/composition/methods/guest/Cargo.toml deleted file mode 100644 index 6dd09c0..0000000 --- a/hash/risc0/composition/methods/guest/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "composition-method" -version = "0.1.0" -edition = "2021" - -[workspace] - -[dependencies] -risc0-zkvm = { path = "../../../external/risc0/risc0/zkvm", features = ["std"], default-features = false } -inner_proof-methods = { path = "../../../inner_proof/methods" } -bytemuck = "1.14" diff --git a/hash/risc0/composition/methods/guest/src/main.rs b/hash/risc0/composition/methods/guest/src/main.rs deleted file mode 100644 index 3d2cecf..0000000 --- a/hash/risc0/composition/methods/guest/src/main.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use inner_proof_methods::INNER_PROOF_METHOD_ID; -use risc0_zkvm::{guest::env, serde}; -use risc0_zkvm::sha; -fn main() { - - let hash: sha::Digest = env::read(); - - env::verify(INNER_PROOF_METHOD_ID, &serde::to_vec(&hash).unwrap()).unwrap(); - - env::commit(&hash); -} - diff --git a/hash/risc0/composition/methods/src/lib.rs b/hash/risc0/composition/methods/src/lib.rs deleted file mode 100644 index ae9d61e..0000000 --- a/hash/risc0/composition/methods/src/lib.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -include!(concat!(env!("OUT_DIR"), "/methods.rs")); diff --git a/hash/risc0/composition/src/main.rs b/hash/risc0/composition/src/main.rs deleted file mode 100644 index 7195a9d..0000000 --- a/hash/risc0/composition/src/main.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use composition_methods::{COMPOSITION_METHOD_ELF, COMPOSITION_METHOD_ID}; -use inner_proof::sha_bench; -use risc0_zkvm::{default_prover, ExecutorEnv}; -use risc0_zkvm::sha; -fn main() { - - let (hash_receipt, hash) = sha_bench(32); - - let env = ExecutorEnv::builder() - // add_assumption makes the receipt to be verified available to the prover. - .add_assumption(hash_receipt) - .write(&hash) - .unwrap() - .build() - .unwrap(); - - let receipt = default_prover().prove(env, COMPOSITION_METHOD_ELF).unwrap(); - - receipt.verify(COMPOSITION_METHOD_ID).unwrap(); - - let hash: sha::Digest = receipt.journal.decode().unwrap(); - eprintln!("hash: {:?}", hash); - -} diff --git a/hash/risc0/inner_proof/Cargo.lock b/hash/risc0/inner_proof/Cargo.lock deleted file mode 100644 index 943cc8f..0000000 --- a/hash/risc0/inner_proof/Cargo.lock +++ /dev/null @@ -1,2778 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addchain" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2e69442aa5628ea6951fa33e24efe8313f4321a91bd729fc2f75bdfc858570" -dependencies = [ - "num-bigint 0.3.3", - "num-integer", - "num-traits", -] - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "cpp_demangle", - "fallible-iterator", - "gimli", - "memmap2", - "object", - "rustc-demangle", - "smallvec", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "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 = "anyhow" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" - -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -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-crypto-primitives" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "blake2", - "derivative", - "digest", - "sha2", -] - -[[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", - "itertools 0.10.5", - "num-bigint 0.4.4", - "num-traits", - "paste", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "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", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-groth16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" -dependencies = [ - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[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-relations" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" -dependencies = [ - "ark-ff", - "ark-std", - "tracing", - "tracing-subscriber", -] - -[[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", - "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", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-snark" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" -dependencies = [ - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "autotools" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8da1805e028a172334c3b680f93e71126f2327622faef2ec3d893c0a4ad77" -dependencies = [ - "cc", -] - -[[package]] -name = "backtrace" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[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.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest", -] - -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bonsai-sdk" -version = "0.6.0-rc.2" -dependencies = [ - "reqwest", - "serde", - "thiserror", -] - -[[package]] -name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - -[[package]] -name = "bytemuck" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[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" -dependencies = [ - "serde", -] - -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "jobserver", - "libc", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "core-graphics-types" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "libc", -] - -[[package]] -name = "cpp_demangle" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "rand_core", - "subtle", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "cust" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6cc71911e179f12483b9734120b45bd00bf64fab085cc4818428523eedd469" -dependencies = [ - "bitflags 1.3.2", - "bytemuck", - "cust_core", - "cust_derive", - "cust_raw", - "find_cuda_helper", -] - -[[package]] -name = "cust_core" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "039f79662cb8f890cbf335e818cd522d6e3a53fe63f61d1aaaf859cd3d975f06" -dependencies = [ - "cust_derive", - "glam", - "mint", - "vek", -] - -[[package]] -name = "cust_derive" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a3bc95fe629aed92b2423de6ccff9e40174b21d19cb6ee6281a4d04ac72f66" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "cust_raw" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf40d6ade12cb9828bbc844b9875c7b93d25e67a3c9bf61c7aa3ae09e402bf8" -dependencies = [ - "find_cuda_helper", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "directories" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - -[[package]] -name = "docker-generate" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "downloader" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05213e96f184578b5f70105d4d0a644a168e99e12d7bea0b200c15d67b5c182" -dependencies = [ - "digest", - "futures", - "rand", - "reqwest", - "thiserror", - "tokio", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "elf" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" - -[[package]] -name = "encoding_rs" -version = "0.8.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "erased-serde" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55d05712b2d8d88102bc9868020c9e5c7a1f5527c452b9b97450a1d006140ba7" -dependencies = [ - "serde", -] - -[[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 = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - -[[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", - "byteorder", - "ff_derive", - "rand_core", - "subtle", -] - -[[package]] -name = "ff_derive" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f54704be45ed286151c5e11531316eaef5b8f5af7d597b806fdb8af108d84a" -dependencies = [ - "addchain", - "cfg-if", - "num-bigint 0.3.3", - "num-integer", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "find_cuda_helper" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f9e65c593dd01ac77daad909ea4ad17f0d6d1776193fc8ea766356177abdad" -dependencies = [ - "glob", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flate2" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" -dependencies = [ - "foreign-types-macros", - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-macros" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "foreign-types-shared" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -dependencies = [ - "fallible-iterator", - "stable_deref_trait", -] - -[[package]] -name = "glam" -version = "0.20.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43e957e744be03f5801a55472f593d43fabdebf25a4585db250f04d86b1675f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "h2" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[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.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "http" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "human-repr" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" - -[[package]] -name = "hyper" -version = "0.14.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http", - "hyper", - "rustls", - "tokio", - "tokio-rustls", -] - -[[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 = "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 = "inner_proof" -version = "0.1.0" -dependencies = [ - "inner_proof-methods", - "rand", - "risc0-zkvm", - "serde", -] - -[[package]] -name = "inner_proof-methods" -version = "0.1.0" -dependencies = [ - "risc0-build", -] - -[[package]] -name = "inventory" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8573b2b1fb643a372c73b23f4da5f888677feef3305146d68a539250a9bccc7" - -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[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.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "jobserver" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "lazy-regex" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d12be4595afdf58bd19e4a9f4e24187da2a66700786ff660a418e9059937a4c" -dependencies = [ - "lazy-regex-proc_macros", - "once_cell", - "regex", -] - -[[package]] -name = "lazy-regex-proc_macros" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bcd58e6c97a7fcbaffcdc95728b393b8d98933bfadad49ed4097845b57ef0b" -dependencies = [ - "proc-macro2", - "quote", - "regex", - "syn 2.0.48", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.152" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" - -[[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.2", - "libc", - "redox_syscall", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - -[[package]] -name = "matrixmultiply" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" -dependencies = [ - "autocfg", - "rawpointer", -] - -[[package]] -name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - -[[package]] -name = "metal" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "550b24b0cd4cf923f36bae78eca457b3a10d8a6a14a9c84cb2687b527e6a84af" -dependencies = [ - "bitflags 1.3.2", - "block", - "core-graphics-types", - "foreign-types", - "log", - "objc", - "paste", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "mint" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff" - -[[package]] -name = "mio" -version = "0.8.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.48.0", -] - -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - -[[package]] -name = "ndarray" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" -dependencies = [ - "matrixmultiply", - "num-complex", - "num-integer", - "num-traits", - "rawpointer", - "rayon", -] - -[[package]] -name = "num-bigint" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" -dependencies = [ - "autocfg", - "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", - "num-integer", - "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-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", - "objc_exception", -] - -[[package]] -name = "objc_exception" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" -dependencies = [ - "cc", -] - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "flate2", - "memchr", - "ruzstd", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[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 = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "prettyplease" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" -dependencies = [ - "proc-macro2", - "syn 2.0.48", -] - -[[package]] -name = "proc-macro2" -version = "1.0.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prost" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" -dependencies = [ - "bytes", - "heck", - "itertools 0.11.0", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn 2.0.48", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" -dependencies = [ - "anyhow", - "itertools 0.11.0", - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "prost-types" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" -dependencies = [ - "prost", -] - -[[package]] -name = "protobuf-src" -version = "1.1.0+21.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" -dependencies = [ - "autotools", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[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", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - -[[package]] -name = "rayon" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[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", - "libredox", - "thiserror", -] - -[[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", -] - -[[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", -] - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "reqwest" -version = "0.11.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" -dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "system-configuration", - "tokio", - "tokio-rustls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots", - "winreg", -] - -[[package]] -name = "ring" -version = "0.17.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" -dependencies = [ - "cc", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.48.0", -] - -[[package]] -name = "risc0-binfmt" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "elf", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "tracing", -] - -[[package]] -name = "risc0-build" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "cargo_metadata", - "docker-generate", - "risc0-binfmt", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "serde_json", - "tempfile", -] - -[[package]] -name = "risc0-build-kernel" -version = "0.20.0-rc.2" -dependencies = [ - "cc", - "directories", - "hex", - "sha2", - "tempfile", -] - -[[package]] -name = "risc0-circuit-recursion" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "bytemuck", - "cust", - "downloader", - "metal", - "rand", - "rayon", - "risc0-circuit-recursion-sys", - "risc0-core", - "risc0-zkp", - "sha2", - "tracing", - "zip", -] - -[[package]] -name = "risc0-circuit-recursion-sys" -version = "0.20.0-rc.2" -dependencies = [ - "glob", - "risc0-build-kernel", - "risc0-core", -] - -[[package]] -name = "risc0-circuit-rv32im" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "cust", - "metal", - "rand", - "rayon", - "risc0-circuit-rv32im-sys", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "tracing", -] - -[[package]] -name = "risc0-circuit-rv32im-sys" -version = "0.20.0-rc.2" -dependencies = [ - "glob", - "risc0-build-kernel", - "risc0-core", -] - -[[package]] -name = "risc0-core" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "rand_core", -] - -[[package]] -name = "risc0-sppark" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be1d1ff7fe501c9f420654bc1ff7461909b85e7f8fb3698a8812c0a8a787306" -dependencies = [ - "cc", - "which", -] - -[[package]] -name = "risc0-sys" -version = "0.20.0-rc.2" -dependencies = [ - "cc", - "cust", - "risc0-build-kernel", - "risc0-sppark", -] - -[[package]] -name = "risc0-zkp" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "blake2", - "bytemuck", - "cust", - "digest", - "ff", - "hex", - "lazy_static", - "metal", - "ndarray", - "paste", - "rand", - "rand_core", - "rayon", - "risc0-core", - "risc0-sys", - "risc0-zkvm-platform", - "serde", - "sha2", - "tracing", -] - -[[package]] -name = "risc0-zkvm" -version = "0.20.0-rc.2" -dependencies = [ - "addr2line", - "anyhow", - "ark-bn254", - "ark-groth16", - "ark-serialize", - "bincode", - "bonsai-sdk", - "bytemuck", - "bytes", - "cfg-if", - "crypto-bigint", - "elf", - "getrandom", - "hex", - "human-repr", - "lazy-regex", - "num-bigint 0.4.4", - "num-derive", - "num-traits", - "prost", - "prost-build", - "protobuf-src", - "rayon", - "risc0-binfmt", - "risc0-circuit-recursion", - "risc0-circuit-rv32im", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "rrs-lib", - "rustc-demangle", - "semver", - "serde", - "sha2", - "tempfile", - "tracing", - "typetag", -] - -[[package]] -name = "risc0-zkvm-platform" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "getrandom", - "libm", -] - -[[package]] -name = "rrs-lib" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" -dependencies = [ - "downcast-rs", - "paste", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.38.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" -dependencies = [ - "bitflags 2.4.2", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.21.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" -dependencies = [ - "log", - "ring", - "rustls-webpki", - "sct", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "ruzstd" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" -dependencies = [ - "byteorder", - "derive_more", - "twox-hash", -] - -[[package]] -name = "ryu" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "semver" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.195" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.195" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "serde_json" -version = "1.0.111" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b187f0231d56fe41bfb12034819dd2bf336422a5866de41bc3fec4b2e3883e8" - -[[package]] -name = "socket2" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tempfile" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys 0.52.0", -] - -[[package]] -name = "thiserror" -version = "1.0.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[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" -version = "1.35.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "pin-project-lite", - "socket2", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "log", - "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", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "tracing-core", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "static_assertions", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "typetag" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43148481c7b66502c48f35b8eef38b6ccdc7a9f04bd4cc294226d901ccc9bc7" -dependencies = [ - "erased-serde", - "inventory", - "once_cell", - "serde", - "typetag-impl", -] - -[[package]] -name = "typetag-impl" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291db8a81af4840c10d636e047cac67664e343be44e24dfdbd1492df9a5d3390" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[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 = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vek" -version = "0.15.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8085882662f9bc47fc8b0cdafa5e19df8f592f650c02b9083da8d45ac9eebd17" -dependencies = [ - "approx", - "num-integer", - "num-traits", - "rustc_version", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[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.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.48", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" - -[[package]] -name = "web-sys" -version = "0.3.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" - -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - -[[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.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.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.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.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.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 = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[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", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "byteorder", - "crc32fast", - "crossbeam-utils", - "flate2", -] diff --git a/hash/risc0/inner_proof/Cargo.toml b/hash/risc0/inner_proof/Cargo.toml deleted file mode 100644 index c935ed6..0000000 --- a/hash/risc0/inner_proof/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -name = "inner_proof" -version = "0.1.0" -edition = "2021" - -[dependencies] -inner_proof-methods = { path = "methods" } -risc0-zkvm = { path = "../external/risc0/risc0/zkvm" } -serde = "1.0" -rand = "0.8.3" - - -[features] -cuda = ["risc0-zkvm/cuda"] -default = [] -metal = ["risc0-zkvm/metal"] -prove = ["risc0-zkvm/prove"] diff --git a/hash/risc0/inner_proof/methods/Cargo.toml b/hash/risc0/inner_proof/methods/Cargo.toml deleted file mode 100644 index b187021..0000000 --- a/hash/risc0/inner_proof/methods/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "inner_proof-methods" -version = "0.1.0" -edition = "2021" - -[build-dependencies] -risc0-build = { path = "../../external/risc0/risc0/build" } - -[package.metadata.risc0] -methods = ["guest"] diff --git a/hash/risc0/inner_proof/methods/build.rs b/hash/risc0/inner_proof/methods/build.rs deleted file mode 100644 index a4aa256..0000000 --- a/hash/risc0/inner_proof/methods/build.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -fn main() { - risc0_build::embed_methods(); -} diff --git a/hash/risc0/inner_proof/methods/guest/Cargo.lock b/hash/risc0/inner_proof/methods/guest/Cargo.lock deleted file mode 100644 index da9ea78..0000000 --- a/hash/risc0/inner_proof/methods/guest/Cargo.lock +++ /dev/null @@ -1,791 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "anyhow" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" - -[[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-crypto-primitives" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "blake2", - "derivative", - "digest", - "sha2", -] - -[[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", - "itertools", - "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", - "itertools", - "num-bigint", - "num-traits", - "paste", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "syn 1.0.107", -] - -[[package]] -name = "ark-ff-macros" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "ark-groth16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" -dependencies = [ - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[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", -] - -[[package]] -name = "ark-relations" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" -dependencies = [ - "ark-ff", - "ark-std", - "tracing", - "tracing-subscriber", -] - -[[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", - "num-bigint", -] - -[[package]] -name = "ark-serialize-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "ark-snark" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" -dependencies = [ - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest", -] - -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bytemuck" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c041d3eab048880cb0b86b256447da3f18859a163c3b8d8893f4e6368abe6393" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "const-oid" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "elf" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b183d6ce6ca4cf30e3db37abf5b52568b5f9015c97d9fbdd7026aa5dcdd758" - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "human-repr" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" - -[[package]] -name = "inner_proof_method" -version = "0.1.0" -dependencies = [ - "risc0-zkvm", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "libc" -version = "0.2.149" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" - -[[package]] -name = "libm" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "num-bigint" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "paste" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro2" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "rand_chacha", - "rand_core", -] - -[[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", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[package]] -name = "risc0-binfmt" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "elf", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "tracing", -] - -[[package]] -name = "risc0-circuit-recursion" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "bytemuck", - "risc0-core", - "risc0-zkp", - "tracing", -] - -[[package]] -name = "risc0-circuit-rv32im" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "tracing", -] - -[[package]] -name = "risc0-core" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "rand_core", -] - -[[package]] -name = "risc0-zkp" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "blake2", - "bytemuck", - "digest", - "hex", - "paste", - "rand_core", - "risc0-core", - "risc0-zkvm-platform", - "serde", - "sha2", - "tracing", -] - -[[package]] -name = "risc0-zkvm" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "ark-bn254", - "ark-groth16", - "ark-serialize", - "bytemuck", - "cfg-if", - "getrandom", - "hex", - "human-repr", - "num-bigint", - "num-derive", - "num-traits", - "risc0-binfmt", - "risc0-circuit-recursion", - "risc0-circuit-rv32im", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "rrs-lib", - "semver", - "serde", - "sha2", - "tracing", -] - -[[package]] -name = "risc0-zkvm-platform" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "getrandom", - "libm", -] - -[[package]] -name = "rrs-lib" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" -dependencies = [ - "downcast-rs", - "paste", -] - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "semver" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" - -[[package]] -name = "serde" -version = "1.0.171" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.171" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "sha2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tracing" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "tracing-core" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "tracing-core", -] - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[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 = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "zerocopy" -version = "0.7.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" -dependencies = [ - "proc-macro2", - "quote", - "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", - "quote", - "syn 2.0.39", -] diff --git a/hash/risc0/inner_proof/methods/guest/Cargo.toml b/hash/risc0/inner_proof/methods/guest/Cargo.toml deleted file mode 100644 index faac96e..0000000 --- a/hash/risc0/inner_proof/methods/guest/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "inner_proof_method" -version = "0.1.0" -edition = "2021" - -[workspace] - -[dependencies] -risc0-zkvm = { path = "../../../external/risc0/risc0/zkvm", default-features = false, features = ["std"]} diff --git a/hash/risc0/inner_proof/methods/guest/src/main.rs b/hash/risc0/inner_proof/methods/guest/src/main.rs deleted file mode 100644 index 024da98..0000000 --- a/hash/risc0/inner_proof/methods/guest/src/main.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#![no_main] - -use risc0_zkvm::{guest::env, sha, sha::Sha256}; - -risc0_zkvm::guest::entry!(main); - -fn main() { - let data: Vec = env::read(); - let hash = sha::Impl::hash_bytes(&data); - env::commit(&hash) -} - - diff --git a/hash/risc0/inner_proof/methods/src/lib.rs b/hash/risc0/inner_proof/methods/src/lib.rs deleted file mode 100644 index ae9d61e..0000000 --- a/hash/risc0/inner_proof/methods/src/lib.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -include!(concat!(env!("OUT_DIR"), "/methods.rs")); diff --git a/hash/risc0/inner_proof/src/lib.rs b/hash/risc0/inner_proof/src/lib.rs deleted file mode 100644 index 1421d60..0000000 --- a/hash/risc0/inner_proof/src/lib.rs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use inner_proof_methods::INNER_PROOF_METHOD_ELF; -use risc0_zkvm::{default_prover, ExecutorEnv, Receipt}; -use risc0_zkvm::{ sha}; -use rand::Rng; - - -pub fn generate_bytes(size: u32) -> Vec { - let mut rng = rand::thread_rng(); - (0..size).map(|_| rng.gen()).collect() -} - -pub fn sha_bench(size: u32) -> (Receipt, sha::Digest) { - - let input = generate_bytes(size); - - let env = ExecutorEnv::builder() - .write(&input) - .unwrap() - .build() - .unwrap(); - - // Obtain the default prover. - let prover = default_prover(); - - // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove(env, INNER_PROOF_METHOD_ELF).unwrap(); - - let _output: sha::Digest = receipt.journal.decode().expect( - "cannot deserialise", - ); - - (receipt, _output) -} \ No newline at end of file diff --git a/hash/risc0/inner_proof/src/main.rs b/hash/risc0/inner_proof/src/main.rs deleted file mode 100644 index 40a3668..0000000 --- a/hash/risc0/inner_proof/src/main.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use inner_proof::sha_bench; -use inner_proof_methods::INNER_PROOF_METHOD_ID; - - -fn main() { - let (receipt, _) = sha_bench(32); - - // Verify receipt, panic if it's wrong - receipt.verify(INNER_PROOF_METHOD_ID).expect( - "cannot verify", - ); -} From 942166d1bb3f9fd3c1e7cdbd4146b4790bfbbcb7 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Mon, 22 Jan 2024 13:12:10 +0530 Subject: [PATCH 16/41] proof composition initial commit --- hash/risc0/composition/Cargo.lock | 2795 +++++++++++++++++ hash/risc0/composition/Cargo.toml | 16 + hash/risc0/composition/methods/Cargo.toml | 10 + hash/risc0/composition/methods/build.rs | 17 + .../composition/methods/guest/Cargo.lock | 1100 +++++++ .../composition/methods/guest/Cargo.toml | 11 + .../composition/methods/guest/src/main.rs | 26 + hash/risc0/composition/methods/src/lib.rs | 15 + hash/risc0/composition/src/main.rs | 50 + hash/risc0/inner_proof/Cargo.lock | 2778 ++++++++++++++++ hash/risc0/inner_proof/Cargo.toml | 17 + hash/risc0/inner_proof/methods/Cargo.toml | 10 + hash/risc0/inner_proof/methods/build.rs | 3 + .../inner_proof/methods/guest/Cargo.lock | 791 +++++ .../inner_proof/methods/guest/Cargo.toml | 9 + .../inner_proof/methods/guest/src/main.rs | 13 + hash/risc0/inner_proof/methods/src/lib.rs | 1 + hash/risc0/inner_proof/src/lib.rs | 33 + hash/risc0/inner_proof/src/main.rs | 24 + 19 files changed, 7719 insertions(+) create mode 100644 hash/risc0/composition/Cargo.lock create mode 100644 hash/risc0/composition/Cargo.toml create mode 100644 hash/risc0/composition/methods/Cargo.toml create mode 100644 hash/risc0/composition/methods/build.rs create mode 100644 hash/risc0/composition/methods/guest/Cargo.lock create mode 100644 hash/risc0/composition/methods/guest/Cargo.toml create mode 100644 hash/risc0/composition/methods/guest/src/main.rs create mode 100644 hash/risc0/composition/methods/src/lib.rs create mode 100644 hash/risc0/composition/src/main.rs create mode 100644 hash/risc0/inner_proof/Cargo.lock create mode 100644 hash/risc0/inner_proof/Cargo.toml create mode 100644 hash/risc0/inner_proof/methods/Cargo.toml create mode 100644 hash/risc0/inner_proof/methods/build.rs create mode 100644 hash/risc0/inner_proof/methods/guest/Cargo.lock create mode 100644 hash/risc0/inner_proof/methods/guest/Cargo.toml create mode 100644 hash/risc0/inner_proof/methods/guest/src/main.rs create mode 100644 hash/risc0/inner_proof/methods/src/lib.rs create mode 100644 hash/risc0/inner_proof/src/lib.rs create mode 100644 hash/risc0/inner_proof/src/main.rs diff --git a/hash/risc0/composition/Cargo.lock b/hash/risc0/composition/Cargo.lock new file mode 100644 index 0000000..9e5e2c8 --- /dev/null +++ b/hash/risc0/composition/Cargo.lock @@ -0,0 +1,2795 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addchain" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2e69442aa5628ea6951fa33e24efe8313f4321a91bd729fc2f75bdfc858570" +dependencies = [ + "num-bigint 0.3.3", + "num-integer", + "num-traits", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "cpp_demangle", + "fallible-iterator", + "gimli", + "memmap2", + "object", + "rustc-demangle", + "smallvec", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "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 = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +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-crypto-primitives" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-snark", + "ark-std", + "blake2", + "derivative", + "digest", + "sha2", +] + +[[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", + "itertools 0.10.5", + "num-bigint 0.4.4", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "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", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-groth16" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +dependencies = [ + "ark-crypto-primitives", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[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-relations" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +dependencies = [ + "ark-ff", + "ark-std", + "tracing", + "tracing-subscriber", +] + +[[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", + "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", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-snark" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +dependencies = [ + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "autotools" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8da1805e028a172334c3b680f93e71126f2327622faef2ec3d893c0a4ad77" +dependencies = [ + "cc", +] + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bonsai-sdk" +version = "0.6.0-rc.2" +dependencies = [ + "reqwest", + "serde", + "thiserror", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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" +dependencies = [ + "serde", +] + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "jobserver", + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "composition" +version = "0.1.0" +dependencies = [ + "composition-methods", + "inner_proof", + "risc0-zkvm", + "serde", +] + +[[package]] +name = "composition-methods" +version = "0.1.0" +dependencies = [ + "risc0-build", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + +[[package]] +name = "cpp_demangle" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cust" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6cc71911e179f12483b9734120b45bd00bf64fab085cc4818428523eedd469" +dependencies = [ + "bitflags 1.3.2", + "bytemuck", + "cust_core", + "cust_derive", + "cust_raw", + "find_cuda_helper", +] + +[[package]] +name = "cust_core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "039f79662cb8f890cbf335e818cd522d6e3a53fe63f61d1aaaf859cd3d975f06" +dependencies = [ + "cust_derive", + "glam", + "mint", + "vek", +] + +[[package]] +name = "cust_derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3bc95fe629aed92b2423de6ccff9e40174b21d19cb6ee6281a4d04ac72f66" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cust_raw" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf40d6ade12cb9828bbc844b9875c7b93d25e67a3c9bf61c7aa3ae09e402bf8" +dependencies = [ + "find_cuda_helper", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "directories" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "docker-generate" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "downloader" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05213e96f184578b5f70105d4d0a644a168e99e12d7bea0b200c15d67b5c182" +dependencies = [ + "digest", + "futures", + "rand", + "reqwest", + "thiserror", + "tokio", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elf" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "erased-serde" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55d05712b2d8d88102bc9868020c9e5c7a1f5527c452b9b97450a1d006140ba7" +dependencies = [ + "serde", +] + +[[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 = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[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", + "byteorder", + "ff_derive", + "rand_core", + "subtle", +] + +[[package]] +name = "ff_derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f54704be45ed286151c5e11531316eaef5b8f5af7d597b806fdb8af108d84a" +dependencies = [ + "addchain", + "cfg-if", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "find_cuda_helper" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f9e65c593dd01ac77daad909ea4ad17f0d6d1776193fc8ea766356177abdad" +dependencies = [ + "glob", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator", + "stable_deref_trait", +] + +[[package]] +name = "glam" +version = "0.20.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43e957e744be03f5801a55472f593d43fabdebf25a4585db250f04d86b1675f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "h2" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[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.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "http" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "human-repr" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[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 = "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 = "inner_proof" +version = "0.1.0" +dependencies = [ + "inner_proof-methods", + "rand", + "risc0-zkvm", + "serde", +] + +[[package]] +name = "inner_proof-methods" +version = "0.1.0" +dependencies = [ + "risc0-build", +] + +[[package]] +name = "inventory" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8573b2b1fb643a372c73b23f4da5f888677feef3305146d68a539250a9bccc7" + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "jobserver" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy-regex" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d12be4595afdf58bd19e4a9f4e24187da2a66700786ff660a418e9059937a4c" +dependencies = [ + "lazy-regex-proc_macros", + "once_cell", + "regex", +] + +[[package]] +name = "lazy-regex-proc_macros" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44bcd58e6c97a7fcbaffcdc95728b393b8d98933bfadad49ed4097845b57ef0b" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 2.0.48", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[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.2", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "matrixmultiply" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "metal" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "550b24b0cd4cf923f36bae78eca457b3a10d8a6a14a9c84cb2687b527e6a84af" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", + "paste", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mint" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff" + +[[package]] +name = "mio" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "ndarray" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +dependencies = [ + "matrixmultiply", + "num-complex", + "num-integer", + "num-traits", + "rawpointer", + "rayon", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "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", + "num-integer", + "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-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "flate2", + "memchr", + "ruzstd", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[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 = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +dependencies = [ + "proc-macro2", + "syn 2.0.48", +] + +[[package]] +name = "proc-macro2" +version = "1.0.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" +dependencies = [ + "bytes", + "heck", + "itertools 0.11.0", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 2.0.48", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "prost-types" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +dependencies = [ + "prost", +] + +[[package]] +name = "protobuf-src" +version = "1.1.0+21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" +dependencies = [ + "autotools", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[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", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[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", + "libredox", + "thiserror", +] + +[[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", +] + +[[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", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "system-configuration", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.48.0", +] + +[[package]] +name = "risc0-binfmt" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "elf", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "tracing", +] + +[[package]] +name = "risc0-build" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "cargo_metadata", + "docker-generate", + "risc0-binfmt", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "serde_json", + "tempfile", +] + +[[package]] +name = "risc0-build-kernel" +version = "0.20.0-rc.2" +dependencies = [ + "cc", + "directories", + "hex", + "sha2", + "tempfile", +] + +[[package]] +name = "risc0-circuit-recursion" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "bytemuck", + "cust", + "downloader", + "metal", + "rand", + "rayon", + "risc0-circuit-recursion-sys", + "risc0-core", + "risc0-zkp", + "sha2", + "tracing", + "zip", +] + +[[package]] +name = "risc0-circuit-recursion-sys" +version = "0.20.0-rc.2" +dependencies = [ + "glob", + "risc0-build-kernel", + "risc0-core", +] + +[[package]] +name = "risc0-circuit-rv32im" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "cust", + "metal", + "rand", + "rayon", + "risc0-circuit-rv32im-sys", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "tracing", +] + +[[package]] +name = "risc0-circuit-rv32im-sys" +version = "0.20.0-rc.2" +dependencies = [ + "glob", + "risc0-build-kernel", + "risc0-core", +] + +[[package]] +name = "risc0-core" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "rand_core", +] + +[[package]] +name = "risc0-sppark" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be1d1ff7fe501c9f420654bc1ff7461909b85e7f8fb3698a8812c0a8a787306" +dependencies = [ + "cc", + "which", +] + +[[package]] +name = "risc0-sys" +version = "0.20.0-rc.2" +dependencies = [ + "cc", + "cust", + "risc0-build-kernel", + "risc0-sppark", +] + +[[package]] +name = "risc0-zkp" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "blake2", + "bytemuck", + "cust", + "digest", + "ff", + "hex", + "lazy_static", + "metal", + "ndarray", + "paste", + "rand", + "rand_core", + "rayon", + "risc0-core", + "risc0-sys", + "risc0-zkvm-platform", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm" +version = "0.20.0-rc.2" +dependencies = [ + "addr2line", + "anyhow", + "ark-bn254", + "ark-groth16", + "ark-serialize", + "bincode", + "bonsai-sdk", + "bytemuck", + "bytes", + "cfg-if", + "crypto-bigint", + "elf", + "getrandom", + "hex", + "human-repr", + "lazy-regex", + "num-bigint 0.4.4", + "num-derive", + "num-traits", + "prost", + "prost-build", + "protobuf-src", + "rayon", + "risc0-binfmt", + "risc0-circuit-recursion", + "risc0-circuit-rv32im", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "rrs-lib", + "rustc-demangle", + "semver", + "serde", + "sha2", + "tempfile", + "tracing", + "typetag", +] + +[[package]] +name = "risc0-zkvm-platform" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "getrandom", + "libm", +] + +[[package]] +name = "rrs-lib" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" +dependencies = [ + "downcast-rs", + "paste", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more", + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "semver" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "serde_json" +version = "1.0.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b187f0231d56fe41bfb12034819dd2bf336422a5866de41bc3fec4b2e3883e8" + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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" +version = "1.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "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", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "tracing-core", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "typetag" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43148481c7b66502c48f35b8eef38b6ccdc7a9f04bd4cc294226d901ccc9bc7" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291db8a81af4840c10d636e047cac67664e343be44e24dfdbd1492df9a5d3390" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[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 = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vek" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8085882662f9bc47fc8b0cdafa5e19df8f592f650c02b9083da8d45ac9eebd17" +dependencies = [ + "approx", + "num-integer", + "num-traits", + "rustc_version", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[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.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" + +[[package]] +name = "web-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[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.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.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.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.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.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 = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "byteorder", + "crc32fast", + "crossbeam-utils", + "flate2", +] diff --git a/hash/risc0/composition/Cargo.toml b/hash/risc0/composition/Cargo.toml new file mode 100644 index 0000000..9dd76d2 --- /dev/null +++ b/hash/risc0/composition/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "composition" +version = "0.1.0" +edition = "2021" + +[dependencies] +composition-methods = { path = "methods" } +inner_proof = { path = "../inner_proof" } +risc0-zkvm = { path = "../external/risc0/risc0/zkvm" } +serde = "1.0" + +[features] +cuda = ["risc0-zkvm/cuda"] +default = [] +metal = ["risc0-zkvm/metal"] +prove = ["risc0-zkvm/prove"] diff --git a/hash/risc0/composition/methods/Cargo.toml b/hash/risc0/composition/methods/Cargo.toml new file mode 100644 index 0000000..be6e230 --- /dev/null +++ b/hash/risc0/composition/methods/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "composition-methods" +version = "0.1.0" +edition = "2021" + +[build-dependencies] +risc0-build = { path = "../../external/risc0/risc0/build" } + +[package.metadata.risc0] +methods = ["guest"] diff --git a/hash/risc0/composition/methods/build.rs b/hash/risc0/composition/methods/build.rs new file mode 100644 index 0000000..a4aa256 --- /dev/null +++ b/hash/risc0/composition/methods/build.rs @@ -0,0 +1,17 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +fn main() { + risc0_build::embed_methods(); +} diff --git a/hash/risc0/composition/methods/guest/Cargo.lock b/hash/risc0/composition/methods/guest/Cargo.lock new file mode 100644 index 0000000..4077f62 --- /dev/null +++ b/hash/risc0/composition/methods/guest/Cargo.lock @@ -0,0 +1,1100 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "anyhow" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" + +[[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-crypto-primitives" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-snark", + "ark-std", + "blake2", + "derivative", + "digest", + "sha2", +] + +[[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", + "itertools", + "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", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.107", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "ark-groth16" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +dependencies = [ + "ark-crypto-primitives", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[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", +] + +[[package]] +name = "ark-relations" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +dependencies = [ + "ark-ff", + "ark-std", + "tracing", + "tracing-subscriber", +] + +[[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", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "ark-snark" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +dependencies = [ + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[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 = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "composition-method" +version = "0.1.0" +dependencies = [ + "bytemuck", + "inner_proof-methods", + "risc0-zkvm", +] + +[[package]] +name = "const-oid" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "docker-generate" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elf" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2b183d6ce6ca4cf30e3db37abf5b52568b5f9015c97d9fbdd7026aa5dcdd758" + +[[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 = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "human-repr" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" + +[[package]] +name = "inner_proof-methods" +version = "0.1.0" +dependencies = [ + "risc0-build", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "libc" +version = "0.2.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" + +[[package]] +name = "libm" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" + +[[package]] +name = "linux-raw-sys" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "paste" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[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", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[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 = "risc0-binfmt" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "elf", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "tracing", +] + +[[package]] +name = "risc0-build" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "cargo_metadata", + "docker-generate", + "risc0-binfmt", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "serde_json", + "tempfile", +] + +[[package]] +name = "risc0-circuit-recursion" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "bytemuck", + "risc0-core", + "risc0-zkp", + "tracing", +] + +[[package]] +name = "risc0-circuit-rv32im" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "tracing", +] + +[[package]] +name = "risc0-core" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "rand_core", +] + +[[package]] +name = "risc0-zkp" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "blake2", + "bytemuck", + "digest", + "hex", + "paste", + "rand_core", + "risc0-core", + "risc0-zkvm-platform", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "ark-bn254", + "ark-groth16", + "ark-serialize", + "bytemuck", + "cfg-if", + "getrandom", + "hex", + "human-repr", + "num-bigint", + "num-derive", + "num-traits", + "risc0-binfmt", + "risc0-circuit-recursion", + "risc0-circuit-rv32im", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "rrs-lib", + "semver", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm-platform" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "getrandom", + "libm", +] + +[[package]] +name = "rrs-lib" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" +dependencies = [ + "downcast-rs", + "paste", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "semver" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" +dependencies = [ + "serde", +] + +[[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_derive" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +dependencies = [ + "proc-macro2", + "quote", + "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.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "thiserror" +version = "1.0.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "tracing-core", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[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 = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[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.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.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.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.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.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 = "zerocopy" +version = "0.7.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" +dependencies = [ + "proc-macro2", + "quote", + "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", + "quote", + "syn 2.0.39", +] diff --git a/hash/risc0/composition/methods/guest/Cargo.toml b/hash/risc0/composition/methods/guest/Cargo.toml new file mode 100644 index 0000000..6dd09c0 --- /dev/null +++ b/hash/risc0/composition/methods/guest/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "composition-method" +version = "0.1.0" +edition = "2021" + +[workspace] + +[dependencies] +risc0-zkvm = { path = "../../../external/risc0/risc0/zkvm", features = ["std"], default-features = false } +inner_proof-methods = { path = "../../../inner_proof/methods" } +bytemuck = "1.14" diff --git a/hash/risc0/composition/methods/guest/src/main.rs b/hash/risc0/composition/methods/guest/src/main.rs new file mode 100644 index 0000000..3d2cecf --- /dev/null +++ b/hash/risc0/composition/methods/guest/src/main.rs @@ -0,0 +1,26 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use inner_proof_methods::INNER_PROOF_METHOD_ID; +use risc0_zkvm::{guest::env, serde}; +use risc0_zkvm::sha; +fn main() { + + let hash: sha::Digest = env::read(); + + env::verify(INNER_PROOF_METHOD_ID, &serde::to_vec(&hash).unwrap()).unwrap(); + + env::commit(&hash); +} + diff --git a/hash/risc0/composition/methods/src/lib.rs b/hash/risc0/composition/methods/src/lib.rs new file mode 100644 index 0000000..ae9d61e --- /dev/null +++ b/hash/risc0/composition/methods/src/lib.rs @@ -0,0 +1,15 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +include!(concat!(env!("OUT_DIR"), "/methods.rs")); diff --git a/hash/risc0/composition/src/main.rs b/hash/risc0/composition/src/main.rs new file mode 100644 index 0000000..470bfe7 --- /dev/null +++ b/hash/risc0/composition/src/main.rs @@ -0,0 +1,50 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use composition_methods::{COMPOSITION_METHOD_ELF, COMPOSITION_METHOD_ID}; +use inner_proof::sha_bench; +use risc0_zkvm::{default_prover, ExecutorEnv}; +use risc0_zkvm::sha; +use std::time::Instant; + +fn main() { + + let (hash_receipt, hash) = sha_bench(32); + + let t0 = Instant::now(); + + let env = ExecutorEnv::builder() + // add_assumption makes the receipt to be verified available to the prover. + .add_assumption(hash_receipt) + .write(&hash) + .unwrap() + .build() + .unwrap(); + + let t1 = t0.elapsed(); + + let receipt = default_prover().prove(env, COMPOSITION_METHOD_ELF).unwrap(); + + let t2 = t0.elapsed(); + + receipt.verify(COMPOSITION_METHOD_ID).unwrap(); + + let t3 = t0.elapsed(); + + let hash: sha::Digest = receipt.journal.decode().unwrap(); + eprintln!("hash: {:?}", hash); + eprintln!("ExecutorEnv Builder time: {:?}", t1); + eprintln!("Proof generation + receiving receipt time: {:?}", t2 - t1); + eprintln!("Verification time: {:?}", t3 - t2); +} diff --git a/hash/risc0/inner_proof/Cargo.lock b/hash/risc0/inner_proof/Cargo.lock new file mode 100644 index 0000000..943cc8f --- /dev/null +++ b/hash/risc0/inner_proof/Cargo.lock @@ -0,0 +1,2778 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addchain" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2e69442aa5628ea6951fa33e24efe8313f4321a91bd729fc2f75bdfc858570" +dependencies = [ + "num-bigint 0.3.3", + "num-integer", + "num-traits", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "cpp_demangle", + "fallible-iterator", + "gimli", + "memmap2", + "object", + "rustc-demangle", + "smallvec", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "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 = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +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-crypto-primitives" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-snark", + "ark-std", + "blake2", + "derivative", + "digest", + "sha2", +] + +[[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", + "itertools 0.10.5", + "num-bigint 0.4.4", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "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", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-groth16" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +dependencies = [ + "ark-crypto-primitives", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[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-relations" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +dependencies = [ + "ark-ff", + "ark-std", + "tracing", + "tracing-subscriber", +] + +[[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", + "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", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-snark" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +dependencies = [ + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "autotools" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8da1805e028a172334c3b680f93e71126f2327622faef2ec3d893c0a4ad77" +dependencies = [ + "cc", +] + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bonsai-sdk" +version = "0.6.0-rc.2" +dependencies = [ + "reqwest", + "serde", + "thiserror", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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" +dependencies = [ + "serde", +] + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "jobserver", + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + +[[package]] +name = "cpp_demangle" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cust" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6cc71911e179f12483b9734120b45bd00bf64fab085cc4818428523eedd469" +dependencies = [ + "bitflags 1.3.2", + "bytemuck", + "cust_core", + "cust_derive", + "cust_raw", + "find_cuda_helper", +] + +[[package]] +name = "cust_core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "039f79662cb8f890cbf335e818cd522d6e3a53fe63f61d1aaaf859cd3d975f06" +dependencies = [ + "cust_derive", + "glam", + "mint", + "vek", +] + +[[package]] +name = "cust_derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3bc95fe629aed92b2423de6ccff9e40174b21d19cb6ee6281a4d04ac72f66" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cust_raw" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf40d6ade12cb9828bbc844b9875c7b93d25e67a3c9bf61c7aa3ae09e402bf8" +dependencies = [ + "find_cuda_helper", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "directories" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "docker-generate" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "downloader" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05213e96f184578b5f70105d4d0a644a168e99e12d7bea0b200c15d67b5c182" +dependencies = [ + "digest", + "futures", + "rand", + "reqwest", + "thiserror", + "tokio", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elf" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "erased-serde" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55d05712b2d8d88102bc9868020c9e5c7a1f5527c452b9b97450a1d006140ba7" +dependencies = [ + "serde", +] + +[[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 = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[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", + "byteorder", + "ff_derive", + "rand_core", + "subtle", +] + +[[package]] +name = "ff_derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f54704be45ed286151c5e11531316eaef5b8f5af7d597b806fdb8af108d84a" +dependencies = [ + "addchain", + "cfg-if", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "find_cuda_helper" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f9e65c593dd01ac77daad909ea4ad17f0d6d1776193fc8ea766356177abdad" +dependencies = [ + "glob", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator", + "stable_deref_trait", +] + +[[package]] +name = "glam" +version = "0.20.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43e957e744be03f5801a55472f593d43fabdebf25a4585db250f04d86b1675f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "h2" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[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.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "http" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "human-repr" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[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 = "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 = "inner_proof" +version = "0.1.0" +dependencies = [ + "inner_proof-methods", + "rand", + "risc0-zkvm", + "serde", +] + +[[package]] +name = "inner_proof-methods" +version = "0.1.0" +dependencies = [ + "risc0-build", +] + +[[package]] +name = "inventory" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8573b2b1fb643a372c73b23f4da5f888677feef3305146d68a539250a9bccc7" + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "jobserver" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy-regex" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d12be4595afdf58bd19e4a9f4e24187da2a66700786ff660a418e9059937a4c" +dependencies = [ + "lazy-regex-proc_macros", + "once_cell", + "regex", +] + +[[package]] +name = "lazy-regex-proc_macros" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44bcd58e6c97a7fcbaffcdc95728b393b8d98933bfadad49ed4097845b57ef0b" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 2.0.48", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[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.2", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "matrixmultiply" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "metal" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "550b24b0cd4cf923f36bae78eca457b3a10d8a6a14a9c84cb2687b527e6a84af" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", + "paste", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mint" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff" + +[[package]] +name = "mio" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "ndarray" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +dependencies = [ + "matrixmultiply", + "num-complex", + "num-integer", + "num-traits", + "rawpointer", + "rayon", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "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", + "num-integer", + "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-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "flate2", + "memchr", + "ruzstd", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[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 = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +dependencies = [ + "proc-macro2", + "syn 2.0.48", +] + +[[package]] +name = "proc-macro2" +version = "1.0.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" +dependencies = [ + "bytes", + "heck", + "itertools 0.11.0", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 2.0.48", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "prost-types" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +dependencies = [ + "prost", +] + +[[package]] +name = "protobuf-src" +version = "1.1.0+21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" +dependencies = [ + "autotools", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[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", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[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", + "libredox", + "thiserror", +] + +[[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", +] + +[[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", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "system-configuration", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.48.0", +] + +[[package]] +name = "risc0-binfmt" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "elf", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "tracing", +] + +[[package]] +name = "risc0-build" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "cargo_metadata", + "docker-generate", + "risc0-binfmt", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "serde_json", + "tempfile", +] + +[[package]] +name = "risc0-build-kernel" +version = "0.20.0-rc.2" +dependencies = [ + "cc", + "directories", + "hex", + "sha2", + "tempfile", +] + +[[package]] +name = "risc0-circuit-recursion" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "bytemuck", + "cust", + "downloader", + "metal", + "rand", + "rayon", + "risc0-circuit-recursion-sys", + "risc0-core", + "risc0-zkp", + "sha2", + "tracing", + "zip", +] + +[[package]] +name = "risc0-circuit-recursion-sys" +version = "0.20.0-rc.2" +dependencies = [ + "glob", + "risc0-build-kernel", + "risc0-core", +] + +[[package]] +name = "risc0-circuit-rv32im" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "cust", + "metal", + "rand", + "rayon", + "risc0-circuit-rv32im-sys", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "tracing", +] + +[[package]] +name = "risc0-circuit-rv32im-sys" +version = "0.20.0-rc.2" +dependencies = [ + "glob", + "risc0-build-kernel", + "risc0-core", +] + +[[package]] +name = "risc0-core" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "rand_core", +] + +[[package]] +name = "risc0-sppark" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be1d1ff7fe501c9f420654bc1ff7461909b85e7f8fb3698a8812c0a8a787306" +dependencies = [ + "cc", + "which", +] + +[[package]] +name = "risc0-sys" +version = "0.20.0-rc.2" +dependencies = [ + "cc", + "cust", + "risc0-build-kernel", + "risc0-sppark", +] + +[[package]] +name = "risc0-zkp" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "blake2", + "bytemuck", + "cust", + "digest", + "ff", + "hex", + "lazy_static", + "metal", + "ndarray", + "paste", + "rand", + "rand_core", + "rayon", + "risc0-core", + "risc0-sys", + "risc0-zkvm-platform", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm" +version = "0.20.0-rc.2" +dependencies = [ + "addr2line", + "anyhow", + "ark-bn254", + "ark-groth16", + "ark-serialize", + "bincode", + "bonsai-sdk", + "bytemuck", + "bytes", + "cfg-if", + "crypto-bigint", + "elf", + "getrandom", + "hex", + "human-repr", + "lazy-regex", + "num-bigint 0.4.4", + "num-derive", + "num-traits", + "prost", + "prost-build", + "protobuf-src", + "rayon", + "risc0-binfmt", + "risc0-circuit-recursion", + "risc0-circuit-rv32im", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "rrs-lib", + "rustc-demangle", + "semver", + "serde", + "sha2", + "tempfile", + "tracing", + "typetag", +] + +[[package]] +name = "risc0-zkvm-platform" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "getrandom", + "libm", +] + +[[package]] +name = "rrs-lib" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" +dependencies = [ + "downcast-rs", + "paste", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more", + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "semver" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "serde_json" +version = "1.0.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b187f0231d56fe41bfb12034819dd2bf336422a5866de41bc3fec4b2e3883e8" + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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" +version = "1.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "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", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "tracing-core", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "typetag" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43148481c7b66502c48f35b8eef38b6ccdc7a9f04bd4cc294226d901ccc9bc7" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291db8a81af4840c10d636e047cac67664e343be44e24dfdbd1492df9a5d3390" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[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 = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vek" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8085882662f9bc47fc8b0cdafa5e19df8f592f650c02b9083da8d45ac9eebd17" +dependencies = [ + "approx", + "num-integer", + "num-traits", + "rustc_version", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[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.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" + +[[package]] +name = "web-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[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.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.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.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.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.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 = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "byteorder", + "crc32fast", + "crossbeam-utils", + "flate2", +] diff --git a/hash/risc0/inner_proof/Cargo.toml b/hash/risc0/inner_proof/Cargo.toml new file mode 100644 index 0000000..c935ed6 --- /dev/null +++ b/hash/risc0/inner_proof/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "inner_proof" +version = "0.1.0" +edition = "2021" + +[dependencies] +inner_proof-methods = { path = "methods" } +risc0-zkvm = { path = "../external/risc0/risc0/zkvm" } +serde = "1.0" +rand = "0.8.3" + + +[features] +cuda = ["risc0-zkvm/cuda"] +default = [] +metal = ["risc0-zkvm/metal"] +prove = ["risc0-zkvm/prove"] diff --git a/hash/risc0/inner_proof/methods/Cargo.toml b/hash/risc0/inner_proof/methods/Cargo.toml new file mode 100644 index 0000000..b187021 --- /dev/null +++ b/hash/risc0/inner_proof/methods/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "inner_proof-methods" +version = "0.1.0" +edition = "2021" + +[build-dependencies] +risc0-build = { path = "../../external/risc0/risc0/build" } + +[package.metadata.risc0] +methods = ["guest"] diff --git a/hash/risc0/inner_proof/methods/build.rs b/hash/risc0/inner_proof/methods/build.rs new file mode 100644 index 0000000..08a8a4e --- /dev/null +++ b/hash/risc0/inner_proof/methods/build.rs @@ -0,0 +1,3 @@ +fn main() { + risc0_build::embed_methods(); +} diff --git a/hash/risc0/inner_proof/methods/guest/Cargo.lock b/hash/risc0/inner_proof/methods/guest/Cargo.lock new file mode 100644 index 0000000..da9ea78 --- /dev/null +++ b/hash/risc0/inner_proof/methods/guest/Cargo.lock @@ -0,0 +1,791 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "anyhow" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" + +[[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-crypto-primitives" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-snark", + "ark-std", + "blake2", + "derivative", + "digest", + "sha2", +] + +[[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", + "itertools", + "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", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.107", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "ark-groth16" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +dependencies = [ + "ark-crypto-primitives", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[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", +] + +[[package]] +name = "ark-relations" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +dependencies = [ + "ark-ff", + "ark-std", + "tracing", + "tracing-subscriber", +] + +[[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", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "ark-snark" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +dependencies = [ + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bytemuck" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c041d3eab048880cb0b86b256447da3f18859a163c3b8d8893f4e6368abe6393" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elf" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2b183d6ce6ca4cf30e3db37abf5b52568b5f9015c97d9fbdd7026aa5dcdd758" + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "human-repr" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" + +[[package]] +name = "inner_proof_method" +version = "0.1.0" +dependencies = [ + "risc0-zkvm", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "libc" +version = "0.2.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" + +[[package]] +name = "libm" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "paste" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[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", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "risc0-binfmt" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "elf", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "tracing", +] + +[[package]] +name = "risc0-circuit-recursion" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "bytemuck", + "risc0-core", + "risc0-zkp", + "tracing", +] + +[[package]] +name = "risc0-circuit-rv32im" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "tracing", +] + +[[package]] +name = "risc0-core" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "rand_core", +] + +[[package]] +name = "risc0-zkp" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "blake2", + "bytemuck", + "digest", + "hex", + "paste", + "rand_core", + "risc0-core", + "risc0-zkvm-platform", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm" +version = "0.20.0-rc.2" +dependencies = [ + "anyhow", + "ark-bn254", + "ark-groth16", + "ark-serialize", + "bytemuck", + "cfg-if", + "getrandom", + "hex", + "human-repr", + "num-bigint", + "num-derive", + "num-traits", + "risc0-binfmt", + "risc0-circuit-recursion", + "risc0-circuit-rv32im", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "rrs-lib", + "semver", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm-platform" +version = "0.20.0-rc.2" +dependencies = [ + "bytemuck", + "getrandom", + "libm", +] + +[[package]] +name = "rrs-lib" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" +dependencies = [ + "downcast-rs", + "paste", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "semver" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" + +[[package]] +name = "serde" +version = "1.0.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "tracing-core", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[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 = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "zerocopy" +version = "0.7.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" +dependencies = [ + "proc-macro2", + "quote", + "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", + "quote", + "syn 2.0.39", +] diff --git a/hash/risc0/inner_proof/methods/guest/Cargo.toml b/hash/risc0/inner_proof/methods/guest/Cargo.toml new file mode 100644 index 0000000..faac96e --- /dev/null +++ b/hash/risc0/inner_proof/methods/guest/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "inner_proof_method" +version = "0.1.0" +edition = "2021" + +[workspace] + +[dependencies] +risc0-zkvm = { path = "../../../external/risc0/risc0/zkvm", default-features = false, features = ["std"]} diff --git a/hash/risc0/inner_proof/methods/guest/src/main.rs b/hash/risc0/inner_proof/methods/guest/src/main.rs new file mode 100644 index 0000000..2da5528 --- /dev/null +++ b/hash/risc0/inner_proof/methods/guest/src/main.rs @@ -0,0 +1,13 @@ +#![no_main] + +use risc0_zkvm::{guest::env, sha, sha::Sha256}; + +risc0_zkvm::guest::entry!(main); + +fn main() { + let data: Vec = env::read(); + let hash = sha::Impl::hash_bytes(&data); + env::commit(&hash) +} + + diff --git a/hash/risc0/inner_proof/methods/src/lib.rs b/hash/risc0/inner_proof/methods/src/lib.rs new file mode 100644 index 0000000..1bdb308 --- /dev/null +++ b/hash/risc0/inner_proof/methods/src/lib.rs @@ -0,0 +1 @@ +include!(concat!(env!("OUT_DIR"), "/methods.rs")); diff --git a/hash/risc0/inner_proof/src/lib.rs b/hash/risc0/inner_proof/src/lib.rs new file mode 100644 index 0000000..902f1ad --- /dev/null +++ b/hash/risc0/inner_proof/src/lib.rs @@ -0,0 +1,33 @@ +use inner_proof_methods::INNER_PROOF_METHOD_ELF; +use risc0_zkvm::{default_prover, ExecutorEnv, Receipt}; +use risc0_zkvm::{ sha}; +use rand::Rng; + + +pub fn generate_bytes(size: u32) -> Vec { + let mut rng = rand::thread_rng(); + (0..size).map(|_| rng.gen()).collect() +} + +pub fn sha_bench(size: u32) -> (Receipt, sha::Digest) { + + let input = generate_bytes(size); + + let env = ExecutorEnv::builder() + .write(&input) + .unwrap() + .build() + .unwrap(); + + // Obtain the default prover. + let prover = default_prover(); + + // Produce a receipt by proving the specified ELF binary. + let receipt = prover.prove(env, INNER_PROOF_METHOD_ELF).unwrap(); + + let _output: sha::Digest = receipt.journal.decode().expect( + "cannot deserialise", + ); + + (receipt, _output) +} \ No newline at end of file diff --git a/hash/risc0/inner_proof/src/main.rs b/hash/risc0/inner_proof/src/main.rs new file mode 100644 index 0000000..50c6f19 --- /dev/null +++ b/hash/risc0/inner_proof/src/main.rs @@ -0,0 +1,24 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +use inner_proof::sha_bench; +use inner_proof_methods::INNER_PROOF_METHOD_ID; + +fn main() { + let (receipt, _output) = sha_bench(32); + + // Verify receipt, panic if it's wrong + receipt.verify(INNER_PROOF_METHOD_ID).expect( + "cannot verify", + ); + + eprintln!("hash: {:?}", _output); +} From 79f1d2ae1364a2818965b09aa0720471c979ed60 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Tue, 23 Jan 2024 12:59:50 +0530 Subject: [PATCH 17/41] Cargo.lock ignored --- .gitignore | 1 + hash/risc0/bench/Cargo.lock | 2349 --------------------- hash/risc0/bench/methods/guest/Cargo.lock | 1177 ----------- 3 files changed, 1 insertion(+), 3526 deletions(-) delete mode 100644 hash/risc0/bench/Cargo.lock delete mode 100644 hash/risc0/bench/methods/guest/Cargo.lock diff --git a/.gitignore b/.gitignore index 9479611..0bc5b19 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ build target a.out +Cargo.lock \ No newline at end of file diff --git a/hash/risc0/bench/Cargo.lock b/hash/risc0/bench/Cargo.lock deleted file mode 100644 index 4ab16e5..0000000 --- a/hash/risc0/bench/Cargo.lock +++ /dev/null @@ -1,2349 +0,0 @@ -# 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", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "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 = "anyhow" -version = "1.0.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" - -[[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-crypto-primitives" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "blake2", - "derivative", - "digest", - "sha2 0.10.8", -] - -[[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", - "itertools 0.10.5", - "num-bigint", - "num-traits", - "paste", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "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", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-groth16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" -dependencies = [ - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[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-relations" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" -dependencies = [ - "ark-ff", - "ark-std", - "tracing", - "tracing-subscriber", -] - -[[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", - "num-bigint", -] - -[[package]] -name = "ark-serialize-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-snark" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" -dependencies = [ - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", -] - -[[package]] -name = "arrayref" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "autotools" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8da1805e028a172334c3b680f93e71126f2327622faef2ec3d893c0a4ad77" -dependencies = [ - "cc", -] - -[[package]] -name = "backtrace" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.21.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" - -[[package]] -name = "benchmark" -version = "0.1.0" -dependencies = [ - "ark-ff", - "ark-serialize", - "benchmark_methods", - "hex", - "rand", - "risc0-core", - "risc0-zkvm", - "serde", - "sha2 0.10.6", - "zkhash", -] - -[[package]] -name = "benchmark_methods" -version = "0.1.0" -dependencies = [ - "risc0-build", -] - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[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 = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest", -] - -[[package]] -name = "blake2b_simd" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" -dependencies = [ - "arrayref", - "arrayvec", - "constant_time_eq", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bls12_381" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3c196a77437e7cc2fb515ce413a6401291578b5afc8ecb29a3c7ab957f05941" -dependencies = [ - "ff 0.12.1", - "group 0.12.1", - "pairing", - "rand_core", - "subtle", -] - -[[package]] -name = "bonsai-sdk" -version = "0.6.0-rc.2" -dependencies = [ - "reqwest", - "serde", - "thiserror", -] - -[[package]] -name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - -[[package]] -name = "bytemuck" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[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" -dependencies = [ - "serde", -] - -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - -[[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 = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[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.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "cpufeatures" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" -dependencies = [ - "libc", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "docker-generate" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "elf" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6e7d85896690fe195447717af8eceae0593ac2196fd42fe88c184e904406ce" - -[[package]] -name = "encoding_rs" -version = "0.8.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" -dependencies = [ - "cfg-if", -] - -[[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.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "fastrand" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" - -[[package]] -name = "ff" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" -dependencies = [ - "bitvec", - "rand_core", - "subtle", -] - -[[package]] -name = "ff" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" -dependencies = [ - "bitvec", - "rand_core", - "subtle", -] - -[[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", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures-channel" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" - -[[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-core", - "futures-io", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" - -[[package]] -name = "group" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" -dependencies = [ - "ff 0.12.1", - "memuse", - "rand_core", - "subtle", -] - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff 0.13.0", - "rand_core", - "subtle", -] - -[[package]] -name = "h2" -version = "0.3.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "halo2" -version = "0.1.0-beta.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a23c779b38253fe1538102da44ad5bd5378495a61d2c4ee18d64eaa61ae5995" -dependencies = [ - "halo2_proofs", -] - -[[package]] -name = "halo2_proofs" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e925780549adee8364c7f2b685c753f6f3df23bde520c67416e93bf615933760" -dependencies = [ - "blake2b_simd", - "ff 0.12.1", - "group 0.12.1", - "pasta_curves 0.4.1", - "rand_core", - "rayon", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[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.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 = "home" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "http" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "human-repr" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" - -[[package]] -name = "hyper" -version = "0.14.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.4.10", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http", - "hyper", - "rustls", - "tokio", - "tokio-rustls", -] - -[[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 = "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 = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[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 = "jubjub" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a575df5f985fe1cd5b2b05664ff6accfc46559032b954529fd225a2168d27b0f" -dependencies = [ - "bitvec", - "bls12_381", - "ff 0.12.1", - "group 0.12.1", - "rand_core", - "subtle", -] - -[[package]] -name = "keccak" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin 0.5.2", -] - -[[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 = "linux-raw-sys" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "memchr" -version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memuse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2145869435ace5ea6ea3d35f59be559317ec9a0d04e1812d5f185a87b6d36f1a" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" -dependencies = [ - "libc", - "wasi", - "windows-sys", -] - -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - -[[package]] -name = "num-bigint" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[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 = "pairing" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135590d8bdba2b31346f9cd1fb2a912329f5135e832a4f422942eb6ead8b6b3b" -dependencies = [ - "group 0.12.1", -] - -[[package]] -name = "pasta_curves" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc65faf8e7313b4b1fbaa9f7ca917a0eed499a9663be71477f87993604341d8" -dependencies = [ - "blake2b_simd", - "ff 0.12.1", - "group 0.12.1", - "lazy_static", - "rand", - "static_assertions", - "subtle", -] - -[[package]] -name = "pasta_curves" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" -dependencies = [ - "blake2b_simd", - "ff 0.13.0", - "group 0.13.0", - "lazy_static", - "rand", - "static_assertions", - "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 = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[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 = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "prettyplease" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" -dependencies = [ - "proc-macro2", - "syn 2.0.39", -] - -[[package]] -name = "proc-macro2" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prost" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" -dependencies = [ - "bytes", - "heck", - "itertools 0.11.0", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn 2.0.39", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" -dependencies = [ - "anyhow", - "itertools 0.11.0", - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "prost-types" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" -dependencies = [ - "prost", -] - -[[package]] -name = "protobuf-src" -version = "1.1.0+21.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" -dependencies = [ - "autotools", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[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", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[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", - "crossbeam-utils", -] - -[[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 = "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", -] - -[[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", -] - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "reqwest" -version = "0.11.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" -dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "system-configuration", - "tokio", - "tokio-rustls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots", - "winreg", -] - -[[package]] -name = "ring" -version = "0.17.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" -dependencies = [ - "cc", - "getrandom", - "libc", - "spin 0.9.8", - "untrusted", - "windows-sys", -] - -[[package]] -name = "risc0-binfmt" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "elf", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "tracing", -] - -[[package]] -name = "risc0-build" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "cargo_metadata", - "docker-generate", - "risc0-binfmt", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "serde_json", - "tempfile", -] - -[[package]] -name = "risc0-circuit-recursion" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "bytemuck", - "risc0-core", - "risc0-zkp", - "tracing", -] - -[[package]] -name = "risc0-circuit-rv32im" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "tracing", -] - -[[package]] -name = "risc0-core" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "rand_core", -] - -[[package]] -name = "risc0-zkp" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "blake2", - "bytemuck", - "digest", - "hex", - "paste", - "rand_core", - "risc0-core", - "risc0-zkvm-platform", - "serde", - "sha2 0.10.8", - "tracing", -] - -[[package]] -name = "risc0-zkvm" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "ark-bn254", - "ark-groth16", - "ark-serialize", - "bincode", - "bonsai-sdk", - "bytemuck", - "bytes", - "cfg-if", - "getrandom", - "hex", - "human-repr", - "num-bigint", - "num-derive", - "num-traits", - "prost", - "prost-build", - "protobuf-src", - "risc0-binfmt", - "risc0-circuit-recursion", - "risc0-circuit-rv32im", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "rrs-lib", - "semver", - "serde", - "sha2 0.10.8", - "tracing", -] - -[[package]] -name = "risc0-zkvm-platform" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "getrandom", - "libm", -] - -[[package]] -name = "rrs-lib" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" -dependencies = [ - "downcast-rs", - "paste", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.38.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" -dependencies = [ - "bitflags 2.4.1", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[package]] -name = "rustls" -version = "0.21.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" -dependencies = [ - "log", - "ring", - "rustls-webpki", - "sct", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "ryu" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" - -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "semver" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.192" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.192" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" -dependencies = [ - "proc-macro2", - "quote", - "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 = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.10.6" -source = "git+https://github.com/risc0/RustCrypto-hashes?tag=sha2-v0.10.6-risczero.0#7fd6900c4f637bd15ee2642dfa77110f8f1ad065" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest", - "keccak", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tempfile" -version = "3.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys", -] - -[[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", - "quote", - "syn 2.0.39", -] - -[[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" -version = "1.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "pin-project-lite", - "socket2 0.5.5", - "windows-sys", -] - -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "log", - "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", - "quote", - "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", - "valuable", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "tracing-core", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[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 = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[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 = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[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", - "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", - "quote", - "syn 2.0.39", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" -dependencies = [ - "cfg-if", - "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", - "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", - "quote", - "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 = "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 = "webpki-roots" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" - -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - -[[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-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.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[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_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[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_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[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_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "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", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "zkhash" -version = "0.2.0" -source = "git+https://github.com/HorizenLabs/poseidon2.git#bb476b9ca38198cf5092487283c8b8c5d4317c4e" -dependencies = [ - "ark-ff", - "ark-std", - "bitvec", - "blake2", - "bls12_381", - "byteorder", - "cfg-if", - "group 0.12.1", - "group 0.13.0", - "halo2", - "hex", - "jubjub", - "lazy_static", - "pasta_curves 0.5.1", - "rand", - "serde", - "sha2 0.10.8", - "sha3", - "subtle", -] diff --git a/hash/risc0/bench/methods/guest/Cargo.lock b/hash/risc0/bench/methods/guest/Cargo.lock deleted file mode 100644 index e1880c4..0000000 --- a/hash/risc0/bench/methods/guest/Cargo.lock +++ /dev/null @@ -1,1177 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "anyhow" -version = "1.0.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" - -[[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-crypto-primitives" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "blake2", - "derivative", - "digest", - "sha2 0.10.8", -] - -[[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", - "itertools", - "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", - "itertools", - "num-bigint", - "num-traits", - "paste", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "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", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-groth16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" -dependencies = [ - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[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", -] - -[[package]] -name = "ark-relations" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" -dependencies = [ - "ark-ff", - "ark-std", - "tracing", - "tracing-subscriber", -] - -[[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", - "num-bigint", -] - -[[package]] -name = "ark-serialize-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-snark" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" -dependencies = [ - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", -] - -[[package]] -name = "arrayref" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest", -] - -[[package]] -name = "blake2b_simd" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" -dependencies = [ - "arrayref", - "arrayvec", - "constant_time_eq", -] - -[[package]] -name = "blake3" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" -dependencies = [ - "arrayref", - "arrayvec", - "cc", - "cfg-if", - "constant_time_eq", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bls12_381" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3c196a77437e7cc2fb515ce413a6401291578b5afc8ecb29a3c7ab957f05941" -dependencies = [ - "ff 0.12.1", - "group 0.12.1", - "pairing", - "rand_core", - "subtle", -] - -[[package]] -name = "bytemuck" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[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 = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[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.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" - -[[package]] -name = "cpufeatures" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" -dependencies = [ - "libc", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "elf" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6e7d85896690fe195447717af8eceae0593ac2196fd42fe88c184e904406ce" - -[[package]] -name = "ff" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" -dependencies = [ - "bitvec", - "rand_core", - "subtle", -] - -[[package]] -name = "ff" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" -dependencies = [ - "bitvec", - "rand_core", - "subtle", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "group" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" -dependencies = [ - "ff 0.12.1", - "memuse", - "rand_core", - "subtle", -] - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff 0.13.0", - "rand_core", - "subtle", -] - -[[package]] -name = "halo2" -version = "0.1.0-beta.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a23c779b38253fe1538102da44ad5bd5378495a61d2c4ee18d64eaa61ae5995" -dependencies = [ - "halo2_proofs", -] - -[[package]] -name = "halo2_proofs" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e925780549adee8364c7f2b685c753f6f3df23bde520c67416e93bf615933760" -dependencies = [ - "blake2b_simd", - "ff 0.12.1", - "group 0.12.1", - "pasta_curves 0.4.1", - "rand_core", - "rayon", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "human-repr" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "jubjub" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a575df5f985fe1cd5b2b05664ff6accfc46559032b954529fd225a2168d27b0f" -dependencies = [ - "bitvec", - "bls12_381", - "ff 0.12.1", - "group 0.12.1", - "rand_core", - "subtle", -] - -[[package]] -name = "keccak" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin", -] - -[[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 = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memuse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2145869435ace5ea6ea3d35f59be559317ec9a0d04e1812d5f185a87b6d36f1a" - -[[package]] -name = "method" -version = "0.1.0" -dependencies = [ - "ark-ff", - "ark-serialize", - "blake3", - "lazy_static", - "rand", - "risc0-core", - "risc0-zkp", - "risc0-zkvm", - "sha2 0.10.6", - "sha3", - "zkhash", -] - -[[package]] -name = "num-bigint" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "pairing" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135590d8bdba2b31346f9cd1fb2a912329f5135e832a4f422942eb6ead8b6b3b" -dependencies = [ - "group 0.12.1", -] - -[[package]] -name = "pasta_curves" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc65faf8e7313b4b1fbaa9f7ca917a0eed499a9663be71477f87993604341d8" -dependencies = [ - "blake2b_simd", - "ff 0.12.1", - "group 0.12.1", - "lazy_static", - "rand", - "static_assertions", - "subtle", -] - -[[package]] -name = "pasta_curves" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" -dependencies = [ - "blake2b_simd", - "ff 0.13.0", - "group 0.13.0", - "lazy_static", - "rand", - "static_assertions", - "subtle", -] - -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "pin-project-lite" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro2" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[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", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[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", - "crossbeam-utils", -] - -[[package]] -name = "risc0-binfmt" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "elf", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "tracing", -] - -[[package]] -name = "risc0-circuit-recursion" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "bytemuck", - "risc0-core", - "risc0-zkp", - "tracing", -] - -[[package]] -name = "risc0-circuit-rv32im" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "tracing", -] - -[[package]] -name = "risc0-core" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "rand_core", -] - -[[package]] -name = "risc0-zkp" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "blake2", - "bytemuck", - "digest", - "hex", - "paste", - "rand_core", - "risc0-core", - "risc0-zkvm-platform", - "serde", - "sha2 0.10.8", - "tracing", -] - -[[package]] -name = "risc0-zkvm" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "ark-bn254", - "ark-groth16", - "ark-serialize", - "bytemuck", - "cfg-if", - "getrandom", - "hex", - "human-repr", - "num-bigint", - "num-derive", - "num-traits", - "risc0-binfmt", - "risc0-circuit-recursion", - "risc0-circuit-rv32im", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "rrs-lib", - "semver", - "serde", - "sha2 0.10.8", - "tracing", -] - -[[package]] -name = "risc0-zkvm-platform" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "getrandom", - "libm", -] - -[[package]] -name = "rrs-lib" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" -dependencies = [ - "downcast-rs", - "paste", -] - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "semver" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" - -[[package]] -name = "serde" -version = "1.0.192" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.192" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "sha2" -version = "0.10.6" -source = "git+https://github.com/risc0/RustCrypto-hashes?tag=sha2-v0.10.6-risczero.0#7fd6900c4f637bd15ee2642dfa77110f8f1ad065" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest", - "keccak", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "log", - "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", - "quote", - "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", - "valuable", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "tracing-core", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[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 = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "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", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "zkhash" -version = "0.2.0" -source = "git+https://github.com/HorizenLabs/poseidon2.git#bb476b9ca38198cf5092487283c8b8c5d4317c4e" -dependencies = [ - "ark-ff", - "ark-std", - "bitvec", - "blake2", - "bls12_381", - "byteorder", - "cfg-if", - "group 0.12.1", - "group 0.13.0", - "halo2", - "hex", - "jubjub", - "lazy_static", - "pasta_curves 0.5.1", - "rand", - "serde", - "sha2 0.10.8", - "sha3", - "subtle", -] From 193737eabd26c41eab95a808d80a9e58100b9e4d Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Tue, 23 Jan 2024 13:50:41 +0530 Subject: [PATCH 18/41] seperated accelerated and non-accelerated versions of sha256 --- hash/risc0/bench/bench_tree.cfg | 4 +-- hash/risc0/bench/run_tree.sh | 8 ++--- hash/risc0/bench/src/benches/mod.rs | 1 + hash/risc0/bench/src/benches/sha256.rs | 24 +-------------- .../bench/src/benches/sha256_accelerated.rs | 30 +++++++++++++++++++ hash/risc0/bench/src/main.rs | 9 +++++- 6 files changed, 46 insertions(+), 30 deletions(-) create mode 100644 hash/risc0/bench/src/benches/sha256_accelerated.rs diff --git a/hash/risc0/bench/bench_tree.cfg b/hash/risc0/bench/bench_tree.cfg index 529f0fb..f6d767e 100644 --- a/hash/risc0/bench/bench_tree.cfg +++ b/hash/risc0/bench/bench_tree.cfg @@ -2,10 +2,10 @@ name: "Hashes benchmarking using risc0 prover" author: timeout: 1000 params: - [ HASH_TYPE: [ "poseidon2_babybear", "poseidon2_babybear_native", "poseidon2_bn128"] + [ HASH_TYPE_TREE: [ "poseidon2_babybear", "poseidon2_babybear_native", "poseidon2_bn128"] , TREE_DEPTH: [ 2, 4, 8, 16 ] ] -tags: risc0, $HASH_TYPE +tags: risc0, $HASH_TYPE_TREE comments: The benchmarks includes for poseidon2(merkle hashing) over bn128 and babybear. the hashing is done inside the guest and receipt is received which is verified. diff --git a/hash/risc0/bench/run_tree.sh b/hash/risc0/bench/run_tree.sh index cdd865e..81a0750 100755 --- a/hash/risc0/bench/run_tree.sh +++ b/hash/risc0/bench/run_tree.sh @@ -1,6 +1,6 @@ #!/bin/bash -if [ -z ${ZKBENCH_HASH_TYPE} ]; then -ZKBENCH_HASH_TYPE="poseidon2_babybear_native" +if [ -z ${ZKBENCH_HASH_TYPE_TREE} ]; then +ZKBENCH_HASH_TYPE_TREE="poseidon2_babybear_native" fi if [ -z ${ZKBENCH_TREE_DEPTH} ]; then @@ -8,8 +8,8 @@ ZKBENCH_TREE_DEPTH=2 fi echo "Running benchmarks with the following configurations:" -echo "HASH = $ZKBENCH_HASH_TYPE" +echo "HASH = $ZKBENCH_HASH_TYPE_TREE" echo "Tree Depth = $ZKBENCH_TREE_DEPTH" # Run the benchmarks -./target/release/benchmark $ZKBENCH_HASH_TYPE $ZKBENCH_TREE_DEPTH \ No newline at end of file +./target/release/benchmark $ZKBENCH_HASH_TYPE_TREE $ZKBENCH_TREE_DEPTH \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/mod.rs b/hash/risc0/bench/src/benches/mod.rs index c5bbdea..adeeccf 100644 --- a/hash/risc0/bench/src/benches/mod.rs +++ b/hash/risc0/bench/src/benches/mod.rs @@ -1,4 +1,5 @@ pub mod sha256; +pub mod sha256_accelerated; pub mod keccak; pub mod blake2b; pub mod blake3; diff --git a/hash/risc0/bench/src/benches/sha256.rs b/hash/risc0/bench/src/benches/sha256.rs index cae5b79..1777f56 100644 --- a/hash/risc0/bench/src/benches/sha256.rs +++ b/hash/risc0/bench/src/benches/sha256.rs @@ -1,10 +1,9 @@ use benchmark_methods::{ - SHA256_ELF, SHA256_ID, SHA256_ACCELERATED_ELF, SHA256_ACCELERATED_ID + SHA256_ELF, SHA256_ID }; use risc0_zkvm::{default_prover, ExecutorEnv}; use risc0_zkvm::{ sha}; use std::time::Instant; -use hex::encode; pub fn sha_bench(input: Vec) { let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); @@ -30,25 +29,4 @@ pub fn sha_bench(input: Vec) { eprintln!("Hash: {:?}", _output); - let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); - eprintln!("\n------RustCrypto sha hashing(accelerated)------\n"); - // Obtain the default prover. - let prover = default_prover(); - - let start_time = Instant::now(); - // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove(env, SHA256_ACCELERATED_ELF).unwrap(); - let elapsed_time = start_time.elapsed(); - - // verify your receipt - receipt.verify(SHA256_ACCELERATED_ID).unwrap(); - - let elapsed_time2 = start_time.elapsed(); - - let _output: [u8;32] = receipt.journal.decode().unwrap(); - let hash = encode(_output); - eprintln!("Total time: {:?}", elapsed_time2); - eprintln!("Verification time: {:?}", elapsed_time2 - elapsed_time); - - eprintln!("Hash: {:?}", hash); } \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/sha256_accelerated.rs b/hash/risc0/bench/src/benches/sha256_accelerated.rs new file mode 100644 index 0000000..6233cae --- /dev/null +++ b/hash/risc0/bench/src/benches/sha256_accelerated.rs @@ -0,0 +1,30 @@ +use benchmark_methods::{ + SHA256_ACCELERATED_ELF, SHA256_ACCELERATED_ID +}; +use risc0_zkvm::{default_prover, ExecutorEnv}; +use std::time::Instant; +use hex::encode; +pub fn sha_accelerated_bench(input: Vec) { + + let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); + eprintln!("\n------RustCrypto sha hashing(accelerated)------\n"); + // Obtain the default prover. + let prover = default_prover(); + + let start_time = Instant::now(); + // Produce a receipt by proving the specified ELF binary. + let receipt = prover.prove(env, SHA256_ACCELERATED_ELF).unwrap(); + let elapsed_time = start_time.elapsed(); + + // verify your receipt + receipt.verify(SHA256_ACCELERATED_ID).unwrap(); + + let elapsed_time2 = start_time.elapsed(); + + let _output: [u8;32] = receipt.journal.decode().unwrap(); + let hash = encode(_output); + eprintln!("Total time: {:?}", elapsed_time2); + eprintln!("Verification time: {:?}", elapsed_time2 - elapsed_time); + + eprintln!("Hash: {:?}", hash); +} \ No newline at end of file diff --git a/hash/risc0/bench/src/main.rs b/hash/risc0/bench/src/main.rs index bee3f3a..c5ba0f7 100644 --- a/hash/risc0/bench/src/main.rs +++ b/hash/risc0/bench/src/main.rs @@ -1,6 +1,7 @@ mod benches; use benches::{ sha256::sha_bench, + sha256_accelerated::sha_accelerated_bench, keccak::keccak_bench, blake2b::blake2b_bench, blake3::blake3_bench, @@ -22,7 +23,7 @@ fn main() { let args: Vec = std::env::args().collect(); if args.len() != 3 { - println!("Wrong number of arguments"); + println!("Wrong number of arguments! The program expects two arguments: and "); // Exit the program with a non-zero exit code process::exit(1); } @@ -37,6 +38,12 @@ fn main() { let input = generate_bytes(size); sha_bench(input.clone()); } + "sha256_accelerated" => { + println!("Accelerated SHA256 Benchmarking: "); + eprintln!("data size(bytes): {:?}", size); + let input = generate_bytes(size); + sha_accelerated_bench(input.clone()); + } "keccak" => { println!("KECCAK Benchmarking: "); eprintln!("data size(bytes): {:?}", size); From d0dda87066ea08fd8dff60d12c5d49120ea79bf6 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Tue, 23 Jan 2024 14:15:53 +0530 Subject: [PATCH 19/41] build.sh and run.sh added in composition/ --- hash/risc0/composition/build.sh | 1 + hash/risc0/composition/run.sh | 1 + 2 files changed, 2 insertions(+) create mode 100755 hash/risc0/composition/build.sh create mode 100755 hash/risc0/composition/run.sh diff --git a/hash/risc0/composition/build.sh b/hash/risc0/composition/build.sh new file mode 100755 index 0000000..7f1b114 --- /dev/null +++ b/hash/risc0/composition/build.sh @@ -0,0 +1 @@ +cargo build --release \ No newline at end of file diff --git a/hash/risc0/composition/run.sh b/hash/risc0/composition/run.sh new file mode 100755 index 0000000..7acdd03 --- /dev/null +++ b/hash/risc0/composition/run.sh @@ -0,0 +1 @@ +./target/release/composition \ No newline at end of file From f4b4d6e6e6c12cc951d217f933e84efca98d554e Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Thu, 25 Jan 2024 23:35:41 +0530 Subject: [PATCH 20/41] data size passed as environment variable argument in composition --- .gitmodules | 1 - hash/risc0/README.md | 7 +++++++ hash/risc0/composition/Cargo.lock | 4 ++-- .../risc0/composition/methods/guest/src/main.rs | 3 ++- hash/risc0/composition/run.sh | 2 +- hash/risc0/composition/src/main.rs | 17 ++++++++++++++++- hash/risc0/external/risc0 | 2 +- hash/risc0/inner_proof/src/main.rs | 14 +++++++++++++- 8 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 hash/risc0/README.md diff --git a/.gitmodules b/.gitmodules index 27593ef..e579aae 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,4 +16,3 @@ [submodule "hash/risc0/external/risc0"] path = hash/risc0/external/risc0 url = https://github.com/risc0/risc0.git - branch = release-0.20 diff --git a/hash/risc0/README.md b/hash/risc0/README.md new file mode 100644 index 0000000..edaa9ab --- /dev/null +++ b/hash/risc0/README.md @@ -0,0 +1,7 @@ +Benchmarking inside risc'0 zkvm +-------------------------------- + +- `external` folder contains risc0 as a git submodule. +- `bench` folder contains the benchmarking for different hash functions. Go to the `bench/README.md` for more details. +- `inner_proof` folder contains methods for generating the Receipt for sha256 which is being used as an inner proof in `composition` +- `composition` folder contains methods of proof composition which uses `inner_proof`. diff --git a/hash/risc0/composition/Cargo.lock b/hash/risc0/composition/Cargo.lock index 9e5e2c8..d2dff75 100644 --- a/hash/risc0/composition/Cargo.lock +++ b/hash/risc0/composition/Cargo.lock @@ -398,9 +398,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" dependencies = [ "serde", ] diff --git a/hash/risc0/composition/methods/guest/src/main.rs b/hash/risc0/composition/methods/guest/src/main.rs index 3d2cecf..1f30186 100644 --- a/hash/risc0/composition/methods/guest/src/main.rs +++ b/hash/risc0/composition/methods/guest/src/main.rs @@ -18,8 +18,9 @@ use risc0_zkvm::sha; fn main() { let hash: sha::Digest = env::read(); - + let hash2: sha::Digest = env::read(); env::verify(INNER_PROOF_METHOD_ID, &serde::to_vec(&hash).unwrap()).unwrap(); + env::verify(INNER_PROOF_METHOD_ID, &serde::to_vec(&hash2).unwrap()).unwrap(); env::commit(&hash); } diff --git a/hash/risc0/composition/run.sh b/hash/risc0/composition/run.sh index 7acdd03..bd6dfec 100755 --- a/hash/risc0/composition/run.sh +++ b/hash/risc0/composition/run.sh @@ -1 +1 @@ -./target/release/composition \ No newline at end of file +./target/release/composition 32 \ No newline at end of file diff --git a/hash/risc0/composition/src/main.rs b/hash/risc0/composition/src/main.rs index 470bfe7..9a6a17b 100644 --- a/hash/risc0/composition/src/main.rs +++ b/hash/risc0/composition/src/main.rs @@ -17,18 +17,33 @@ use inner_proof::sha_bench; use risc0_zkvm::{default_prover, ExecutorEnv}; use risc0_zkvm::sha; use std::time::Instant; +use std::process; fn main() { - let (hash_receipt, hash) = sha_bench(32); + let args: Vec = std::env::args().collect(); + if args.len() != 2 { + println!("Wrong number of arguments! The program expects one arguments: "); + // Exit the program with a non-zero exit code + process::exit(1); + } + + let data_size = args[1].parse::().unwrap(); + let t0 = Instant::now(); + let (hash_receipt, hash) = sha_bench(data_size.try_into().unwrap()); + let (hash_receipt2, hash2) = sha_bench(data_size.try_into().unwrap()); + let env = ExecutorEnv::builder() // add_assumption makes the receipt to be verified available to the prover. .add_assumption(hash_receipt) .write(&hash) .unwrap() + .add_assumption(hash_receipt2) + .write(&hash2) + .unwrap() .build() .unwrap(); diff --git a/hash/risc0/external/risc0 b/hash/risc0/external/risc0 index a4d2b5d..1742ef8 160000 --- a/hash/risc0/external/risc0 +++ b/hash/risc0/external/risc0 @@ -1 +1 @@ -Subproject commit a4d2b5d95685554ee34a39d60b40fa2c5deff57a +Subproject commit 1742ef8098d246871055501a0559811c9a8fece4 diff --git a/hash/risc0/inner_proof/src/main.rs b/hash/risc0/inner_proof/src/main.rs index 50c6f19..0bb1c0d 100644 --- a/hash/risc0/inner_proof/src/main.rs +++ b/hash/risc0/inner_proof/src/main.rs @@ -11,9 +11,21 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. use inner_proof::sha_bench; use inner_proof_methods::INNER_PROOF_METHOD_ID; +use std::process; fn main() { - let (receipt, _output) = sha_bench(32); + + let args: Vec = std::env::args().collect(); + + if args.len() != 2 { + println!("Wrong number of arguments! The program expects two arguments: and "); + // Exit the program with a non-zero exit code + process::exit(1); + } + + let data_size = args[1].parse::().unwrap(); + + let (receipt, _output) = sha_bench(data_size.try_into().unwrap()); // Verify receipt, panic if it's wrong receipt.verify(INNER_PROOF_METHOD_ID).expect( From 09bfd1b8c0954e28141bcc1d5c02874114a94f50 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Wed, 31 Jan 2024 13:01:11 +0530 Subject: [PATCH 21/41] passing string to env::read() --- hash/risc0/composition/methods/guest/src/main.rs | 8 ++++++-- hash/risc0/inner_proof/methods/guest/src/main.rs | 4 ++-- hash/risc0/inner_proof/src/lib.rs | 13 +++++++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/hash/risc0/composition/methods/guest/src/main.rs b/hash/risc0/composition/methods/guest/src/main.rs index 1f30186..c575ece 100644 --- a/hash/risc0/composition/methods/guest/src/main.rs +++ b/hash/risc0/composition/methods/guest/src/main.rs @@ -16,12 +16,16 @@ use inner_proof_methods::INNER_PROOF_METHOD_ID; use risc0_zkvm::{guest::env, serde}; use risc0_zkvm::sha; fn main() { - + let c1 = env::cycle_count(); let hash: sha::Digest = env::read(); let hash2: sha::Digest = env::read(); + let c2 = env::cycle_count(); + env::verify(INNER_PROOF_METHOD_ID, &serde::to_vec(&hash).unwrap()).unwrap(); env::verify(INNER_PROOF_METHOD_ID, &serde::to_vec(&hash2).unwrap()).unwrap(); - + let c3 = env::cycle_count(); + eprintln!("cycles for input builder: {:?}", c2 - c1); + eprintln!("cycles for inner_proof verification inside guest: {:?}", c3 - c2); env::commit(&hash); } diff --git a/hash/risc0/inner_proof/methods/guest/src/main.rs b/hash/risc0/inner_proof/methods/guest/src/main.rs index 2da5528..28fc0ac 100644 --- a/hash/risc0/inner_proof/methods/guest/src/main.rs +++ b/hash/risc0/inner_proof/methods/guest/src/main.rs @@ -5,8 +5,8 @@ use risc0_zkvm::{guest::env, sha, sha::Sha256}; risc0_zkvm::guest::entry!(main); fn main() { - let data: Vec = env::read(); - let hash = sha::Impl::hash_bytes(&data); + let data: String = env::read(); + let hash = sha::Impl::hash_bytes(&data.as_bytes()); env::commit(&hash) } diff --git a/hash/risc0/inner_proof/src/lib.rs b/hash/risc0/inner_proof/src/lib.rs index 902f1ad..6c6ab88 100644 --- a/hash/risc0/inner_proof/src/lib.rs +++ b/hash/risc0/inner_proof/src/lib.rs @@ -4,9 +4,18 @@ use risc0_zkvm::{ sha}; use rand::Rng; -pub fn generate_bytes(size: u32) -> Vec { +pub fn generate_bytes(size: u32) -> String { let mut rng = rand::thread_rng(); - (0..size).map(|_| rng.gen()).collect() + let random_bytes: Vec = (0..(size/2)).map(|_| rng.gen()).collect(); + + let random_string: String = random_bytes + .iter() + .map(|byte| format!("{:02X}", byte)) // Convert each byte to a two-digit hexadecimal string + .collect(); + + // eprintln!("bytes: {:?}", random_string.as_bytes().len()); + random_string + } pub fn sha_bench(size: u32) -> (Receipt, sha::Digest) { From b1061b8daadad21d5f2f42286c3db79d12df38e9 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Thu, 8 Feb 2024 00:47:08 +0530 Subject: [PATCH 22/41] initial commit for hash benchmarking using plonky2 --- hash/plonky2/Cargo.toml | 10 +++++++++ hash/plonky2/src/main.rs | 47 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 hash/plonky2/Cargo.toml create mode 100644 hash/plonky2/src/main.rs diff --git a/hash/plonky2/Cargo.toml b/hash/plonky2/Cargo.toml new file mode 100644 index 0000000..e68c003 --- /dev/null +++ b/hash/plonky2/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "plonky2" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow = "1.0.79" +plonky2 = "0.1.4" diff --git a/hash/plonky2/src/main.rs b/hash/plonky2/src/main.rs new file mode 100644 index 0000000..241b63e --- /dev/null +++ b/hash/plonky2/src/main.rs @@ -0,0 +1,47 @@ +use anyhow::Result; +use plonky2::field::types::Field; +use plonky2::hash::hash_types::RichField; +use plonky2::field::goldilocks_field::GoldilocksField; +use plonky2::hash::keccak; +use plonky2::hash::keccak::KeccakHash; +use plonky2::hash::poseidon::PoseidonHash; +use plonky2::iop::witness::{PartialWitness, WitnessWrite}; +use plonky2::plonk::circuit_builder::CircuitBuilder; +use plonky2::plonk::circuit_data::CircuitConfig; +use plonky2::plonk::config::{AlgebraicHasher, GenericConfig, PoseidonGoldilocksConfig}; + +fn main() -> Result<()> { + const D: usize = 2; + type C = PoseidonGoldilocksConfig; + type F = >::F; + + let config = CircuitConfig::standard_recursion_config(); + let mut builder = CircuitBuilder::::new(config); + + // The arithmetic circuit. + let initial = builder.add_virtual_target(); + let hash = builder.hash_or_noop::(vec![initial]); + + // Public inputs are the initial value (provided below) and the result (which is generated). + builder.register_public_input(initial); + builder.register_public_input(hash.elements[0]); + builder.register_public_input(hash.elements[1]); + builder.register_public_input(hash.elements[2]); + builder.register_public_input(hash.elements[3]); + + // Provide initial values. + let mut pw = PartialWitness::new(); + pw.set_target(initial, F::ONE); + + + let data = builder.build::(); + let proof = data.prove(pw)?; + + println!( + "hash of {} is: {}", + proof.public_inputs[0], proof.public_inputs[1] + ); + + data.verify(proof) + +} From cd8dfedacead778db152bf4273c5c008c1968cc0 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Fri, 9 Feb 2024 01:17:56 +0530 Subject: [PATCH 23/41] poseidon hash bench --- hash/plonky2/Cargo.toml | 2 + hash/plonky2/src/bench/mod.rs | 1 + hash/plonky2/src/bench/poseidon.rs | 64 ++++++++++++++++++++++++++++ hash/plonky2/src/main.rs | 67 ++++++++++++------------------ 4 files changed, 93 insertions(+), 41 deletions(-) create mode 100644 hash/plonky2/src/bench/mod.rs create mode 100644 hash/plonky2/src/bench/poseidon.rs diff --git a/hash/plonky2/Cargo.toml b/hash/plonky2/Cargo.toml index e68c003..c7e4e43 100644 --- a/hash/plonky2/Cargo.toml +++ b/hash/plonky2/Cargo.toml @@ -8,3 +8,5 @@ edition = "2021" [dependencies] anyhow = "1.0.79" plonky2 = "0.1.4" +rand = "0.8.3" + diff --git a/hash/plonky2/src/bench/mod.rs b/hash/plonky2/src/bench/mod.rs new file mode 100644 index 0000000..af26fd2 --- /dev/null +++ b/hash/plonky2/src/bench/mod.rs @@ -0,0 +1 @@ +pub mod poseidon; \ No newline at end of file diff --git a/hash/plonky2/src/bench/poseidon.rs b/hash/plonky2/src/bench/poseidon.rs new file mode 100644 index 0000000..706f040 --- /dev/null +++ b/hash/plonky2/src/bench/poseidon.rs @@ -0,0 +1,64 @@ +use anyhow::Result; +use plonky2::field::types::Field; +// use plonky2::hash::hash_types::{HashOutTarget, RichField}; +use plonky2::field::goldilocks_field::GoldilocksField; +// use plonky2::hash::keccak; +// use plonky2::hash::keccak::KeccakHash; +use plonky2::hash::poseidon::PoseidonHash; +use plonky2::iop::witness::{PartialWitness, WitnessWrite}; +use plonky2::plonk::circuit_builder::CircuitBuilder; +use plonky2::plonk::circuit_data::CircuitConfig; +use plonky2::plonk::config::{/*AlgebraicHasher,*/ GenericConfig, PoseidonGoldilocksConfig}; +use rand::Rng; + +fn generate_data(size: usize) -> Vec { + // let mut rng = rand::thread_rng(); + // (0..size).map(|_| rng.gen()).collect() + + let mut data: Vec = Vec::new(); + for _ in 0..(1< Result<()> { + + let data = generate_data(depth); + + const D: usize = 2; + type C = PoseidonGoldilocksConfig; + type F = >::F; + + let config = CircuitConfig::standard_recursion_config(); + let mut builder = CircuitBuilder::::new(config); + + // The arithmetic circuit. + let initial = builder.add_virtual_targets(data.len()); + + let hash = builder.hash_or_noop::(initial.clone()); + + // Public inputs are the initial value (provided below) and the result (which is generated). + builder.register_public_inputs(initial.clone().as_slice()); + builder.register_public_input(hash.elements[0]); + builder.register_public_input(hash.elements[1]); + builder.register_public_input(hash.elements[2]); + builder.register_public_input(hash.elements[3]); + + // Provide initial values. + let mut pw = PartialWitness::new(); + pw.set_target_arr(initial.as_slice(), data.as_slice()); + + + let data = builder.build::(); + let proof = data.prove(pw)?; + + + data.verify(proof) + +} diff --git a/hash/plonky2/src/main.rs b/hash/plonky2/src/main.rs index 241b63e..a08de49 100644 --- a/hash/plonky2/src/main.rs +++ b/hash/plonky2/src/main.rs @@ -1,47 +1,32 @@ -use anyhow::Result; -use plonky2::field::types::Field; -use plonky2::hash::hash_types::RichField; -use plonky2::field::goldilocks_field::GoldilocksField; -use plonky2::hash::keccak; -use plonky2::hash::keccak::KeccakHash; -use plonky2::hash::poseidon::PoseidonHash; -use plonky2::iop::witness::{PartialWitness, WitnessWrite}; -use plonky2::plonk::circuit_builder::CircuitBuilder; -use plonky2::plonk::circuit_data::CircuitConfig; -use plonky2::plonk::config::{AlgebraicHasher, GenericConfig, PoseidonGoldilocksConfig}; +use std::process; +mod bench; +use bench::poseidon::poseidon_bench; -fn main() -> Result<()> { - const D: usize = 2; - type C = PoseidonGoldilocksConfig; - type F = >::F; +fn main() { + let args: Vec = std::env::args().collect(); - let config = CircuitConfig::standard_recursion_config(); - let mut builder = CircuitBuilder::::new(config); + if args.len() != 3 { + println!("Wrong number of arguments! The program expects two arguments: and "); + // Exit the program with a non-zero exit code + process::exit(1); + } + + let hash_type = &args[1]; + let size = args[2].parse::().unwrap(); - // The arithmetic circuit. - let initial = builder.add_virtual_target(); - let hash = builder.hash_or_noop::(vec![initial]); + match hash_type.as_str() { - // Public inputs are the initial value (provided below) and the result (which is generated). - builder.register_public_input(initial); - builder.register_public_input(hash.elements[0]); - builder.register_public_input(hash.elements[1]); - builder.register_public_input(hash.elements[2]); - builder.register_public_input(hash.elements[3]); + "poseidon" => { + println!("Running Poseidon: "); + eprintln!("Tree Depth: {:?}", size); + let _ = poseidon_bench(size); + } - // Provide initial values. - let mut pw = PartialWitness::new(); - pw.set_target(initial, F::ONE); + _ => { + println!("Wrong Benchmark Name!"); + } + } - - let data = builder.build::(); - let proof = data.prove(pw)?; - - println!( - "hash of {} is: {}", - proof.public_inputs[0], proof.public_inputs[1] - ); - - data.verify(proof) - -} + println!("All Done!"); + +} \ No newline at end of file From 8f98119c3bad49e45a24401214682264e32c3ade Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Fri, 23 Feb 2024 22:22:00 +0530 Subject: [PATCH 24/41] sha256 plonky2 currenlty uses https://github.com/polymerdao/plonky2-sha256 codebase --- hash/plonky2/Cargo.toml | 7 +- hash/plonky2/src/bench/keccak.rs | 25 +++ hash/plonky2/src/bench/mod.rs | 1 - hash/plonky2/src/bench/sha256/ch.rs | 29 +++ hash/plonky2/src/bench/sha256/constants.rs | 24 ++ hash/plonky2/src/bench/sha256/maj.rs | 32 +++ hash/plonky2/src/bench/sha256/rotate.rs | 11 + hash/plonky2/src/bench/sha256/sha.rs | 241 +++++++++++++++++++++ hash/plonky2/src/bench/sha256/shift.rs | 12 + hash/plonky2/src/bench/sha256/sigma.rs | 115 ++++++++++ hash/plonky2/src/bench/sha256/xor3.rs | 26 +++ hash/plonky2/src/main.rs | 30 ++- 12 files changed, 550 insertions(+), 3 deletions(-) create mode 100644 hash/plonky2/src/bench/keccak.rs delete mode 100644 hash/plonky2/src/bench/mod.rs create mode 100644 hash/plonky2/src/bench/sha256/ch.rs create mode 100644 hash/plonky2/src/bench/sha256/constants.rs create mode 100644 hash/plonky2/src/bench/sha256/maj.rs create mode 100644 hash/plonky2/src/bench/sha256/rotate.rs create mode 100644 hash/plonky2/src/bench/sha256/sha.rs create mode 100644 hash/plonky2/src/bench/sha256/shift.rs create mode 100644 hash/plonky2/src/bench/sha256/sigma.rs create mode 100644 hash/plonky2/src/bench/sha256/xor3.rs diff --git a/hash/plonky2/Cargo.toml b/hash/plonky2/Cargo.toml index c7e4e43..615fea1 100644 --- a/hash/plonky2/Cargo.toml +++ b/hash/plonky2/Cargo.toml @@ -6,7 +6,12 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -anyhow = "1.0.79" +plonky2_u32 ={ git = "https://github.com/0xPolygonZero/plonky2-u32"} +plonky2_field ={ git = "https://github.com/0xPolygonZero/plonky2"} plonky2 = "0.1.4" rand = "0.8.3" +anyhow = "1.0.79" +sha2 = "0.10" + + diff --git a/hash/plonky2/src/bench/keccak.rs b/hash/plonky2/src/bench/keccak.rs new file mode 100644 index 0000000..785e853 --- /dev/null +++ b/hash/plonky2/src/bench/keccak.rs @@ -0,0 +1,25 @@ +// use anyhow::Result; +// use plonky2::field::types::Field; +// use plonky2::gates::poseidon::PoseidonGate; +// use plonky2::hash::hash_types::{HashOutTarget, RichField}; +// use plonky2::field::goldilocks_field::GoldilocksField; +// use plonky2::hash::keccak::{KeccakHash, KeccakPermutation}; +// use plonky2::hash::keccak; +// use plonky2::hash::keccak::KeccakHash; +// use plonky2::hash::poseidon::PoseidonHash; +// use plonky2::iop::witness::{PartialWitness, WitnessWrite}; +// use plonky2::plonk::circuit_builder::CircuitBuilder; +// use plonky2::plonk::circuit_data::CircuitConfig; +// use plonky2::plonk::config::{AlgebraicHasher, GenericConfig, PoseidonGoldilocksConfig, KeccakGoldilocksConfig}; +// use rand::Rng; +// use plonky2::iop::target::Target; +// use plonky2::iop::target::BoolTarget; +// use plonky2::field::extension::Extendable; +// use std::marker::PhantomData; + + + +pub fn keccak_bench(size: usize) { + + +} diff --git a/hash/plonky2/src/bench/mod.rs b/hash/plonky2/src/bench/mod.rs deleted file mode 100644 index af26fd2..0000000 --- a/hash/plonky2/src/bench/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod poseidon; \ No newline at end of file diff --git a/hash/plonky2/src/bench/sha256/ch.rs b/hash/plonky2/src/bench/sha256/ch.rs new file mode 100644 index 0000000..ce26f53 --- /dev/null +++ b/hash/plonky2/src/bench/sha256/ch.rs @@ -0,0 +1,29 @@ +// use plonky2::{hash::hash_types::HashOutTarget, iop::target::Target, iop::target::BoolTarget}; +use plonky2::iop::target::BoolTarget; + +use plonky2::hash::hash_types::RichField; +use plonky2::plonk::circuit_builder::CircuitBuilder; +// use plonky2_field::extension; +use plonky2::field::extension::Extendable; +use plonky2_u32::gadgets::arithmetic_u32::U32Target; +use super::sigma::bits_to_u32_target; +use super::sigma::u32_to_bits_target; + +pub fn ch, const D: usize>( + builder: &mut CircuitBuilder, + a: &U32Target, + b: &U32Target, + c: &U32Target, +) -> U32Target { + let a_bits = u32_to_bits_target::(builder, a); + let b_bits = u32_to_bits_target::(builder, b); + let c_bits = u32_to_bits_target::(builder, c); + let mut res_bits = Vec::new(); + for i in 0..32 { + let b_sub_c = builder.sub(b_bits[i].target, c_bits[i].target); + let a_mul_b_sub_c = builder.mul(a_bits[i].target, b_sub_c); + let a_mul_b_sub_c_add_c = builder.add(a_mul_b_sub_c, c_bits[i].target); + res_bits.push(BoolTarget::new_unsafe(a_mul_b_sub_c_add_c)); + } + bits_to_u32_target(builder, res_bits) +} \ No newline at end of file diff --git a/hash/plonky2/src/bench/sha256/constants.rs b/hash/plonky2/src/bench/sha256/constants.rs new file mode 100644 index 0000000..e652bff --- /dev/null +++ b/hash/plonky2/src/bench/sha256/constants.rs @@ -0,0 +1,24 @@ + +pub const H: [u32; 8] = [ + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, + 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 +]; + +pub const K: [u32; 64] = [ + 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, + 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, + 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, + 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, + 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, + 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, + 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, + 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967, + 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, + 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, + 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, + 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, + 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, + 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, + 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, + 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2 +]; \ No newline at end of file diff --git a/hash/plonky2/src/bench/sha256/maj.rs b/hash/plonky2/src/bench/sha256/maj.rs new file mode 100644 index 0000000..6876f4e --- /dev/null +++ b/hash/plonky2/src/bench/sha256/maj.rs @@ -0,0 +1,32 @@ +use plonky2::iop::target::BoolTarget; +use plonky2::hash::hash_types::RichField; +use plonky2::plonk::circuit_builder::CircuitBuilder; +use plonky2::field::extension::Extendable; +use plonky2_u32::gadgets::arithmetic_u32::U32Target; + +use super::sigma::u32_to_bits_target; +use super::sigma::bits_to_u32_target; + +pub fn maj, const D: usize>( + builder: &mut CircuitBuilder, + a: &U32Target, + b: &U32Target, + c: &U32Target, +) -> U32Target { + let a_bits = u32_to_bits_target::(builder, a); + let b_bits = u32_to_bits_target::(builder, b); + let c_bits = u32_to_bits_target::(builder, c); + let mut res_bits = Vec::new(); + for i in 0..32 { + let m = builder.mul(b_bits[i].target, c_bits[i].target); + let two = builder.two(); + let two_m = builder.mul(two, m); + let b_add_c = builder.add(b_bits[i].target, c_bits[i].target); + let b_add_c_sub_two_m = builder.sub(b_add_c, two_m); + let a_mul_b_add_c_sub_two_m = builder.mul(a_bits[i].target, b_add_c_sub_two_m); + let res = builder.add(a_mul_b_add_c_sub_two_m, m); + + res_bits.push(BoolTarget::new_unsafe(res)); + } + bits_to_u32_target(builder, res_bits) +} \ No newline at end of file diff --git a/hash/plonky2/src/bench/sha256/rotate.rs b/hash/plonky2/src/bench/sha256/rotate.rs new file mode 100644 index 0000000..fec8361 --- /dev/null +++ b/hash/plonky2/src/bench/sha256/rotate.rs @@ -0,0 +1,11 @@ +// define ROTATE(x, y) (((x)>>(y)) | ((x)<<(32-(y)))) +pub fn rotate32(y: usize) -> Vec { + let mut res = Vec::new(); + for i in 32 - y..32 { + res.push(i); + } + for i in 0..32 - y { + res.push(i); + } + res +} \ No newline at end of file diff --git a/hash/plonky2/src/bench/sha256/sha.rs b/hash/plonky2/src/bench/sha256/sha.rs new file mode 100644 index 0000000..7d092e9 --- /dev/null +++ b/hash/plonky2/src/bench/sha256/sha.rs @@ -0,0 +1,241 @@ +use plonky2::iop::target::BoolTarget; +use plonky2::hash::hash_types::RichField; +use plonky2::iop::target::Target; +use plonky2::plonk::circuit_builder::CircuitBuilder; +use plonky2::field::extension::Extendable; +use plonky2_u32::gadgets::arithmetic_u32::{CircuitBuilderU32, U32Target}; +use anyhow::Result; +use plonky2::plonk::config::PoseidonGoldilocksConfig; +use plonky2::plonk::config::GenericConfig; +use plonky2::plonk::circuit_data::CircuitConfig; +use plonky2::iop::witness::{PartialWitness, WitnessWrite}; +// use rand::Rng; +use sha2::{Digest, Sha256}; +use super::sigma::big_sigma0; +use super::sigma::big_sigma1; +use super::sigma::sigma0; +use super::sigma::sigma1; +use super::maj::maj; +use super::constants::*; +use super::ch::ch; + +fn add_u32, const D: usize>( + builder: &mut CircuitBuilder, + a: &U32Target, + b: &U32Target, +) -> U32Target { + let (res, _carry) = builder.add_u32(*a, *b); + res +} + +pub struct Sha256Targets { + pub message: Vec, + pub digest: Vec, +} + +pub fn array_to_bits(bytes: &[u8]) -> Vec { + let len = bytes.len(); + let mut ret = Vec::new(); + for i in 0..len { + for j in 0..8 { + let b = (bytes[i] >> (7 - j)) & 1; + ret.push(b == 1); + } + } + ret +} + + +pub fn make_circuits, const D: usize>( + builder: &mut CircuitBuilder, + msg_len_in_bits: u64, + +) -> Sha256Targets { + + + let mut message = Vec::new(); + let mut digest = Vec::new(); + + let block_count = (msg_len_in_bits + 65 + 511) / 512; + let padded_msg_len = 512 * block_count; + let p = padded_msg_len - 64 - msg_len_in_bits; + assert!(p > 1); + + //msg + for _ in 0..msg_len_in_bits { + message.push(builder.add_virtual_bool_target_unsafe()); + } + + //append a single bit '1' + message.push(builder.constant_bool(true)); + + //append '0' bit so that total length become multiple of 512 + for _ in 0..p - 1 { + message.push(builder.constant_bool(false)); + } + + //append the msg length as 64bit big-endian integer + for i in 0..64 { + let b = ((msg_len_in_bits as u64) >> (63 - i)) & 1; + message.push(builder.constant_bool(b == 1)); + } + + // init states + let mut state = Vec::new(); + for i in 0..8 { + state.push(builder.constant_u32(H[i])); + } + + let mut k256 = Vec::new(); + for i in 0..64 { + k256.push(builder.constant_u32(K[i])); + } + + for blk in 0..block_count { + let mut x = Vec::new(); + let mut a = state[0].clone(); + let mut b = state[1].clone(); + let mut c = state[2].clone(); + let mut d = state[3].clone(); + let mut e = state[4].clone(); + let mut f = state[5].clone(); + let mut g = state[6].clone(); + let mut h = state[7].clone(); + + for i in 0..16 { + let index = blk as usize * 512 + i * 32; + let u32_target = builder.le_sum(message[index..index + 32].iter().rev()); + + x.push(U32Target(u32_target)); + let mut t1 = h.clone(); + let big_sigma1_e = big_sigma1(builder, &e); + t1 = add_u32(builder, &t1, &big_sigma1_e); + let ch_e_f_g = ch(builder, &e, &f, &g); + t1 = add_u32(builder, &t1, &ch_e_f_g); + t1 = add_u32(builder, &t1, &k256[i]); + t1 = add_u32(builder, &t1, &x[i]); + + let mut t2 = big_sigma0(builder, &a); + let maj_a_b_c = maj(builder, &a, &b, &c); + t2 = add_u32(builder, &t2, &maj_a_b_c); + + h = g; + g = f; + f = e; + e = add_u32(builder, &d, &t1); + d = c; + c = b; + b = a; + a = add_u32(builder, &t1, &t2); + } + + for i in 16..64 { + let s0 = sigma0(builder, &x[(i + 1) & 0x0f]); + let s1 = sigma1(builder, &x[(i + 14) & 0x0f]); + + let s0_add_s1 = add_u32(builder, &s0, &s1); + let s0_add_s1_add_x = add_u32(builder, &s0_add_s1, &x[(i + 9) & 0xf]); + x[i & 0xf] = add_u32(builder, &x[i & 0xf], &s0_add_s1_add_x); + + let big_sigma0_a = big_sigma0(builder, &a); + let big_sigma1_e = big_sigma1(builder, &e); + let ch_e_f_g = ch(builder, &e, &f, &g); + let maj_a_b_c = maj(builder, &a, &b, &c); + + let h_add_sigma1 = add_u32(builder, &h, &big_sigma1_e); + let h_add_sigma1_add_ch_e_f_g = add_u32(builder, &h_add_sigma1, &ch_e_f_g); + let h_add_sigma1_add_ch_e_f_g_add_k256 = + add_u32(builder, &h_add_sigma1_add_ch_e_f_g, &k256[i]); + + let t1 = add_u32(builder, &x[i & 0xf], &h_add_sigma1_add_ch_e_f_g_add_k256); + let t2 = add_u32(builder, &big_sigma0_a, &maj_a_b_c); + + h = g; + g = f; + f = e; + e = add_u32(builder, &d, &t1); + d = c; + c = b; + b = a; + a = add_u32(builder, &t1, &t2); + } + + state[0] = add_u32(builder, &state[0], &a); + state[1] = add_u32(builder, &state[1], &b); + state[2] = add_u32(builder, &state[2], &c); + state[3] = add_u32(builder, &state[3], &d); + state[4] = add_u32(builder, &state[4], &e); + state[5] = add_u32(builder, &state[5], &f); + state[6] = add_u32(builder, &state[6], &g); + state[7] = add_u32(builder, &state[7], &h); + } + + for i in 0..8 { + let bit_targets = builder.split_le_base::<2>(state[i].0, 32); + for j in (0..32).rev() { + digest.push(BoolTarget::new_unsafe(bit_targets[j])); + } + } + + Sha256Targets { message, digest } +} + + +fn generate_random_bytes() -> Vec { + const MSG_SIZE: usize = 64; + let mut msg = vec![0; MSG_SIZE as usize]; + for i in 0..MSG_SIZE - 1 { + msg[i] = i as u8; + } + + msg + +} + +pub fn sha256_bench() -> Result<()> { + let msg = generate_random_bytes(); + + let mut hasher = Sha256::new(); + hasher.update(msg.clone()); + let hash = hasher.finalize(); + // println!("Hash: {:#04X}", hash); + + let msg_bits = array_to_bits(&msg.clone()); + let len = msg.len() * 8; + println!("block count: {}", (len + 65 + 511) / 512); + const D: usize = 2; + type C = PoseidonGoldilocksConfig; + type F = >::F; + let mut builder = CircuitBuilder::::new(CircuitConfig::standard_recursion_config()); + let targets = make_circuits(&mut builder, len as u64); + let mut pw = PartialWitness::new(); + + for i in 0..len { + pw.set_bool_target(targets.message[i], msg_bits[i]); + } + + let expected_res = array_to_bits(hash.as_slice()); + for i in 0..expected_res.len() { + if expected_res[i] { + builder.assert_one(targets.digest[i].target); + } else { + builder.assert_zero(targets.digest[i].target); + } + } + + println!( + "Constructing inner proof with {} gates", + builder.num_gates() + ); + let data = builder.build::(); + // let timing = TimingTree::new("prove", Level::Debug); + let proof = data.prove(pw).unwrap(); + // timing.print(); + + // let timing = TimingTree::new("verify", Level::Debug); + let res = data.verify(proof); + // timing.print(); + + res + +} \ No newline at end of file diff --git a/hash/plonky2/src/bench/sha256/shift.rs b/hash/plonky2/src/bench/sha256/shift.rs new file mode 100644 index 0000000..a52d4e2 --- /dev/null +++ b/hash/plonky2/src/bench/sha256/shift.rs @@ -0,0 +1,12 @@ +// x>>y +// Assume: 0 at index 32 +pub fn shift32(y: usize) -> Vec { + let mut res = Vec::new(); + for _ in 32 - y..32 { + res.push(32); + } + for i in 0..32 - y { + res.push(i); + } + res +} \ No newline at end of file diff --git a/hash/plonky2/src/bench/sha256/sigma.rs b/hash/plonky2/src/bench/sha256/sigma.rs new file mode 100644 index 0000000..6a16c9c --- /dev/null +++ b/hash/plonky2/src/bench/sha256/sigma.rs @@ -0,0 +1,115 @@ +// use plonky2::{hash::hash_types::HashOutTarget, iop::target::Target, iop::target::BoolTarget}; +use plonky2::iop::target::BoolTarget; + +use plonky2::hash::hash_types::RichField; +use plonky2::plonk::circuit_builder::CircuitBuilder; +// use plonky2_field::extension; +use plonky2::field::extension::Extendable; +use plonky2_u32::gadgets::arithmetic_u32::U32Target; +use super::shift::shift32; +use super::rotate::rotate32; +use super::xor3::xor3; + +pub fn u32_to_bits_target, const D: usize, const B: usize>( + builder: &mut CircuitBuilder, + a: &U32Target, +) -> Vec { + let mut res = Vec::new(); + let bit_targets = builder.split_le_base::(a.0, 32); + for i in (0..32).rev() { + res.push(BoolTarget::new_unsafe(bit_targets[i])); + } + res +} + +pub fn bits_to_u32_target, const D: usize>( + builder: &mut CircuitBuilder, + bits_target: Vec, +) -> U32Target { + let bit_len = bits_target.len(); + assert_eq!(bit_len, 32); + U32Target(builder.le_sum(bits_target[0..32].iter().rev())) +} + +pub fn sigma0, const D: usize>( + builder: &mut CircuitBuilder, + a: &U32Target, +) -> U32Target { + let mut a_bits = u32_to_bits_target::(builder, a); + a_bits.push(builder.constant_bool(false)); + let rotate7 = rotate32(7); + let rotate18 = rotate32(18); + let shift3 = shift32(3); + let mut res_bits = Vec::new(); + for i in 0..32 { + res_bits.push(xor3( + builder, + a_bits[rotate7[i]], + a_bits[rotate18[i]], + a_bits[shift3[i]], + )); + } + bits_to_u32_target(builder, res_bits) +} + +pub fn sigma1, const D: usize>( + builder: &mut CircuitBuilder, + a: &U32Target, +) -> U32Target { + let mut a_bits = u32_to_bits_target::(builder, a); + a_bits.push(builder.constant_bool(false)); + let rotate17 = rotate32(17); + let rotate19 = rotate32(19); + let shift10 = shift32(10); + let mut res_bits = Vec::new(); + for i in 0..32 { + res_bits.push(xor3( + builder, + a_bits[rotate17[i]], + a_bits[rotate19[i]], + a_bits[shift10[i]], + )); + } + bits_to_u32_target(builder, res_bits) +} + +//#define Sigma0(x) (ROTATE((x), 2) ^ ROTATE((x),13) ^ ROTATE((x),22)) +pub fn big_sigma0, const D: usize>( + builder: &mut CircuitBuilder, + a: &U32Target, +) -> U32Target { + let a_bits = u32_to_bits_target::(builder, a); + let rotate2 = rotate32(2); + let rotate13 = rotate32(13); + let rotate22 = rotate32(22); + let mut res_bits = Vec::new(); + for i in 0..32 { + res_bits.push(xor3( + builder, + a_bits[rotate2[i]], + a_bits[rotate13[i]], + a_bits[rotate22[i]], + )); + } + bits_to_u32_target(builder, res_bits) +} + +pub fn big_sigma1, const D: usize>( + builder: &mut CircuitBuilder, + a: &U32Target, +) -> U32Target { + let a_bits = u32_to_bits_target::(builder, a); + let rotate6 = rotate32(6); + let rotate11 = rotate32(11); + let rotate25 = rotate32(25); + let mut res_bits = Vec::new(); + for i in 0..32 { + res_bits.push(xor3( + builder, + a_bits[rotate6[i]], + a_bits[rotate11[i]], + a_bits[rotate25[i]], + )); + } + bits_to_u32_target(builder, res_bits) +} \ No newline at end of file diff --git a/hash/plonky2/src/bench/sha256/xor3.rs b/hash/plonky2/src/bench/sha256/xor3.rs new file mode 100644 index 0000000..4a176ac --- /dev/null +++ b/hash/plonky2/src/bench/sha256/xor3.rs @@ -0,0 +1,26 @@ +use plonky2::iop::target::BoolTarget; +use plonky2::hash::hash_types::RichField; +use plonky2::plonk::circuit_builder::CircuitBuilder; +use plonky2::field::extension::Extendable; + +pub fn xor3, const D: usize>( + builder: &mut CircuitBuilder, + a: BoolTarget, + b: BoolTarget, + c: BoolTarget, +) -> BoolTarget { + let m = builder.mul(b.target, c.target); + let two_b = builder.add(b.target, b.target); + let two_c = builder.add(c.target, c.target); + let two_m = builder.add(m, m); + let four_m = builder.add(two_m, two_m); + let one = builder.one(); + let one_sub_two_b = builder.sub(one, two_b); + let one_sub_two_b_sub_two_c = builder.sub(one_sub_two_b, two_c); + let one_sub_two_b_sub_two_c_add_four_m = builder.add(one_sub_two_b_sub_two_c, four_m); + let mut res = builder.mul(a.target, one_sub_two_b_sub_two_c_add_four_m); + res = builder.add(res, b.target); + res = builder.add(res, c.target); + + BoolTarget::new_unsafe(builder.sub(res, two_m)) +} \ No newline at end of file diff --git a/hash/plonky2/src/main.rs b/hash/plonky2/src/main.rs index a08de49..0eaa9fb 100644 --- a/hash/plonky2/src/main.rs +++ b/hash/plonky2/src/main.rs @@ -1,6 +1,23 @@ use std::process; -mod bench; +mod bench{ + pub mod keccak; + pub mod poseidon; + pub mod sha256{ + pub mod constants; + pub mod shift; + pub mod rotate; + pub mod sigma; + pub mod sha; + pub mod xor3; + pub mod maj; + pub mod ch; + + } +} + use bench::poseidon::poseidon_bench; +use bench::keccak::keccak_bench; +use bench::sha256::sha::sha256_bench; fn main() { let args: Vec = std::env::args().collect(); @@ -22,6 +39,17 @@ fn main() { let _ = poseidon_bench(size); } + "keccak" => { + println!("Running keccak: "); + eprintln!("input size: {:?}", size); + let _ = keccak_bench(size); + } + + "sha256" => { + println!("Running sha256: "); + let _ = sha256_bench(); + } + _ => { println!("Wrong Benchmark Name!"); } From 839e3448e11a9b168b83be89a6013eaec7696164 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Wed, 24 Apr 2024 23:15:15 +0530 Subject: [PATCH 25/41] plonky2 version changed to 0.2.2, build.sh and run.sh added --- hash/plonky2/Cargo.toml | 9 +++++---- hash/plonky2/build.sh | 8 ++++++++ hash/plonky2/run.sh | 15 +++++++++++++++ hash/plonky2/src/bench/keccak.rs | 2 +- hash/plonky2/src/bench/poseidon.rs | 19 +++++++++++++++++-- hash/plonky2/src/bench/sha256/sha.rs | 2 -- hash/risc0/external/risc0 | 2 +- 7 files changed, 47 insertions(+), 10 deletions(-) create mode 100755 hash/plonky2/build.sh create mode 100755 hash/plonky2/run.sh diff --git a/hash/plonky2/Cargo.toml b/hash/plonky2/Cargo.toml index 615fea1..cc7a85d 100644 --- a/hash/plonky2/Cargo.toml +++ b/hash/plonky2/Cargo.toml @@ -1,14 +1,15 @@ [package] -name = "plonky2" +name = "plonky2_hash_benchmarks" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -plonky2_u32 ={ git = "https://github.com/0xPolygonZero/plonky2-u32"} -plonky2_field ={ git = "https://github.com/0xPolygonZero/plonky2"} -plonky2 = "0.1.4" + +# TODO: This can be later changed to original github +plonky2_u32 ={ git = "https://github.com/man2706kum/plonky2-u32.git"} +plonky2 = "0.2.2" rand = "0.8.3" anyhow = "1.0.79" sha2 = "0.10" diff --git a/hash/plonky2/build.sh b/hash/plonky2/build.sh new file mode 100755 index 0000000..749ad6c --- /dev/null +++ b/hash/plonky2/build.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Set nightly as the default toolchain +rustup override set nightly + +# Build +cargo build + diff --git a/hash/plonky2/run.sh b/hash/plonky2/run.sh new file mode 100755 index 0000000..9f1d247 --- /dev/null +++ b/hash/plonky2/run.sh @@ -0,0 +1,15 @@ +#!/bin/bash +if [ -z ${ZKBENCH_HASH_TYPE} ]; then +ZKBENCH_HASH_TYPE="poseidon" +fi + +if [ -z ${ZKBENCH_INPUT_SIZE_BYTES} ]; then +ZKBENCH_INPUT_SIZE_BYTES=4 +fi + +echo "Running benchmarks with the following configurations:" +echo "HASH = $ZKBENCH_HASH_TYPE" +echo "Input Size (Bytes) = $ZKBENCH_INPUT_SIZE_BYTES" + +# Run the benchmarks +./target/debug/plonky2_hash_benchmarks $ZKBENCH_HASH_TYPE $ZKBENCH_INPUT_SIZE_BYTES \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak.rs b/hash/plonky2/src/bench/keccak.rs index 785e853..ac7a356 100644 --- a/hash/plonky2/src/bench/keccak.rs +++ b/hash/plonky2/src/bench/keccak.rs @@ -19,7 +19,7 @@ -pub fn keccak_bench(size: usize) { +pub fn keccak_bench(_size: usize) { } diff --git a/hash/plonky2/src/bench/poseidon.rs b/hash/plonky2/src/bench/poseidon.rs index 706f040..1f176eb 100644 --- a/hash/plonky2/src/bench/poseidon.rs +++ b/hash/plonky2/src/bench/poseidon.rs @@ -10,6 +10,7 @@ use plonky2::plonk::circuit_builder::CircuitBuilder; use plonky2::plonk::circuit_data::CircuitConfig; use plonky2::plonk::config::{/*AlgebraicHasher,*/ GenericConfig, PoseidonGoldilocksConfig}; use rand::Rng; +use std::time; fn generate_data(size: usize) -> Vec { // let mut rng = rand::thread_rng(); @@ -56,9 +57,23 @@ pub fn poseidon_bench(depth: usize) -> Result<()> { let data = builder.build::(); - let proof = data.prove(pw)?; + let (proof_generation_time, proof) = { - data.verify(proof) + let start = time::Instant::now(); + let proof = data.prove(pw)?; + let end_time = start.elapsed(); + (end_time, proof) + }; + + let (verification_time, result) = { + let start = time::Instant::now(); + let result = data.verify(proof); + let end_time = start.elapsed(); + (end_time, result) + }; + eprintln!("proof generation time: {:?}", proof_generation_time); + eprintln!("verification time: {:?}", verification_time); + result } diff --git a/hash/plonky2/src/bench/sha256/sha.rs b/hash/plonky2/src/bench/sha256/sha.rs index 7d092e9..0d52002 100644 --- a/hash/plonky2/src/bench/sha256/sha.rs +++ b/hash/plonky2/src/bench/sha256/sha.rs @@ -1,6 +1,5 @@ use plonky2::iop::target::BoolTarget; use plonky2::hash::hash_types::RichField; -use plonky2::iop::target::Target; use plonky2::plonk::circuit_builder::CircuitBuilder; use plonky2::field::extension::Extendable; use plonky2_u32::gadgets::arithmetic_u32::{CircuitBuilderU32, U32Target}; @@ -9,7 +8,6 @@ use plonky2::plonk::config::PoseidonGoldilocksConfig; use plonky2::plonk::config::GenericConfig; use plonky2::plonk::circuit_data::CircuitConfig; use plonky2::iop::witness::{PartialWitness, WitnessWrite}; -// use rand::Rng; use sha2::{Digest, Sha256}; use super::sigma::big_sigma0; use super::sigma::big_sigma1; diff --git a/hash/risc0/external/risc0 b/hash/risc0/external/risc0 index 1742ef8..02fad7a 160000 --- a/hash/risc0/external/risc0 +++ b/hash/risc0/external/risc0 @@ -1 +1 @@ -Subproject commit 1742ef8098d246871055501a0559811c9a8fece4 +Subproject commit 02fad7a498764d5c6cc851f246813b73b41c30b8 From 2583d79a7c17b42399fe95469cf2947f82c761cc Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Fri, 26 Apr 2024 18:56:39 +0530 Subject: [PATCH 26/41] proof generation time and verification time added --- hash/plonky2/src/bench/poseidon.rs | 3 --- hash/plonky2/src/bench/sha256/sha.rs | 24 +++++++++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/hash/plonky2/src/bench/poseidon.rs b/hash/plonky2/src/bench/poseidon.rs index 1f176eb..0208f1e 100644 --- a/hash/plonky2/src/bench/poseidon.rs +++ b/hash/plonky2/src/bench/poseidon.rs @@ -13,8 +13,6 @@ use rand::Rng; use std::time; fn generate_data(size: usize) -> Vec { - // let mut rng = rand::thread_rng(); - // (0..size).map(|_| rng.gen()).collect() let mut data: Vec = Vec::new(); for _ in 0..(1< Vec { let random_u64: u64 = rng.gen(); data.push(GoldilocksField::from_canonical_u64(random_u64)); } - // eprint!("data: {:?}", data); data } diff --git a/hash/plonky2/src/bench/sha256/sha.rs b/hash/plonky2/src/bench/sha256/sha.rs index 0d52002..d6de7ee 100644 --- a/hash/plonky2/src/bench/sha256/sha.rs +++ b/hash/plonky2/src/bench/sha256/sha.rs @@ -196,7 +196,6 @@ pub fn sha256_bench() -> Result<()> { let mut hasher = Sha256::new(); hasher.update(msg.clone()); let hash = hasher.finalize(); - // println!("Hash: {:#04X}", hash); let msg_bits = array_to_bits(&msg.clone()); let len = msg.len() * 8; @@ -226,14 +225,25 @@ pub fn sha256_bench() -> Result<()> { builder.num_gates() ); let data = builder.build::(); - // let timing = TimingTree::new("prove", Level::Debug); - let proof = data.prove(pw).unwrap(); - // timing.print(); - // let timing = TimingTree::new("verify", Level::Debug); - let res = data.verify(proof); - // timing.print(); + let (proof_time, proof ) = { + let start = std::time::Instant::now(); + let proof = data.prove(pw).unwrap(); + let end = start.elapsed(); + (end, proof) + }; + + let (verification_time, res) = { + let start = std::time::Instant::now(); + let res = data.verify(proof); + let end = start.elapsed(); + (end, res) + }; + + eprintln!("Proof Generation Time: {:?}", proof_time); + eprintln!("Verification Time: {:?}", verification_time); + res } \ No newline at end of file From 53dcdaa3704e6e7827d25e0ad9c45bc268418643 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Thu, 23 May 2024 22:10:07 +0530 Subject: [PATCH 27/41] xor u64 circuit for keccak --- hash/plonky2/src/bench/keccak.rs | 157 ++++++++++++++++++++++++++++--- 1 file changed, 145 insertions(+), 12 deletions(-) diff --git a/hash/plonky2/src/bench/keccak.rs b/hash/plonky2/src/bench/keccak.rs index ac7a356..2dc4d14 100644 --- a/hash/plonky2/src/bench/keccak.rs +++ b/hash/plonky2/src/bench/keccak.rs @@ -1,25 +1,158 @@ // use anyhow::Result; -// use plonky2::field::types::Field; +use plonky2::field::types::Field; // use plonky2::gates::poseidon::PoseidonGate; // use plonky2::hash::hash_types::{HashOutTarget, RichField}; -// use plonky2::field::goldilocks_field::GoldilocksField; -// use plonky2::hash::keccak::{KeccakHash, KeccakPermutation}; +use plonky2::field::goldilocks_field::GoldilocksField; +use plonky2::hash::keccak::{KeccakHash, KeccakPermutation, /*KeccakPermutation */}; // use plonky2::hash::keccak; -// use plonky2::hash::keccak::KeccakHash; -// use plonky2::hash::poseidon::PoseidonHash; +use plonky2::hash::poseidon::PoseidonHash; // use plonky2::iop::witness::{PartialWitness, WitnessWrite}; -// use plonky2::plonk::circuit_builder::CircuitBuilder; -// use plonky2::plonk::circuit_data::CircuitConfig; -// use plonky2::plonk::config::{AlgebraicHasher, GenericConfig, PoseidonGoldilocksConfig, KeccakGoldilocksConfig}; -// use rand::Rng; +use plonky2::plonk::circuit_builder::CircuitBuilder; +use plonky2::plonk::circuit_data::CircuitConfig; +use plonky2::plonk::config::{/*AlgebraicHasher,*/ GenericConfig,/* PoseidonGoldilocksConfig, */ KeccakGoldilocksConfig}; +use rand::Rng; // use plonky2::iop::target::Target; // use plonky2::iop::target::BoolTarget; -// use plonky2::field::extension::Extendable; +use plonky2::field::extension::Extendable; // use std::marker::PhantomData; +use plonky2::plonk::config::Hasher; +use plonky2_u32::gadgets::arithmetic_u32::{CircuitBuilderU32, U32Target}; +use plonky2::field::types::PrimeField64; +use plonky2::iop::witness::Witness; +use plonky2::hash::hash_types::RichField; +use plonky2::iop::target::BoolTarget; +fn generate_data(size: usize) -> Vec { -pub fn keccak_bench(_size: usize) { - + let mut data: Vec = Vec::new(); + for _ in 0..(1<>::F; + + let config = CircuitConfig::standard_recursion_config(); + let mut builder = CircuitBuilder::::new(config); + + let initial = builder.add_virtual_targets(data.len()); + + let hash = KeccakHash::<32>::hash_or_noop(&data); + eprintln!("{:?}", hash); + +} + + +//---------------------------------------------------------- + +const KECCAK_WIDTH: usize = 1600; +const KECCAK_RATE: usize = 1088; +const KECCAK_CAPACITY: usize = KECCAK_WIDTH - KECCAK_RATE; +const KECCAK_LANES: usize = KECCAK_WIDTH / 64; +const KECCAK_ROUNDS: usize = 24; + +const ROUND_CONSTANTS: [u64; KECCAK_ROUNDS] = [ + 0x0000000000000001, 0x0000000000008082, 0x800000000000808A, 0x8000000080008000, + 0x000000000000808B, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009, + 0x000000000000008A, 0x0000000000000088, 0x0000000080008009, 0x000000008000000A, + 0x000000008000808B, 0x800000000000008B, 0x8000000000008089, 0x8000000000008003, + 0x8000000000008002, 0x8000000000000080, 0x000000000000800A, 0x800000008000000A, + 0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008, +]; + +fn initialize_state() -> [u64; KECCAK_LANES] { + [0; KECCAK_LANES] +} +pub struct U64Target([U32Target;2]); + +// copied from sha256 circuit +// TODO: move to some common place +pub fn u32_to_bits_target, const D: usize, const B: usize>( + builder: &mut CircuitBuilder, + a: &U32Target, +) -> Vec { + let mut res = Vec::new(); + let bit_targets = builder.split_le_base::(a.0, 32); + for i in (0..32).rev() { + res.push(BoolTarget::new_unsafe(bit_targets[i])); + } + res +} + +// copied from sha256 circuit +// TODO: move to some common place +pub fn bits_to_u32_target, const D: usize>( + builder: &mut CircuitBuilder, + bits_target: Vec, +) -> U32Target { + let bit_len = bits_target.len(); + assert_eq!(bit_len, 32); + U32Target(builder.le_sum(bits_target[0..32].iter().rev())) +} + +//TODO: not tested +pub fn xor_u64, const D: usize>( + builder: &mut CircuitBuilder, + x: U64Target, + y: U64Target, +) -> U64Target { + let xor_x0_y0 = xor_u32(builder, x.0[0], y.0[0]); + let xor_x1_y1 = xor_u32(builder, x.0[1], y.0[1]); + + U64Target([xor_x0_y0,xor_x1_y1]) + +} + +pub fn xor_u32, const D: usize>( + builder: &mut CircuitBuilder, + x: U32Target, + y: U32Target, +) -> U32Target { + + let bits_target_x = u32_to_bits_target::(builder, &x); + let bits_target_y = u32_to_bits_target::(builder, &y); + + assert_eq!(bits_target_x.len(), bits_target_y.len()); + + let mut xor_result_final = Vec::::new(); + for i in 0..bits_target_x.len() { + let a_plus_b = builder.add(bits_target_x.get(i).unwrap().target, bits_target_y.get(i).unwrap().target); + let ab = builder.mul(bits_target_x.get(i).unwrap().target, bits_target_y.get(i).unwrap().target); + let two_ab = builder.mul_const(F::from_canonical_u64(2), ab); + let xor_result = builder.sub(a_plus_b, two_ab); + xor_result_final.push(BoolTarget::new_unsafe(xor_result)); + } + let result = bits_to_u32_target(builder, xor_result_final); + result + +} + +// Theta +// pub fn theta, const D: usize>( +// builder: &mut CircuitBuilder, +// state: &mut [U64Target; KECCAK_LANES] +// ) { + +// let mut c = [0u64; 5]; +// for x in 0..5 { +// c[x] = state[x] ^ state[x + 5] ^ state[x + 10] ^ state[x + 15] ^ state[x + 20]; +// } +// for x in 0..5 { +// let d = c[(x + 4) % 5] ^ c[(x + 1) % 5].rotate_left(1); +// for y in 0..5 { +// state[x + 5 * y] ^= d; +// } +// } + +// } \ No newline at end of file From 7cc901e5211c3889b89c18c474561621d2132a7a Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Thu, 30 May 2024 23:19:42 +0530 Subject: [PATCH 28/41] circuits for different arithemtic operations of BoolTarget, u32 and u64(needed for different hashes) --- .../src/arithmetic/binary_arithmetic.rs | 30 ++++ hash/plonky2/src/arithmetic/u32_arithmetic.rs | 80 ++++++++++ hash/plonky2/src/arithmetic/u64_arithmetic.rs | 32 ++++ hash/plonky2/src/bench/keccak.rs | 138 +++++++++--------- hash/plonky2/src/main.rs | 6 + 5 files changed, 217 insertions(+), 69 deletions(-) create mode 100644 hash/plonky2/src/arithmetic/binary_arithmetic.rs create mode 100644 hash/plonky2/src/arithmetic/u32_arithmetic.rs create mode 100644 hash/plonky2/src/arithmetic/u64_arithmetic.rs diff --git a/hash/plonky2/src/arithmetic/binary_arithmetic.rs b/hash/plonky2/src/arithmetic/binary_arithmetic.rs new file mode 100644 index 0000000..ffdde19 --- /dev/null +++ b/hash/plonky2/src/arithmetic/binary_arithmetic.rs @@ -0,0 +1,30 @@ +use plonky2::hash::hash_types::RichField; +use plonky2::field::extension::Extendable; +use plonky2::plonk::circuit_builder::CircuitBuilder; +use plonky2::iop::target::BoolTarget; + +pub trait CircuitBuilderBoolTarget, const D: usize> { + fn and(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget; + fn or(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget; + fn xor(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget; + +} + +impl, const D: usize> CircuitBuilderBoolTarget + for CircuitBuilder{ + fn xor(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget { + + // a ^ b := (a - b)^2 + let s = self.sub(a.target, b.target); + BoolTarget::new_unsafe(self.mul(s, s)) + + } + + fn and(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget { + self.and(a, b) + } + + fn or(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget { + self.or(a, b) + } + } \ No newline at end of file diff --git a/hash/plonky2/src/arithmetic/u32_arithmetic.rs b/hash/plonky2/src/arithmetic/u32_arithmetic.rs new file mode 100644 index 0000000..08ba34b --- /dev/null +++ b/hash/plonky2/src/arithmetic/u32_arithmetic.rs @@ -0,0 +1,80 @@ +use plonky2::iop::target::{BoolTarget, Target}; +use plonky2::hash::hash_types::RichField; +use plonky2::field::extension::Extendable; +use plonky2::plonk::circuit_builder::CircuitBuilder; + +use super::binary_arithmetic::CircuitBuilderBoolTarget; +#[derive(Clone, Copy, Debug)] +pub struct U32Target(pub Target); + +pub trait CircuitBuilderU32, const D: usize> { + fn or_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; + fn and_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; + fn xor_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; + + fn from_u32(&mut self, a: U32Target) -> Vec; + fn to_u32(&mut self, a: Vec) -> U32Target; + +} + +impl, const D: usize> CircuitBuilderU32 + for CircuitBuilder{ + + fn from_u32(&mut self, a: U32Target) -> Vec { + + let mut res = Vec::new(); + let bit_targets = self.split_le_base::<2>(a.0, 32); + + for i in (0..32).rev() { + res.push(BoolTarget::new_unsafe(bit_targets[i])); + } + res + } + + fn to_u32(&mut self, a: Vec) -> U32Target { + let bit_len = a.len(); + assert_eq!(bit_len, 32); + U32Target(self.le_sum(a[0..32].iter().rev())) + } + + + fn or_u32(&mut self, a: U32Target, b: U32Target) -> U32Target { + let binary_target_a = self.from_u32(a); + let binary_target_b = self.from_u32(b); + + let mut res = Vec::::new(); + for i in 0..32 { + + let r = self.or(binary_target_a[i], binary_target_b[i]); + res.push(r); + } + self.to_u32(res) + } + + fn and_u32(&mut self, a: U32Target, b: U32Target) -> U32Target { + let binary_target_a = self.from_u32(a); + let binary_target_b = self.from_u32(b); + + let mut res = Vec::::new(); + for i in 0..32 { + + let r = self.and(binary_target_a[i], binary_target_b[i]); + res.push(r); + } + self.to_u32(res) + + } + + fn xor_u32(&mut self, a: U32Target, b: U32Target) -> U32Target { + let binary_target_a = self.from_u32(a); + let binary_target_b = self.from_u32(b); + + let mut res = Vec::::new(); + for i in 0..32 { + + let r = self.xor(binary_target_a[i], binary_target_b[i]); + res.push(r); + } + self.to_u32(res) + } + } \ No newline at end of file diff --git a/hash/plonky2/src/arithmetic/u64_arithmetic.rs b/hash/plonky2/src/arithmetic/u64_arithmetic.rs new file mode 100644 index 0000000..abd711d --- /dev/null +++ b/hash/plonky2/src/arithmetic/u64_arithmetic.rs @@ -0,0 +1,32 @@ +use plonky2::hash::hash_types::RichField; +use plonky2::field::extension::Extendable; +use plonky2::plonk::circuit_builder::CircuitBuilder; +use super::u32_arithmetic::CircuitBuilderU32; +use super::u32_arithmetic::U32Target; +#[derive(Clone, Copy, Debug)] +pub struct U64Target(pub [U32Target;2]); + +pub trait CircuitBuilderU64, const D: usize> { + fn and(&mut self, a: U64Target, b: U64Target) -> U64Target; + fn xor(&mut self, a: U64Target, b: U64Target) -> U64Target; +} + +impl, const D: usize> CircuitBuilderU64 + for CircuitBuilder{ + fn xor(&mut self, a: U64Target, b: U64Target) -> U64Target { + let mut result = Vec::new(); + for i in 0..2 { + result.push(self.xor_u32(a.0[i], b.0[i])); + } + U64Target([result[0], result[1]]) + } + + fn and(&mut self, a: U64Target, b: U64Target) -> U64Target { + let mut result = Vec::new(); + + for i in 0..2 { + result.push(self.and_u32(a.0[i], b.0[i])); + } + U64Target([result[0], result[1]]) + } +} \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak.rs b/hash/plonky2/src/bench/keccak.rs index 2dc4d14..e64b0b9 100644 --- a/hash/plonky2/src/bench/keccak.rs +++ b/hash/plonky2/src/bench/keccak.rs @@ -56,87 +56,87 @@ pub fn keccak_bench(_size: usize) { //---------------------------------------------------------- -const KECCAK_WIDTH: usize = 1600; -const KECCAK_RATE: usize = 1088; -const KECCAK_CAPACITY: usize = KECCAK_WIDTH - KECCAK_RATE; -const KECCAK_LANES: usize = KECCAK_WIDTH / 64; -const KECCAK_ROUNDS: usize = 24; +// const KECCAK_WIDTH: usize = 1600; +// const KECCAK_RATE: usize = 1088; +// const KECCAK_CAPACITY: usize = KECCAK_WIDTH - KECCAK_RATE; +// const KECCAK_LANES: usize = KECCAK_WIDTH / 64; +// const KECCAK_ROUNDS: usize = 24; -const ROUND_CONSTANTS: [u64; KECCAK_ROUNDS] = [ - 0x0000000000000001, 0x0000000000008082, 0x800000000000808A, 0x8000000080008000, - 0x000000000000808B, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009, - 0x000000000000008A, 0x0000000000000088, 0x0000000080008009, 0x000000008000000A, - 0x000000008000808B, 0x800000000000008B, 0x8000000000008089, 0x8000000000008003, - 0x8000000000008002, 0x8000000000000080, 0x000000000000800A, 0x800000008000000A, - 0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008, -]; +// const ROUND_CONSTANTS: [u64; KECCAK_ROUNDS] = [ +// 0x0000000000000001, 0x0000000000008082, 0x800000000000808A, 0x8000000080008000, +// 0x000000000000808B, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009, +// 0x000000000000008A, 0x0000000000000088, 0x0000000080008009, 0x000000008000000A, +// 0x000000008000808B, 0x800000000000008B, 0x8000000000008089, 0x8000000000008003, +// 0x8000000000008002, 0x8000000000000080, 0x000000000000800A, 0x800000008000000A, +// 0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008, +// ]; -fn initialize_state() -> [u64; KECCAK_LANES] { - [0; KECCAK_LANES] -} -pub struct U64Target([U32Target;2]); +// fn initialize_state() -> [u64; KECCAK_LANES] { +// [0; KECCAK_LANES] +// } +// pub struct U64Target([U32Target;2]); -// copied from sha256 circuit -// TODO: move to some common place -pub fn u32_to_bits_target, const D: usize, const B: usize>( - builder: &mut CircuitBuilder, - a: &U32Target, -) -> Vec { - let mut res = Vec::new(); - let bit_targets = builder.split_le_base::(a.0, 32); - for i in (0..32).rev() { - res.push(BoolTarget::new_unsafe(bit_targets[i])); - } - res -} +// // copied from sha256 circuit +// // TODO: move to some common place +// pub fn u32_to_bits_target, const D: usize, const B: usize>( +// builder: &mut CircuitBuilder, +// a: &U32Target, +// ) -> Vec { +// let mut res = Vec::new(); +// let bit_targets = builder.split_le_base::(a.0, 32); +// for i in (0..32).rev() { +// res.push(BoolTarget::new_unsafe(bit_targets[i])); +// } +// res +// } -// copied from sha256 circuit -// TODO: move to some common place -pub fn bits_to_u32_target, const D: usize>( - builder: &mut CircuitBuilder, - bits_target: Vec, -) -> U32Target { - let bit_len = bits_target.len(); - assert_eq!(bit_len, 32); - U32Target(builder.le_sum(bits_target[0..32].iter().rev())) -} +// // copied from sha256 circuit +// // TODO: move to some common place +// pub fn bits_to_u32_target, const D: usize>( +// builder: &mut CircuitBuilder, +// bits_target: Vec, +// ) -> U32Target { +// let bit_len = bits_target.len(); +// assert_eq!(bit_len, 32); +// U32Target(builder.le_sum(bits_target[0..32].iter().rev())) +// } -//TODO: not tested -pub fn xor_u64, const D: usize>( - builder: &mut CircuitBuilder, - x: U64Target, - y: U64Target, -) -> U64Target { - let xor_x0_y0 = xor_u32(builder, x.0[0], y.0[0]); - let xor_x1_y1 = xor_u32(builder, x.0[1], y.0[1]); +// //TODO: not tested +// pub fn xor_u64, const D: usize>( +// builder: &mut CircuitBuilder, +// x: U64Target, +// y: U64Target, +// ) -> U64Target { +// let xor_x0_y0 = xor_u32(builder, x.0[0], y.0[0]); +// let xor_x1_y1 = xor_u32(builder, x.0[1], y.0[1]); - U64Target([xor_x0_y0,xor_x1_y1]) +// U64Target([xor_x0_y0,xor_x1_y1]) -} +// } -pub fn xor_u32, const D: usize>( - builder: &mut CircuitBuilder, - x: U32Target, - y: U32Target, -) -> U32Target { +// pub fn xor_u32, const D: usize>( +// builder: &mut CircuitBuilder, +// x: U32Target, +// y: U32Target, +// ) -> U32Target { - let bits_target_x = u32_to_bits_target::(builder, &x); - let bits_target_y = u32_to_bits_target::(builder, &y); +// let bits_target_x = u32_to_bits_target::(builder, &x); +// let bits_target_y = u32_to_bits_target::(builder, &y); - assert_eq!(bits_target_x.len(), bits_target_y.len()); +// assert_eq!(bits_target_x.len(), bits_target_y.len()); - let mut xor_result_final = Vec::::new(); - for i in 0..bits_target_x.len() { - let a_plus_b = builder.add(bits_target_x.get(i).unwrap().target, bits_target_y.get(i).unwrap().target); - let ab = builder.mul(bits_target_x.get(i).unwrap().target, bits_target_y.get(i).unwrap().target); - let two_ab = builder.mul_const(F::from_canonical_u64(2), ab); - let xor_result = builder.sub(a_plus_b, two_ab); - xor_result_final.push(BoolTarget::new_unsafe(xor_result)); - } - let result = bits_to_u32_target(builder, xor_result_final); - result +// let mut xor_result_final = Vec::::new(); +// for i in 0..bits_target_x.len() { +// let a_plus_b = builder.add(bits_target_x.get(i).unwrap().target, bits_target_y.get(i).unwrap().target); +// let ab = builder.mul(bits_target_x.get(i).unwrap().target, bits_target_y.get(i).unwrap().target); +// let two_ab = builder.mul_const(F::from_canonical_u64(2), ab); +// let xor_result = builder.sub(a_plus_b, two_ab); +// xor_result_final.push(BoolTarget::new_unsafe(xor_result)); +// } +// let result = bits_to_u32_target(builder, xor_result_final); +// result -} +// } // Theta // pub fn theta, const D: usize>( diff --git a/hash/plonky2/src/main.rs b/hash/plonky2/src/main.rs index 0eaa9fb..a87e42b 100644 --- a/hash/plonky2/src/main.rs +++ b/hash/plonky2/src/main.rs @@ -15,6 +15,12 @@ mod bench{ } } +mod arithmetic { + pub mod binary_arithmetic; + pub mod u32_arithmetic; + pub mod u64_arithmetic; +} + use bench::poseidon::poseidon_bench; use bench::keccak::keccak_bench; use bench::sha256::sha::sha256_bench; From 1db0d91ed1a9b6a7bf85ec7328db0b4c270f94d2 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Fri, 31 May 2024 00:34:13 +0530 Subject: [PATCH 29/41] more circuits for u32, u64 arithmetics --- hash/plonky2/src/arithmetic/u32_arithmetic.rs | 23 +++++++++---- hash/plonky2/src/arithmetic/u64_arithmetic.rs | 32 +++++++++++++++---- hash/plonky2/src/bench/keccak.rs | 22 ++++--------- 3 files changed, 49 insertions(+), 28 deletions(-) diff --git a/hash/plonky2/src/arithmetic/u32_arithmetic.rs b/hash/plonky2/src/arithmetic/u32_arithmetic.rs index 08ba34b..f6c4676 100644 --- a/hash/plonky2/src/arithmetic/u32_arithmetic.rs +++ b/hash/plonky2/src/arithmetic/u32_arithmetic.rs @@ -1,25 +1,30 @@ -use plonky2::iop::target::{BoolTarget, Target}; +use plonky2::iop::target::BoolTarget; use plonky2::hash::hash_types::RichField; use plonky2::field::extension::Extendable; use plonky2::plonk::circuit_builder::CircuitBuilder; - +use plonky2_u32::gadgets::arithmetic_u32::U32Target; use super::binary_arithmetic::CircuitBuilderBoolTarget; -#[derive(Clone, Copy, Debug)] -pub struct U32Target(pub Target); +use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; -pub trait CircuitBuilderU32, const D: usize> { +pub trait CircuitBuilderU32M, const D: usize> { fn or_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; fn and_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; fn xor_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; + fn rotate_left_u32(&mut self, a: U32Target, n: u8) -> U32Target; fn from_u32(&mut self, a: U32Target) -> Vec; fn to_u32(&mut self, a: Vec) -> U32Target; + // fn constant_u32(&mut self, c: u32) -> U32Target; } -impl, const D: usize> CircuitBuilderU32 +impl, const D: usize> CircuitBuilderU32M for CircuitBuilder{ + // fn constant_u32(&mut self, c: u32) -> U32Target { + // U32Target(self.constant(F::from_canonical_u32(c))) + // } + fn from_u32(&mut self, a: U32Target) -> Vec { let mut res = Vec::new(); @@ -77,4 +82,10 @@ impl, const D: usize> CircuitBuilderU32 } self.to_u32(res) } + + fn rotate_left_u32(&mut self, a: U32Target, n: u8) -> U32Target { + let two_power_n = self.constant_u32(0x1 << n); + let (lo, hi) = self.mul_u32(a, two_power_n); + self.add_u32(lo, hi).0 + } } \ No newline at end of file diff --git a/hash/plonky2/src/arithmetic/u64_arithmetic.rs b/hash/plonky2/src/arithmetic/u64_arithmetic.rs index abd711d..9d3f0b7 100644 --- a/hash/plonky2/src/arithmetic/u64_arithmetic.rs +++ b/hash/plonky2/src/arithmetic/u64_arithmetic.rs @@ -1,19 +1,24 @@ use plonky2::hash::hash_types::RichField; use plonky2::field::extension::Extendable; use plonky2::plonk::circuit_builder::CircuitBuilder; -use super::u32_arithmetic::CircuitBuilderU32; -use super::u32_arithmetic::U32Target; +use plonky2_u32::gadgets::arithmetic_u32::U32Target; +use super::u32_arithmetic::CircuitBuilderU32M; +use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; + #[derive(Clone, Copy, Debug)] pub struct U64Target(pub [U32Target;2]); pub trait CircuitBuilderU64, const D: usize> { - fn and(&mut self, a: U64Target, b: U64Target) -> U64Target; - fn xor(&mut self, a: U64Target, b: U64Target) -> U64Target; + fn and_u64(&mut self, a: U64Target, b: U64Target) -> U64Target; + fn xor_u64(&mut self, a: U64Target, b: U64Target) -> U64Target; + fn rotate_left_u64(&mut self, a: U64Target, n: u8) -> U64Target; + + fn zero_u64(&mut self) -> U64Target; } impl, const D: usize> CircuitBuilderU64 for CircuitBuilder{ - fn xor(&mut self, a: U64Target, b: U64Target) -> U64Target { + fn xor_u64(&mut self, a: U64Target, b: U64Target) -> U64Target { let mut result = Vec::new(); for i in 0..2 { result.push(self.xor_u32(a.0[i], b.0[i])); @@ -21,7 +26,7 @@ impl, const D: usize> CircuitBuilderU64 U64Target([result[0], result[1]]) } - fn and(&mut self, a: U64Target, b: U64Target) -> U64Target { + fn and_u64(&mut self, a: U64Target, b: U64Target) -> U64Target { let mut result = Vec::new(); for i in 0..2 { @@ -29,4 +34,19 @@ impl, const D: usize> CircuitBuilderU64 } U64Target([result[0], result[1]]) } + + fn rotate_left_u64(&mut self, a: U64Target, n: u8) -> U64Target { + let (lo, hi) = if n < 32 { (a.0[0], a.0[1]) } else { (a.0[1], a.0[0]) }; + + let two_power_x = self.constant_u32(0x1 << (n % 32)); + let (lo0, hi0) = self.mul_u32(lo, two_power_x); + let (lo1, hi1) = self.mul_add_u32(hi, two_power_x, hi0); + + U64Target([self.add_u32(lo0, hi1).0, lo1]) + } + + fn zero_u64(&mut self) -> U64Target { + let zero_u32 = self.zero_u32(); + U64Target([zero_u32,zero_u32]) + } } \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak.rs b/hash/plonky2/src/bench/keccak.rs index e64b0b9..5822815 100644 --- a/hash/plonky2/src/bench/keccak.rs +++ b/hash/plonky2/src/bench/keccak.rs @@ -1,27 +1,17 @@ -// use anyhow::Result; use plonky2::field::types::Field; -// use plonky2::gates::poseidon::PoseidonGate; -// use plonky2::hash::hash_types::{HashOutTarget, RichField}; use plonky2::field::goldilocks_field::GoldilocksField; -use plonky2::hash::keccak::{KeccakHash, KeccakPermutation, /*KeccakPermutation */}; -// use plonky2::hash::keccak; -use plonky2::hash::poseidon::PoseidonHash; -// use plonky2::iop::witness::{PartialWitness, WitnessWrite}; +use plonky2::hash::keccak::KeccakHash; use plonky2::plonk::circuit_builder::CircuitBuilder; use plonky2::plonk::circuit_data::CircuitConfig; -use plonky2::plonk::config::{/*AlgebraicHasher,*/ GenericConfig,/* PoseidonGoldilocksConfig, */ KeccakGoldilocksConfig}; +use plonky2::plonk::config::{GenericConfig, KeccakGoldilocksConfig}; use rand::Rng; -// use plonky2::iop::target::Target; -// use plonky2::iop::target::BoolTarget; use plonky2::field::extension::Extendable; -// use std::marker::PhantomData; use plonky2::plonk::config::Hasher; - -use plonky2_u32::gadgets::arithmetic_u32::{CircuitBuilderU32, U32Target}; -use plonky2::field::types::PrimeField64; -use plonky2::iop::witness::Witness; use plonky2::hash::hash_types::RichField; -use plonky2::iop::target::BoolTarget; + +use crate::arithmetic::u64_arithmetic::U64Target; +use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; + fn generate_data(size: usize) -> Vec { From 85505b3104642b9a3d1a114d6c45673b1bdfc359 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Fri, 31 May 2024 14:28:20 +0530 Subject: [PATCH 30/41] round functions for keccak --- .../src/arithmetic/binary_arithmetic.rs | 2 + hash/plonky2/src/arithmetic/u32_arithmetic.rs | 18 +- hash/plonky2/src/arithmetic/u64_arithmetic.rs | 8 + hash/plonky2/src/bench/keccak.rs | 228 +++++++++++------- 4 files changed, 158 insertions(+), 98 deletions(-) diff --git a/hash/plonky2/src/arithmetic/binary_arithmetic.rs b/hash/plonky2/src/arithmetic/binary_arithmetic.rs index ffdde19..89c95b0 100644 --- a/hash/plonky2/src/arithmetic/binary_arithmetic.rs +++ b/hash/plonky2/src/arithmetic/binary_arithmetic.rs @@ -3,6 +3,8 @@ use plonky2::field::extension::Extendable; use plonky2::plonk::circuit_builder::CircuitBuilder; use plonky2::iop::target::BoolTarget; +//TODO: remove the dead codes later +#[allow(dead_code)] pub trait CircuitBuilderBoolTarget, const D: usize> { fn and(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget; fn or(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget; diff --git a/hash/plonky2/src/arithmetic/u32_arithmetic.rs b/hash/plonky2/src/arithmetic/u32_arithmetic.rs index f6c4676..cacbdea 100644 --- a/hash/plonky2/src/arithmetic/u32_arithmetic.rs +++ b/hash/plonky2/src/arithmetic/u32_arithmetic.rs @@ -6,6 +6,8 @@ use plonky2_u32::gadgets::arithmetic_u32::U32Target; use super::binary_arithmetic::CircuitBuilderBoolTarget; use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; +//TODO: remove the dead codes later +#[allow(dead_code)] pub trait CircuitBuilderU32M, const D: usize> { fn or_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; fn and_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; @@ -15,16 +17,14 @@ pub trait CircuitBuilderU32M, const D: usize> { fn from_u32(&mut self, a: U32Target) -> Vec; fn to_u32(&mut self, a: Vec) -> U32Target; - // fn constant_u32(&mut self, c: u32) -> U32Target; + // not := 0xFFFFFFFF - x + fn not_u32(&mut self, a: U32Target) -> U32Target; + } impl, const D: usize> CircuitBuilderU32M for CircuitBuilder{ - // fn constant_u32(&mut self, c: u32) -> U32Target { - // U32Target(self.constant(F::from_canonical_u32(c))) - // } - fn from_u32(&mut self, a: U32Target) -> Vec { let mut res = Vec::new(); @@ -88,4 +88,12 @@ impl, const D: usize> CircuitBuilderU32M let (lo, hi) = self.mul_u32(a, two_power_n); self.add_u32(lo, hi).0 } + + // not := 0xFFFFFFFF - x + fn not_u32(&mut self, a: U32Target) -> U32Target { + let zero = self.zero_u32(); + let ff = self.constant_u32(0xFFFFFFFF); + self.sub_u32(ff, a, zero).0 + } + } \ No newline at end of file diff --git a/hash/plonky2/src/arithmetic/u64_arithmetic.rs b/hash/plonky2/src/arithmetic/u64_arithmetic.rs index 9d3f0b7..c33d2be 100644 --- a/hash/plonky2/src/arithmetic/u64_arithmetic.rs +++ b/hash/plonky2/src/arithmetic/u64_arithmetic.rs @@ -8,12 +8,16 @@ use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; #[derive(Clone, Copy, Debug)] pub struct U64Target(pub [U32Target;2]); +//TODO: remove the dead codes later +#[allow(dead_code)] pub trait CircuitBuilderU64, const D: usize> { fn and_u64(&mut self, a: U64Target, b: U64Target) -> U64Target; fn xor_u64(&mut self, a: U64Target, b: U64Target) -> U64Target; fn rotate_left_u64(&mut self, a: U64Target, n: u8) -> U64Target; fn zero_u64(&mut self) -> U64Target; + + fn not_u64(&mut self, a: U64Target) -> U64Target; } impl, const D: usize> CircuitBuilderU64 @@ -49,4 +53,8 @@ impl, const D: usize> CircuitBuilderU64 let zero_u32 = self.zero_u32(); U64Target([zero_u32,zero_u32]) } + + fn not_u64(&mut self, a: U64Target) -> U64Target { + U64Target([self.not_u32(a.0[0]), self.not_u32(a.0[1])]) + } } \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak.rs b/hash/plonky2/src/bench/keccak.rs index 5822815..4898ba3 100644 --- a/hash/plonky2/src/bench/keccak.rs +++ b/hash/plonky2/src/bench/keccak.rs @@ -8,7 +8,7 @@ use rand::Rng; use plonky2::field::extension::Extendable; use plonky2::plonk::config::Hasher; use plonky2::hash::hash_types::RichField; - +use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; use crate::arithmetic::u64_arithmetic::U64Target; use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; @@ -36,7 +36,7 @@ pub fn keccak_bench(_size: usize) { let config = CircuitConfig::standard_recursion_config(); let mut builder = CircuitBuilder::::new(config); - let initial = builder.add_virtual_targets(data.len()); + let _initial = builder.add_virtual_targets(data.len()); let hash = KeccakHash::<32>::hash_or_noop(&data); eprintln!("{:?}", hash); @@ -46,103 +46,145 @@ pub fn keccak_bench(_size: usize) { //---------------------------------------------------------- + // const KECCAK_WIDTH: usize = 1600; // const KECCAK_RATE: usize = 1088; // const KECCAK_CAPACITY: usize = KECCAK_WIDTH - KECCAK_RATE; // const KECCAK_LANES: usize = KECCAK_WIDTH / 64; -// const KECCAK_ROUNDS: usize = 24; +const KECCAK_ROUNDS: usize = 24; -// const ROUND_CONSTANTS: [u64; KECCAK_ROUNDS] = [ -// 0x0000000000000001, 0x0000000000008082, 0x800000000000808A, 0x8000000080008000, -// 0x000000000000808B, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009, -// 0x000000000000008A, 0x0000000000000088, 0x0000000080008009, 0x000000008000000A, -// 0x000000008000808B, 0x800000000000008B, 0x8000000000008089, 0x8000000000008003, -// 0x8000000000008002, 0x8000000000000080, 0x000000000000800A, 0x800000008000000A, -// 0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008, -// ]; - -// fn initialize_state() -> [u64; KECCAK_LANES] { -// [0; KECCAK_LANES] -// } -// pub struct U64Target([U32Target;2]); - -// // copied from sha256 circuit -// // TODO: move to some common place -// pub fn u32_to_bits_target, const D: usize, const B: usize>( -// builder: &mut CircuitBuilder, -// a: &U32Target, -// ) -> Vec { -// let mut res = Vec::new(); -// let bit_targets = builder.split_le_base::(a.0, 32); -// for i in (0..32).rev() { -// res.push(BoolTarget::new_unsafe(bit_targets[i])); -// } -// res -// } - -// // copied from sha256 circuit -// // TODO: move to some common place -// pub fn bits_to_u32_target, const D: usize>( -// builder: &mut CircuitBuilder, -// bits_target: Vec, -// ) -> U32Target { -// let bit_len = bits_target.len(); -// assert_eq!(bit_len, 32); -// U32Target(builder.le_sum(bits_target[0..32].iter().rev())) -// } - -// //TODO: not tested -// pub fn xor_u64, const D: usize>( -// builder: &mut CircuitBuilder, -// x: U64Target, -// y: U64Target, -// ) -> U64Target { -// let xor_x0_y0 = xor_u32(builder, x.0[0], y.0[0]); -// let xor_x1_y1 = xor_u32(builder, x.0[1], y.0[1]); - -// U64Target([xor_x0_y0,xor_x1_y1]) - -// } - -// pub fn xor_u32, const D: usize>( -// builder: &mut CircuitBuilder, -// x: U32Target, -// y: U32Target, -// ) -> U32Target { - -// let bits_target_x = u32_to_bits_target::(builder, &x); -// let bits_target_y = u32_to_bits_target::(builder, &y); - -// assert_eq!(bits_target_x.len(), bits_target_y.len()); - -// let mut xor_result_final = Vec::::new(); -// for i in 0..bits_target_x.len() { -// let a_plus_b = builder.add(bits_target_x.get(i).unwrap().target, bits_target_y.get(i).unwrap().target); -// let ab = builder.mul(bits_target_x.get(i).unwrap().target, bits_target_y.get(i).unwrap().target); -// let two_ab = builder.mul_const(F::from_canonical_u64(2), ab); -// let xor_result = builder.sub(a_plus_b, two_ab); -// xor_result_final.push(BoolTarget::new_unsafe(xor_result)); -// } -// let result = bits_to_u32_target(builder, xor_result_final); -// result - -// } +//TODO: remove the dead codes later +#[allow(dead_code)] +const ROUND_CONSTANTS: [u64; KECCAK_ROUNDS] = [ + 0x0000000000000001, 0x0000000000008082, 0x800000000000808A, 0x8000000080008000, + 0x000000000000808B, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009, + 0x000000000000008A, 0x0000000000000088, 0x0000000080008009, 0x000000008000000A, + 0x000000008000808B, 0x800000000000008B, 0x8000000000008089, 0x8000000000008003, + 0x8000000000008002, 0x8000000000000080, 0x000000000000800A, 0x800000008000000A, + 0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008, +]; +//TODO: remove the dead codes later +#[allow(dead_code)] // Theta -// pub fn theta, const D: usize>( -// builder: &mut CircuitBuilder, -// state: &mut [U64Target; KECCAK_LANES] -// ) { +pub fn theta, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5] +){ + let mut c = [builder.zero_u64(); 5]; + let mut d = [builder.zero_u64(); 5]; -// let mut c = [0u64; 5]; -// for x in 0..5 { -// c[x] = state[x] ^ state[x + 5] ^ state[x + 10] ^ state[x + 15] ^ state[x + 20]; -// } -// for x in 0..5 { -// let d = c[(x + 4) % 5] ^ c[(x + 1) % 5].rotate_left(1); -// for y in 0..5 { -// state[x + 5 * y] ^= d; -// } -// } + // Compute column parities + for x in 0..5 { -// } \ No newline at end of file + let xor_x0_x1 = builder.xor_u64(state[x][0], state[x][1]); + let xor_x0_x1_x2 = builder.xor_u64(xor_x0_x1, state[x][2]); + let xor_x0_x1_x2_x3 = builder.xor_u64(xor_x0_x1_x2, state[x][3]); + c[x] = builder.xor_u64(xor_x0_x1_x2_x3, state[x][4]); + + } + + // Compute rotated parities + for x in 0..5 { + let c_left = c[(x + 4) % 5]; + let c_right_rot = builder.rotate_left_u64(c[(x + 1) % 5], 1); + d[x] = builder.xor_u64(c_left, c_right_rot); + } + + // Modify the state + for x in 0..5 { + for y in 0..5 { + state[x][y] = builder.xor_u64(state[x][y], d[x]); + } + } +} + +//TODO: remove the dead codes later +#[allow(dead_code)] +//rho +fn rho, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5] +){ + const RHO_OFFSETS: [[usize; 5]; 5] = [ + [0, 1, 62, 28, 27], + [36, 44, 6, 55, 20], + [3, 10, 43, 25, 39], + [41, 45, 15, 21, 8], + [18, 2, 61, 56, 14], + ]; + + for x in 0..5 { + for y in 0..5 { + let rotation = RHO_OFFSETS[x][y]; + state[x][y] = builder.rotate_left_u64(state[x][y], rotation as u8); + } + } +} + +//TODO: remove the dead codes later +#[allow(dead_code)] +//pi +fn pi, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5] +){ + let mut new_state = [[builder.zero_u64(); 5]; 5]; + for x in 0..5 { + for y in 0..5 { + new_state[(2 * x + 3 * y) % 5][y] = state[x][y]; + } + } + *state = new_state; +} + +//TODO: remove the dead codes later +#[allow(dead_code)] +//iota +fn iota, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5], + round: usize +){ + + let lo = builder.constant_u32((ROUND_CONSTANTS[round] & 0xFFFFFFFF) as u32); + let hi = builder.constant_u32(((ROUND_CONSTANTS[round] >> 32)& 0xFFFFFFFF) as u32); + state[0][0] = builder.xor_u64(state[0][0], U64Target([lo,hi])) ; +} + +//TODO: remove the dead codes later +#[allow(dead_code)] +fn chi, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5] +){ + for x in 0..5 { + let mut temp = [builder.zero_u64(); 5]; + for y in 0..5 { + temp[y] = state[x][y]; + } + + + for y in 0..5 { + let t1 = builder.not_u64(temp[(y + 1) % 5]); + let t2 = builder.and_u64(t1, temp[(y + 2) % 5]); + state[x][y] = builder.xor_u64(state[x][y], t2); + } + } +} + +//TODO: remove the dead codes later +#[allow(dead_code)] +// permutation +fn keccak_permutation, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5] +) { + for i in 0..24 { + theta(builder, state); + rho(builder, state); + pi(builder, state); + chi(builder, state); + iota(builder, state, ROUND_CONSTANTS[i] as usize) + } +} \ No newline at end of file From d2cf4f7c81f178610a3e225deb2129434066eb87 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Fri, 31 May 2024 20:42:13 +0530 Subject: [PATCH 31/41] keccak hash circuit added, test added(incomplete) --- hash/plonky2/src/bench/keccak.rs | 205 +++++++++++++++++++++++++++++-- 1 file changed, 198 insertions(+), 7 deletions(-) diff --git a/hash/plonky2/src/bench/keccak.rs b/hash/plonky2/src/bench/keccak.rs index 4898ba3..78d0bef 100644 --- a/hash/plonky2/src/bench/keccak.rs +++ b/hash/plonky2/src/bench/keccak.rs @@ -11,7 +11,8 @@ use plonky2::hash::hash_types::RichField; use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; use crate::arithmetic::u64_arithmetic::U64Target; use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; - +use plonky2::iop::witness::Witness; +use plonky2::field::types::PrimeField64; fn generate_data(size: usize) -> Vec { @@ -25,6 +26,27 @@ fn generate_data(size: usize) -> Vec { } +//TODO: remove the dead codes later +#[allow(dead_code)] +pub trait WitnessU64: Witness { + fn set_u64_target(&mut self, target: U64Target, value: u64); + // fn get_u64_target(&self, target: U64Target) -> (u64, u64); +} + +impl, F: PrimeField64> WitnessU64 for T { + fn set_u64_target(&mut self, target: U64Target, value: u64) { + self.set_target(target.0[0].0, F::from_canonical_u32((value & 0xFFFFFFFF) as u32)); + self.set_target(target.0[1].0, F::from_canonical_u32(((value >> 32) & 0xFFFFFFFF) as u32)); + } + + // fn get_u64_target(&self, target: U64Target) -> (u64, u64) { + // let x_u64 = self.get_target(target.0).to_canonical_u64(); + // let low = x_u64 as u32; + // let high = (x_u64 >> 32) as u32; + // (low, high) + // } +} + // TODO: Circuit needs to be implemented pub fn keccak_bench(_size: usize) { @@ -48,9 +70,9 @@ pub fn keccak_bench(_size: usize) { // const KECCAK_WIDTH: usize = 1600; -// const KECCAK_RATE: usize = 1088; -// const KECCAK_CAPACITY: usize = KECCAK_WIDTH - KECCAK_RATE; -// const KECCAK_LANES: usize = KECCAK_WIDTH / 64; +const KECCAK_RATE: usize = 1088; +// const KECCAK_CsAPACITY: usize = KECCAK_WIDTH - KECCAK_RATE; +// const KECCAKs_LANES: usize = KECCAK_WIDTH / 64; const KECCAK_ROUNDS: usize = 24; //TODO: remove the dead codes later @@ -176,7 +198,7 @@ fn chi, const D: usize>( //TODO: remove the dead codes later #[allow(dead_code)] // permutation -fn keccak_permutation, const D: usize>( +fn keccak_f, const D: usize>( builder: &mut CircuitBuilder, state: &mut [[U64Target; 5]; 5] ) { @@ -185,6 +207,175 @@ fn keccak_permutation, const D: usize>( rho(builder, state); pi(builder, state); chi(builder, state); - iota(builder, state, ROUND_CONSTANTS[i] as usize) + iota(builder, state, i) } -} \ No newline at end of file +} + +//TODO: remove the dead codes later +#[allow(dead_code)] +fn absorb, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5], + message: &[U64Target], + rate: usize +) { + let chunks = message.chunks(rate / 64); + for block in chunks { + for (i, &word) in block.iter().enumerate() { + let x = i % 5; + let y = i / 5; + state[x][y] = builder.xor_u64(state[x][y], word); + } + keccak_f(builder, state); // Assume keccak_f is implemented as a circuit + } +} + +//TODO: remove the dead codes later +#[allow(dead_code)] +fn squeeze, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5], + rate: usize, + output_length: usize +) -> Vec { + let mut hash = Vec::new(); + while hash.len() * 8 < output_length { + for y in 0..5 { + for x in 0..5 { + if (x + 5 * y) * 64 < rate { + hash.push(state[x][y]); + if hash.len() * 8 >= output_length { + return hash; + } + } + } + } + keccak_f(builder, state); // Assume keccak_f is implemented as a circuit + } + hash +} + +//TODO: remove the dead codes later +#[allow(dead_code)] +fn keccak_pad, const D: usize>( + builder: &mut CircuitBuilder, + message: &[U64Target], + rate: usize +) -> Vec { + let mut padded_message = message.to_vec(); + let rate_words = rate / 64; + let mut pad_len = rate_words - (message.len() % rate_words); + + if pad_len == 0 { + pad_len = rate_words; + } + + if pad_len == 1 { + padded_message.push(U64Target([builder.one_u32(), builder.one_u32()])); + } else { + padded_message.push(U64Target([builder.one_u32(), builder.zero_u32()])); + for _ in 1..(pad_len - 1) { + padded_message.push(U64Target([builder.zero_u32(), builder.zero_u32()])); + } + padded_message.push(U64Target([builder.zero_u32(), builder.one_u32()])); + } + + padded_message +} + +//TODO: remove the dead codes later +#[allow(dead_code)] +fn keccak256, const D: usize>( + builder: &mut CircuitBuilder, + message: &[U64Target] +) -> Vec { + let mut state = [[builder.zero_u64(); 5]; 5]; + let rate = KECCAK_RATE; + + // Padding + let padded_message = keccak_pad(builder, message, rate); + + // Absorbing + absorb(builder, &mut state, &padded_message, rate); + + // Squeezing + let hash = squeeze(builder, &mut state, rate, 256); + + hash +} + +#[test] +fn test_keccak256() { + // use plonky2_u32::gadgets::arithmetic_u32::U32Target; + // use plonky2::iop::target::Target; + use plonky2::iop::witness::PartialWitness; + use plonky2::plonk::config::PoseidonGoldilocksConfig; + // use plonky2_u32::witness::WitnessU32; + type F = GoldilocksField; // Choose the field used in your implementation. + const D: usize = 2; // This should match the extension degree used. + + // Create circuit builder. + let config = CircuitConfig::standard_recursion_config(); + let mut builder = CircuitBuilder::::new(config); + + // Example input message + let input = b"hello"; + + // Convert input to U64Target format used in your Keccak circuit. + let input_u64: Vec = input.chunks(8) + .map(|chunk| { + let mut chunk_padded = [0u8; 8]; + chunk_padded[..chunk.len()].copy_from_slice(chunk); + let value = u64::from_le_bytes(chunk_padded); + U64Target([ + builder.constant_u32(value as u32), + builder.constant_u32((value >> 32) as u32), + ]) + }) + .collect(); + + + + // Build the Keccak-256 circuit. + let _ = keccak256(&mut builder, &input_u64); + + // Generate the circuit and witness. + let data = builder.build::(); + let mut pw = PartialWitness::new(); + + let input_u64_plain: Vec = input.chunks(8) + .map(|chunk| { + let mut chunk_padded = [0u8; 8]; + chunk_padded[..chunk.len()].copy_from_slice(chunk); + u64::from_le_bytes(chunk_padded) + }) + .collect(); + + for (i, &byte) in input_u64_plain.iter().enumerate() { + pw.set_u64_target(input_u64[i], byte as u64); + } + + // Run the circuit. + let hash_result = data.prove(pw).unwrap(); + + let _ = data.verify(hash_result); + + // // Extract the hash result from the circuit output. + // let mut output_bytes = Vec::new(); + // for target in hash_targets { + // let lo = hash_result.get_u32(target.0[0]) as u64; + // let hi = (hash_result.get_u32(target.0[1]) as u64) << 32; + // let combined = lo | hi; + // output_bytes.extend_from_slice(&combined.to_le_bytes()); + // } + + // // Truncate to 256 bits (32 bytes). + // output_bytes.truncate(32); + + // // Compute the expected hash using a reference implementation. + // let expected_hash = keccak256_reference(input); + + // // Compare the circuit output with the expected hash. + // assert_eq!(output_bytes, expected_hash, "Keccak-256 hash mismatch"); + } + From 5e7d6fd8c830197b60cd635480975560df1b94ff Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Tue, 11 Jun 2024 18:01:07 +0530 Subject: [PATCH 32/41] restructure of funtions --- .../src/arithmetic/binary_arithmetic.rs | 16 +- hash/plonky2/src/arithmetic/u32_arithmetic.rs | 34 +- hash/plonky2/src/bench/keccak.rs | 381 ---------- hash/plonky2/src/bench/keccak256/chi.rs | 25 + hash/plonky2/src/bench/keccak256/iota.rs | 30 + hash/plonky2/src/bench/keccak256/keccak.rs | 699 ++++++++++++++++++ hash/plonky2/src/bench/keccak256/pi.rs | 20 + hash/plonky2/src/bench/keccak256/rho.rs | 27 + hash/plonky2/src/bench/keccak256/theta.rs | 204 +++++ hash/plonky2/src/bench/poseidon.rs | 6 +- hash/plonky2/src/main.rs | 12 +- 11 files changed, 1042 insertions(+), 412 deletions(-) delete mode 100644 hash/plonky2/src/bench/keccak.rs create mode 100644 hash/plonky2/src/bench/keccak256/chi.rs create mode 100644 hash/plonky2/src/bench/keccak256/iota.rs create mode 100644 hash/plonky2/src/bench/keccak256/keccak.rs create mode 100644 hash/plonky2/src/bench/keccak256/pi.rs create mode 100644 hash/plonky2/src/bench/keccak256/rho.rs create mode 100644 hash/plonky2/src/bench/keccak256/theta.rs diff --git a/hash/plonky2/src/arithmetic/binary_arithmetic.rs b/hash/plonky2/src/arithmetic/binary_arithmetic.rs index 89c95b0..9aad0f9 100644 --- a/hash/plonky2/src/arithmetic/binary_arithmetic.rs +++ b/hash/plonky2/src/arithmetic/binary_arithmetic.rs @@ -6,8 +6,8 @@ use plonky2::iop::target::BoolTarget; //TODO: remove the dead codes later #[allow(dead_code)] pub trait CircuitBuilderBoolTarget, const D: usize> { - fn and(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget; - fn or(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget; + // fn and(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget; + // fn or(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget; fn xor(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget; } @@ -22,11 +22,11 @@ impl, const D: usize> CircuitBuilderBoolTarget BoolTarget { - self.and(a, b) - } + // fn and(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget { + // self.and(a, b) + // } - fn or(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget { - self.or(a, b) - } + // fn or(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget { + // self.or(a, b) + // } } \ No newline at end of file diff --git a/hash/plonky2/src/arithmetic/u32_arithmetic.rs b/hash/plonky2/src/arithmetic/u32_arithmetic.rs index cacbdea..4978321 100644 --- a/hash/plonky2/src/arithmetic/u32_arithmetic.rs +++ b/hash/plonky2/src/arithmetic/u32_arithmetic.rs @@ -9,10 +9,10 @@ use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; //TODO: remove the dead codes later #[allow(dead_code)] pub trait CircuitBuilderU32M, const D: usize> { - fn or_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; + // fn or_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; fn and_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; fn xor_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; - fn rotate_left_u32(&mut self, a: U32Target, n: u8) -> U32Target; + // fn rotate_left_u32(&mut self, a: U32Target, n: u8) -> U32Target; fn from_u32(&mut self, a: U32Target) -> Vec; fn to_u32(&mut self, a: Vec) -> U32Target; @@ -43,18 +43,18 @@ impl, const D: usize> CircuitBuilderU32M } - fn or_u32(&mut self, a: U32Target, b: U32Target) -> U32Target { - let binary_target_a = self.from_u32(a); - let binary_target_b = self.from_u32(b); + // fn or_u32(&mut self, a: U32Target, b: U32Target) -> U32Target { + // let binary_target_a = self.from_u32(a); + // let binary_target_b = self.from_u32(b); - let mut res = Vec::::new(); - for i in 0..32 { + // let mut res = Vec::::new(); + // for i in 0..32 { - let r = self.or(binary_target_a[i], binary_target_b[i]); - res.push(r); - } - self.to_u32(res) - } + // let r = self.or(binary_target_a[i], binary_target_b[i]); + // res.push(r); + // } + // self.to_u32(res) + // } fn and_u32(&mut self, a: U32Target, b: U32Target) -> U32Target { let binary_target_a = self.from_u32(a); @@ -83,11 +83,11 @@ impl, const D: usize> CircuitBuilderU32M self.to_u32(res) } - fn rotate_left_u32(&mut self, a: U32Target, n: u8) -> U32Target { - let two_power_n = self.constant_u32(0x1 << n); - let (lo, hi) = self.mul_u32(a, two_power_n); - self.add_u32(lo, hi).0 - } + // fn rotate_left_u32(&mut self, a: U32Target, n: u8) -> U32Target { + // let two_power_n = self.constant_u32(0x1 << n); + // let (lo, hi) = self.mul_u32(a, two_power_n); + // self.add_u32(lo, hi).0 + // } // not := 0xFFFFFFFF - x fn not_u32(&mut self, a: U32Target) -> U32Target { diff --git a/hash/plonky2/src/bench/keccak.rs b/hash/plonky2/src/bench/keccak.rs deleted file mode 100644 index 78d0bef..0000000 --- a/hash/plonky2/src/bench/keccak.rs +++ /dev/null @@ -1,381 +0,0 @@ -use plonky2::field::types::Field; -use plonky2::field::goldilocks_field::GoldilocksField; -use plonky2::hash::keccak::KeccakHash; -use plonky2::plonk::circuit_builder::CircuitBuilder; -use plonky2::plonk::circuit_data::CircuitConfig; -use plonky2::plonk::config::{GenericConfig, KeccakGoldilocksConfig}; -use rand::Rng; -use plonky2::field::extension::Extendable; -use plonky2::plonk::config::Hasher; -use plonky2::hash::hash_types::RichField; -use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; -use crate::arithmetic::u64_arithmetic::U64Target; -use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; -use plonky2::iop::witness::Witness; -use plonky2::field::types::PrimeField64; - -fn generate_data(size: usize) -> Vec { - - let mut data: Vec = Vec::new(); - for _ in 0..(1<: Witness { - fn set_u64_target(&mut self, target: U64Target, value: u64); - // fn get_u64_target(&self, target: U64Target) -> (u64, u64); -} - -impl, F: PrimeField64> WitnessU64 for T { - fn set_u64_target(&mut self, target: U64Target, value: u64) { - self.set_target(target.0[0].0, F::from_canonical_u32((value & 0xFFFFFFFF) as u32)); - self.set_target(target.0[1].0, F::from_canonical_u32(((value >> 32) & 0xFFFFFFFF) as u32)); - } - - // fn get_u64_target(&self, target: U64Target) -> (u64, u64) { - // let x_u64 = self.get_target(target.0).to_canonical_u64(); - // let low = x_u64 as u32; - // let high = (x_u64 >> 32) as u32; - // (low, high) - // } -} - -// TODO: Circuit needs to be implemented -pub fn keccak_bench(_size: usize) { - - let data = generate_data(2); - const D: usize = 2; - type C = KeccakGoldilocksConfig; - type F = >::F; - - let config = CircuitConfig::standard_recursion_config(); - let mut builder = CircuitBuilder::::new(config); - - let _initial = builder.add_virtual_targets(data.len()); - - let hash = KeccakHash::<32>::hash_or_noop(&data); - eprintln!("{:?}", hash); - -} - - -//---------------------------------------------------------- - - -// const KECCAK_WIDTH: usize = 1600; -const KECCAK_RATE: usize = 1088; -// const KECCAK_CsAPACITY: usize = KECCAK_WIDTH - KECCAK_RATE; -// const KECCAKs_LANES: usize = KECCAK_WIDTH / 64; -const KECCAK_ROUNDS: usize = 24; - -//TODO: remove the dead codes later -#[allow(dead_code)] -const ROUND_CONSTANTS: [u64; KECCAK_ROUNDS] = [ - 0x0000000000000001, 0x0000000000008082, 0x800000000000808A, 0x8000000080008000, - 0x000000000000808B, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009, - 0x000000000000008A, 0x0000000000000088, 0x0000000080008009, 0x000000008000000A, - 0x000000008000808B, 0x800000000000008B, 0x8000000000008089, 0x8000000000008003, - 0x8000000000008002, 0x8000000000000080, 0x000000000000800A, 0x800000008000000A, - 0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008, -]; - -//TODO: remove the dead codes later -#[allow(dead_code)] -// Theta -pub fn theta, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5] -){ - let mut c = [builder.zero_u64(); 5]; - let mut d = [builder.zero_u64(); 5]; - - // Compute column parities - for x in 0..5 { - - let xor_x0_x1 = builder.xor_u64(state[x][0], state[x][1]); - let xor_x0_x1_x2 = builder.xor_u64(xor_x0_x1, state[x][2]); - let xor_x0_x1_x2_x3 = builder.xor_u64(xor_x0_x1_x2, state[x][3]); - c[x] = builder.xor_u64(xor_x0_x1_x2_x3, state[x][4]); - - } - - // Compute rotated parities - for x in 0..5 { - let c_left = c[(x + 4) % 5]; - let c_right_rot = builder.rotate_left_u64(c[(x + 1) % 5], 1); - d[x] = builder.xor_u64(c_left, c_right_rot); - } - - // Modify the state - for x in 0..5 { - for y in 0..5 { - state[x][y] = builder.xor_u64(state[x][y], d[x]); - } - } -} - -//TODO: remove the dead codes later -#[allow(dead_code)] -//rho -fn rho, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5] -){ - const RHO_OFFSETS: [[usize; 5]; 5] = [ - [0, 1, 62, 28, 27], - [36, 44, 6, 55, 20], - [3, 10, 43, 25, 39], - [41, 45, 15, 21, 8], - [18, 2, 61, 56, 14], - ]; - - for x in 0..5 { - for y in 0..5 { - let rotation = RHO_OFFSETS[x][y]; - state[x][y] = builder.rotate_left_u64(state[x][y], rotation as u8); - } - } -} - -//TODO: remove the dead codes later -#[allow(dead_code)] -//pi -fn pi, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5] -){ - let mut new_state = [[builder.zero_u64(); 5]; 5]; - for x in 0..5 { - for y in 0..5 { - new_state[(2 * x + 3 * y) % 5][y] = state[x][y]; - } - } - *state = new_state; -} - -//TODO: remove the dead codes later -#[allow(dead_code)] -//iota -fn iota, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5], - round: usize -){ - - let lo = builder.constant_u32((ROUND_CONSTANTS[round] & 0xFFFFFFFF) as u32); - let hi = builder.constant_u32(((ROUND_CONSTANTS[round] >> 32)& 0xFFFFFFFF) as u32); - state[0][0] = builder.xor_u64(state[0][0], U64Target([lo,hi])) ; -} - -//TODO: remove the dead codes later -#[allow(dead_code)] -fn chi, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5] -){ - for x in 0..5 { - let mut temp = [builder.zero_u64(); 5]; - for y in 0..5 { - temp[y] = state[x][y]; - } - - - for y in 0..5 { - let t1 = builder.not_u64(temp[(y + 1) % 5]); - let t2 = builder.and_u64(t1, temp[(y + 2) % 5]); - state[x][y] = builder.xor_u64(state[x][y], t2); - } - } -} - -//TODO: remove the dead codes later -#[allow(dead_code)] -// permutation -fn keccak_f, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5] -) { - for i in 0..24 { - theta(builder, state); - rho(builder, state); - pi(builder, state); - chi(builder, state); - iota(builder, state, i) - } -} - -//TODO: remove the dead codes later -#[allow(dead_code)] -fn absorb, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5], - message: &[U64Target], - rate: usize -) { - let chunks = message.chunks(rate / 64); - for block in chunks { - for (i, &word) in block.iter().enumerate() { - let x = i % 5; - let y = i / 5; - state[x][y] = builder.xor_u64(state[x][y], word); - } - keccak_f(builder, state); // Assume keccak_f is implemented as a circuit - } -} - -//TODO: remove the dead codes later -#[allow(dead_code)] -fn squeeze, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5], - rate: usize, - output_length: usize -) -> Vec { - let mut hash = Vec::new(); - while hash.len() * 8 < output_length { - for y in 0..5 { - for x in 0..5 { - if (x + 5 * y) * 64 < rate { - hash.push(state[x][y]); - if hash.len() * 8 >= output_length { - return hash; - } - } - } - } - keccak_f(builder, state); // Assume keccak_f is implemented as a circuit - } - hash -} - -//TODO: remove the dead codes later -#[allow(dead_code)] -fn keccak_pad, const D: usize>( - builder: &mut CircuitBuilder, - message: &[U64Target], - rate: usize -) -> Vec { - let mut padded_message = message.to_vec(); - let rate_words = rate / 64; - let mut pad_len = rate_words - (message.len() % rate_words); - - if pad_len == 0 { - pad_len = rate_words; - } - - if pad_len == 1 { - padded_message.push(U64Target([builder.one_u32(), builder.one_u32()])); - } else { - padded_message.push(U64Target([builder.one_u32(), builder.zero_u32()])); - for _ in 1..(pad_len - 1) { - padded_message.push(U64Target([builder.zero_u32(), builder.zero_u32()])); - } - padded_message.push(U64Target([builder.zero_u32(), builder.one_u32()])); - } - - padded_message -} - -//TODO: remove the dead codes later -#[allow(dead_code)] -fn keccak256, const D: usize>( - builder: &mut CircuitBuilder, - message: &[U64Target] -) -> Vec { - let mut state = [[builder.zero_u64(); 5]; 5]; - let rate = KECCAK_RATE; - - // Padding - let padded_message = keccak_pad(builder, message, rate); - - // Absorbing - absorb(builder, &mut state, &padded_message, rate); - - // Squeezing - let hash = squeeze(builder, &mut state, rate, 256); - - hash -} - -#[test] -fn test_keccak256() { - // use plonky2_u32::gadgets::arithmetic_u32::U32Target; - // use plonky2::iop::target::Target; - use plonky2::iop::witness::PartialWitness; - use plonky2::plonk::config::PoseidonGoldilocksConfig; - // use plonky2_u32::witness::WitnessU32; - type F = GoldilocksField; // Choose the field used in your implementation. - const D: usize = 2; // This should match the extension degree used. - - // Create circuit builder. - let config = CircuitConfig::standard_recursion_config(); - let mut builder = CircuitBuilder::::new(config); - - // Example input message - let input = b"hello"; - - // Convert input to U64Target format used in your Keccak circuit. - let input_u64: Vec = input.chunks(8) - .map(|chunk| { - let mut chunk_padded = [0u8; 8]; - chunk_padded[..chunk.len()].copy_from_slice(chunk); - let value = u64::from_le_bytes(chunk_padded); - U64Target([ - builder.constant_u32(value as u32), - builder.constant_u32((value >> 32) as u32), - ]) - }) - .collect(); - - - - // Build the Keccak-256 circuit. - let _ = keccak256(&mut builder, &input_u64); - - // Generate the circuit and witness. - let data = builder.build::(); - let mut pw = PartialWitness::new(); - - let input_u64_plain: Vec = input.chunks(8) - .map(|chunk| { - let mut chunk_padded = [0u8; 8]; - chunk_padded[..chunk.len()].copy_from_slice(chunk); - u64::from_le_bytes(chunk_padded) - }) - .collect(); - - for (i, &byte) in input_u64_plain.iter().enumerate() { - pw.set_u64_target(input_u64[i], byte as u64); - } - - // Run the circuit. - let hash_result = data.prove(pw).unwrap(); - - let _ = data.verify(hash_result); - - // // Extract the hash result from the circuit output. - // let mut output_bytes = Vec::new(); - // for target in hash_targets { - // let lo = hash_result.get_u32(target.0[0]) as u64; - // let hi = (hash_result.get_u32(target.0[1]) as u64) << 32; - // let combined = lo | hi; - // output_bytes.extend_from_slice(&combined.to_le_bytes()); - // } - - // // Truncate to 256 bits (32 bytes). - // output_bytes.truncate(32); - - // // Compute the expected hash using a reference implementation. - // let expected_hash = keccak256_reference(input); - - // // Compare the circuit output with the expected hash. - // assert_eq!(output_bytes, expected_hash, "Keccak-256 hash mismatch"); - } - diff --git a/hash/plonky2/src/bench/keccak256/chi.rs b/hash/plonky2/src/bench/keccak256/chi.rs new file mode 100644 index 0000000..5dd266b --- /dev/null +++ b/hash/plonky2/src/bench/keccak256/chi.rs @@ -0,0 +1,25 @@ +use plonky2::hash::hash_types::RichField; +use plonky2::plonk::circuit_builder::CircuitBuilder; +use plonky2::field::extension::Extendable; +use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; + +use crate::arithmetic::u64_arithmetic::U64Target; + +pub fn chi, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5] +){ + for x in 0..5 { + let mut temp = [builder.zero_u64(); 5]; + for y in 0..5 { + temp[y] = state[x][y]; + } + + + for y in 0..5 { + let t1 = builder.not_u64(temp[(y + 1) % 5]); + let t2 = builder.and_u64(t1, temp[(y + 2) % 5]); + state[x][y] = builder.xor_u64(state[x][y], t2); + } + } +} \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak256/iota.rs b/hash/plonky2/src/bench/keccak256/iota.rs new file mode 100644 index 0000000..511495c --- /dev/null +++ b/hash/plonky2/src/bench/keccak256/iota.rs @@ -0,0 +1,30 @@ +use plonky2::hash::hash_types::RichField; +use plonky2::plonk::circuit_builder::CircuitBuilder; +use plonky2::field::extension::Extendable; +use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; + +use crate::arithmetic::u64_arithmetic::U64Target; +use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; + +const KECCAK_ROUNDS: usize = 24; + +const ROUND_CONSTANTS: [u64; KECCAK_ROUNDS] = [ + 0x0000000000000001, 0x0000000000008082, 0x800000000000808A, 0x8000000080008000, + 0x000000000000808B, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009, + 0x000000000000008A, 0x0000000000000088, 0x0000000080008009, 0x000000008000000A, + 0x000000008000808B, 0x800000000000008B, 0x8000000000008089, 0x8000000000008003, + 0x8000000000008002, 0x8000000000000080, 0x000000000000800A, 0x800000008000000A, + 0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008, +]; + +//iota +pub fn iota, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5], + round: usize +){ + + let lo = builder.constant_u32((ROUND_CONSTANTS[round] & 0xFFFFFFFF) as u32); + let hi = builder.constant_u32(((ROUND_CONSTANTS[round] >> 32)& 0xFFFFFFFF) as u32); + state[0][0] = builder.xor_u64(state[0][0], U64Target([lo,hi])) ; +} \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak256/keccak.rs b/hash/plonky2/src/bench/keccak256/keccak.rs new file mode 100644 index 0000000..79920c9 --- /dev/null +++ b/hash/plonky2/src/bench/keccak256/keccak.rs @@ -0,0 +1,699 @@ +use plonky2::field::types::Field; +use plonky2::field::goldilocks_field::GoldilocksField; +use plonky2::hash::keccak::KeccakHash; +use plonky2::plonk::circuit_builder::CircuitBuilder; +use plonky2::plonk::circuit_data::CircuitConfig; +use plonky2::plonk::config::{GenericConfig, KeccakGoldilocksConfig}; +use rand::Rng; +use plonky2::field::extension::Extendable; +use plonky2::plonk::config::Hasher; +use plonky2::hash::hash_types::RichField; +use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; +use crate::arithmetic::u64_arithmetic::U64Target; +use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; +use plonky2::iop::witness::Witness; +use plonky2::field::types::PrimeField64; +use super::{chi::chi, iota::iota, pi::pi, rho::rho, theta::theta}; +fn generate_data(size: usize) -> Vec { + + let mut data: Vec = Vec::new(); + for _ in 0..(1<: Witness { + fn set_u64_target(&mut self, target: U64Target, value: u64); + // fn get_u64_target(&self, target: U64Target) -> (u64, u64); +} + +impl, F: PrimeField64> WitnessU64 for T { + fn set_u64_target(&mut self, target: U64Target, value: u64) { + self.set_target(target.0[0].0, F::from_canonical_u32((value & 0xFFFFFFFF) as u32)); + self.set_target(target.0[1].0, F::from_canonical_u32(((value >> 32) & 0xFFFFFFFF) as u32)); + } + + // fn get_u64_target(&self, target: U64Target) -> (u64, u64) { + // let x_u64 = self.get_target(target.0[0].0).to_canonical_u64(); + // let y_u64 = self.get_target(target.0[1].0).to_canonical_u64(); + + + // (x_u64, y_u64) + // } +} + +// TODO: Circuit needs to be implemented +pub fn keccak_bench(_size: usize) { + + let data = generate_data(2); + const D: usize = 2; + type C = KeccakGoldilocksConfig; + type F = >::F; + + let config = CircuitConfig::standard_recursion_config(); + let mut builder = CircuitBuilder::::new(config); + + let _initial = builder.add_virtual_targets(data.len()); + + let hash = KeccakHash::<32>::hash_or_noop(&data); + eprintln!("{:?}", hash); + +} + + +//---------------------------------------------------------- + + +// const KECCAK_WIDTH: usize = 1600; +const KECCAK_RATE: usize = 1088; +// const KECCAK_CAPACITY: usize = KECCAK_WIDTH - KECCAK_RATE; +// const KECCAK_LANES: usize = KECCAK_WIDTH / 64; + +// permutation +fn keccak_f, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5] +) { + for i in 0..24 { + let _ = theta(builder, state); + let _ = rho(builder, state); + let _ = pi(builder, state); + let _ = chi(builder, state); + let _ = iota(builder, state, i); + } +} + + +fn absorb, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5], + message: &[U64Target], + rate: usize +) { + let chunks = message.chunks(rate / 64); + for block in chunks { + for (i, &word) in block.iter().enumerate() { + let x = i % 5; + let y = i / 5; + state[x][y] = builder.xor_u64(state[x][y], word); + } + keccak_f(builder, state); // Assume keccak_f is implemented as a circuit + } +} + + +fn squeeze, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5], + rate: usize, + output_length: usize +) -> Vec { + let mut hash = Vec::new(); + while hash.len() * 8 < output_length { + for y in 0..5 { + for x in 0..5 { + if (x + 5 * y) * 64 < rate { + hash.push(state[x][y]); + if hash.len() * 8 >= output_length { + return hash; + } + } + } + } + keccak_f(builder, state); // Assume keccak_f is implemented as a circuit + } + hash +} + + +fn keccak_pad, const D: usize>( + builder: &mut CircuitBuilder, + message: &[U64Target], + rate: usize +) -> Vec { + let mut padded_message = message.to_vec(); + let rate_words = rate / 64; + let mut pad_len = rate_words - (message.len() % rate_words); + + if pad_len == 0 { + pad_len = rate_words; + } + + if pad_len == 1 { + padded_message.push(U64Target([builder.one_u32(), builder.one_u32()])); + } else { + padded_message.push(U64Target([builder.one_u32(), builder.zero_u32()])); + for _ in 1..(pad_len - 1) { + padded_message.push(U64Target([builder.zero_u32(), builder.zero_u32()])); + } + padded_message.push(U64Target([builder.zero_u32(), builder.one_u32()])); + } + + padded_message +} + + +fn keccak256, const D: usize>( + builder: &mut CircuitBuilder, + message: &[U64Target] +) -> Vec { + let mut state = [[builder.zero_u64(); 5]; 5]; + let rate = KECCAK_RATE; + + // Padding + let padded_message = keccak_pad(builder, message, rate); + + // Absorbing + absorb(builder, &mut state, &padded_message, rate); + + // Squeezing + let hash = squeeze(builder, &mut state, rate, 256); + + hash +} + +#[test] +fn test_keccak256() { + // use plonky2_u32::gadgets::arithmetic_u32::U32Target; + // use plonky2::iop::target::Target; + use plonky2::iop::witness::PartialWitness; + use plonky2::plonk::config::PoseidonGoldilocksConfig; + use rand::RngCore; + + // use plonky2_u32::witness::WitnessU32; + type F = GoldilocksField; // Choose the field used in your implementation. + const D: usize = 2; // This should match the extension degree used. + + // Create circuit builder. + let config = CircuitConfig::standard_recursion_config(); + let mut builder = CircuitBuilder::::new(config); + + // Example input message + let mut input = [0u8; 8]; + let _ = rand::thread_rng().try_fill_bytes(&mut input); + + // let input = b"hello world"; + eprintln!("{:?}", input.len()); + // Convert input to U64Target format used in your Keccak circuit. + let input_u64: Vec = input.chunks(8) + .map(|chunk| { + let mut chunk_padded = [0u8; 8]; + chunk_padded[..chunk.len()].copy_from_slice(chunk); + let value = u64::from_le_bytes(chunk_padded); + U64Target([ + builder.constant_u32(value as u32), + builder.constant_u32((value >> 32) as u32), + ]) + }) + .collect(); + + + + // Build the Keccak-256 circuit. + let _ = keccak256(&mut builder, &input_u64); + + eprintln!("{:?}", builder.num_gates()); + + // Generate the circuit and witness. + let data = builder.build::(); + let mut pw = PartialWitness::new(); + + let input_u64_plain: Vec = input.chunks(8) + .map(|chunk| { + let mut chunk_padded = [0u8; 8]; + chunk_padded[..chunk.len()].copy_from_slice(chunk); + u64::from_le_bytes(chunk_padded) + }) + .collect(); + + for (i, &byte) in input_u64_plain.iter().enumerate() { + pw.set_u64_target(input_u64[i], byte as u64); + } + + // Run the circuit. + let hash_result = data.prove(pw).unwrap(); + + let _ = data.verify(hash_result.clone()); + + // Extract the hash result from the circuit output. + // let mut output_bytes = Vec::new(); + // for target in hash_targets { + // let lo = hash_result.get_u32(target.0[0]) as u64; + // let hi = (hash_result.get_u32(target.0[1]) as u64) << 32; + // let combined = lo | hi; + // output_bytes.extend_from_slice(&combined.to_le_bytes()); + // } + + // // Truncate to 256 bits (32 bytes). + // output_bytes.truncate(32); + + // // Compute the expected hash using a reference implementation. + // let expected_hash = keccak256_reference(input); + + // // Compare the circuit output with the expected hash. + // assert_eq!(output_bytes, expected_hash, "Keccak-256 hash mismatch"); + + println!("{:?}",hash_result.get_public_inputs_hash()); +} + + +#[cfg(test)] +mod tests { + use super::*; + use plonky2::field::goldilocks_field::GoldilocksField; + // use plonky2::field::types::Field; + use plonky2::hash::hash_types::RichField; + use plonky2::iop::witness::{PartialWitness/* , Witness*/}; + use plonky2::plonk::circuit_builder::CircuitBuilder; + use plonky2::plonk::circuit_data::CircuitConfig; + use plonky2::plonk::config::PoseidonGoldilocksConfig; + // use plonky2_u32::gadgets::arithmetic_u32::U32Target; + use crate::arithmetic::u64_arithmetic::U64Target; + + fn create_u64_target, const D: usize>( + builder: &mut CircuitBuilder, + value: u64 + ) -> U64Target { + let lo = value as u32; + let hi = (value >> 32) as u32; + U64Target([builder.constant_u32(lo), builder.constant_u32(hi)]) + } + + #[test] + fn test_theta_function() { + type F = GoldilocksField; + const D: usize = 2; + + // Create circuit builder + let config = CircuitConfig::standard_recursion_config(); + let mut builder = CircuitBuilder::::new(config); + + // Input state + let input_state: [[U64Target; 5]; 5] = [ + [ + create_u64_target(&mut builder, 0x0000000000000001), + create_u64_target(&mut builder, 0x0000000000000002), + create_u64_target(&mut builder, 0x0000000000000003), + create_u64_target(&mut builder, 0x0000000000000004), + create_u64_target(&mut builder, 0x0000000000000005) + ], + [ + create_u64_target(&mut builder, 0x0000000000000006), + create_u64_target(&mut builder, 0x0000000000000007), + create_u64_target(&mut builder, 0x0000000000000008), + create_u64_target(&mut builder, 0x0000000000000009), + create_u64_target(&mut builder, 0x000000000000000A) + ], + [ + create_u64_target(&mut builder, 0x000000000000000B), + create_u64_target(&mut builder, 0x000000000000000C), + create_u64_target(&mut builder, 0x000000000000000D), + create_u64_target(&mut builder, 0x000000000000000E), + create_u64_target(&mut builder, 0x000000000000000F) + ], + [ + create_u64_target(&mut builder, 0x0000000000000010), + create_u64_target(&mut builder, 0x0000000000000011), + create_u64_target(&mut builder, 0x0000000000000012), + create_u64_target(&mut builder, 0x0000000000000013), + create_u64_target(&mut builder, 0x0000000000000014) + ], + [ + create_u64_target(&mut builder, 0x0000000000000015), + create_u64_target(&mut builder, 0x0000000000000016), + create_u64_target(&mut builder, 0x0000000000000017), + create_u64_target(&mut builder, 0x0000000000000018), + create_u64_target(&mut builder, 0x0000000000000019) + ] + ]; + + // Expected output state (after theta) + let expected_state = [ + [ + create_u64_target(&mut builder, 0x7B7B7B7B7B7B7B7B), + create_u64_target(&mut builder, 0x8B8B8B8B8B8B8B8B), + create_u64_target(&mut builder, 0x9B9B9B9B9B9B9B9B), + create_u64_target(&mut builder, 0xABABABABABABABAB), + create_u64_target(&mut builder, 0xBBBBBBBBBBBBBBBB) + ], + [ + create_u64_target(&mut builder, 0xCBCBCBCBCBCBCBCB), + create_u64_target(&mut builder, 0xDBDBDBDBDBDBDBDB), + create_u64_target(&mut builder, 0xEBEBEBEBEBEBEBEB), + create_u64_target(&mut builder, 0xFBFBFBFBFBFBFBFB), + create_u64_target(&mut builder, 0x0B0B0B0B0B0B0B0B) + ], + [ + create_u64_target(&mut builder, 0x1B1B1B1B1B1B1B1B), + create_u64_target(&mut builder, 0x2B2B2B2B2B2B2B2B), + create_u64_target(&mut builder, 0x3B3B3B3B3B3B3B3B), + create_u64_target(&mut builder, 0x4B4B4B4B4B4B4B4B), + create_u64_target(&mut builder, 0x5B5B5B5B5B5B5B5B) + ], + [ + create_u64_target(&mut builder, 0x6B6B6B6B6B6B6B6B), + create_u64_target(&mut builder, 0x7B7B7B7B7B7B7B7B), + create_u64_target(&mut builder, 0x8B8B8B8B8B8B8B8B), + create_u64_target(&mut builder, 0x9B9B9B9B9B9B9B9B), + create_u64_target(&mut builder, 0xABABABABABABABAB) + ], + [ + create_u64_target(&mut builder, 0xBBBBBBBBBBBBBBBB), + create_u64_target(&mut builder, 0xCBCBCBCBCBCBCBCB), + create_u64_target(&mut builder, 0xDBDBDBDBDBDBDBDB), + create_u64_target(&mut builder, 0xEBEBEBEBEBEBEBEB), + create_u64_target(&mut builder, 0xFBFBFBFBFBFBFBFB) + ] + ]; + + // Run the theta function + let mut state = input_state; + theta(&mut builder, &mut state); + + + // Check if the output state matches the expected state + for x in 0..5 { + for y in 0..5 { + for i in 0..2 { + println!("Comparing: {:?} and {:?}", state[x][y].0[i].0, expected_state[x][y].0[i].0); + let res = builder.is_equal(state[x][y].0[i].0, expected_state[x][y].0[i].0); + builder.assert_bool(res); + } + } + } + + println!("{:?}", builder.num_gates()); + // Build the circuit + let data = builder.build::(); + + // Create witness and prove + let mut pw = PartialWitness::new(); + pw.set_u64_target(input_state[0][0], 0x0000000000000001); + pw.set_u64_target(input_state[0][1], 0x0000000000000002); + pw.set_u64_target(input_state[0][2], 0x0000000000000003); + pw.set_u64_target(input_state[0][3], 0x0000000000000004); + pw.set_u64_target(input_state[0][4], 0x0000000000000005); + pw.set_u64_target(input_state[1][0], 0x0000000000000006); + pw.set_u64_target(input_state[1][1], 0x0000000000000007); + pw.set_u64_target(input_state[1][2], 0x0000000000000008); + pw.set_u64_target(input_state[1][3], 0x0000000000000009); + pw.set_u64_target(input_state[1][4], 0x000000000000000A); + pw.set_u64_target(input_state[2][0], 0x000000000000000B); + pw.set_u64_target(input_state[2][1], 0x000000000000000C); + pw.set_u64_target(input_state[2][2], 0x000000000000000D); + pw.set_u64_target(input_state[2][3], 0x000000000000000E); + pw.set_u64_target(input_state[2][4], 0x000000000000000F); + pw.set_u64_target(input_state[3][0], 0x0000000000000010); + pw.set_u64_target(input_state[3][1], 0x0000000000000011); + pw.set_u64_target(input_state[3][2], 0x0000000000000012); + pw.set_u64_target(input_state[3][3], 0x0000000000000013); + pw.set_u64_target(input_state[3][4], 0x0000000000000014); + pw.set_u64_target(input_state[4][0], 0x0000000000000015); + pw.set_u64_target(input_state[4][1], 0x0000000000000016); + pw.set_u64_target(input_state[4][2], 0x0000000000000017); + pw.set_u64_target(input_state[4][3], 0x0000000000000018); + pw.set_u64_target(input_state[4][4], 0x0000000000000019); + + let proof = data.prove(pw).unwrap(); + assert!(data.verify(proof).is_ok()); + } + + + #[test] + fn test_rho_function() { + type F = GoldilocksField; + const D: usize = 2; + + // Create circuit builder + let config = CircuitConfig::standard_recursion_config(); + let mut builder = CircuitBuilder::::new(config); + + // Input state (example, should be taken from an authoritative source) + let input_state = [ + [ + create_u64_target(&mut builder, 0x0000000000000001), + create_u64_target(&mut builder, 0x0000000000000002), + create_u64_target(&mut builder, 0x0000000000000003), + create_u64_target(&mut builder, 0x0000000000000004), + create_u64_target(&mut builder, 0x0000000000000005) + ], + [ + create_u64_target(&mut builder, 0x0000000000000006), + create_u64_target(&mut builder, 0x0000000000000007), + create_u64_target(&mut builder, 0x0000000000000008), + create_u64_target(&mut builder, 0x0000000000000009), + create_u64_target(&mut builder, 0x000000000000000A) + ], + [ + create_u64_target(&mut builder, 0x000000000000000B), + create_u64_target(&mut builder, 0x000000000000000C), + create_u64_target(&mut builder, 0x000000000000000D), + create_u64_target(&mut builder, 0x000000000000000E), + create_u64_target(&mut builder, 0x000000000000000F) + ], + [ + create_u64_target(&mut builder, 0x0000000000000010), + create_u64_target(&mut builder, 0x0000000000000011), + create_u64_target(&mut builder, 0x0000000000000012), + create_u64_target(&mut builder, 0x0000000000000013), + create_u64_target(&mut builder, 0x0000000000000014) + ], + [ + create_u64_target(&mut builder, 0x0000000000000015), + create_u64_target(&mut builder, 0x0000000000000016), + create_u64_target(&mut builder, 0x0000000000000017), + create_u64_target(&mut builder, 0x0000000000000018), + create_u64_target(&mut builder, 0x0000000000000019) + ] + ]; + + // Expected state after rho (example, should be taken from an authoritative source) + let expected_state = [ + [ + create_u64_target(&mut builder, 0x0000000000000001), + create_u64_target(&mut builder, 0x0000000000000100), + create_u64_target(&mut builder, 0x0000000000003000), + create_u64_target(&mut builder, 0x0000000000040000), + create_u64_target(&mut builder, 0x0000000000500000) + ], + [ + create_u64_target(&mut builder, 0x0000000000600000), + create_u64_target(&mut builder, 0x0000000000700000), + create_u64_target(&mut builder, 0x0000000008000000), + create_u64_target(&mut builder, 0x0000000009000000), + create_u64_target(&mut builder, 0x00000000A0000000) + ], + [ + create_u64_target(&mut builder, 0x00000000B0000000), + create_u64_target(&mut builder, 0x00000000C0000000), + create_u64_target(&mut builder, 0x0000000D00000000), + create_u64_target(&mut builder, 0x0000000E00000000), + create_u64_target(&mut builder, 0x0000000F00000000) + ], + [ + create_u64_target(&mut builder, 0x0000001000000000), + create_u64_target(&mut builder, 0x0000001100000000), + create_u64_target(&mut builder, 0x0000001200000000), + create_u64_target(&mut builder, 0x0000001300000000), + create_u64_target(&mut builder, 0x0000001400000000) + ], + [ + create_u64_target(&mut builder, 0x0000001500000000), + create_u64_target(&mut builder, 0x0000001600000000), + create_u64_target(&mut builder, 0x0000001700000000), + create_u64_target(&mut builder, 0x0000001800000000), + create_u64_target(&mut builder, 0x0000001900000000) + ] + ]; + + // Run the rho function + let mut state = input_state; + rho(&mut builder, &mut state); + // Check if the output state matches the expected state + for x in 0..5 { + for y in 0..5 { + let res = builder.is_equal(state[x][y].0[0].0, expected_state[x][y].0[0].0); + let res2 = builder.is_equal(state[x][y].0[1].0, expected_state[x][y].0[1].0); + + builder.assert_bool(res); + builder.assert_bool(res2); + } + } + + println!("{:?}", builder.num_gates()); + // Build the circuit + let data = builder.build::(); + + // Create witness and prove + let pw = PartialWitness::new(); + let proof = data.prove(pw).unwrap(); + assert!(data.verify(proof).is_ok()); + } + + + #[test] + fn test_keccak256_permutation() { + type F = GoldilocksField; + const D: usize = 2; + + // Create circuit builder + let config = CircuitConfig::standard_recursion_config(); + let mut builder = CircuitBuilder::::new(config); + + // Input state (example, should be taken from an authoritative source) + let input_state = [ + [ + create_u64_target(&mut builder, 0x0000000000000001), + create_u64_target(&mut builder, 0x0000000000000002), + create_u64_target(&mut builder, 0x0000000000000003), + create_u64_target(&mut builder, 0x0000000000000004), + create_u64_target(&mut builder, 0x0000000000000005) + ], + [ + create_u64_target(&mut builder, 0x0000000000000006), + create_u64_target(&mut builder, 0x0000000000000007), + create_u64_target(&mut builder, 0x0000000000000008), + create_u64_target(&mut builder, 0x0000000000000009), + create_u64_target(&mut builder, 0x000000000000000A) + ], + [ + create_u64_target(&mut builder, 0x000000000000000B), + create_u64_target(&mut builder, 0x000000000000000C), + create_u64_target(&mut builder, 0x000000000000000D), + create_u64_target(&mut builder, 0x000000000000000E), + create_u64_target(&mut builder, 0x000000000000000F) + ], + [ + create_u64_target(&mut builder, 0x0000000000000010), + create_u64_target(&mut builder, 0x0000000000000011), + create_u64_target(&mut builder, 0x0000000000000012), + create_u64_target(&mut builder, 0x0000000000000013), + create_u64_target(&mut builder, 0x0000000000000014) + ], + [ + create_u64_target(&mut builder, 0x0000000000000015), + create_u64_target(&mut builder, 0x0000000000000016), + create_u64_target(&mut builder, 0x0000000000000017), + create_u64_target(&mut builder, 0x0000000000000018), + create_u64_target(&mut builder, 0x0000000000000019) + ] + ]; + + // Expected state after keccak256 permutation (example, should be taken from an authoritative source) + let expected_state = [ + [ + create_u64_target(&mut builder, 0xE69F6BAE986CCF06), + create_u64_target(&mut builder, 0xDF9D77905A3546B6), + create_u64_target(&mut builder, 0x7BFBFFF923073CEB), + create_u64_target(&mut builder, 0xB2D9AB3E200FD999), + create_u64_target(&mut builder, 0x1A741CAEC020555C) + ], + [ + create_u64_target(&mut builder, 0x56D7B52E1442C0AE), + create_u64_target(&mut builder, 0xEBA39A0E00EF9FE9), + create_u64_target(&mut builder, 0x2D6FF9BE61A295EE), + create_u64_target(&mut builder, 0xC82D01AE6E142988), + create_u64_target(&mut builder, 0xCDEDECBAD32B9246) + ], + [ + create_u64_target(&mut builder, 0x7AF13F3C6F6E4AF6), + create_u64_target(&mut builder, 0xBD469F697CCF7B91), + create_u64_target(&mut builder, 0xAB4F902ED5B9FD93), + create_u64_target(&mut builder, 0xFC4F6A6C27E0190B), + create_u64_target(&mut builder, 0x3D41F5EF85540B06) + ], + [ + create_u64_target(&mut builder, 0x2D9F050A3E1600F4), + create_u64_target(&mut builder, 0x0ED46287DA8AA931), + create_u64_target(&mut builder, 0xA13AD679DFAA4EA3), + create_u64_target(&mut builder, 0x70B1D7A7C896E12A), + create_u64_target(&mut builder, 0xA2CF9C93C5326E0D) + ], + [ + create_u64_target(&mut builder, 0x2CE66FBC3AC94F5B), + create_u64_target(&mut builder, 0x4960E539C1EF3BA7), + create_u64_target(&mut builder, 0xC7C50305DF46E1BB), + create_u64_target(&mut builder, 0xEE6FE33D998F8A8B), + create_u64_target(&mut builder, 0x2A971ED5399DC662) + ] + ]; + + // Run the keccak256 permutation function + let mut state = input_state; + keccak_f(&mut builder, &mut state); + + // Check if the output state matches the expected state + for x in 0..5 { + for y in 0..5 { + let res1 = builder.is_equal(state[x][y].0[0].0, expected_state[x][y].0[0].0); + let res2 = builder.is_equal(state[x][y].0[1].0, expected_state[x][y].0[1].0); + + builder.assert_bool(res1); + builder.assert_bool(res2); + } + } + println!("{:?}", builder.num_gates()); + // Build the circuit + let data = builder.build::(); + + // Create witness and prove + let pw = PartialWitness::new(); + let proof = data.prove(pw).unwrap(); + assert!(data.verify(proof).is_ok()); + } + + + #[test] + fn test_keccak256_hash() { + type F = GoldilocksField; + const D: usize = 2; + + // Create circuit builder + let config = CircuitConfig::standard_recursion_config(); + let mut builder = CircuitBuilder::::new(config); + + // Input message (example, should be taken from an authoritative source) + let input_message = vec![ + create_u64_target(&mut builder, 0x0000000000000001), + create_u64_target(&mut builder, 0x0000000000000002), + create_u64_target(&mut builder, 0x0000000000000003), + create_u64_target(&mut builder, 0x0000000000000004) + ]; + + // Expected hash (example, should be taken from an authoritative source) + let expected_hash = vec![ + create_u64_target(&mut builder, 0xA7FFC6F8BF1ED766), + create_u64_target(&mut builder, 0x51C14756A061D662), + create_u64_target(&mut builder, 0xF580FF4DE43B49FA), + create_u64_target(&mut builder, 0x82D80A4B80F8434A) + ]; + + // Run the keccak256 hash function + let hash = keccak256(&mut builder, &input_message); + + // Check if the output hash matches the expected hash + for i in 0..expected_hash.len() { + let res1 = builder.is_equal(hash[i].0[0].0, expected_hash[i].0[0].0); + let res2 = builder.is_equal(hash[i].0[1].0, expected_hash[i].0[1].0); + + builder.assert_bool(res1); + builder.assert_bool(res2); + } + + println!("{:?}", builder.num_gates()); + // Build the circuit + let data = builder.build::(); + + // Create witness and prove + let pw = PartialWitness::new(); + let proof = data.prove(pw).unwrap(); + assert!(data.verify(proof).is_ok()); + } + + +} diff --git a/hash/plonky2/src/bench/keccak256/pi.rs b/hash/plonky2/src/bench/keccak256/pi.rs new file mode 100644 index 0000000..5862c18 --- /dev/null +++ b/hash/plonky2/src/bench/keccak256/pi.rs @@ -0,0 +1,20 @@ +use plonky2::hash::hash_types::RichField; +use plonky2::plonk::circuit_builder::CircuitBuilder; +use plonky2::field::extension::Extendable; +use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; + +use crate::arithmetic::u64_arithmetic::U64Target; + +//pi +pub fn pi, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5] +){ + let mut new_state = [[builder.zero_u64(); 5]; 5]; + for x in 0..5 { + for y in 0..5 { + new_state[(2 * x + 3 * y) % 5][y] = state[x][y]; + } + } + *state = new_state; +} \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak256/rho.rs b/hash/plonky2/src/bench/keccak256/rho.rs new file mode 100644 index 0000000..c37df14 --- /dev/null +++ b/hash/plonky2/src/bench/keccak256/rho.rs @@ -0,0 +1,27 @@ +use plonky2::hash::hash_types::RichField; +use plonky2::plonk::circuit_builder::CircuitBuilder; +use plonky2::field::extension::Extendable; +use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; + +use crate::arithmetic::u64_arithmetic::U64Target; + +//rho +pub fn rho, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5] +){ + const RHO_OFFSETS: [[usize; 5]; 5] = [ + [0, 1, 62, 28, 27], + [36, 44, 6, 55, 20], + [3, 10, 43, 25, 39], + [41, 45, 15, 21, 8], + [18, 2, 61, 56, 14], + ]; + + for x in 0..5 { + for y in 0..5 { + let rotation = RHO_OFFSETS[x][y]; + state[x][y] = builder.rotate_left_u64(state[x][y], rotation as u8); + } + } +} \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak256/theta.rs b/hash/plonky2/src/bench/keccak256/theta.rs new file mode 100644 index 0000000..fafc11e --- /dev/null +++ b/hash/plonky2/src/bench/keccak256/theta.rs @@ -0,0 +1,204 @@ +use plonky2::hash::hash_types::RichField; +use plonky2::plonk::circuit_builder::CircuitBuilder; +use plonky2::field::extension::Extendable; +use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; + + +use crate::arithmetic::u64_arithmetic::U64Target; + +// Theta +pub fn theta, const D: usize>( + builder: &mut CircuitBuilder, + state: &mut [[U64Target; 5]; 5] +){ + let mut c = [builder.zero_u64(); 5]; + let mut d = [builder.zero_u64(); 5]; + + // Compute column parities + for x in 0..5 { + + let xor_x0_x1 = builder.xor_u64(state[x][0], state[x][1]); + let xor_x0_x1_x2 = builder.xor_u64(xor_x0_x1, state[x][2]); + let xor_x0_x1_x2_x3 = builder.xor_u64(xor_x0_x1_x2, state[x][3]); + c[x] = builder.xor_u64(xor_x0_x1_x2_x3, state[x][4]); + + } + + // Compute rotated parities + for x in 0..5 { + let c_left = c[(x + 4) % 5]; + let c_right_rot = builder.rotate_left_u64(c[(x + 1) % 5], 1); + d[x] = builder.xor_u64(c_left, c_right_rot); + } + + // Modify the state + for x in 0..5 { + for y in 0..5 { + state[x][y] = builder.xor_u64(state[x][y], d[x]); + } + } +} + + + +#[cfg(test)] +mod tests { + use super::*; + use plonky2::field::goldilocks_field::GoldilocksField; + use plonky2::hash::hash_types::RichField; + use plonky2::iop::witness::PartialWitness; + use plonky2::plonk::circuit_builder::CircuitBuilder; + use plonky2::plonk::circuit_data::CircuitConfig; + use plonky2::plonk::config::PoseidonGoldilocksConfig; + use crate::arithmetic::u64_arithmetic::U64Target; + use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; + use crate::bench::keccak256::keccak::WitnessU64; + + fn create_u64_target, const D: usize>( + builder: &mut CircuitBuilder, + value: u64 + ) -> U64Target { + let lo = value as u32; + let hi = (value >> 32) as u32; + U64Target([builder.constant_u32(lo), builder.constant_u32(hi)]) + } + + #[test] + fn test_theta_function() { + type F = GoldilocksField; + const D: usize = 2; + + // Create circuit builder + let config = CircuitConfig::standard_recursion_config(); + let mut builder = CircuitBuilder::::new(config); + + // Input state + let input_state: [[U64Target; 5]; 5] = [ + [ + create_u64_target(&mut builder, 0x0000000000000001), + create_u64_target(&mut builder, 0x0000000000000002), + create_u64_target(&mut builder, 0x0000000000000003), + create_u64_target(&mut builder, 0x0000000000000004), + create_u64_target(&mut builder, 0x0000000000000005) + ], + [ + create_u64_target(&mut builder, 0x0000000000000006), + create_u64_target(&mut builder, 0x0000000000000007), + create_u64_target(&mut builder, 0x0000000000000008), + create_u64_target(&mut builder, 0x0000000000000009), + create_u64_target(&mut builder, 0x000000000000000A) + ], + [ + create_u64_target(&mut builder, 0x000000000000000B), + create_u64_target(&mut builder, 0x000000000000000C), + create_u64_target(&mut builder, 0x000000000000000D), + create_u64_target(&mut builder, 0x000000000000000E), + create_u64_target(&mut builder, 0x000000000000000F) + ], + [ + create_u64_target(&mut builder, 0x0000000000000010), + create_u64_target(&mut builder, 0x0000000000000011), + create_u64_target(&mut builder, 0x0000000000000012), + create_u64_target(&mut builder, 0x0000000000000013), + create_u64_target(&mut builder, 0x0000000000000014) + ], + [ + create_u64_target(&mut builder, 0x0000000000000015), + create_u64_target(&mut builder, 0x0000000000000016), + create_u64_target(&mut builder, 0x0000000000000017), + create_u64_target(&mut builder, 0x0000000000000018), + create_u64_target(&mut builder, 0x0000000000000019) + ] + ]; + + // Expected output state (after theta) + let expected_state = [ + [ + create_u64_target(&mut builder, 0x7B7B7B7B7B7B7B7B), + create_u64_target(&mut builder, 0x8B8B8B8B8B8B8B8B), + create_u64_target(&mut builder, 0x9B9B9B9B9B9B9B9B), + create_u64_target(&mut builder, 0xABABABABABABABAB), + create_u64_target(&mut builder, 0xBBBBBBBBBBBBBBBB) + ], + [ + create_u64_target(&mut builder, 0xCBCBCBCBCBCBCBCB), + create_u64_target(&mut builder, 0xDBDBDBDBDBDBDBDB), + create_u64_target(&mut builder, 0xEBEBEBEBEBEBEBEB), + create_u64_target(&mut builder, 0xFBFBFBFBFBFBFBFB), + create_u64_target(&mut builder, 0x0B0B0B0B0B0B0B0B) + ], + [ + create_u64_target(&mut builder, 0x1B1B1B1B1B1B1B1B), + create_u64_target(&mut builder, 0x2B2B2B2B2B2B2B2B), + create_u64_target(&mut builder, 0x3B3B3B3B3B3B3B3B), + create_u64_target(&mut builder, 0x4B4B4B4B4B4B4B4B), + create_u64_target(&mut builder, 0x5B5B5B5B5B5B5B5B) + ], + [ + create_u64_target(&mut builder, 0x6B6B6B6B6B6B6B6B), + create_u64_target(&mut builder, 0x7B7B7B7B7B7B7B7B), + create_u64_target(&mut builder, 0x8B8B8B8B8B8B8B8B), + create_u64_target(&mut builder, 0x9B9B9B9B9B9B9B9B), + create_u64_target(&mut builder, 0xABABABABABABABAB) + ], + [ + create_u64_target(&mut builder, 0xBBBBBBBBBBBBBBBB), + create_u64_target(&mut builder, 0xCBCBCBCBCBCBCBCB), + create_u64_target(&mut builder, 0xDBDBDBDBDBDBDBDB), + create_u64_target(&mut builder, 0xEBEBEBEBEBEBEBEB), + create_u64_target(&mut builder, 0xFBFBFBFBFBFBFBFB) + ] + ]; + + // Run the theta function + let mut state = input_state; + let _ = theta(&mut builder, &mut state); + + + // Check if the output state matches the expected state + for x in 0..5 { + for y in 0..5 { + for i in 0..2 { + println!("Comparing: {:?} and {:?}", state[x][y].0[i].0, expected_state[x][y].0[i].0); + let res = builder.is_equal(state[x][y].0[i].0, expected_state[x][y].0[i].0); + builder.assert_bool(res); + } + } + } + + println!("{:?}", builder.num_gates()); + // Build the circuit + let data = builder.build::(); + + // Create witness and prove + let mut pw = PartialWitness::new(); + pw.set_u64_target(input_state[0][0], 0x0000000000000001); + pw.set_u64_target(input_state[0][1], 0x0000000000000002); + pw.set_u64_target(input_state[0][2], 0x0000000000000003); + pw.set_u64_target(input_state[0][3], 0x0000000000000004); + pw.set_u64_target(input_state[0][4], 0x0000000000000005); + pw.set_u64_target(input_state[1][0], 0x0000000000000006); + pw.set_u64_target(input_state[1][1], 0x0000000000000007); + pw.set_u64_target(input_state[1][2], 0x0000000000000008); + pw.set_u64_target(input_state[1][3], 0x0000000000000009); + pw.set_u64_target(input_state[1][4], 0x000000000000000A); + pw.set_u64_target(input_state[2][0], 0x000000000000000B); + pw.set_u64_target(input_state[2][1], 0x000000000000000C); + pw.set_u64_target(input_state[2][2], 0x000000000000000D); + pw.set_u64_target(input_state[2][3], 0x000000000000000E); + pw.set_u64_target(input_state[2][4], 0x000000000000000F); + pw.set_u64_target(input_state[3][0], 0x0000000000000010); + pw.set_u64_target(input_state[3][1], 0x0000000000000011); + pw.set_u64_target(input_state[3][2], 0x0000000000000012); + pw.set_u64_target(input_state[3][3], 0x0000000000000013); + pw.set_u64_target(input_state[3][4], 0x0000000000000014); + pw.set_u64_target(input_state[4][0], 0x0000000000000015); + pw.set_u64_target(input_state[4][1], 0x0000000000000016); + pw.set_u64_target(input_state[4][2], 0x0000000000000017); + pw.set_u64_target(input_state[4][3], 0x0000000000000018); + pw.set_u64_target(input_state[4][4], 0x0000000000000019); + + let proof = data.prove(pw).unwrap(); + assert!(data.verify(proof).is_ok()); + } +} \ No newline at end of file diff --git a/hash/plonky2/src/bench/poseidon.rs b/hash/plonky2/src/bench/poseidon.rs index 0208f1e..2663997 100644 --- a/hash/plonky2/src/bench/poseidon.rs +++ b/hash/plonky2/src/bench/poseidon.rs @@ -1,14 +1,12 @@ use anyhow::Result; use plonky2::field::types::Field; -// use plonky2::hash::hash_types::{HashOutTarget, RichField}; use plonky2::field::goldilocks_field::GoldilocksField; -// use plonky2::hash::keccak; -// use plonky2::hash::keccak::KeccakHash; + use plonky2::hash::poseidon::PoseidonHash; use plonky2::iop::witness::{PartialWitness, WitnessWrite}; use plonky2::plonk::circuit_builder::CircuitBuilder; use plonky2::plonk::circuit_data::CircuitConfig; -use plonky2::plonk::config::{/*AlgebraicHasher,*/ GenericConfig, PoseidonGoldilocksConfig}; +use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig}; use rand::Rng; use std::time; diff --git a/hash/plonky2/src/main.rs b/hash/plonky2/src/main.rs index a87e42b..3981027 100644 --- a/hash/plonky2/src/main.rs +++ b/hash/plonky2/src/main.rs @@ -1,6 +1,5 @@ use std::process; mod bench{ - pub mod keccak; pub mod poseidon; pub mod sha256{ pub mod constants; @@ -13,6 +12,15 @@ mod bench{ pub mod ch; } + + pub mod keccak256{ + pub mod theta; + pub mod rho; + pub mod pi; + pub mod iota; + pub mod chi; + pub mod keccak; + } } mod arithmetic { @@ -22,7 +30,7 @@ mod arithmetic { } use bench::poseidon::poseidon_bench; -use bench::keccak::keccak_bench; +use bench::keccak256::keccak::keccak_bench; use bench::sha256::sha::sha256_bench; fn main() { From 1199701caaa5df16c73afaeb6bd3a7ee32ec9c97 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Mon, 15 Jul 2024 22:38:42 +0530 Subject: [PATCH 33/41] plonky2 circuit for keccak256. code taken from https://github.com/qope/plonky2-keccak256/tree/main --- hash/plonky2/Cargo.toml | 2 + hash/plonky2/src/arithmetic/u64_arithmetic.rs | 5 + hash/plonky2/src/bench/keccak256/chi.rs | 25 - hash/plonky2/src/bench/keccak256/iota.rs | 30 - hash/plonky2/src/bench/keccak256/keccak.rs | 1146 +++++++---------- hash/plonky2/src/bench/keccak256/pi.rs | 20 - hash/plonky2/src/bench/keccak256/rho.rs | 27 - hash/plonky2/src/bench/keccak256/theta.rs | 204 --- hash/plonky2/src/main.rs | 5 - 9 files changed, 493 insertions(+), 971 deletions(-) delete mode 100644 hash/plonky2/src/bench/keccak256/chi.rs delete mode 100644 hash/plonky2/src/bench/keccak256/iota.rs delete mode 100644 hash/plonky2/src/bench/keccak256/pi.rs delete mode 100644 hash/plonky2/src/bench/keccak256/rho.rs delete mode 100644 hash/plonky2/src/bench/keccak256/theta.rs diff --git a/hash/plonky2/Cargo.toml b/hash/plonky2/Cargo.toml index cc7a85d..25ac85f 100644 --- a/hash/plonky2/Cargo.toml +++ b/hash/plonky2/Cargo.toml @@ -13,6 +13,8 @@ plonky2 = "0.2.2" rand = "0.8.3" anyhow = "1.0.79" sha2 = "0.10" +tiny-keccak={version="2.0.2", features=["keccak"]} +hex="0.4.3" diff --git a/hash/plonky2/src/arithmetic/u64_arithmetic.rs b/hash/plonky2/src/arithmetic/u64_arithmetic.rs index c33d2be..01b8c0f 100644 --- a/hash/plonky2/src/arithmetic/u64_arithmetic.rs +++ b/hash/plonky2/src/arithmetic/u64_arithmetic.rs @@ -18,6 +18,7 @@ pub trait CircuitBuilderU64, const D: usize> { fn zero_u64(&mut self) -> U64Target; fn not_u64(&mut self, a: U64Target) -> U64Target; + fn add_virtual_u64_target(&mut self) -> U64Target; } impl, const D: usize> CircuitBuilderU64 @@ -57,4 +58,8 @@ impl, const D: usize> CircuitBuilderU64 fn not_u64(&mut self, a: U64Target) -> U64Target { U64Target([self.not_u32(a.0[0]), self.not_u32(a.0[1])]) } + + fn add_virtual_u64_target(&mut self) -> U64Target { + U64Target([U32Target(self.add_virtual_target()),U32Target(self.add_virtual_target())]) + } } \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak256/chi.rs b/hash/plonky2/src/bench/keccak256/chi.rs deleted file mode 100644 index 5dd266b..0000000 --- a/hash/plonky2/src/bench/keccak256/chi.rs +++ /dev/null @@ -1,25 +0,0 @@ -use plonky2::hash::hash_types::RichField; -use plonky2::plonk::circuit_builder::CircuitBuilder; -use plonky2::field::extension::Extendable; -use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; - -use crate::arithmetic::u64_arithmetic::U64Target; - -pub fn chi, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5] -){ - for x in 0..5 { - let mut temp = [builder.zero_u64(); 5]; - for y in 0..5 { - temp[y] = state[x][y]; - } - - - for y in 0..5 { - let t1 = builder.not_u64(temp[(y + 1) % 5]); - let t2 = builder.and_u64(t1, temp[(y + 2) % 5]); - state[x][y] = builder.xor_u64(state[x][y], t2); - } - } -} \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak256/iota.rs b/hash/plonky2/src/bench/keccak256/iota.rs deleted file mode 100644 index 511495c..0000000 --- a/hash/plonky2/src/bench/keccak256/iota.rs +++ /dev/null @@ -1,30 +0,0 @@ -use plonky2::hash::hash_types::RichField; -use plonky2::plonk::circuit_builder::CircuitBuilder; -use plonky2::field::extension::Extendable; -use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; - -use crate::arithmetic::u64_arithmetic::U64Target; -use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; - -const KECCAK_ROUNDS: usize = 24; - -const ROUND_CONSTANTS: [u64; KECCAK_ROUNDS] = [ - 0x0000000000000001, 0x0000000000008082, 0x800000000000808A, 0x8000000080008000, - 0x000000000000808B, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009, - 0x000000000000008A, 0x0000000000000088, 0x0000000080008009, 0x000000008000000A, - 0x000000008000808B, 0x800000000000008B, 0x8000000000008089, 0x8000000000008003, - 0x8000000000008002, 0x8000000000000080, 0x000000000000800A, 0x800000008000000A, - 0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008, -]; - -//iota -pub fn iota, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5], - round: usize -){ - - let lo = builder.constant_u32((ROUND_CONSTANTS[round] & 0xFFFFFFFF) as u32); - let hi = builder.constant_u32(((ROUND_CONSTANTS[round] >> 32)& 0xFFFFFFFF) as u32); - state[0][0] = builder.xor_u64(state[0][0], U64Target([lo,hi])) ; -} \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak256/keccak.rs b/hash/plonky2/src/bench/keccak256/keccak.rs index 79920c9..715c69b 100644 --- a/hash/plonky2/src/bench/keccak256/keccak.rs +++ b/hash/plonky2/src/bench/keccak256/keccak.rs @@ -1,699 +1,525 @@ -use plonky2::field::types::Field; -use plonky2::field::goldilocks_field::GoldilocksField; -use plonky2::hash::keccak::KeccakHash; -use plonky2::plonk::circuit_builder::CircuitBuilder; -use plonky2::plonk::circuit_data::CircuitConfig; -use plonky2::plonk::config::{GenericConfig, KeccakGoldilocksConfig}; +// code taken from https://github.com/qope/plonky2-keccak256/tree/main + +use std::marker::PhantomData; + +use plonky2::{ + field::extension::Extendable, + hash::hash_types::RichField, + iop::{ + target::BoolTarget, + witness::{PartialWitness, WitnessWrite}, + }, + plonk::circuit_builder::CircuitBuilder, + field::goldilocks_field::GoldilocksField, +}; +use std::time::Instant; use rand::Rng; -use plonky2::field::extension::Extendable; -use plonky2::plonk::config::Hasher; -use plonky2::hash::hash_types::RichField; -use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; -use crate::arithmetic::u64_arithmetic::U64Target; -use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; -use plonky2::iop::witness::Witness; -use plonky2::field::types::PrimeField64; -use super::{chi::chi, iota::iota, pi::pi, rho::rho, theta::theta}; -fn generate_data(size: usize) -> Vec { +use tiny_keccak::Keccak; +use tiny_keccak::Hasher; +use plonky2::plonk::circuit_data::CircuitConfig; +use plonky2::plonk::config::PoseidonGoldilocksConfig; +use anyhow::Result; - let mut data: Vec = Vec::new(); - for _ in 0..(1< { + pub bits: Vec, + _phantom: PhantomData, } - -pub trait WitnessU64: Witness { - fn set_u64_target(&mut self, target: U64Target, value: u64); - // fn get_u64_target(&self, target: U64Target) -> (u64, u64); -} - -impl, F: PrimeField64> WitnessU64 for T { - fn set_u64_target(&mut self, target: U64Target, value: u64) { - self.set_target(target.0[0].0, F::from_canonical_u32((value & 0xFFFFFFFF) as u32)); - self.set_target(target.0[1].0, F::from_canonical_u32(((value >> 32) & 0xFFFFFFFF) as u32)); - } - - // fn get_u64_target(&self, target: U64Target) -> (u64, u64) { - // let x_u64 = self.get_target(target.0[0].0).to_canonical_u64(); - // let y_u64 = self.get_target(target.0[1].0).to_canonical_u64(); - - - // (x_u64, y_u64) - // } -} - -// TODO: Circuit needs to be implemented -pub fn keccak_bench(_size: usize) { - - let data = generate_data(2); - const D: usize = 2; - type C = KeccakGoldilocksConfig; - type F = >::F; - - let config = CircuitConfig::standard_recursion_config(); - let mut builder = CircuitBuilder::::new(config); - - let _initial = builder.add_virtual_targets(data.len()); - - let hash = KeccakHash::<32>::hash_or_noop(&data); - eprintln!("{:?}", hash); - -} - - -//---------------------------------------------------------- - - -// const KECCAK_WIDTH: usize = 1600; -const KECCAK_RATE: usize = 1088; -// const KECCAK_CAPACITY: usize = KECCAK_WIDTH - KECCAK_RATE; -// const KECCAK_LANES: usize = KECCAK_WIDTH / 64; - -// permutation -fn keccak_f, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5] -) { - for i in 0..24 { - let _ = theta(builder, state); - let _ = rho(builder, state); - let _ = pi(builder, state); - let _ = chi(builder, state); - let _ = iota(builder, state, i); - } -} - - -fn absorb, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5], - message: &[U64Target], - rate: usize -) { - let chunks = message.chunks(rate / 64); - for block in chunks { - for (i, &word) in block.iter().enumerate() { - let x = i % 5; - let y = i / 5; - state[x][y] = builder.xor_u64(state[x][y], word); +impl U64Target +where + F: RichField + Extendable, +{ + pub fn new(builder: &mut CircuitBuilder) -> Self { + let mut result = vec![]; + for _ in 0..64 { + result.push(builder.add_virtual_bool_target_safe()); } - keccak_f(builder, state); // Assume keccak_f is implemented as a circuit - } -} - - -fn squeeze, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5], - rate: usize, - output_length: usize -) -> Vec { - let mut hash = Vec::new(); - while hash.len() * 8 < output_length { - for y in 0..5 { - for x in 0..5 { - if (x + 5 * y) * 64 < rate { - hash.push(state[x][y]); - if hash.len() * 8 >= output_length { - return hash; - } - } - } + Self { + bits: result, + _phantom: PhantomData, + } + } + + pub fn from(bits: Vec) -> Self { + assert_eq!(bits.len(), 64); + Self { + bits, + _phantom: PhantomData, + } + } + + pub fn set_witness(&self, bits: Vec, pw: &mut PartialWitness) { + for i in 0..64 { + pw.set_bool_target(self.bits[i], bits[i]); + } + } + + pub fn constant(x: u64, builder: &mut CircuitBuilder) -> Self { + let mut result = vec![]; + let x_bits = u64_to_bits(x); + for i in 0..64 { + result.push(builder.constant_bool(x_bits[i])); + } + Self { + bits: result, + _phantom: PhantomData, + } + } + + pub fn connect(&self, other: &Self, builder: &mut CircuitBuilder) { + for i in 0..64 { + builder.connect(self.bits[i].target, other.bits[i].target); + } + } + + pub fn to_bits(&self, builder: &mut CircuitBuilder) -> Vec { + let output = Self::new(builder); + self.connect(&output, builder); + output.bits + } + + pub fn xor(&self, other: &Self, builder: &mut CircuitBuilder) -> Self { + let mut result = vec![]; + for i in 0..64 { + let xor_target = xor_circuit(self.bits[i], other.bits[i], builder); + result.push(xor_target); + } + Self { + bits: result, + _phantom: PhantomData, + } + } + + pub fn xor_const(&self, other: u64, builder: &mut CircuitBuilder) -> Self { + let other_bits = u64_to_bits(other); + let mut result = vec![]; + for i in 0..64 { + let xor_target = xor_const_circuit(self.bits[i], other_bits[i], builder); + result.push(xor_target); + } + Self { + bits: result, + _phantom: PhantomData, + } + } + + /* Rotate left by n + * Note that the input parameter n is constant. It is not necessary to make n a constant target or public input, + * because different n generates a different circuit. + */ + pub fn rotl(&self, n: usize) -> Self { + let rotate = rotate_u64(n); + let mut output = vec![]; + for i in 0..64 { + output.push(self.bits[rotate[i]]); + } + + Self { + bits: output, + _phantom: PhantomData, + } + } + + pub fn and(&self, other: &Self, builder: &mut CircuitBuilder) -> Self { + let mut result = vec![]; + for i in 0..64 { + result.push(builder.and(self.bits[i], other.bits[i])); + } + Self { + bits: result, + _phantom: PhantomData, + } + } + + pub fn not(&self, builder: &mut CircuitBuilder) -> Self { + let mut result = vec![]; + for i in 0..64 { + result.push(builder.not(self.bits[i])); + } + Self { + bits: result, + _phantom: PhantomData, + } + } + + /// Calculate `self & !other`. + pub fn and_not(&self, other: &Self, builder: &mut CircuitBuilder) -> Self { + let mut result = vec![]; + for i in 0..64 { + // x(1 - y) = x - xy + result.push(BoolTarget::new_unsafe(builder.arithmetic( + F::NEG_ONE, + F::ONE, + self.bits[i].target, + other.bits[i].target, + self.bits[i].target, + ))); + } + Self { + bits: result, + _phantom: PhantomData, } - keccak_f(builder, state); // Assume keccak_f is implemented as a circuit } - hash } - -fn keccak_pad, const D: usize>( +pub fn xor_circuit( + a: BoolTarget, + b: BoolTarget, builder: &mut CircuitBuilder, - message: &[U64Target], - rate: usize -) -> Vec { - let mut padded_message = message.to_vec(); - let rate_words = rate / 64; - let mut pad_len = rate_words - (message.len() % rate_words); - - if pad_len == 0 { - pad_len = rate_words; - } +) -> BoolTarget +where + F: RichField + Extendable, +{ + // a = 0, b = 0 => 0 + // a = 1, b = 0 => 1 + // a = 0, b = 1 => 1 + // a = 1, b = 1 => 0 + // xor(a, b) = a*(1-b) + (1-a)*b = a + b - 2*ab + let b_minus_2ab = builder.arithmetic(-F::TWO, F::ONE, a.target, b.target, b.target); + let a_plus_b_minus_2ab = builder.add(a.target, b_minus_2ab); + // let c = builder.add_virtual_bool_target_safe(); + // builder.connect(c.target, a_plus_b_neg_two_ab); - if pad_len == 1 { - padded_message.push(U64Target([builder.one_u32(), builder.one_u32()])); + BoolTarget::new_unsafe(a_plus_b_minus_2ab) +} + +pub fn xor_const_circuit( + a: BoolTarget, + b: bool, + builder: &mut CircuitBuilder, +) -> BoolTarget +where + F: RichField + Extendable, +{ + // b = 0 => xor(a, b) = a + // b = 1 => xor(a, b) = 1 - a = not(a) + if b { + builder.not(a) } else { - padded_message.push(U64Target([builder.one_u32(), builder.zero_u32()])); - for _ in 1..(pad_len - 1) { - padded_message.push(U64Target([builder.zero_u32(), builder.zero_u32()])); + a + } +} + +// reffered to https://github.com/polymerdao/plonky2-sha256 +/// 0 -> [0, 1, 2, ..., 63] +/// 1 -> [63, 0, 1, ..., 62] +/// 63 -> [1, 2, ..., 63, 0] +fn rotate_u64(y: usize) -> Vec { + let mut res = Vec::new(); + for i in 64 - y..64 { + res.push(i); + } + for i in 0..64 - y { + res.push(i); + } + res +} + +pub fn from_bits_to_u64(bools: &[bool]) -> u64 { + let mut result: u64 = 0; + let mut shift = 0; + for &bit in bools { + if bit { + result |= 1 << shift; + } + shift += 1; + if shift == 64 { + break; + } + } + result +} + +pub fn u64_to_bits(num: u64) -> Vec { + let mut result = Vec::with_capacity(64); + let mut n = num; + for _ in 0..64 { + result.push(n & 1 == 1); + n >>= 1; + } + result +} + +pub const ROUND_CONSTANTS: [u64; 24] = [ + 1u64, + 0x8082u64, + 0x800000000000808au64, + 0x8000000080008000u64, + 0x808bu64, + 0x80000001u64, + 0x8000000080008081u64, + 0x8000000000008009u64, + 0x8au64, + 0x88u64, + 0x80008009u64, + 0x8000000au64, + 0x8000808bu64, + 0x800000000000008bu64, + 0x8000000000008089u64, + 0x8000000000008003u64, + 0x8000000000008002u64, + 0x8000000000000080u64, + 0x800au64, + 0x800000008000000au64, + 0x8000000080008081u64, + 0x8000000000008080u64, + 0x80000001u64, + 0x8000000080008008u64, +]; +pub const ROTR: [usize; 25] = [ + 0, 1, 62, 28, 27, 36, 44, 6, 55, 20, 3, 10, 43, 25, 39, 41, 45, 15, 21, 8, 18, 2, 61, 56, 14, +]; + +#[derive(Clone, Debug)] +pub struct KeccakTarget { + words: Vec>, + _phantom: PhantomData, +} + +impl KeccakTarget +where + F: RichField + Extendable, +{ + pub fn new(builder: &mut CircuitBuilder) -> Self { + let mut result = vec![]; + for _ in 0..25 { + result.push(U64Target::new(builder)); + } + Self { + words: result, + _phantom: PhantomData, } - padded_message.push(U64Target([builder.zero_u32(), builder.one_u32()])); } - padded_message + pub fn set_witness(&self, bits: Vec, pw: &mut PartialWitness) { + assert_eq!(bits.len(), 1600); + for i in 0..25 { + self.words[i].set_witness(bits[i * 64..(i + 1) * 64].to_vec(), pw); + } + } + + pub fn connect(&self, other: &Self, builder: &mut CircuitBuilder) { + for i in 0..25 { + self.words[i].connect(&other.words[i], builder); + } + } + + pub fn from(bits: Vec) -> Self { + let mut result = vec![]; + for i in 0..25 { + result.push(U64Target::from(bits[i * 64..(i + 1) * 64].to_vec())); + } + Self { + words: result, + _phantom: PhantomData, + } + } + + pub fn keccak_round(&mut self, rc: u64, builder: &mut CircuitBuilder) { + // θ step + let mut c = vec![]; + for x in 0..5 { + let xor01 = self.words[x].xor(&self.words[x + 5], builder); + let xor012 = xor01.xor(&self.words[x + 2 * 5], builder); + let xor0123 = xor012.xor(&self.words[x + 3 * 5], builder); + let xor01234 = xor0123.xor(&self.words[x + 4 * 5], builder); + c.push(xor01234); + } + let mut d = vec![]; + for x in 0..5 { + let rot_c = c[(x + 1) % 5].rotl(1); + d.push(c[(x + 4) % 5].xor(&rot_c, builder)); + } + for x in 0..5 { + for y in 0..5 { + self.words[x + y * 5] = self.words[x + y * 5].xor(&d[x], builder); + } + } + // ρ and π steps + let mut b_words: [Option>; 25] = [(); 25].map(|_| None); + for x in 0..5 { + for y in 0..5 { + let rot_self = self.words[x + y * 5].rotl(ROTR[x + y * 5]); + + b_words[y + ((2 * x + 3 * y) % 5) * 5] = Some(rot_self); + } + } + let b = KeccakTarget { + words: b_words.into_iter().map(|x| x.unwrap()).collect(), + _phantom: PhantomData, + }; + + // χ step + for x in 0..5 { + for y in 0..5 { + // b.words[(x + 2) % 5 + y * 5] & !b.words[(x + 1) % 5 + y * 5] + let and_not_b = + b.words[(x + 2) % 5 + y * 5].and_not(&b.words[(x + 1) % 5 + y * 5], builder); + self.words[x + y * 5] = b.words[x + y * 5].xor(&and_not_b, builder); + } + } + + self.words[0] = self.words[0].xor_const(rc, builder); + } + + pub fn keccakf(&self, builder: &mut CircuitBuilder) -> Self { + let mut result = self.clone(); + for round_constant in ROUND_CONSTANTS.into_iter().take(24) { + result.keccak_round(round_constant, builder); + } + + result + } } - -fn keccak256, const D: usize>( +pub fn keccak256_circuit( + input: Vec, builder: &mut CircuitBuilder, - message: &[U64Target] -) -> Vec { - let mut state = [[builder.zero_u64(); 5]; 5]; - let rate = KECCAK_RATE; +) -> Vec +where + F: RichField + Extendable, +{ + assert_eq!(input.len() % 8, 0); // input should be bytes. + let block_size_in_bytes = 136; // in bytes + let input_len_in_bytes = input.len() / 8; + let num_blocks = input_len_in_bytes / block_size_in_bytes + 1; - // Padding - let padded_message = keccak_pad(builder, message, rate); + let mut padded = vec![]; + for _ in 0..block_size_in_bytes * 8 * num_blocks { + padded.push(builder.add_virtual_bool_target_safe()); + } - // Absorbing - absorb(builder, &mut state, &padded_message, rate); + // register input + for i in 0..input_len_in_bytes * 8 { + builder.connect(padded[i].target, input[i].target); + } - // Squeezing - let hash = squeeze(builder, &mut state, rate, 256); + // append 0x01 = 1000 0000 after the last input + let true_target = builder.constant_bool(true); + builder.connect(padded[input_len_in_bytes * 8].target, true_target.target); - hash + // pad 0s + let false_target = builder.constant_bool(false); + let last_index = padded.len() - 1; + for i in input_len_in_bytes * 8 + 1..last_index { + builder.connect(padded[i].target, false_target.target); + } + + // xor 0x80 = 0000 0001 with the last byte. + // however the last bit is ensured to be 0, so just fill 1. + builder.connect(padded[last_index].target, true_target.target); + + let mut m = KeccakTarget::new(builder); + for i in 0..1600 { + let word = i / 64; + let bit = i % 64; + builder.connect(m.words[word].bits[bit].target, false_target.target); + } + + for i in 0..num_blocks { + for j in 0..block_size_in_bytes * 8 { + let word = j / 64; + let bit = j % 64; + let xor_t = xor_circuit( + m.words[word].bits[bit], + padded[i * block_size_in_bytes * 8 + j], + builder, + ); + m.words[word].bits[bit] = xor_t; + } + m = m.keccakf(builder); + } + + let mut z = Vec::new(); + for i in 0..256 { + let new_target = builder.add_virtual_bool_target_safe(); + let word = i / 64; + let bit = i % 64; + builder.connect(new_target.target, m.words[word].bits[bit].target); + z.push(new_target); + } + z } -#[test] -fn test_keccak256() { - // use plonky2_u32::gadgets::arithmetic_u32::U32Target; - // use plonky2::iop::target::Target; - use plonky2::iop::witness::PartialWitness; - use plonky2::plonk::config::PoseidonGoldilocksConfig; - use rand::RngCore; +pub fn keccak_bench(size: usize) -> Result<()>{ + + type F = GoldilocksField; + type C = PoseidonGoldilocksConfig; + const D: usize = 2; - // use plonky2_u32::witness::WitnessU32; - type F = GoldilocksField; // Choose the field used in your implementation. - const D: usize = 2; // This should match the extension degree used. + let input_bytes = generate_data(size); + let input = hex::encode(input_bytes); + let expected_output = expected_keccak(&hex::decode(input.clone()).unwrap()); + + let input_bits = hex_str_to_bits(input.as_str())?; + let exptected_output_bits = hex_str_to_bits(&expected_output)?; - // Create circuit builder. let config = CircuitConfig::standard_recursion_config(); let mut builder = CircuitBuilder::::new(config); - // Example input message - let mut input = [0u8; 8]; - let _ = rand::thread_rng().try_fill_bytes(&mut input); + let mut input_t = vec![]; + for i in 0..input_bits.len() { + input_t.push(builder.constant_bool(input_bits[i])); + } + let output_t = keccak256_circuit(input_t, &mut builder); - // let input = b"hello world"; - eprintln!("{:?}", input.len()); - // Convert input to U64Target format used in your Keccak circuit. - let input_u64: Vec = input.chunks(8) - .map(|chunk| { - let mut chunk_padded = [0u8; 8]; - chunk_padded[..chunk.len()].copy_from_slice(chunk); - let value = u64::from_le_bytes(chunk_padded); - U64Target([ - builder.constant_u32(value as u32), - builder.constant_u32((value >> 32) as u32), - ]) - }) - .collect(); - - - - // Build the Keccak-256 circuit. - let _ = keccak256(&mut builder, &input_u64); - - eprintln!("{:?}", builder.num_gates()); - - // Generate the circuit and witness. - let data = builder.build::(); let mut pw = PartialWitness::new(); - - let input_u64_plain: Vec = input.chunks(8) - .map(|chunk| { - let mut chunk_padded = [0u8; 8]; - chunk_padded[..chunk.len()].copy_from_slice(chunk); - u64::from_le_bytes(chunk_padded) - }) - .collect(); - - for (i, &byte) in input_u64_plain.iter().enumerate() { - pw.set_u64_target(input_u64[i], byte as u64); + for i in 0..256 { + pw.set_bool_target(output_t[i], exptected_output_bits[i]); } - // Run the circuit. - let hash_result = data.prove(pw).unwrap(); + println!("circuit size: {:?}", builder.num_gates()); + let data = builder.build::(); + let now = Instant::now(); + let proof = data.prove(pw)?; - let _ = data.verify(hash_result.clone()); - - // Extract the hash result from the circuit output. - // let mut output_bytes = Vec::new(); - // for target in hash_targets { - // let lo = hash_result.get_u32(target.0[0]) as u64; - // let hi = (hash_result.get_u32(target.0[1]) as u64) << 32; - // let combined = lo | hi; - // output_bytes.extend_from_slice(&combined.to_le_bytes()); - // } + println!("time = {:?}", now.elapsed()); + println!( + "degree = {}, degree_bits= {}", + data.common.degree(), + data.common.degree_bits() + ); - // // Truncate to 256 bits (32 bytes). - // output_bytes.truncate(32); - - // // Compute the expected hash using a reference implementation. - // let expected_hash = keccak256_reference(input); - - // // Compare the circuit output with the expected hash. - // assert_eq!(output_bytes, expected_hash, "Keccak-256 hash mismatch"); - - println!("{:?}",hash_result.get_public_inputs_hash()); -} - - -#[cfg(test)] -mod tests { - use super::*; - use plonky2::field::goldilocks_field::GoldilocksField; - // use plonky2::field::types::Field; - use plonky2::hash::hash_types::RichField; - use plonky2::iop::witness::{PartialWitness/* , Witness*/}; - use plonky2::plonk::circuit_builder::CircuitBuilder; - use plonky2::plonk::circuit_data::CircuitConfig; - use plonky2::plonk::config::PoseidonGoldilocksConfig; - // use plonky2_u32::gadgets::arithmetic_u32::U32Target; - use crate::arithmetic::u64_arithmetic::U64Target; - - fn create_u64_target, const D: usize>( - builder: &mut CircuitBuilder, - value: u64 - ) -> U64Target { - let lo = value as u32; - let hi = (value >> 32) as u32; - U64Target([builder.constant_u32(lo), builder.constant_u32(hi)]) - } - - #[test] - fn test_theta_function() { - type F = GoldilocksField; - const D: usize = 2; - - // Create circuit builder - let config = CircuitConfig::standard_recursion_config(); - let mut builder = CircuitBuilder::::new(config); - - // Input state - let input_state: [[U64Target; 5]; 5] = [ - [ - create_u64_target(&mut builder, 0x0000000000000001), - create_u64_target(&mut builder, 0x0000000000000002), - create_u64_target(&mut builder, 0x0000000000000003), - create_u64_target(&mut builder, 0x0000000000000004), - create_u64_target(&mut builder, 0x0000000000000005) - ], - [ - create_u64_target(&mut builder, 0x0000000000000006), - create_u64_target(&mut builder, 0x0000000000000007), - create_u64_target(&mut builder, 0x0000000000000008), - create_u64_target(&mut builder, 0x0000000000000009), - create_u64_target(&mut builder, 0x000000000000000A) - ], - [ - create_u64_target(&mut builder, 0x000000000000000B), - create_u64_target(&mut builder, 0x000000000000000C), - create_u64_target(&mut builder, 0x000000000000000D), - create_u64_target(&mut builder, 0x000000000000000E), - create_u64_target(&mut builder, 0x000000000000000F) - ], - [ - create_u64_target(&mut builder, 0x0000000000000010), - create_u64_target(&mut builder, 0x0000000000000011), - create_u64_target(&mut builder, 0x0000000000000012), - create_u64_target(&mut builder, 0x0000000000000013), - create_u64_target(&mut builder, 0x0000000000000014) - ], - [ - create_u64_target(&mut builder, 0x0000000000000015), - create_u64_target(&mut builder, 0x0000000000000016), - create_u64_target(&mut builder, 0x0000000000000017), - create_u64_target(&mut builder, 0x0000000000000018), - create_u64_target(&mut builder, 0x0000000000000019) - ] - ]; - - // Expected output state (after theta) - let expected_state = [ - [ - create_u64_target(&mut builder, 0x7B7B7B7B7B7B7B7B), - create_u64_target(&mut builder, 0x8B8B8B8B8B8B8B8B), - create_u64_target(&mut builder, 0x9B9B9B9B9B9B9B9B), - create_u64_target(&mut builder, 0xABABABABABABABAB), - create_u64_target(&mut builder, 0xBBBBBBBBBBBBBBBB) - ], - [ - create_u64_target(&mut builder, 0xCBCBCBCBCBCBCBCB), - create_u64_target(&mut builder, 0xDBDBDBDBDBDBDBDB), - create_u64_target(&mut builder, 0xEBEBEBEBEBEBEBEB), - create_u64_target(&mut builder, 0xFBFBFBFBFBFBFBFB), - create_u64_target(&mut builder, 0x0B0B0B0B0B0B0B0B) - ], - [ - create_u64_target(&mut builder, 0x1B1B1B1B1B1B1B1B), - create_u64_target(&mut builder, 0x2B2B2B2B2B2B2B2B), - create_u64_target(&mut builder, 0x3B3B3B3B3B3B3B3B), - create_u64_target(&mut builder, 0x4B4B4B4B4B4B4B4B), - create_u64_target(&mut builder, 0x5B5B5B5B5B5B5B5B) - ], - [ - create_u64_target(&mut builder, 0x6B6B6B6B6B6B6B6B), - create_u64_target(&mut builder, 0x7B7B7B7B7B7B7B7B), - create_u64_target(&mut builder, 0x8B8B8B8B8B8B8B8B), - create_u64_target(&mut builder, 0x9B9B9B9B9B9B9B9B), - create_u64_target(&mut builder, 0xABABABABABABABAB) - ], - [ - create_u64_target(&mut builder, 0xBBBBBBBBBBBBBBBB), - create_u64_target(&mut builder, 0xCBCBCBCBCBCBCBCB), - create_u64_target(&mut builder, 0xDBDBDBDBDBDBDBDB), - create_u64_target(&mut builder, 0xEBEBEBEBEBEBEBEB), - create_u64_target(&mut builder, 0xFBFBFBFBFBFBFBFB) - ] - ]; - - // Run the theta function - let mut state = input_state; - theta(&mut builder, &mut state); - - - // Check if the output state matches the expected state - for x in 0..5 { - for y in 0..5 { - for i in 0..2 { - println!("Comparing: {:?} and {:?}", state[x][y].0[i].0, expected_state[x][y].0[i].0); - let res = builder.is_equal(state[x][y].0[i].0, expected_state[x][y].0[i].0); - builder.assert_bool(res); - } - } - } - - println!("{:?}", builder.num_gates()); - // Build the circuit - let data = builder.build::(); - - // Create witness and prove - let mut pw = PartialWitness::new(); - pw.set_u64_target(input_state[0][0], 0x0000000000000001); - pw.set_u64_target(input_state[0][1], 0x0000000000000002); - pw.set_u64_target(input_state[0][2], 0x0000000000000003); - pw.set_u64_target(input_state[0][3], 0x0000000000000004); - pw.set_u64_target(input_state[0][4], 0x0000000000000005); - pw.set_u64_target(input_state[1][0], 0x0000000000000006); - pw.set_u64_target(input_state[1][1], 0x0000000000000007); - pw.set_u64_target(input_state[1][2], 0x0000000000000008); - pw.set_u64_target(input_state[1][3], 0x0000000000000009); - pw.set_u64_target(input_state[1][4], 0x000000000000000A); - pw.set_u64_target(input_state[2][0], 0x000000000000000B); - pw.set_u64_target(input_state[2][1], 0x000000000000000C); - pw.set_u64_target(input_state[2][2], 0x000000000000000D); - pw.set_u64_target(input_state[2][3], 0x000000000000000E); - pw.set_u64_target(input_state[2][4], 0x000000000000000F); - pw.set_u64_target(input_state[3][0], 0x0000000000000010); - pw.set_u64_target(input_state[3][1], 0x0000000000000011); - pw.set_u64_target(input_state[3][2], 0x0000000000000012); - pw.set_u64_target(input_state[3][3], 0x0000000000000013); - pw.set_u64_target(input_state[3][4], 0x0000000000000014); - pw.set_u64_target(input_state[4][0], 0x0000000000000015); - pw.set_u64_target(input_state[4][1], 0x0000000000000016); - pw.set_u64_target(input_state[4][2], 0x0000000000000017); - pw.set_u64_target(input_state[4][3], 0x0000000000000018); - pw.set_u64_target(input_state[4][4], 0x0000000000000019); - - let proof = data.prove(pw).unwrap(); - assert!(data.verify(proof).is_ok()); - } - - - #[test] - fn test_rho_function() { - type F = GoldilocksField; - const D: usize = 2; - - // Create circuit builder - let config = CircuitConfig::standard_recursion_config(); - let mut builder = CircuitBuilder::::new(config); - - // Input state (example, should be taken from an authoritative source) - let input_state = [ - [ - create_u64_target(&mut builder, 0x0000000000000001), - create_u64_target(&mut builder, 0x0000000000000002), - create_u64_target(&mut builder, 0x0000000000000003), - create_u64_target(&mut builder, 0x0000000000000004), - create_u64_target(&mut builder, 0x0000000000000005) - ], - [ - create_u64_target(&mut builder, 0x0000000000000006), - create_u64_target(&mut builder, 0x0000000000000007), - create_u64_target(&mut builder, 0x0000000000000008), - create_u64_target(&mut builder, 0x0000000000000009), - create_u64_target(&mut builder, 0x000000000000000A) - ], - [ - create_u64_target(&mut builder, 0x000000000000000B), - create_u64_target(&mut builder, 0x000000000000000C), - create_u64_target(&mut builder, 0x000000000000000D), - create_u64_target(&mut builder, 0x000000000000000E), - create_u64_target(&mut builder, 0x000000000000000F) - ], - [ - create_u64_target(&mut builder, 0x0000000000000010), - create_u64_target(&mut builder, 0x0000000000000011), - create_u64_target(&mut builder, 0x0000000000000012), - create_u64_target(&mut builder, 0x0000000000000013), - create_u64_target(&mut builder, 0x0000000000000014) - ], - [ - create_u64_target(&mut builder, 0x0000000000000015), - create_u64_target(&mut builder, 0x0000000000000016), - create_u64_target(&mut builder, 0x0000000000000017), - create_u64_target(&mut builder, 0x0000000000000018), - create_u64_target(&mut builder, 0x0000000000000019) - ] - ]; - - // Expected state after rho (example, should be taken from an authoritative source) - let expected_state = [ - [ - create_u64_target(&mut builder, 0x0000000000000001), - create_u64_target(&mut builder, 0x0000000000000100), - create_u64_target(&mut builder, 0x0000000000003000), - create_u64_target(&mut builder, 0x0000000000040000), - create_u64_target(&mut builder, 0x0000000000500000) - ], - [ - create_u64_target(&mut builder, 0x0000000000600000), - create_u64_target(&mut builder, 0x0000000000700000), - create_u64_target(&mut builder, 0x0000000008000000), - create_u64_target(&mut builder, 0x0000000009000000), - create_u64_target(&mut builder, 0x00000000A0000000) - ], - [ - create_u64_target(&mut builder, 0x00000000B0000000), - create_u64_target(&mut builder, 0x00000000C0000000), - create_u64_target(&mut builder, 0x0000000D00000000), - create_u64_target(&mut builder, 0x0000000E00000000), - create_u64_target(&mut builder, 0x0000000F00000000) - ], - [ - create_u64_target(&mut builder, 0x0000001000000000), - create_u64_target(&mut builder, 0x0000001100000000), - create_u64_target(&mut builder, 0x0000001200000000), - create_u64_target(&mut builder, 0x0000001300000000), - create_u64_target(&mut builder, 0x0000001400000000) - ], - [ - create_u64_target(&mut builder, 0x0000001500000000), - create_u64_target(&mut builder, 0x0000001600000000), - create_u64_target(&mut builder, 0x0000001700000000), - create_u64_target(&mut builder, 0x0000001800000000), - create_u64_target(&mut builder, 0x0000001900000000) - ] - ]; - - // Run the rho function - let mut state = input_state; - rho(&mut builder, &mut state); - // Check if the output state matches the expected state - for x in 0..5 { - for y in 0..5 { - let res = builder.is_equal(state[x][y].0[0].0, expected_state[x][y].0[0].0); - let res2 = builder.is_equal(state[x][y].0[1].0, expected_state[x][y].0[1].0); - - builder.assert_bool(res); - builder.assert_bool(res2); - } - } - - println!("{:?}", builder.num_gates()); - // Build the circuit - let data = builder.build::(); - - // Create witness and prove - let pw = PartialWitness::new(); - let proof = data.prove(pw).unwrap(); - assert!(data.verify(proof).is_ok()); - } - - - #[test] - fn test_keccak256_permutation() { - type F = GoldilocksField; - const D: usize = 2; - - // Create circuit builder - let config = CircuitConfig::standard_recursion_config(); - let mut builder = CircuitBuilder::::new(config); - - // Input state (example, should be taken from an authoritative source) - let input_state = [ - [ - create_u64_target(&mut builder, 0x0000000000000001), - create_u64_target(&mut builder, 0x0000000000000002), - create_u64_target(&mut builder, 0x0000000000000003), - create_u64_target(&mut builder, 0x0000000000000004), - create_u64_target(&mut builder, 0x0000000000000005) - ], - [ - create_u64_target(&mut builder, 0x0000000000000006), - create_u64_target(&mut builder, 0x0000000000000007), - create_u64_target(&mut builder, 0x0000000000000008), - create_u64_target(&mut builder, 0x0000000000000009), - create_u64_target(&mut builder, 0x000000000000000A) - ], - [ - create_u64_target(&mut builder, 0x000000000000000B), - create_u64_target(&mut builder, 0x000000000000000C), - create_u64_target(&mut builder, 0x000000000000000D), - create_u64_target(&mut builder, 0x000000000000000E), - create_u64_target(&mut builder, 0x000000000000000F) - ], - [ - create_u64_target(&mut builder, 0x0000000000000010), - create_u64_target(&mut builder, 0x0000000000000011), - create_u64_target(&mut builder, 0x0000000000000012), - create_u64_target(&mut builder, 0x0000000000000013), - create_u64_target(&mut builder, 0x0000000000000014) - ], - [ - create_u64_target(&mut builder, 0x0000000000000015), - create_u64_target(&mut builder, 0x0000000000000016), - create_u64_target(&mut builder, 0x0000000000000017), - create_u64_target(&mut builder, 0x0000000000000018), - create_u64_target(&mut builder, 0x0000000000000019) - ] - ]; - - // Expected state after keccak256 permutation (example, should be taken from an authoritative source) - let expected_state = [ - [ - create_u64_target(&mut builder, 0xE69F6BAE986CCF06), - create_u64_target(&mut builder, 0xDF9D77905A3546B6), - create_u64_target(&mut builder, 0x7BFBFFF923073CEB), - create_u64_target(&mut builder, 0xB2D9AB3E200FD999), - create_u64_target(&mut builder, 0x1A741CAEC020555C) - ], - [ - create_u64_target(&mut builder, 0x56D7B52E1442C0AE), - create_u64_target(&mut builder, 0xEBA39A0E00EF9FE9), - create_u64_target(&mut builder, 0x2D6FF9BE61A295EE), - create_u64_target(&mut builder, 0xC82D01AE6E142988), - create_u64_target(&mut builder, 0xCDEDECBAD32B9246) - ], - [ - create_u64_target(&mut builder, 0x7AF13F3C6F6E4AF6), - create_u64_target(&mut builder, 0xBD469F697CCF7B91), - create_u64_target(&mut builder, 0xAB4F902ED5B9FD93), - create_u64_target(&mut builder, 0xFC4F6A6C27E0190B), - create_u64_target(&mut builder, 0x3D41F5EF85540B06) - ], - [ - create_u64_target(&mut builder, 0x2D9F050A3E1600F4), - create_u64_target(&mut builder, 0x0ED46287DA8AA931), - create_u64_target(&mut builder, 0xA13AD679DFAA4EA3), - create_u64_target(&mut builder, 0x70B1D7A7C896E12A), - create_u64_target(&mut builder, 0xA2CF9C93C5326E0D) - ], - [ - create_u64_target(&mut builder, 0x2CE66FBC3AC94F5B), - create_u64_target(&mut builder, 0x4960E539C1EF3BA7), - create_u64_target(&mut builder, 0xC7C50305DF46E1BB), - create_u64_target(&mut builder, 0xEE6FE33D998F8A8B), - create_u64_target(&mut builder, 0x2A971ED5399DC662) - ] - ]; - - // Run the keccak256 permutation function - let mut state = input_state; - keccak_f(&mut builder, &mut state); - - // Check if the output state matches the expected state - for x in 0..5 { - for y in 0..5 { - let res1 = builder.is_equal(state[x][y].0[0].0, expected_state[x][y].0[0].0); - let res2 = builder.is_equal(state[x][y].0[1].0, expected_state[x][y].0[1].0); - - builder.assert_bool(res1); - builder.assert_bool(res2); - } - } - println!("{:?}", builder.num_gates()); - // Build the circuit - let data = builder.build::(); - - // Create witness and prove - let pw = PartialWitness::new(); - let proof = data.prove(pw).unwrap(); - assert!(data.verify(proof).is_ok()); - } - - - #[test] - fn test_keccak256_hash() { - type F = GoldilocksField; - const D: usize = 2; - - // Create circuit builder - let config = CircuitConfig::standard_recursion_config(); - let mut builder = CircuitBuilder::::new(config); - - // Input message (example, should be taken from an authoritative source) - let input_message = vec![ - create_u64_target(&mut builder, 0x0000000000000001), - create_u64_target(&mut builder, 0x0000000000000002), - create_u64_target(&mut builder, 0x0000000000000003), - create_u64_target(&mut builder, 0x0000000000000004) - ]; - - // Expected hash (example, should be taken from an authoritative source) - let expected_hash = vec![ - create_u64_target(&mut builder, 0xA7FFC6F8BF1ED766), - create_u64_target(&mut builder, 0x51C14756A061D662), - create_u64_target(&mut builder, 0xF580FF4DE43B49FA), - create_u64_target(&mut builder, 0x82D80A4B80F8434A) - ]; - - // Run the keccak256 hash function - let hash = keccak256(&mut builder, &input_message); - - // Check if the output hash matches the expected hash - for i in 0..expected_hash.len() { - let res1 = builder.is_equal(hash[i].0[0].0, expected_hash[i].0[0].0); - let res2 = builder.is_equal(hash[i].0[1].0, expected_hash[i].0[1].0); - - builder.assert_bool(res1); - builder.assert_bool(res2); - } - - println!("{:?}", builder.num_gates()); - // Build the circuit - let data = builder.build::(); - - // Create witness and prove - let pw = PartialWitness::new(); - let proof = data.prove(pw).unwrap(); - assert!(data.verify(proof).is_ok()); - } + data.verify(proof)?; + Ok(()) } + +fn generate_data(size: usize) -> Vec { + + let mut rng = rand::thread_rng(); + let mut bytes = vec![0u8; size]; + rng.fill(&mut bytes[..]); + bytes +} + +fn u8_to_bits(num: u8) -> Vec { + let mut result = Vec::with_capacity(8); + let mut n = num; + for _ in 0..8 { + result.push(n & 1 == 1); + n >>= 1; + } + result +} + +fn hex_str_to_bits(input: &str) -> Result> { + let input_u8 = hex::decode(input)?; + let input_bits = input_u8 + .iter() + .flat_map(|x| u8_to_bits(*x)) + .collect::>(); + Ok(input_bits) +} + +fn expected_keccak(input: &[u8]) -> String { + let mut hasher = Keccak::v256(); + hasher.update(input); + let mut hash = [0u8; 32]; + hasher.finalize(&mut hash); + + hex::encode(hash) +} \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak256/pi.rs b/hash/plonky2/src/bench/keccak256/pi.rs deleted file mode 100644 index 5862c18..0000000 --- a/hash/plonky2/src/bench/keccak256/pi.rs +++ /dev/null @@ -1,20 +0,0 @@ -use plonky2::hash::hash_types::RichField; -use plonky2::plonk::circuit_builder::CircuitBuilder; -use plonky2::field::extension::Extendable; -use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; - -use crate::arithmetic::u64_arithmetic::U64Target; - -//pi -pub fn pi, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5] -){ - let mut new_state = [[builder.zero_u64(); 5]; 5]; - for x in 0..5 { - for y in 0..5 { - new_state[(2 * x + 3 * y) % 5][y] = state[x][y]; - } - } - *state = new_state; -} \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak256/rho.rs b/hash/plonky2/src/bench/keccak256/rho.rs deleted file mode 100644 index c37df14..0000000 --- a/hash/plonky2/src/bench/keccak256/rho.rs +++ /dev/null @@ -1,27 +0,0 @@ -use plonky2::hash::hash_types::RichField; -use plonky2::plonk::circuit_builder::CircuitBuilder; -use plonky2::field::extension::Extendable; -use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; - -use crate::arithmetic::u64_arithmetic::U64Target; - -//rho -pub fn rho, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5] -){ - const RHO_OFFSETS: [[usize; 5]; 5] = [ - [0, 1, 62, 28, 27], - [36, 44, 6, 55, 20], - [3, 10, 43, 25, 39], - [41, 45, 15, 21, 8], - [18, 2, 61, 56, 14], - ]; - - for x in 0..5 { - for y in 0..5 { - let rotation = RHO_OFFSETS[x][y]; - state[x][y] = builder.rotate_left_u64(state[x][y], rotation as u8); - } - } -} \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak256/theta.rs b/hash/plonky2/src/bench/keccak256/theta.rs deleted file mode 100644 index fafc11e..0000000 --- a/hash/plonky2/src/bench/keccak256/theta.rs +++ /dev/null @@ -1,204 +0,0 @@ -use plonky2::hash::hash_types::RichField; -use plonky2::plonk::circuit_builder::CircuitBuilder; -use plonky2::field::extension::Extendable; -use crate::arithmetic::u64_arithmetic::CircuitBuilderU64; - - -use crate::arithmetic::u64_arithmetic::U64Target; - -// Theta -pub fn theta, const D: usize>( - builder: &mut CircuitBuilder, - state: &mut [[U64Target; 5]; 5] -){ - let mut c = [builder.zero_u64(); 5]; - let mut d = [builder.zero_u64(); 5]; - - // Compute column parities - for x in 0..5 { - - let xor_x0_x1 = builder.xor_u64(state[x][0], state[x][1]); - let xor_x0_x1_x2 = builder.xor_u64(xor_x0_x1, state[x][2]); - let xor_x0_x1_x2_x3 = builder.xor_u64(xor_x0_x1_x2, state[x][3]); - c[x] = builder.xor_u64(xor_x0_x1_x2_x3, state[x][4]); - - } - - // Compute rotated parities - for x in 0..5 { - let c_left = c[(x + 4) % 5]; - let c_right_rot = builder.rotate_left_u64(c[(x + 1) % 5], 1); - d[x] = builder.xor_u64(c_left, c_right_rot); - } - - // Modify the state - for x in 0..5 { - for y in 0..5 { - state[x][y] = builder.xor_u64(state[x][y], d[x]); - } - } -} - - - -#[cfg(test)] -mod tests { - use super::*; - use plonky2::field::goldilocks_field::GoldilocksField; - use plonky2::hash::hash_types::RichField; - use plonky2::iop::witness::PartialWitness; - use plonky2::plonk::circuit_builder::CircuitBuilder; - use plonky2::plonk::circuit_data::CircuitConfig; - use plonky2::plonk::config::PoseidonGoldilocksConfig; - use crate::arithmetic::u64_arithmetic::U64Target; - use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; - use crate::bench::keccak256::keccak::WitnessU64; - - fn create_u64_target, const D: usize>( - builder: &mut CircuitBuilder, - value: u64 - ) -> U64Target { - let lo = value as u32; - let hi = (value >> 32) as u32; - U64Target([builder.constant_u32(lo), builder.constant_u32(hi)]) - } - - #[test] - fn test_theta_function() { - type F = GoldilocksField; - const D: usize = 2; - - // Create circuit builder - let config = CircuitConfig::standard_recursion_config(); - let mut builder = CircuitBuilder::::new(config); - - // Input state - let input_state: [[U64Target; 5]; 5] = [ - [ - create_u64_target(&mut builder, 0x0000000000000001), - create_u64_target(&mut builder, 0x0000000000000002), - create_u64_target(&mut builder, 0x0000000000000003), - create_u64_target(&mut builder, 0x0000000000000004), - create_u64_target(&mut builder, 0x0000000000000005) - ], - [ - create_u64_target(&mut builder, 0x0000000000000006), - create_u64_target(&mut builder, 0x0000000000000007), - create_u64_target(&mut builder, 0x0000000000000008), - create_u64_target(&mut builder, 0x0000000000000009), - create_u64_target(&mut builder, 0x000000000000000A) - ], - [ - create_u64_target(&mut builder, 0x000000000000000B), - create_u64_target(&mut builder, 0x000000000000000C), - create_u64_target(&mut builder, 0x000000000000000D), - create_u64_target(&mut builder, 0x000000000000000E), - create_u64_target(&mut builder, 0x000000000000000F) - ], - [ - create_u64_target(&mut builder, 0x0000000000000010), - create_u64_target(&mut builder, 0x0000000000000011), - create_u64_target(&mut builder, 0x0000000000000012), - create_u64_target(&mut builder, 0x0000000000000013), - create_u64_target(&mut builder, 0x0000000000000014) - ], - [ - create_u64_target(&mut builder, 0x0000000000000015), - create_u64_target(&mut builder, 0x0000000000000016), - create_u64_target(&mut builder, 0x0000000000000017), - create_u64_target(&mut builder, 0x0000000000000018), - create_u64_target(&mut builder, 0x0000000000000019) - ] - ]; - - // Expected output state (after theta) - let expected_state = [ - [ - create_u64_target(&mut builder, 0x7B7B7B7B7B7B7B7B), - create_u64_target(&mut builder, 0x8B8B8B8B8B8B8B8B), - create_u64_target(&mut builder, 0x9B9B9B9B9B9B9B9B), - create_u64_target(&mut builder, 0xABABABABABABABAB), - create_u64_target(&mut builder, 0xBBBBBBBBBBBBBBBB) - ], - [ - create_u64_target(&mut builder, 0xCBCBCBCBCBCBCBCB), - create_u64_target(&mut builder, 0xDBDBDBDBDBDBDBDB), - create_u64_target(&mut builder, 0xEBEBEBEBEBEBEBEB), - create_u64_target(&mut builder, 0xFBFBFBFBFBFBFBFB), - create_u64_target(&mut builder, 0x0B0B0B0B0B0B0B0B) - ], - [ - create_u64_target(&mut builder, 0x1B1B1B1B1B1B1B1B), - create_u64_target(&mut builder, 0x2B2B2B2B2B2B2B2B), - create_u64_target(&mut builder, 0x3B3B3B3B3B3B3B3B), - create_u64_target(&mut builder, 0x4B4B4B4B4B4B4B4B), - create_u64_target(&mut builder, 0x5B5B5B5B5B5B5B5B) - ], - [ - create_u64_target(&mut builder, 0x6B6B6B6B6B6B6B6B), - create_u64_target(&mut builder, 0x7B7B7B7B7B7B7B7B), - create_u64_target(&mut builder, 0x8B8B8B8B8B8B8B8B), - create_u64_target(&mut builder, 0x9B9B9B9B9B9B9B9B), - create_u64_target(&mut builder, 0xABABABABABABABAB) - ], - [ - create_u64_target(&mut builder, 0xBBBBBBBBBBBBBBBB), - create_u64_target(&mut builder, 0xCBCBCBCBCBCBCBCB), - create_u64_target(&mut builder, 0xDBDBDBDBDBDBDBDB), - create_u64_target(&mut builder, 0xEBEBEBEBEBEBEBEB), - create_u64_target(&mut builder, 0xFBFBFBFBFBFBFBFB) - ] - ]; - - // Run the theta function - let mut state = input_state; - let _ = theta(&mut builder, &mut state); - - - // Check if the output state matches the expected state - for x in 0..5 { - for y in 0..5 { - for i in 0..2 { - println!("Comparing: {:?} and {:?}", state[x][y].0[i].0, expected_state[x][y].0[i].0); - let res = builder.is_equal(state[x][y].0[i].0, expected_state[x][y].0[i].0); - builder.assert_bool(res); - } - } - } - - println!("{:?}", builder.num_gates()); - // Build the circuit - let data = builder.build::(); - - // Create witness and prove - let mut pw = PartialWitness::new(); - pw.set_u64_target(input_state[0][0], 0x0000000000000001); - pw.set_u64_target(input_state[0][1], 0x0000000000000002); - pw.set_u64_target(input_state[0][2], 0x0000000000000003); - pw.set_u64_target(input_state[0][3], 0x0000000000000004); - pw.set_u64_target(input_state[0][4], 0x0000000000000005); - pw.set_u64_target(input_state[1][0], 0x0000000000000006); - pw.set_u64_target(input_state[1][1], 0x0000000000000007); - pw.set_u64_target(input_state[1][2], 0x0000000000000008); - pw.set_u64_target(input_state[1][3], 0x0000000000000009); - pw.set_u64_target(input_state[1][4], 0x000000000000000A); - pw.set_u64_target(input_state[2][0], 0x000000000000000B); - pw.set_u64_target(input_state[2][1], 0x000000000000000C); - pw.set_u64_target(input_state[2][2], 0x000000000000000D); - pw.set_u64_target(input_state[2][3], 0x000000000000000E); - pw.set_u64_target(input_state[2][4], 0x000000000000000F); - pw.set_u64_target(input_state[3][0], 0x0000000000000010); - pw.set_u64_target(input_state[3][1], 0x0000000000000011); - pw.set_u64_target(input_state[3][2], 0x0000000000000012); - pw.set_u64_target(input_state[3][3], 0x0000000000000013); - pw.set_u64_target(input_state[3][4], 0x0000000000000014); - pw.set_u64_target(input_state[4][0], 0x0000000000000015); - pw.set_u64_target(input_state[4][1], 0x0000000000000016); - pw.set_u64_target(input_state[4][2], 0x0000000000000017); - pw.set_u64_target(input_state[4][3], 0x0000000000000018); - pw.set_u64_target(input_state[4][4], 0x0000000000000019); - - let proof = data.prove(pw).unwrap(); - assert!(data.verify(proof).is_ok()); - } -} \ No newline at end of file diff --git a/hash/plonky2/src/main.rs b/hash/plonky2/src/main.rs index 3981027..599e5a1 100644 --- a/hash/plonky2/src/main.rs +++ b/hash/plonky2/src/main.rs @@ -14,11 +14,6 @@ mod bench{ } pub mod keccak256{ - pub mod theta; - pub mod rho; - pub mod pi; - pub mod iota; - pub mod chi; pub mod keccak; } } From bbea51f9475dc0dc806f3c3b4443834b054e1de9 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Tue, 16 Jul 2024 18:29:19 +0530 Subject: [PATCH 34/41] code cleaning and fixing random bytes generation for sha256 --- .../src/arithmetic/binary_arithmetic.rs | 86 +++++-- hash/plonky2/src/arithmetic/u32_arithmetic.rs | 136 ++++------- hash/plonky2/src/arithmetic/u64_arithmetic.rs | 179 ++++++++++---- hash/plonky2/src/bench/keccak256/keccak.rs | 223 +----------------- hash/plonky2/src/bench/poseidon.rs | 2 +- hash/plonky2/src/bench/sha256/ch.rs | 7 +- hash/plonky2/src/bench/sha256/maj.rs | 3 +- hash/plonky2/src/bench/sha256/rotate.rs | 11 - hash/plonky2/src/bench/sha256/sha.rs | 32 +-- hash/plonky2/src/bench/sha256/shift.rs | 12 - hash/plonky2/src/bench/sha256/sigma.rs | 30 +-- hash/plonky2/src/main.rs | 4 +- 12 files changed, 271 insertions(+), 454 deletions(-) delete mode 100644 hash/plonky2/src/bench/sha256/rotate.rs delete mode 100644 hash/plonky2/src/bench/sha256/shift.rs diff --git a/hash/plonky2/src/arithmetic/binary_arithmetic.rs b/hash/plonky2/src/arithmetic/binary_arithmetic.rs index 9aad0f9..0c644e9 100644 --- a/hash/plonky2/src/arithmetic/binary_arithmetic.rs +++ b/hash/plonky2/src/arithmetic/binary_arithmetic.rs @@ -3,30 +3,76 @@ use plonky2::field::extension::Extendable; use plonky2::plonk::circuit_builder::CircuitBuilder; use plonky2::iop::target::BoolTarget; -//TODO: remove the dead codes later -#[allow(dead_code)] -pub trait CircuitBuilderBoolTarget, const D: usize> { - // fn and(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget; - // fn or(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget; - fn xor(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget; +pub fn xor_circuit( + a: BoolTarget, + b: BoolTarget, + builder: &mut CircuitBuilder, +) -> BoolTarget +where + F: RichField + Extendable, +{ + + // xor(a, b) = a*(1-b) + (1-a)*b = a + b - 2*ab + let b_minus_2ab = builder.arithmetic(-F::TWO, F::ONE, a.target, b.target, b.target); + let a_plus_b_minus_2ab = builder.add(a.target, b_minus_2ab); + BoolTarget::new_unsafe(a_plus_b_minus_2ab) } -impl, const D: usize> CircuitBuilderBoolTarget - for CircuitBuilder{ - fn xor(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget { +pub fn xor_const_circuit( + a: BoolTarget, + b: bool, + builder: &mut CircuitBuilder, +) -> BoolTarget +where + F: RichField + Extendable, +{ + // b = 0 => xor(a, b) = a + // b = 1 => xor(a, b) = 1 - a = not(a) + if b { + builder.not(a) + } else { + a + } +} - // a ^ b := (a - b)^2 - let s = self.sub(a.target, b.target); - BoolTarget::new_unsafe(self.mul(s, s)) +// reffered to https://github.com/polymerdao/plonky2-sha256 +/// 0 -> [0, 1, 2, ..., 63] +/// 1 -> [63, 0, 1, ..., 62] +/// 63 -> [1, 2, ..., 63, 0] +pub fn rotate_u64(y: usize) -> Vec { + let mut res = Vec::new(); + for i in 64 - y..64 { + res.push(i); + } + for i in 0..64 - y { + res.push(i); + } + res +} +#[allow(dead_code)] +pub fn from_bits_to_u64(bools: &[bool]) -> u64 { + let mut result: u64 = 0; + let mut shift = 0; + for &bit in bools { + if bit { + result |= 1 << shift; } + shift += 1; + if shift == 64 { + break; + } + } + result +} - // fn and(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget { - // self.and(a, b) - // } - - // fn or(&mut self, a: BoolTarget, b: BoolTarget) -> BoolTarget { - // self.or(a, b) - // } - } \ No newline at end of file +pub fn u64_to_bits(num: u64) -> Vec { + let mut result = Vec::with_capacity(64); + let mut n = num; + for _ in 0..64 { + result.push(n & 1 == 1); + n >>= 1; + } + result +} \ No newline at end of file diff --git a/hash/plonky2/src/arithmetic/u32_arithmetic.rs b/hash/plonky2/src/arithmetic/u32_arithmetic.rs index 4978321..734c74b 100644 --- a/hash/plonky2/src/arithmetic/u32_arithmetic.rs +++ b/hash/plonky2/src/arithmetic/u32_arithmetic.rs @@ -3,97 +3,59 @@ use plonky2::hash::hash_types::RichField; use plonky2::field::extension::Extendable; use plonky2::plonk::circuit_builder::CircuitBuilder; use plonky2_u32::gadgets::arithmetic_u32::U32Target; -use super::binary_arithmetic::CircuitBuilderBoolTarget; use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; -//TODO: remove the dead codes later -#[allow(dead_code)] -pub trait CircuitBuilderU32M, const D: usize> { - // fn or_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; - fn and_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; - fn xor_u32(&mut self, a: U32Target, b: U32Target) -> U32Target; - // fn rotate_left_u32(&mut self, a: U32Target, n: u8) -> U32Target; - - fn from_u32(&mut self, a: U32Target) -> Vec; - fn to_u32(&mut self, a: Vec) -> U32Target; - - // not := 0xFFFFFFFF - x - fn not_u32(&mut self, a: U32Target) -> U32Target; - +pub fn add_u32, const D: usize>( + builder: &mut CircuitBuilder, + a: &U32Target, + b: &U32Target, +) -> U32Target { + let (res, _carry) = builder.add_u32(*a, *b); + res } -impl, const D: usize> CircuitBuilderU32M - for CircuitBuilder{ +pub fn u32_to_bits_target, const D: usize, const B: usize>( + builder: &mut CircuitBuilder, + a: &U32Target, +) -> Vec { + let mut res = Vec::new(); + let bit_targets = builder.split_le_base::(a.0, 32); + for i in (0..32).rev() { + res.push(BoolTarget::new_unsafe(bit_targets[i])); + } + res +} - fn from_u32(&mut self, a: U32Target) -> Vec { +pub fn bits_to_u32_target, const D: usize>( + builder: &mut CircuitBuilder, + bits_target: Vec, +) -> U32Target { + let bit_len = bits_target.len(); + assert_eq!(bit_len, 32); + U32Target(builder.le_sum(bits_target[0..32].iter().rev())) +} - let mut res = Vec::new(); - let bit_targets = self.split_le_base::<2>(a.0, 32); +// x>>y +// Assume: 0 at index 32 +pub fn shift32(y: usize) -> Vec { + let mut res = Vec::new(); + for _ in 32 - y..32 { + res.push(32); + } + for i in 0..32 - y { + res.push(i); + } + res +} - for i in (0..32).rev() { - res.push(BoolTarget::new_unsafe(bit_targets[i])); - } - res - } - - fn to_u32(&mut self, a: Vec) -> U32Target { - let bit_len = a.len(); - assert_eq!(bit_len, 32); - U32Target(self.le_sum(a[0..32].iter().rev())) - } - - - // fn or_u32(&mut self, a: U32Target, b: U32Target) -> U32Target { - // let binary_target_a = self.from_u32(a); - // let binary_target_b = self.from_u32(b); - - // let mut res = Vec::::new(); - // for i in 0..32 { - - // let r = self.or(binary_target_a[i], binary_target_b[i]); - // res.push(r); - // } - // self.to_u32(res) - // } - - fn and_u32(&mut self, a: U32Target, b: U32Target) -> U32Target { - let binary_target_a = self.from_u32(a); - let binary_target_b = self.from_u32(b); - - let mut res = Vec::::new(); - for i in 0..32 { - - let r = self.and(binary_target_a[i], binary_target_b[i]); - res.push(r); - } - self.to_u32(res) - - } - - fn xor_u32(&mut self, a: U32Target, b: U32Target) -> U32Target { - let binary_target_a = self.from_u32(a); - let binary_target_b = self.from_u32(b); - - let mut res = Vec::::new(); - for i in 0..32 { - - let r = self.xor(binary_target_a[i], binary_target_b[i]); - res.push(r); - } - self.to_u32(res) - } - - // fn rotate_left_u32(&mut self, a: U32Target, n: u8) -> U32Target { - // let two_power_n = self.constant_u32(0x1 << n); - // let (lo, hi) = self.mul_u32(a, two_power_n); - // self.add_u32(lo, hi).0 - // } - - // not := 0xFFFFFFFF - x - fn not_u32(&mut self, a: U32Target) -> U32Target { - let zero = self.zero_u32(); - let ff = self.constant_u32(0xFFFFFFFF); - self.sub_u32(ff, a, zero).0 - } - - } \ No newline at end of file +// define ROTATE(x, y) (((x)>>(y)) | ((x)<<(32-(y)))) +pub fn rotate32(y: usize) -> Vec { + let mut res = Vec::new(); + for i in 32 - y..32 { + res.push(i); + } + for i in 0..32 - y { + res.push(i); + } + res +} \ No newline at end of file diff --git a/hash/plonky2/src/arithmetic/u64_arithmetic.rs b/hash/plonky2/src/arithmetic/u64_arithmetic.rs index 01b8c0f..bc9cbd0 100644 --- a/hash/plonky2/src/arithmetic/u64_arithmetic.rs +++ b/hash/plonky2/src/arithmetic/u64_arithmetic.rs @@ -1,65 +1,152 @@ use plonky2::hash::hash_types::RichField; use plonky2::field::extension::Extendable; use plonky2::plonk::circuit_builder::CircuitBuilder; -use plonky2_u32::gadgets::arithmetic_u32::U32Target; -use super::u32_arithmetic::CircuitBuilderU32M; -use plonky2_u32::gadgets::arithmetic_u32::CircuitBuilderU32; +use std::marker::PhantomData; +use plonky2::iop::target::BoolTarget; +use plonky2::iop::witness::PartialWitness; +use plonky2::iop::witness::WitnessWrite; -#[derive(Clone, Copy, Debug)] -pub struct U64Target(pub [U32Target;2]); +use crate::arithmetic::binary_arithmetic::{rotate_u64,xor_const_circuit,u64_to_bits,xor_circuit}; -//TODO: remove the dead codes later -#[allow(dead_code)] -pub trait CircuitBuilderU64, const D: usize> { - fn and_u64(&mut self, a: U64Target, b: U64Target) -> U64Target; - fn xor_u64(&mut self, a: U64Target, b: U64Target) -> U64Target; - fn rotate_left_u64(&mut self, a: U64Target, n: u8) -> U64Target; - - fn zero_u64(&mut self) -> U64Target; - - fn not_u64(&mut self, a: U64Target) -> U64Target; - fn add_virtual_u64_target(&mut self) -> U64Target; +#[derive(Clone, Debug)] +pub struct U64Target { + pub bits: Vec, + _phantom: PhantomData, } -impl, const D: usize> CircuitBuilderU64 - for CircuitBuilder{ - fn xor_u64(&mut self, a: U64Target, b: U64Target) -> U64Target { - let mut result = Vec::new(); - for i in 0..2 { - result.push(self.xor_u32(a.0[i], b.0[i])); +impl U64Target +where + F: RichField + Extendable, +{ + pub fn new(builder: &mut CircuitBuilder) -> Self { + let mut result = vec![]; + for _ in 0..64 { + result.push(builder.add_virtual_bool_target_safe()); } - U64Target([result[0], result[1]]) - } - - fn and_u64(&mut self, a: U64Target, b: U64Target) -> U64Target { - let mut result = Vec::new(); - - for i in 0..2 { - result.push(self.and_u32(a.0[i], b.0[i])); + Self { + bits: result, + _phantom: PhantomData, } - U64Target([result[0], result[1]]) } - fn rotate_left_u64(&mut self, a: U64Target, n: u8) -> U64Target { - let (lo, hi) = if n < 32 { (a.0[0], a.0[1]) } else { (a.0[1], a.0[0]) }; - - let two_power_x = self.constant_u32(0x1 << (n % 32)); - let (lo0, hi0) = self.mul_u32(lo, two_power_x); - let (lo1, hi1) = self.mul_add_u32(hi, two_power_x, hi0); - - U64Target([self.add_u32(lo0, hi1).0, lo1]) + pub fn from(bits: Vec) -> Self { + assert_eq!(bits.len(), 64); + Self { + bits, + _phantom: PhantomData, + } } - fn zero_u64(&mut self) -> U64Target { - let zero_u32 = self.zero_u32(); - U64Target([zero_u32,zero_u32]) + pub fn set_witness(&self, bits: Vec, pw: &mut PartialWitness) { + for i in 0..64 { + pw.set_bool_target(self.bits[i], bits[i]); + } } - fn not_u64(&mut self, a: U64Target) -> U64Target { - U64Target([self.not_u32(a.0[0]), self.not_u32(a.0[1])]) + pub fn constant(x: u64, builder: &mut CircuitBuilder) -> Self { + let mut result = vec![]; + let x_bits = u64_to_bits(x); + for i in 0..64 { + result.push(builder.constant_bool(x_bits[i])); + } + Self { + bits: result, + _phantom: PhantomData, + } } - fn add_virtual_u64_target(&mut self) -> U64Target { - U64Target([U32Target(self.add_virtual_target()),U32Target(self.add_virtual_target())]) + pub fn connect(&self, other: &Self, builder: &mut CircuitBuilder) { + for i in 0..64 { + builder.connect(self.bits[i].target, other.bits[i].target); + } + } + + pub fn to_bits(&self, builder: &mut CircuitBuilder) -> Vec { + let output = Self::new(builder); + self.connect(&output, builder); + output.bits + } + + pub fn xor(&self, other: &Self, builder: &mut CircuitBuilder) -> Self { + let mut result = vec![]; + for i in 0..64 { + let xor_target = xor_circuit(self.bits[i], other.bits[i], builder); + result.push(xor_target); + } + Self { + bits: result, + _phantom: PhantomData, + } + } + + pub fn xor_const(&self, other: u64, builder: &mut CircuitBuilder) -> Self { + let other_bits = u64_to_bits(other); + let mut result = vec![]; + for i in 0..64 { + let xor_target = xor_const_circuit(self.bits[i], other_bits[i], builder); + result.push(xor_target); + } + Self { + bits: result, + _phantom: PhantomData, + } + } + + /* Rotate left by n + * Note that the input parameter n is constant. It is not necessary to make n a constant target or public input, + * because different n generates a different circuit. + */ + pub fn rotl(&self, n: usize) -> Self { + let rotate = rotate_u64(n); + let mut output = vec![]; + for i in 0..64 { + output.push(self.bits[rotate[i]]); + } + + Self { + bits: output, + _phantom: PhantomData, + } + } + + pub fn and(&self, other: &Self, builder: &mut CircuitBuilder) -> Self { + let mut result = vec![]; + for i in 0..64 { + result.push(builder.and(self.bits[i], other.bits[i])); + } + Self { + bits: result, + _phantom: PhantomData, + } + } + + pub fn not(&self, builder: &mut CircuitBuilder) -> Self { + let mut result = vec![]; + for i in 0..64 { + result.push(builder.not(self.bits[i])); + } + Self { + bits: result, + _phantom: PhantomData, + } + } + + /// Calculate `self & !other`. + pub fn and_not(&self, other: &Self, builder: &mut CircuitBuilder) -> Self { + let mut result = vec![]; + for i in 0..64 { + // x(1 - y) = x - xy + result.push(BoolTarget::new_unsafe(builder.arithmetic( + F::NEG_ONE, + F::ONE, + self.bits[i].target, + other.bits[i].target, + self.bits[i].target, + ))); + } + Self { + bits: result, + _phantom: PhantomData, + } } } \ No newline at end of file diff --git a/hash/plonky2/src/bench/keccak256/keccak.rs b/hash/plonky2/src/bench/keccak256/keccak.rs index 715c69b..ae519d9 100644 --- a/hash/plonky2/src/bench/keccak256/keccak.rs +++ b/hash/plonky2/src/bench/keccak256/keccak.rs @@ -20,227 +20,8 @@ use plonky2::plonk::circuit_data::CircuitConfig; use plonky2::plonk::config::PoseidonGoldilocksConfig; use anyhow::Result; - -#[derive(Clone, Debug)] -pub struct U64Target { - pub bits: Vec, - _phantom: PhantomData, -} - -impl U64Target -where - F: RichField + Extendable, -{ - pub fn new(builder: &mut CircuitBuilder) -> Self { - let mut result = vec![]; - for _ in 0..64 { - result.push(builder.add_virtual_bool_target_safe()); - } - Self { - bits: result, - _phantom: PhantomData, - } - } - - pub fn from(bits: Vec) -> Self { - assert_eq!(bits.len(), 64); - Self { - bits, - _phantom: PhantomData, - } - } - - pub fn set_witness(&self, bits: Vec, pw: &mut PartialWitness) { - for i in 0..64 { - pw.set_bool_target(self.bits[i], bits[i]); - } - } - - pub fn constant(x: u64, builder: &mut CircuitBuilder) -> Self { - let mut result = vec![]; - let x_bits = u64_to_bits(x); - for i in 0..64 { - result.push(builder.constant_bool(x_bits[i])); - } - Self { - bits: result, - _phantom: PhantomData, - } - } - - pub fn connect(&self, other: &Self, builder: &mut CircuitBuilder) { - for i in 0..64 { - builder.connect(self.bits[i].target, other.bits[i].target); - } - } - - pub fn to_bits(&self, builder: &mut CircuitBuilder) -> Vec { - let output = Self::new(builder); - self.connect(&output, builder); - output.bits - } - - pub fn xor(&self, other: &Self, builder: &mut CircuitBuilder) -> Self { - let mut result = vec![]; - for i in 0..64 { - let xor_target = xor_circuit(self.bits[i], other.bits[i], builder); - result.push(xor_target); - } - Self { - bits: result, - _phantom: PhantomData, - } - } - - pub fn xor_const(&self, other: u64, builder: &mut CircuitBuilder) -> Self { - let other_bits = u64_to_bits(other); - let mut result = vec![]; - for i in 0..64 { - let xor_target = xor_const_circuit(self.bits[i], other_bits[i], builder); - result.push(xor_target); - } - Self { - bits: result, - _phantom: PhantomData, - } - } - - /* Rotate left by n - * Note that the input parameter n is constant. It is not necessary to make n a constant target or public input, - * because different n generates a different circuit. - */ - pub fn rotl(&self, n: usize) -> Self { - let rotate = rotate_u64(n); - let mut output = vec![]; - for i in 0..64 { - output.push(self.bits[rotate[i]]); - } - - Self { - bits: output, - _phantom: PhantomData, - } - } - - pub fn and(&self, other: &Self, builder: &mut CircuitBuilder) -> Self { - let mut result = vec![]; - for i in 0..64 { - result.push(builder.and(self.bits[i], other.bits[i])); - } - Self { - bits: result, - _phantom: PhantomData, - } - } - - pub fn not(&self, builder: &mut CircuitBuilder) -> Self { - let mut result = vec![]; - for i in 0..64 { - result.push(builder.not(self.bits[i])); - } - Self { - bits: result, - _phantom: PhantomData, - } - } - - /// Calculate `self & !other`. - pub fn and_not(&self, other: &Self, builder: &mut CircuitBuilder) -> Self { - let mut result = vec![]; - for i in 0..64 { - // x(1 - y) = x - xy - result.push(BoolTarget::new_unsafe(builder.arithmetic( - F::NEG_ONE, - F::ONE, - self.bits[i].target, - other.bits[i].target, - self.bits[i].target, - ))); - } - Self { - bits: result, - _phantom: PhantomData, - } - } -} - -pub fn xor_circuit( - a: BoolTarget, - b: BoolTarget, - builder: &mut CircuitBuilder, -) -> BoolTarget -where - F: RichField + Extendable, -{ - // a = 0, b = 0 => 0 - // a = 1, b = 0 => 1 - // a = 0, b = 1 => 1 - // a = 1, b = 1 => 0 - // xor(a, b) = a*(1-b) + (1-a)*b = a + b - 2*ab - let b_minus_2ab = builder.arithmetic(-F::TWO, F::ONE, a.target, b.target, b.target); - let a_plus_b_minus_2ab = builder.add(a.target, b_minus_2ab); - // let c = builder.add_virtual_bool_target_safe(); - // builder.connect(c.target, a_plus_b_neg_two_ab); - - BoolTarget::new_unsafe(a_plus_b_minus_2ab) -} - -pub fn xor_const_circuit( - a: BoolTarget, - b: bool, - builder: &mut CircuitBuilder, -) -> BoolTarget -where - F: RichField + Extendable, -{ - // b = 0 => xor(a, b) = a - // b = 1 => xor(a, b) = 1 - a = not(a) - if b { - builder.not(a) - } else { - a - } -} - -// reffered to https://github.com/polymerdao/plonky2-sha256 -/// 0 -> [0, 1, 2, ..., 63] -/// 1 -> [63, 0, 1, ..., 62] -/// 63 -> [1, 2, ..., 63, 0] -fn rotate_u64(y: usize) -> Vec { - let mut res = Vec::new(); - for i in 64 - y..64 { - res.push(i); - } - for i in 0..64 - y { - res.push(i); - } - res -} - -pub fn from_bits_to_u64(bools: &[bool]) -> u64 { - let mut result: u64 = 0; - let mut shift = 0; - for &bit in bools { - if bit { - result |= 1 << shift; - } - shift += 1; - if shift == 64 { - break; - } - } - result -} - -pub fn u64_to_bits(num: u64) -> Vec { - let mut result = Vec::with_capacity(64); - let mut n = num; - for _ in 0..64 { - result.push(n & 1 == 1); - n >>= 1; - } - result -} +use crate::arithmetic::binary_arithmetic::xor_circuit; +use crate::arithmetic::u64_arithmetic::U64Target; pub const ROUND_CONSTANTS: [u64; 24] = [ 1u64, diff --git a/hash/plonky2/src/bench/poseidon.rs b/hash/plonky2/src/bench/poseidon.rs index 2663997..62e36c8 100644 --- a/hash/plonky2/src/bench/poseidon.rs +++ b/hash/plonky2/src/bench/poseidon.rs @@ -40,7 +40,7 @@ pub fn poseidon_bench(depth: usize) -> Result<()> { let hash = builder.hash_or_noop::(initial.clone()); // Public inputs are the initial value (provided below) and the result (which is generated). - builder.register_public_inputs(initial.clone().as_slice()); + // builder.register_public_inputs(initial.clone().as_slice()); builder.register_public_input(hash.elements[0]); builder.register_public_input(hash.elements[1]); builder.register_public_input(hash.elements[2]); diff --git a/hash/plonky2/src/bench/sha256/ch.rs b/hash/plonky2/src/bench/sha256/ch.rs index ce26f53..912d64c 100644 --- a/hash/plonky2/src/bench/sha256/ch.rs +++ b/hash/plonky2/src/bench/sha256/ch.rs @@ -1,13 +1,10 @@ -// use plonky2::{hash::hash_types::HashOutTarget, iop::target::Target, iop::target::BoolTarget}; use plonky2::iop::target::BoolTarget; - use plonky2::hash::hash_types::RichField; use plonky2::plonk::circuit_builder::CircuitBuilder; -// use plonky2_field::extension; use plonky2::field::extension::Extendable; use plonky2_u32::gadgets::arithmetic_u32::U32Target; -use super::sigma::bits_to_u32_target; -use super::sigma::u32_to_bits_target; +use crate::arithmetic::u32_arithmetic::{bits_to_u32_target, u32_to_bits_target}; + pub fn ch, const D: usize>( builder: &mut CircuitBuilder, diff --git a/hash/plonky2/src/bench/sha256/maj.rs b/hash/plonky2/src/bench/sha256/maj.rs index 6876f4e..e4b307e 100644 --- a/hash/plonky2/src/bench/sha256/maj.rs +++ b/hash/plonky2/src/bench/sha256/maj.rs @@ -4,8 +4,7 @@ use plonky2::plonk::circuit_builder::CircuitBuilder; use plonky2::field::extension::Extendable; use plonky2_u32::gadgets::arithmetic_u32::U32Target; -use super::sigma::u32_to_bits_target; -use super::sigma::bits_to_u32_target; +use crate::arithmetic::u32_arithmetic::{bits_to_u32_target, u32_to_bits_target}; pub fn maj, const D: usize>( builder: &mut CircuitBuilder, diff --git a/hash/plonky2/src/bench/sha256/rotate.rs b/hash/plonky2/src/bench/sha256/rotate.rs deleted file mode 100644 index fec8361..0000000 --- a/hash/plonky2/src/bench/sha256/rotate.rs +++ /dev/null @@ -1,11 +0,0 @@ -// define ROTATE(x, y) (((x)>>(y)) | ((x)<<(32-(y)))) -pub fn rotate32(y: usize) -> Vec { - let mut res = Vec::new(); - for i in 32 - y..32 { - res.push(i); - } - for i in 0..32 - y { - res.push(i); - } - res -} \ No newline at end of file diff --git a/hash/plonky2/src/bench/sha256/sha.rs b/hash/plonky2/src/bench/sha256/sha.rs index d6de7ee..36e1b12 100644 --- a/hash/plonky2/src/bench/sha256/sha.rs +++ b/hash/plonky2/src/bench/sha256/sha.rs @@ -1,3 +1,5 @@ +// code is taken from https://github.com/polymerdao/plonky2-sha256 + use plonky2::iop::target::BoolTarget; use plonky2::hash::hash_types::RichField; use plonky2::plonk::circuit_builder::CircuitBuilder; @@ -16,15 +18,8 @@ use super::sigma::sigma1; use super::maj::maj; use super::constants::*; use super::ch::ch; - -fn add_u32, const D: usize>( - builder: &mut CircuitBuilder, - a: &U32Target, - b: &U32Target, -) -> U32Target { - let (res, _carry) = builder.add_u32(*a, *b); - res -} +use crate::arithmetic::u32_arithmetic::add_u32; +use rand::Rng; pub struct Sha256Targets { pub message: Vec, @@ -179,19 +174,18 @@ pub fn make_circuits, const D: usize>( } -fn generate_random_bytes() -> Vec { - const MSG_SIZE: usize = 64; - let mut msg = vec![0; MSG_SIZE as usize]; - for i in 0..MSG_SIZE - 1 { - msg[i] = i as u8; - } +fn generate_random_bytes(size: usize) -> Vec { + + let mut rng = rand::thread_rng(); + let mut bytes = vec![0u8; size]; + rng.fill(&mut bytes[..]); - msg + bytes } -pub fn sha256_bench() -> Result<()> { - let msg = generate_random_bytes(); +pub fn sha256_bench(size: usize) -> Result<()> { + let msg = generate_random_bytes(size); let mut hasher = Sha256::new(); hasher.update(msg.clone()); @@ -221,7 +215,7 @@ pub fn sha256_bench() -> Result<()> { } println!( - "Constructing inner proof with {} gates", + "number of gates: {}", builder.num_gates() ); let data = builder.build::(); diff --git a/hash/plonky2/src/bench/sha256/shift.rs b/hash/plonky2/src/bench/sha256/shift.rs deleted file mode 100644 index a52d4e2..0000000 --- a/hash/plonky2/src/bench/sha256/shift.rs +++ /dev/null @@ -1,12 +0,0 @@ -// x>>y -// Assume: 0 at index 32 -pub fn shift32(y: usize) -> Vec { - let mut res = Vec::new(); - for _ in 32 - y..32 { - res.push(32); - } - for i in 0..32 - y { - res.push(i); - } - res -} \ No newline at end of file diff --git a/hash/plonky2/src/bench/sha256/sigma.rs b/hash/plonky2/src/bench/sha256/sigma.rs index 6a16c9c..f6a0660 100644 --- a/hash/plonky2/src/bench/sha256/sigma.rs +++ b/hash/plonky2/src/bench/sha256/sigma.rs @@ -1,36 +1,12 @@ -// use plonky2::{hash::hash_types::HashOutTarget, iop::target::Target, iop::target::BoolTarget}; -use plonky2::iop::target::BoolTarget; - use plonky2::hash::hash_types::RichField; use plonky2::plonk::circuit_builder::CircuitBuilder; -// use plonky2_field::extension; use plonky2::field::extension::Extendable; use plonky2_u32::gadgets::arithmetic_u32::U32Target; -use super::shift::shift32; -use super::rotate::rotate32; +use crate::arithmetic::u32_arithmetic::{rotate32, shift32}; +use crate::arithmetic::u32_arithmetic::u32_to_bits_target; +use crate::arithmetic::u32_arithmetic::bits_to_u32_target; use super::xor3::xor3; -pub fn u32_to_bits_target, const D: usize, const B: usize>( - builder: &mut CircuitBuilder, - a: &U32Target, -) -> Vec { - let mut res = Vec::new(); - let bit_targets = builder.split_le_base::(a.0, 32); - for i in (0..32).rev() { - res.push(BoolTarget::new_unsafe(bit_targets[i])); - } - res -} - -pub fn bits_to_u32_target, const D: usize>( - builder: &mut CircuitBuilder, - bits_target: Vec, -) -> U32Target { - let bit_len = bits_target.len(); - assert_eq!(bit_len, 32); - U32Target(builder.le_sum(bits_target[0..32].iter().rev())) -} - pub fn sigma0, const D: usize>( builder: &mut CircuitBuilder, a: &U32Target, diff --git a/hash/plonky2/src/main.rs b/hash/plonky2/src/main.rs index 599e5a1..eeb7e79 100644 --- a/hash/plonky2/src/main.rs +++ b/hash/plonky2/src/main.rs @@ -3,8 +3,6 @@ mod bench{ pub mod poseidon; pub mod sha256{ pub mod constants; - pub mod shift; - pub mod rotate; pub mod sigma; pub mod sha; pub mod xor3; @@ -56,7 +54,7 @@ fn main() { "sha256" => { println!("Running sha256: "); - let _ = sha256_bench(); + let _ = sha256_bench(size); } _ => { From 658faf232e83243a8b7c86f83827ecba2a367fcc Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Fri, 19 Jul 2024 13:48:22 +0530 Subject: [PATCH 35/41] keccak hash from polygon zk_evm --- hash/plonky2/{ => bench}/Cargo.toml | 11 ++- hash/plonky2/{ => bench}/build.sh | 0 hash/plonky2/{ => bench}/run.sh | 0 .../src/arithmetic/binary_arithmetic.rs | 0 .../src/arithmetic/u32_arithmetic.rs | 0 .../src/arithmetic/u64_arithmetic.rs | 0 .../{ => bench}/src/bench/keccak256/keccak.rs | 0 .../src/bench/keccak256/keccak_polygon.rs | 93 +++++++++++++++++++ .../plonky2/{ => bench}/src/bench/poseidon.rs | 0 .../{ => bench}/src/bench/sha256/ch.rs | 0 .../{ => bench}/src/bench/sha256/constants.rs | 0 .../{ => bench}/src/bench/sha256/maj.rs | 0 .../{ => bench}/src/bench/sha256/sha.rs | 0 .../{ => bench}/src/bench/sha256/sigma.rs | 0 .../{ => bench}/src/bench/sha256/xor3.rs | 0 hash/plonky2/{ => bench}/src/main.rs | 1 + 16 files changed, 100 insertions(+), 5 deletions(-) rename hash/plonky2/{ => bench}/Cargo.toml (57%) rename hash/plonky2/{ => bench}/build.sh (100%) rename hash/plonky2/{ => bench}/run.sh (100%) rename hash/plonky2/{ => bench}/src/arithmetic/binary_arithmetic.rs (100%) rename hash/plonky2/{ => bench}/src/arithmetic/u32_arithmetic.rs (100%) rename hash/plonky2/{ => bench}/src/arithmetic/u64_arithmetic.rs (100%) rename hash/plonky2/{ => bench}/src/bench/keccak256/keccak.rs (100%) create mode 100644 hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs rename hash/plonky2/{ => bench}/src/bench/poseidon.rs (100%) rename hash/plonky2/{ => bench}/src/bench/sha256/ch.rs (100%) rename hash/plonky2/{ => bench}/src/bench/sha256/constants.rs (100%) rename hash/plonky2/{ => bench}/src/bench/sha256/maj.rs (100%) rename hash/plonky2/{ => bench}/src/bench/sha256/sha.rs (100%) rename hash/plonky2/{ => bench}/src/bench/sha256/sigma.rs (100%) rename hash/plonky2/{ => bench}/src/bench/sha256/xor3.rs (100%) rename hash/plonky2/{ => bench}/src/main.rs (97%) diff --git a/hash/plonky2/Cargo.toml b/hash/plonky2/bench/Cargo.toml similarity index 57% rename from hash/plonky2/Cargo.toml rename to hash/plonky2/bench/Cargo.toml index 25ac85f..9441eb3 100644 --- a/hash/plonky2/Cargo.toml +++ b/hash/plonky2/bench/Cargo.toml @@ -10,11 +10,12 @@ edition = "2021" # TODO: This can be later changed to original github plonky2_u32 ={ git = "https://github.com/man2706kum/plonky2-u32.git"} plonky2 = "0.2.2" -rand = "0.8.3" -anyhow = "1.0.79" +rand = "0.8.5" +anyhow = "1.0.86" sha2 = "0.10" tiny-keccak={version="2.0.2", features=["keccak"]} hex="0.4.3" - - - +evm_arithmetization ={ git = "https://github.com/0xPolygonZero/zk_evm.git", rev = "a5b92b2b2bcc7bbf8725190aaa0fba7007e51a6a"} +starky ={ git = "https://github.com/0xPolygonZero/plonky2.git", rev = "0e363e16a37a2eacd3349946bd071a460485ad26"} +env_logger = "0.11.3" +log = "0.4.21" diff --git a/hash/plonky2/build.sh b/hash/plonky2/bench/build.sh similarity index 100% rename from hash/plonky2/build.sh rename to hash/plonky2/bench/build.sh diff --git a/hash/plonky2/run.sh b/hash/plonky2/bench/run.sh similarity index 100% rename from hash/plonky2/run.sh rename to hash/plonky2/bench/run.sh diff --git a/hash/plonky2/src/arithmetic/binary_arithmetic.rs b/hash/plonky2/bench/src/arithmetic/binary_arithmetic.rs similarity index 100% rename from hash/plonky2/src/arithmetic/binary_arithmetic.rs rename to hash/plonky2/bench/src/arithmetic/binary_arithmetic.rs diff --git a/hash/plonky2/src/arithmetic/u32_arithmetic.rs b/hash/plonky2/bench/src/arithmetic/u32_arithmetic.rs similarity index 100% rename from hash/plonky2/src/arithmetic/u32_arithmetic.rs rename to hash/plonky2/bench/src/arithmetic/u32_arithmetic.rs diff --git a/hash/plonky2/src/arithmetic/u64_arithmetic.rs b/hash/plonky2/bench/src/arithmetic/u64_arithmetic.rs similarity index 100% rename from hash/plonky2/src/arithmetic/u64_arithmetic.rs rename to hash/plonky2/bench/src/arithmetic/u64_arithmetic.rs diff --git a/hash/plonky2/src/bench/keccak256/keccak.rs b/hash/plonky2/bench/src/bench/keccak256/keccak.rs similarity index 100% rename from hash/plonky2/src/bench/keccak256/keccak.rs rename to hash/plonky2/bench/src/bench/keccak256/keccak.rs diff --git a/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs b/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs new file mode 100644 index 0000000..a2c6f3b --- /dev/null +++ b/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs @@ -0,0 +1,93 @@ +use evm_arithmetization::keccak::keccak_stark::KeccakStark; +use anyhow::Result; +use env_logger::{try_init_from_env, Env, DEFAULT_FILTER_ENV}; +use plonky2::field::types::PrimeField64; +use plonky2::fri::oracle::PolynomialBatch; +use plonky2::iop::challenger::Challenger; +use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig}; +use starky::config::StarkConfig; +use starky::cross_table_lookup::{CtlData, CtlZData}; +use starky::lookup::{GrandProductChallenge, GrandProductChallengeSet}; +use starky::stark_testing::{test_stark_circuit_constraints, test_stark_low_degree}; +use tiny_keccak::keccakf; +use plonky2::field::polynomial::PolynomialValues; +use plonky2::field::types::Field; +use plonky2::timed; +use evm_arithmetization::testing_utils::init_logger; +use plonky2::util::timing::TimingTree; +use evm_arithmetization::prover::prove_single_table; +use starky::lookup::Filter; +use starky::lookup::Column; +use rand::random; +const NUM_INPUTS: usize = 84; + +pub fn keccak_polygon_bench() -> Result<()> { + + const NUM_PERMS: usize = 85; + const D: usize = 2; + type C = PoseidonGoldilocksConfig; + type F = >::F; + type S = KeccakStark; + let stark = S::default(); + let config = StarkConfig::standard_fast_config(); + + init_logger(); + + let input: Vec<([u64; NUM_INPUTS], usize)> = + (0..NUM_PERMS).map(|_| (rand::random(), 0)).collect(); + + let mut timing = TimingTree::new("prove", log::Level::Debug); + let trace_poly_values = timed!( + timing, + "generate trace", + stark.generate_trace(input, 8, &mut timing) + ); + + let cloned_trace_poly_values = timed!(timing, "clone", trace_poly_values.clone()); + + let trace_commitments = timed!( + timing, + "compute trace commitment", + PolynomialBatch::::from_values( + cloned_trace_poly_values, + config.fri_config.rate_bits, + false, + config.fri_config.cap_height, + &mut timing, + None, + ) + ); + let degree = 1 << trace_commitments.degree_log; + + // Fake CTL data. + let ctl_z_data = CtlZData::new( + vec![PolynomialValues::zero(degree)], + PolynomialValues::zero(degree), + GrandProductChallenge { + beta: F::ZERO, + gamma: F::ZERO, + }, + vec![], + vec![Filter::new_simple(Column::constant(F::ZERO))], + ); + let ctl_data = CtlData { + zs_columns: vec![ctl_z_data.clone(); config.num_challenges], + }; + + prove_single_table( + &stark, + &config, + &trace_poly_values, + &trace_commitments, + &ctl_data, + &GrandProductChallengeSet { + challenges: vec![ctl_z_data.challenge; config.num_challenges], + }, + &mut Challenger::new(), + &mut timing, + None, + )?; + + timing.print(); + Ok(()) +} \ No newline at end of file diff --git a/hash/plonky2/src/bench/poseidon.rs b/hash/plonky2/bench/src/bench/poseidon.rs similarity index 100% rename from hash/plonky2/src/bench/poseidon.rs rename to hash/plonky2/bench/src/bench/poseidon.rs diff --git a/hash/plonky2/src/bench/sha256/ch.rs b/hash/plonky2/bench/src/bench/sha256/ch.rs similarity index 100% rename from hash/plonky2/src/bench/sha256/ch.rs rename to hash/plonky2/bench/src/bench/sha256/ch.rs diff --git a/hash/plonky2/src/bench/sha256/constants.rs b/hash/plonky2/bench/src/bench/sha256/constants.rs similarity index 100% rename from hash/plonky2/src/bench/sha256/constants.rs rename to hash/plonky2/bench/src/bench/sha256/constants.rs diff --git a/hash/plonky2/src/bench/sha256/maj.rs b/hash/plonky2/bench/src/bench/sha256/maj.rs similarity index 100% rename from hash/plonky2/src/bench/sha256/maj.rs rename to hash/plonky2/bench/src/bench/sha256/maj.rs diff --git a/hash/plonky2/src/bench/sha256/sha.rs b/hash/plonky2/bench/src/bench/sha256/sha.rs similarity index 100% rename from hash/plonky2/src/bench/sha256/sha.rs rename to hash/plonky2/bench/src/bench/sha256/sha.rs diff --git a/hash/plonky2/src/bench/sha256/sigma.rs b/hash/plonky2/bench/src/bench/sha256/sigma.rs similarity index 100% rename from hash/plonky2/src/bench/sha256/sigma.rs rename to hash/plonky2/bench/src/bench/sha256/sigma.rs diff --git a/hash/plonky2/src/bench/sha256/xor3.rs b/hash/plonky2/bench/src/bench/sha256/xor3.rs similarity index 100% rename from hash/plonky2/src/bench/sha256/xor3.rs rename to hash/plonky2/bench/src/bench/sha256/xor3.rs diff --git a/hash/plonky2/src/main.rs b/hash/plonky2/bench/src/main.rs similarity index 97% rename from hash/plonky2/src/main.rs rename to hash/plonky2/bench/src/main.rs index eeb7e79..ee9a612 100644 --- a/hash/plonky2/src/main.rs +++ b/hash/plonky2/bench/src/main.rs @@ -13,6 +13,7 @@ mod bench{ pub mod keccak256{ pub mod keccak; + // pub mod keccak_polygon; } } From 86daf7b08d1290d60aa9aee044cd9e6e80919ae4 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Mon, 22 Jul 2024 15:02:46 +0530 Subject: [PATCH 36/41] keccak plonky2 implementation from polygon zk_evm --- .gitmodules | 3 + hash/plonky2/bench/Cargo.toml | 6 +- .../src/bench/keccak256/keccak_polygon.rs | 140 +++++++++--------- hash/plonky2/bench/src/main.rs | 12 +- hash/plonky2/external/zk_evm | 1 + 5 files changed, 92 insertions(+), 70 deletions(-) create mode 160000 hash/plonky2/external/zk_evm diff --git a/.gitmodules b/.gitmodules index e579aae..b4df4dd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "hash/risc0/external/risc0"] path = hash/risc0/external/risc0 url = https://github.com/risc0/risc0.git +[submodule "hash/plonky2/external/zk_evm"] + path = hash/plonky2/external/zk_evm + url = https://github.com/hashcloak/zk_evm.git diff --git a/hash/plonky2/bench/Cargo.toml b/hash/plonky2/bench/Cargo.toml index 9441eb3..ccadada 100644 --- a/hash/plonky2/bench/Cargo.toml +++ b/hash/plonky2/bench/Cargo.toml @@ -8,14 +8,14 @@ edition = "2021" [dependencies] # TODO: This can be later changed to original github -plonky2_u32 ={ git = "https://github.com/man2706kum/plonky2-u32.git"} +plonky2_u32 ={ git = "https://github.com/hashcloak/plonky2-u32.git"} plonky2 = "0.2.2" rand = "0.8.5" anyhow = "1.0.86" sha2 = "0.10" tiny-keccak={version="2.0.2", features=["keccak"]} hex="0.4.3" -evm_arithmetization ={ git = "https://github.com/0xPolygonZero/zk_evm.git", rev = "a5b92b2b2bcc7bbf8725190aaa0fba7007e51a6a"} -starky ={ git = "https://github.com/0xPolygonZero/plonky2.git", rev = "0e363e16a37a2eacd3349946bd071a460485ad26"} +evm_arithmetization ={ path = "../external/zk_evm/evm_arithmetization" } +starky = "0.4.0" env_logger = "0.11.3" log = "0.4.21" diff --git a/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs b/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs index a2c6f3b..445d0d8 100644 --- a/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs +++ b/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs @@ -1,93 +1,101 @@ use evm_arithmetization::keccak::keccak_stark::KeccakStark; use anyhow::Result; -use env_logger::{try_init_from_env, Env, DEFAULT_FILTER_ENV}; -use plonky2::field::types::PrimeField64; use plonky2::fri::oracle::PolynomialBatch; use plonky2::iop::challenger::Challenger; use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig}; -use starky::config::StarkConfig; use starky::cross_table_lookup::{CtlData, CtlZData}; use starky::lookup::{GrandProductChallenge, GrandProductChallengeSet}; -use starky::stark_testing::{test_stark_circuit_constraints, test_stark_low_degree}; -use tiny_keccak::keccakf; use plonky2::field::polynomial::PolynomialValues; use plonky2::field::types::Field; use plonky2::timed; -use evm_arithmetization::testing_utils::init_logger; +// use evm_arithmetization::testing_utils::init_logger; use plonky2::util::timing::TimingTree; use evm_arithmetization::prover::prove_single_table; use starky::lookup::Filter; use starky::lookup::Column; -use rand::random; -const NUM_INPUTS: usize = 84; +use evm_arithmetization::StarkConfig; +// use starky::verifier::verify_stark_proof; +// use starky::prover::prove; +use env_logger::DEFAULT_FILTER_ENV; +use env_logger::Env; +use env_logger::try_init_from_env; -pub fn keccak_polygon_bench() -> Result<()> { +// use evm_arithmetization::prover::prove; +// use evm_arithmetization::generation::generate_traces; +// use evm_arithmetization::AllStark; - const NUM_PERMS: usize = 85; - const D: usize = 2; - type C = PoseidonGoldilocksConfig; - type F = >::F; - type S = KeccakStark; - let stark = S::default(); - let config = StarkConfig::standard_fast_config(); +const NUM_INPUTS: usize = 25; - init_logger(); +pub fn keccak_polygon_bench(num_perms: usize) -> Result<()> { - let input: Vec<([u64; NUM_INPUTS], usize)> = - (0..NUM_PERMS).map(|_| (rand::random(), 0)).collect(); + const D: usize = 2; + type C = PoseidonGoldilocksConfig; + type F = >::F; + type S = KeccakStark; + let stark = S::default(); + let config = StarkConfig::standard_fast_config(); - let mut timing = TimingTree::new("prove", log::Level::Debug); - let trace_poly_values = timed!( - timing, - "generate trace", - stark.generate_trace(input, 8, &mut timing) - ); + init_logger(); - let cloned_trace_poly_values = timed!(timing, "clone", trace_poly_values.clone()); + let input: Vec<([u64; NUM_INPUTS], usize)> = + (0..num_perms).map(|_| (rand::random(), 0)).collect(); - let trace_commitments = timed!( - timing, - "compute trace commitment", - PolynomialBatch::::from_values( - cloned_trace_poly_values, - config.fri_config.rate_bits, - false, - config.fri_config.cap_height, - &mut timing, - None, - ) - ); - let degree = 1 << trace_commitments.degree_log; + let mut timing = TimingTree::new("prove", log::Level::Debug); + let trace_poly_values = timed!( + timing, + "generate trace", + stark.generate_trace(input, 8, &mut timing) + ); - // Fake CTL data. - let ctl_z_data = CtlZData::new( - vec![PolynomialValues::zero(degree)], - PolynomialValues::zero(degree), - GrandProductChallenge { - beta: F::ZERO, - gamma: F::ZERO, - }, - vec![], - vec![Filter::new_simple(Column::constant(F::ZERO))], - ); - let ctl_data = CtlData { - zs_columns: vec![ctl_z_data.clone(); config.num_challenges], - }; + let cloned_trace_poly_values = timed!(timing, "clone", trace_poly_values.clone()); - prove_single_table( - &stark, - &config, - &trace_poly_values, - &trace_commitments, - &ctl_data, - &GrandProductChallengeSet { - challenges: vec![ctl_z_data.challenge; config.num_challenges], - }, - &mut Challenger::new(), + let trace_commitments = timed!( + timing, + "compute trace commitment", + PolynomialBatch::::from_values( + cloned_trace_poly_values, + config.fri_config.rate_bits, + false, + config.fri_config.cap_height, &mut timing, None, - )?; + ) + ); + let degree = 1 << trace_commitments.degree_log; - timing.print(); - Ok(()) + // Fake CTL data. + let ctl_z_data = CtlZData::new( + vec![PolynomialValues::zero(degree)], + PolynomialValues::zero(degree), + GrandProductChallenge { + beta: F::ZERO, + gamma: F::ZERO, + }, + vec![], + vec![Filter::new_simple(Column::constant(F::ZERO))], + ); + let ctl_data = CtlData { + zs_columns: vec![ctl_z_data.clone(); config.num_challenges], + }; + + prove_single_table( + &stark, + &config, + &trace_poly_values, + &trace_commitments, + &ctl_data, + &GrandProductChallengeSet { + challenges: vec![ctl_z_data.challenge; config.num_challenges], + }, + &mut Challenger::new(), + &mut timing, + None, + )?; + + timing.print(); + Ok(()) +} + +fn init_logger() { + let _ = try_init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "debug")); } \ No newline at end of file diff --git a/hash/plonky2/bench/src/main.rs b/hash/plonky2/bench/src/main.rs index ee9a612..a5853f8 100644 --- a/hash/plonky2/bench/src/main.rs +++ b/hash/plonky2/bench/src/main.rs @@ -1,3 +1,4 @@ + use std::process; mod bench{ pub mod poseidon; @@ -13,7 +14,7 @@ mod bench{ pub mod keccak256{ pub mod keccak; - // pub mod keccak_polygon; + pub mod keccak_polygon; } } @@ -26,6 +27,8 @@ mod arithmetic { use bench::poseidon::poseidon_bench; use bench::keccak256::keccak::keccak_bench; use bench::sha256::sha::sha256_bench; +use bench::keccak256::keccak_polygon::keccak_polygon_bench; + fn main() { let args: Vec = std::env::args().collect(); @@ -53,6 +56,13 @@ fn main() { let _ = keccak_bench(size); } + "keccak-polygon" => { + println!("Running keccak of plolygon zk_evm: "); + eprintln!("number of permutation: {:?}", size); + let _ = keccak_polygon_bench(size); + } + + "sha256" => { println!("Running sha256: "); let _ = sha256_bench(size); diff --git a/hash/plonky2/external/zk_evm b/hash/plonky2/external/zk_evm new file mode 160000 index 0000000..29f8620 --- /dev/null +++ b/hash/plonky2/external/zk_evm @@ -0,0 +1 @@ +Subproject commit 29f8620338f2b3bb8be62def5666a2d9d7ba5331 From df55390be1f4cb225a3ebd1044689a081a273319 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Fri, 26 Jul 2024 13:10:42 +0530 Subject: [PATCH 37/41] code cleaning --- .../bench/src/bench/keccak256/keccak.rs | 19 ++++---- .../src/bench/keccak256/keccak_polygon.rs | 47 ++++++++++--------- hash/plonky2/bench/src/bench/poseidon.rs | 17 +++---- 3 files changed, 43 insertions(+), 40 deletions(-) diff --git a/hash/plonky2/bench/src/bench/keccak256/keccak.rs b/hash/plonky2/bench/src/bench/keccak256/keccak.rs index ae519d9..b287fa1 100644 --- a/hash/plonky2/bench/src/bench/keccak256/keccak.rs +++ b/hash/plonky2/bench/src/bench/keccak256/keccak.rs @@ -1,7 +1,6 @@ // code taken from https://github.com/qope/plonky2-keccak256/tree/main use std::marker::PhantomData; - use plonky2::{ field::extension::Extendable, hash::hash_types::RichField, @@ -9,19 +8,21 @@ use plonky2::{ target::BoolTarget, witness::{PartialWitness, WitnessWrite}, }, - plonk::circuit_builder::CircuitBuilder, + plonk::{ + circuit_builder::CircuitBuilder, + circuit_data::CircuitConfig, + config::PoseidonGoldilocksConfig, + }, field::goldilocks_field::GoldilocksField, }; use std::time::Instant; use rand::Rng; -use tiny_keccak::Keccak; -use tiny_keccak::Hasher; -use plonky2::plonk::circuit_data::CircuitConfig; -use plonky2::plonk::config::PoseidonGoldilocksConfig; +use tiny_keccak::{Keccak,Hasher}; use anyhow::Result; - -use crate::arithmetic::binary_arithmetic::xor_circuit; -use crate::arithmetic::u64_arithmetic::U64Target; +use crate::arithmetic::{ + binary_arithmetic::xor_circuit, + u64_arithmetic::U64Target +}; pub const ROUND_CONSTANTS: [u64; 24] = [ 1u64, diff --git a/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs b/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs index 445d0d8..8deed2f 100644 --- a/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs +++ b/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs @@ -1,28 +1,29 @@ -use evm_arithmetization::keccak::keccak_stark::KeccakStark; +use evm_arithmetization::{ + keccak::keccak_stark::KeccakStark, + prover::prove_single_table, + StarkConfig +}; use anyhow::Result; -use plonky2::fri::oracle::PolynomialBatch; -use plonky2::iop::challenger::Challenger; -use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig}; -use starky::cross_table_lookup::{CtlData, CtlZData}; -use starky::lookup::{GrandProductChallenge, GrandProductChallengeSet}; -use plonky2::field::polynomial::PolynomialValues; -use plonky2::field::types::Field; -use plonky2::timed; -// use evm_arithmetization::testing_utils::init_logger; -use plonky2::util::timing::TimingTree; -use evm_arithmetization::prover::prove_single_table; -use starky::lookup::Filter; -use starky::lookup::Column; -use evm_arithmetization::StarkConfig; -// use starky::verifier::verify_stark_proof; -// use starky::prover::prove; -use env_logger::DEFAULT_FILTER_ENV; -use env_logger::Env; -use env_logger::try_init_from_env; +use plonky2::{ + fri::oracle::PolynomialBatch, + iop::challenger::Challenger, + plonk::config::{GenericConfig, PoseidonGoldilocksConfig}, + field::polynomial::PolynomialValues, + field::types::Field, + timed, + util::timing::TimingTree, +}; +use starky::{ + cross_table_lookup::{CtlData, CtlZData}, + lookup::{GrandProductChallenge, GrandProductChallengeSet}, + lookup::{Filter,Column}, +}; -// use evm_arithmetization::prover::prove; -// use evm_arithmetization::generation::generate_traces; -// use evm_arithmetization::AllStark; +use env_logger::{ + DEFAULT_FILTER_ENV, + Env, + try_init_from_env +}; const NUM_INPUTS: usize = 25; diff --git a/hash/plonky2/bench/src/bench/poseidon.rs b/hash/plonky2/bench/src/bench/poseidon.rs index 62e36c8..fed9508 100644 --- a/hash/plonky2/bench/src/bench/poseidon.rs +++ b/hash/plonky2/bench/src/bench/poseidon.rs @@ -1,12 +1,13 @@ use anyhow::Result; -use plonky2::field::types::Field; -use plonky2::field::goldilocks_field::GoldilocksField; - -use plonky2::hash::poseidon::PoseidonHash; -use plonky2::iop::witness::{PartialWitness, WitnessWrite}; -use plonky2::plonk::circuit_builder::CircuitBuilder; -use plonky2::plonk::circuit_data::CircuitConfig; -use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig}; +use plonky2::{ + field::types::Field, + field::goldilocks_field::GoldilocksField, + hash::poseidon::PoseidonHash, + iop::witness::{PartialWitness, WitnessWrite}, + plonk::circuit_builder::CircuitBuilder, + plonk::circuit_data::CircuitConfig, + plonk::config::{GenericConfig, PoseidonGoldilocksConfig}, +}; use rand::Rng; use std::time; From c0429fa765bf2188dc907bdeda149a39fc1886eb Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Fri, 26 Jul 2024 13:13:37 +0530 Subject: [PATCH 38/41] risc0 benchmarking removed from this branch --- hash/risc0/README.md | 7 - hash/risc0/bench/.vscode/settings.json | 5 - hash/risc0/bench/Cargo.toml | 16 - hash/risc0/bench/LICENSE | 201 -- hash/risc0/bench/README.md | 12 - hash/risc0/bench/bench.cfg | 11 - hash/risc0/bench/bench_tree.cfg | 11 - hash/risc0/bench/build.sh | 3 - hash/risc0/bench/methods/Cargo.toml | 10 - hash/risc0/bench/methods/build.rs | 3 - hash/risc0/bench/methods/guest/Cargo.toml | 21 - .../bench/methods/guest/src/bin/blake2b.rs | 15 - .../bench/methods/guest/src/bin/blake3.rs | 15 - .../bench/methods/guest/src/bin/keccak.rs | 15 - .../guest/src/bin/poseidon2_babybear.rs | 135 - .../src/bin/poseidon2_babybear_native.rs | 1762 ----------- .../methods/guest/src/bin/poseidon2_bn128.rs | 43 - .../bench/methods/guest/src/bin/sha256.rs | 14 - .../guest/src/bin/sha256_accelerated.rs | 21 - hash/risc0/bench/methods/src/lib.rs | 1 - hash/risc0/bench/run.sh | 15 - hash/risc0/bench/run_tree.sh | 15 - hash/risc0/bench/rust-toolchain.toml | 4 - hash/risc0/bench/src/benches/blake2b.rs | 32 - hash/risc0/bench/src/benches/blake3.rs | 34 - hash/risc0/bench/src/benches/keccak.rs | 33 - hash/risc0/bench/src/benches/mod.rs | 8 - .../bench/src/benches/poseidon2_babybear.rs | 66 - .../src/benches/poseidon2_babybear_native.rs | 47 - .../bench/src/benches/poseidon2_bn128.rs | 48 - hash/risc0/bench/src/benches/sha256.rs | 32 - .../bench/src/benches/sha256_accelerated.rs | 30 - hash/risc0/bench/src/main.rs | 95 - hash/risc0/composition/Cargo.lock | 2795 ----------------- hash/risc0/composition/Cargo.toml | 16 - hash/risc0/composition/build.sh | 1 - hash/risc0/composition/methods/Cargo.toml | 10 - hash/risc0/composition/methods/build.rs | 17 - .../composition/methods/guest/Cargo.lock | 1100 ------- .../composition/methods/guest/Cargo.toml | 11 - .../composition/methods/guest/src/main.rs | 31 - hash/risc0/composition/methods/src/lib.rs | 15 - hash/risc0/composition/run.sh | 1 - hash/risc0/composition/src/main.rs | 65 - hash/risc0/external/risc0 | 1 - hash/risc0/inner_proof/Cargo.lock | 2778 ---------------- hash/risc0/inner_proof/Cargo.toml | 17 - hash/risc0/inner_proof/methods/Cargo.toml | 10 - hash/risc0/inner_proof/methods/build.rs | 3 - .../inner_proof/methods/guest/Cargo.lock | 791 ----- .../inner_proof/methods/guest/Cargo.toml | 9 - .../inner_proof/methods/guest/src/main.rs | 13 - hash/risc0/inner_proof/methods/src/lib.rs | 1 - hash/risc0/inner_proof/src/lib.rs | 42 - hash/risc0/inner_proof/src/main.rs | 36 - 55 files changed, 10543 deletions(-) delete mode 100644 hash/risc0/README.md delete mode 100644 hash/risc0/bench/.vscode/settings.json delete mode 100644 hash/risc0/bench/Cargo.toml delete mode 100644 hash/risc0/bench/LICENSE delete mode 100644 hash/risc0/bench/README.md delete mode 100644 hash/risc0/bench/bench.cfg delete mode 100644 hash/risc0/bench/bench_tree.cfg delete mode 100755 hash/risc0/bench/build.sh delete mode 100644 hash/risc0/bench/methods/Cargo.toml delete mode 100644 hash/risc0/bench/methods/build.rs delete mode 100644 hash/risc0/bench/methods/guest/Cargo.toml delete mode 100644 hash/risc0/bench/methods/guest/src/bin/blake2b.rs delete mode 100644 hash/risc0/bench/methods/guest/src/bin/blake3.rs delete mode 100644 hash/risc0/bench/methods/guest/src/bin/keccak.rs delete mode 100644 hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs delete mode 100644 hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear_native.rs delete mode 100644 hash/risc0/bench/methods/guest/src/bin/poseidon2_bn128.rs delete mode 100644 hash/risc0/bench/methods/guest/src/bin/sha256.rs delete mode 100644 hash/risc0/bench/methods/guest/src/bin/sha256_accelerated.rs delete mode 100644 hash/risc0/bench/methods/src/lib.rs delete mode 100755 hash/risc0/bench/run.sh delete mode 100755 hash/risc0/bench/run_tree.sh delete mode 100644 hash/risc0/bench/rust-toolchain.toml delete mode 100644 hash/risc0/bench/src/benches/blake2b.rs delete mode 100644 hash/risc0/bench/src/benches/blake3.rs delete mode 100644 hash/risc0/bench/src/benches/keccak.rs delete mode 100644 hash/risc0/bench/src/benches/mod.rs delete mode 100644 hash/risc0/bench/src/benches/poseidon2_babybear.rs delete mode 100644 hash/risc0/bench/src/benches/poseidon2_babybear_native.rs delete mode 100644 hash/risc0/bench/src/benches/poseidon2_bn128.rs delete mode 100644 hash/risc0/bench/src/benches/sha256.rs delete mode 100644 hash/risc0/bench/src/benches/sha256_accelerated.rs delete mode 100644 hash/risc0/bench/src/main.rs delete mode 100644 hash/risc0/composition/Cargo.lock delete mode 100644 hash/risc0/composition/Cargo.toml delete mode 100755 hash/risc0/composition/build.sh delete mode 100644 hash/risc0/composition/methods/Cargo.toml delete mode 100644 hash/risc0/composition/methods/build.rs delete mode 100644 hash/risc0/composition/methods/guest/Cargo.lock delete mode 100644 hash/risc0/composition/methods/guest/Cargo.toml delete mode 100644 hash/risc0/composition/methods/guest/src/main.rs delete mode 100644 hash/risc0/composition/methods/src/lib.rs delete mode 100755 hash/risc0/composition/run.sh delete mode 100644 hash/risc0/composition/src/main.rs delete mode 160000 hash/risc0/external/risc0 delete mode 100644 hash/risc0/inner_proof/Cargo.lock delete mode 100644 hash/risc0/inner_proof/Cargo.toml delete mode 100644 hash/risc0/inner_proof/methods/Cargo.toml delete mode 100644 hash/risc0/inner_proof/methods/build.rs delete mode 100644 hash/risc0/inner_proof/methods/guest/Cargo.lock delete mode 100644 hash/risc0/inner_proof/methods/guest/Cargo.toml delete mode 100644 hash/risc0/inner_proof/methods/guest/src/main.rs delete mode 100644 hash/risc0/inner_proof/methods/src/lib.rs delete mode 100644 hash/risc0/inner_proof/src/lib.rs delete mode 100644 hash/risc0/inner_proof/src/main.rs diff --git a/hash/risc0/README.md b/hash/risc0/README.md deleted file mode 100644 index edaa9ab..0000000 --- a/hash/risc0/README.md +++ /dev/null @@ -1,7 +0,0 @@ -Benchmarking inside risc'0 zkvm --------------------------------- - -- `external` folder contains risc0 as a git submodule. -- `bench` folder contains the benchmarking for different hash functions. Go to the `bench/README.md` for more details. -- `inner_proof` folder contains methods for generating the Receipt for sha256 which is being used as an inner proof in `composition` -- `composition` folder contains methods of proof composition which uses `inner_proof`. diff --git a/hash/risc0/bench/.vscode/settings.json b/hash/risc0/bench/.vscode/settings.json deleted file mode 100644 index 4545fa6..0000000 --- a/hash/risc0/bench/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "rust-analyzer.linkedProjects": [ - "./methods/guest/Cargo.toml" - ] -} \ No newline at end of file diff --git a/hash/risc0/bench/Cargo.toml b/hash/risc0/bench/Cargo.toml deleted file mode 100644 index f4f93e0..0000000 --- a/hash/risc0/bench/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "benchmark" -version = "0.1.0" -edition = "2021" - -[dependencies] -risc0-zkvm = { path = "../external/risc0/risc0/zkvm" } -serde = "1.0" -rand = "0.8.3" -sha2 ={ git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.6-risczero.0" } -benchmark_methods = { path = "methods" } -zkhash = { git = "https://github.com/HorizenLabs/poseidon2.git"} -ark-ff = "0.4.2" -hex = "0.4.3" -ark-serialize = "0.4" -risc0-core = { path = "../external/risc0/risc0/core" } diff --git a/hash/risc0/bench/LICENSE b/hash/risc0/bench/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/hash/risc0/bench/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/hash/risc0/bench/README.md b/hash/risc0/bench/README.md deleted file mode 100644 index d0bf8ae..0000000 --- a/hash/risc0/bench/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Benchmarking different hashes inside risc'0 zkvm ------------------------------------------------ - -The benchmark is defined by the following shell scripts: - -- `build.sh` - build the code. - -- `run.sh` and `run2.sh` - run the benchmark itself (`run.sh` for sha256, keccak, blake2b, blake3 and `run2.sh` for poseidon2 over bn128 and babybear) - -Benchmarks can be parameterized using environment variables. By convention, we start the names of these environment variables with the `ZKBENCH_` prefix. - -Additional files `bench.cfg` and `bench_tree.cfg` specifies the configurations and parameters. diff --git a/hash/risc0/bench/bench.cfg b/hash/risc0/bench/bench.cfg deleted file mode 100644 index a5a366f..0000000 --- a/hash/risc0/bench/bench.cfg +++ /dev/null @@ -1,11 +0,0 @@ -name: "Hashes benchmarking using risc0 prover" -author: -timeout: 200 -params: - [ HASH_TYPE: [ "sha256", "keccak", "blake2b", "blake3"] - , INPUT_SIZE_BYTES: [ 256, 512, 1024, 2048 ] - ] -tags: risc0, $HASH_TYPE -comments: - The benchmarks includes for sha256, keccak, blake2b, blake3. - the hashing is done inside the guest and receipt is received which is verified. diff --git a/hash/risc0/bench/bench_tree.cfg b/hash/risc0/bench/bench_tree.cfg deleted file mode 100644 index f6d767e..0000000 --- a/hash/risc0/bench/bench_tree.cfg +++ /dev/null @@ -1,11 +0,0 @@ -name: "Hashes benchmarking using risc0 prover" -author: -timeout: 1000 -params: - [ HASH_TYPE_TREE: [ "poseidon2_babybear", "poseidon2_babybear_native", "poseidon2_bn128"] - , TREE_DEPTH: [ 2, 4, 8, 16 ] - ] -tags: risc0, $HASH_TYPE_TREE -comments: - The benchmarks includes for poseidon2(merkle hashing) over bn128 and babybear. - the hashing is done inside the guest and receipt is received which is verified. diff --git a/hash/risc0/bench/build.sh b/hash/risc0/bench/build.sh deleted file mode 100755 index 0dfa161..0000000 --- a/hash/risc0/bench/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - - cargo build --release diff --git a/hash/risc0/bench/methods/Cargo.toml b/hash/risc0/bench/methods/Cargo.toml deleted file mode 100644 index f391ce6..0000000 --- a/hash/risc0/bench/methods/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "benchmark_methods" -version = "0.1.0" -edition = "2021" - -[build-dependencies] -risc0-build = { path = "../../external/risc0/risc0/build" } - -[package.metadata.risc0] -methods = ["guest"] diff --git a/hash/risc0/bench/methods/build.rs b/hash/risc0/bench/methods/build.rs deleted file mode 100644 index 08a8a4e..0000000 --- a/hash/risc0/bench/methods/build.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - risc0_build::embed_methods(); -} diff --git a/hash/risc0/bench/methods/guest/Cargo.toml b/hash/risc0/bench/methods/guest/Cargo.toml deleted file mode 100644 index 6d495bb..0000000 --- a/hash/risc0/bench/methods/guest/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "method" -version = "0.1.0" -edition = "2021" - -[workspace] - -[dependencies] -# If you want to try (experimental) std support, add `features = [ "std" ]` to risc0-zkvm -risc0-zkvm = { path = "../../../external/risc0/risc0/zkvm", default-features = false,features = ["std"] } -sha3 = "0.10.8" -sha2 ={ git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.6-risczero.0" } -risc0-zkp = {path = "../../../external/risc0/risc0/zkp"} -blake3 = "1.5.0" -zkhash = { git = "https://github.com/HorizenLabs/poseidon2.git"} -ark-serialize = "0.4" -ark-ff = "0.4.2" -risc0-core = {path = "../../../external/risc0/risc0/core"} -lazy_static = "1.4" -# risc0-zkp-core = "0.10.0" -rand = "0.8.5" \ No newline at end of file diff --git a/hash/risc0/bench/methods/guest/src/bin/blake2b.rs b/hash/risc0/bench/methods/guest/src/bin/blake2b.rs deleted file mode 100644 index 4d6c3e5..0000000 --- a/hash/risc0/bench/methods/guest/src/bin/blake2b.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![no_main] - -use risc0_zkvm::{guest::env, sha::Digest}; -use risc0_zkp::core::hash::blake2b::{Blake2b, Blake2bCpuImpl}; - -risc0_zkvm::guest::entry!(main); - -pub fn main() { - - let data: Vec = env::read(); - let hash = Blake2bCpuImpl::blake2b(&data); - let digest: Digest = hash.into(); - env::commit(&digest) - -} diff --git a/hash/risc0/bench/methods/guest/src/bin/blake3.rs b/hash/risc0/bench/methods/guest/src/bin/blake3.rs deleted file mode 100644 index fc78b7a..0000000 --- a/hash/risc0/bench/methods/guest/src/bin/blake3.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![no_main] - -use risc0_zkvm::{guest::env, sha::Digest}; -use blake3::hash; - -risc0_zkvm::guest::entry!(main); - -pub fn main() { - - let data: Vec = env::read(); - let result = hash(&data); - let digest = Digest::try_from(*result.as_bytes()).unwrap(); - env::commit(&digest) - -} diff --git a/hash/risc0/bench/methods/guest/src/bin/keccak.rs b/hash/risc0/bench/methods/guest/src/bin/keccak.rs deleted file mode 100644 index c28e7e0..0000000 --- a/hash/risc0/bench/methods/guest/src/bin/keccak.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![no_main] - -use risc0_zkvm::{guest::env, sha::Digest}; -use sha3::{Digest as _, Keccak256}; - -risc0_zkvm::guest::entry!(main); - -pub fn main() { - - let data: Vec = env::read(); - let hash: [u8;32] = Keccak256::digest(data).into(); - let digest = Digest::try_from(hash).unwrap(); - env::commit(&digest) - -} diff --git a/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs b/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs deleted file mode 100644 index 3577d02..0000000 --- a/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear.rs +++ /dev/null @@ -1,135 +0,0 @@ -#![no_main] -#![allow(non_snake_case)] -use risc0_zkvm::guest::env; -use zkhash::poseidon2::poseidon2; -use zkhash::poseidon2::poseidon2::Poseidon2; -use zkhash::poseidon2::poseidon2_instance_babybear::{/*POSEIDON2_BABYBEAR_16_PARAMS , */POSEIDON2_BABYBEAR_24_PARAMS}; -use zkhash::fields::babybear::FpBabyBear; -use ark_serialize::{CanonicalSerialize, CanonicalDeserialize}; -use std::marker::PhantomData; -use risc0_zkvm::guest::env::cycle_count; - -use ark_ff::PrimeField; - -pub trait MerkleTreeHash { - fn compress(&self, input: &[&F]) -> Vec; -} - -#[derive(Clone, Debug)] -pub struct MerkleTree> { - perm: P, - field: PhantomData, -} - -impl> MerkleTree { - pub fn new(perm: P) -> Self { - MerkleTree { - perm, - field: PhantomData, - } - } - - fn round_up_pow_n(input: usize, n: usize) -> usize { - debug_assert!(n >= 1); - let mut res = 1; - // try powers, starting from n - loop { - res *= n; - if res >= input { - break; - } - } - res - } - - pub fn accumulate(&mut self, set: &[F]) -> Vec { - assert!(set.len()%8 == 0); - let set_size = set.len() / 8; - let mut bound = Self::round_up_pow_n(set_size, 2); - loop { - if bound >= 2 { - break; - } - bound *= 2; - } - let mut nodes: Vec = Vec::with_capacity(bound * 8); - for s in set { - nodes.push(s.to_owned()); - } - // pad - for _ in nodes.len()..bound { - nodes.push(nodes[set_size * 8 - 1].to_owned()); - } - - while nodes.len() > 8 { - let new_len = nodes.len() / 2; - let mut new_nodes: Vec = Vec::with_capacity(new_len); - for i in (0..nodes.len()).step_by(16) { - let inp = [ - &nodes[i], &nodes[i + 1], &nodes[i + 2], &nodes[i + 3], &nodes[i + 4], &nodes[i + 5], &nodes[i + 6], &nodes[i + 7], - &nodes[i + 8], &nodes[i + 9], &nodes[i + 10], &nodes[i + 11], &nodes[i + 12], &nodes[i + 13], &nodes[i + 14], &nodes[i + 15] - ]; - let dig = self.perm.compress(&inp); - - for j in 0..8 { - new_nodes.push(dig[j]); - } - - } - nodes = new_nodes; - } - vec![nodes[0].to_owned(), nodes[1].to_owned(), nodes[2].to_owned(), nodes[3].to_owned(), nodes[4].to_owned(), nodes[5].to_owned(), nodes[6].to_owned(), nodes[7].to_owned()] - } -} - -impl MerkleTreeHash for Poseidon2 { - fn compress(&self, input: &[&F]) -> Vec { - let p = self.permutation(&[ - input[0].to_owned(), input[1].to_owned(),input[2].to_owned(), input[3].to_owned(),input[4].to_owned(), input[5].to_owned(),input[6].to_owned(), input[7].to_owned(), - input[8].to_owned(), input[9].to_owned(),input[10].to_owned(), input[11].to_owned(),input[12].to_owned(), input[13].to_owned(),input[14].to_owned(), input[15].to_owned(), - F::zero(), F::zero(), F::zero(), F::zero(), F::zero(), F::zero(), F::zero(), F::zero() - ]); - - vec![p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]] - } -} - -risc0_zkvm::guest::entry!(main); - -pub fn main() { - - let data: Vec> = env::read(); - - let cycles1 = cycle_count(); - let mut hash_data: Vec = Vec::new(); - for i in 0..data.len() { - let a_uncompressed = FpBabyBear::deserialize_uncompressed(&**data.get(i).unwrap()).unwrap(); - hash_data.push(a_uncompressed); - } - let cycles2 = cycle_count(); - - - let permutation = poseidon2::Poseidon2::new(&POSEIDON2_BABYBEAR_24_PARAMS); - let mut merkle_tree = MerkleTree::new(permutation.clone()); - let cycles3 = cycle_count(); - let hash_final = merkle_tree.accumulate(&hash_data); - - let cycles4 = cycle_count(); - - let mut perm_seralised: Vec> = Vec::new(); - for i in 0..8 { - let mut temp: Vec = Vec::new(); - hash_final.get(i).unwrap().serialize_uncompressed(&mut temp).unwrap(); - perm_seralised.push(temp); - } - let cycles6 = cycle_count(); - - env::commit(&perm_seralised); - - eprintln!("number of cycles for input builder: {:?}", cycles2 - cycles1); - eprintln!("number of cycles for hash permutation builder: {:?}", cycles3 - cycles2); - eprintln!("number of cycles for hash accumulation: {:?}", cycles4 - cycles3); - - eprintln!("number of cycles for permutation seralisation: {:?}", cycles6 - cycles4); - -} diff --git a/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear_native.rs b/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear_native.rs deleted file mode 100644 index 9b47b7b..0000000 --- a/hash/risc0/bench/methods/guest/src/bin/poseidon2_babybear_native.rs +++ /dev/null @@ -1,1762 +0,0 @@ -#![no_main] -#![allow(non_snake_case)] -use risc0_core::field::baby_bear::BabyBearElem; -use risc0_zkvm::guest::env; -use std::marker::PhantomData; -use std::sync::Arc; -use risc0_core::field::Elem; -use lazy_static::lazy_static; -use risc0_zkvm::guest::env::cycle_count; - -// This code is adapted from https://github.com/HorizenLabs/poseidon2/tree/main -#[derive(Clone, Debug)] -pub struct Poseidon2Params { - pub(crate) t: usize, // statesize - pub(crate) d: usize, // sbox degree - pub(crate) rounds_f_beginning: usize, - pub(crate) rounds_p: usize, - #[allow(dead_code)] - pub(crate) rounds_f_end: usize, - pub(crate) rounds: usize, - pub(crate) mat_internal_diag_m_1: Vec, - pub(crate) _mat_internal: Vec>, - pub(crate) round_constants: Vec>, -} - -impl Poseidon2Params { - #[allow(clippy::too_many_arguments)] - - pub const INIT_SHAKE: &'static str = "Poseidon2"; - - pub fn new( - t: usize, - d: usize, - rounds_f: usize, - rounds_p: usize, - mat_internal_diag_m_1: &[F], - mat_internal: &[Vec], - round_constants: &[Vec], - ) -> Self { - assert!(d == 3 || d == 5 || d == 7 || d == 11); - assert_eq!(rounds_f % 2, 0); - let r = rounds_f / 2; - let rounds = rounds_f + rounds_p; - - Poseidon2Params { - t, - d, - rounds_f_beginning: r, - rounds_p, - rounds_f_end: r, - rounds, - mat_internal_diag_m_1: mat_internal_diag_m_1.to_owned(), - _mat_internal: mat_internal.to_owned(), - round_constants: round_constants.to_owned(), - } - } -} -#[derive(Clone, Debug)] -pub struct Poseidon2 { - pub(crate) params: Arc>, -} - -impl Poseidon2 { - pub fn new(params: &Arc>) -> Self { - Poseidon2 { - params: Arc::clone(params), - } - } - - pub fn get_t(&self) -> usize { - self.params.t - } - - pub fn permutation(&self, input: &[F]) -> Vec { - let t = self.params.t; - assert_eq!(input.len(), t); - - let mut current_state = input.to_owned(); - - // Linear layer at beginning - self.matmul_external(&mut current_state); - - for r in 0..self.params.rounds_f_beginning { - current_state = self.add_rc(¤t_state, &self.params.round_constants[r]); - current_state = self.sbox(¤t_state); - self.matmul_external(&mut current_state); - } - - let p_end = self.params.rounds_f_beginning + self.params.rounds_p; - for r in self.params.rounds_f_beginning..p_end { - current_state[0].add_assign(self.params.round_constants[r][0]); - current_state[0] = self.sbox_p(¤t_state[0]); - self.matmul_internal(&mut current_state, &self.params.mat_internal_diag_m_1); - } - - for r in p_end..self.params.rounds { - current_state = self.add_rc(¤t_state, &self.params.round_constants[r]); - current_state = self.sbox(¤t_state); - self.matmul_external(&mut current_state); - } - current_state - } - - fn sbox(&self, input: &[F]) -> Vec { - input.iter().map(|el| self.sbox_p(el)).collect() - } - - fn sbox_p(&self, input: &F) -> F { - let mut input2 = *input; - input2.mul_assign(input2); - - match self.params.d { - 3 => { - let mut out = input2; - out.mul_assign(*input); - out - } - 5 => { - let mut out = input2; - out.mul_assign(out); - out.mul_assign(*input); - out - } - 7 => { - let mut out = input2; - out.mul_assign(out); - out.mul_assign(input2); - out.mul_assign(*input); - out - } - _ => { - panic!() - } - } - } - - fn matmul_m4(&self, input: &mut[F]) { - let t = self.params.t; - let t4 = t / 4; - for i in 0..t4 { - let start_index = i * 4; - let mut t_0 = input[start_index]; - t_0.add_assign(input[start_index + 1]); - let mut t_1 = input[start_index + 2]; - t_1.add_assign(input[start_index + 3]); - let mut t_2 = input[start_index + 1]; - t_2.add_assign(t_2); - t_2.add_assign(t_1); - let mut t_3 = input[start_index + 3]; - t_3.add_assign(t_3); - t_3.add_assign(t_0); - let mut t_4 = t_1; - t_4.add_assign(t_4); - t_4.add_assign(t_4); - t_4.add_assign(t_3); - let mut t_5 = t_0; - t_5.add_assign(t_5); - t_5.add_assign(t_5); - t_5.add_assign(t_2); - let mut t_6 = t_3; - t_6.add_assign(t_5); - let mut t_7 = t_2; - t_7.add_assign(t_4); - input[start_index] = t_6; - input[start_index + 1] = t_5; - input[start_index + 2] = t_7; - input[start_index + 3] = t_4; - } - } - - fn matmul_external(&self, input: &mut[F]) { - let t = self.params.t; - match t { - 2 => { - // Matrix circ(2, 1) - let mut sum = input[0]; - sum.add_assign(input[1]); - input[0].add_assign(sum); - input[1].add_assign(sum); - } - 3 => { - // Matrix circ(2, 1, 1) - let mut sum = input[0]; - sum.add_assign(input[1]); - sum.add_assign(input[2]); - input[0].add_assign(sum); - input[1].add_assign(sum); - input[2].add_assign(sum); - } - 4 => { - // Applying cheap 4x4 MDS matrix to each 4-element part of the state - self.matmul_m4(input); - } - 8 | 12 | 16 | 20 | 24 => { - // Applying cheap 4x4 MDS matrix to each 4-element part of the state - self.matmul_m4(input); - - // Applying second cheap matrix for t > 4 - let t4 = t / 4; - let mut stored = [F::ZERO; 4]; - for l in 0..4 { - stored[l] = input[l]; - for j in 1..t4 { - stored[l].add_assign(input[4 * j + l]); - } - } - for i in 0..input.len() { - input[i].add_assign(stored[i % 4]); - } - } - _ => { - panic!() - } - } - } - - fn matmul_internal(&self, input: &mut[F], mat_internal_diag_m_1: &[F]) { - let t = self.params.t; - - match t { - 2 => { - // [2, 1] - // [1, 3] - let mut sum = input[0]; - sum.add_assign(input[1]); - input[0].add_assign(sum); - input[1].add_assign(input[1]); - input[1].add_assign(sum); - } - 3 => { - // [2, 1, 1] - // [1, 2, 1] - // [1, 1, 3] - let mut sum = input[0]; - sum.add_assign(input[1]); - sum.add_assign(input[2]); - input[0].add_assign(sum); - input[1].add_assign(sum); - input[2].add_assign(input[2]); - input[2].add_assign(sum); - } - 4 | 8 | 12 | 16 | 20 | 24 => { - // Compute input sum - let mut sum = input[0]; - input - .iter() - .skip(1) - .take(t-1) - .for_each(|el| sum.add_assign(*el)); - // Add sum + diag entry * element to each element - for i in 0..input.len() { - input[i].mul_assign(mat_internal_diag_m_1[i]); - input[i].add_assign(sum); - } - } - _ => { - panic!() - } - } - } - - fn add_rc(&self, input: &[F], rc: &[F]) -> Vec { - input - .iter() - .zip(rc.iter()) - .map(|(a, b)| { - let mut r = *a; - r.add_assign(*b); - r - }) - .collect() - } -} - - -//merkle tree -pub trait MerkleTreeHash { - fn compress(&self, input: &[&F]) -> Vec; -} - -#[derive(Clone, Debug)] -pub struct MerkleTree> { - perm: P, - field: PhantomData, -} - -impl> MerkleTree { - pub fn new(perm: P) -> Self { - MerkleTree { - perm, - field: PhantomData, - } - } - - fn round_up_pow_n(input: usize, n: usize) -> usize { - debug_assert!(n >= 1); - let mut res = 1; - // try powers, starting from n - loop { - res *= n; - if res >= input { - break; - } - } - res - } - - pub fn accumulate(&mut self, set: &[F]) -> Vec { - assert!(set.len()%8 == 0); - let set_size = set.len() / 8; - let mut bound = Self::round_up_pow_n(set_size, 2); - loop { - if bound >= 2 { - break; - } - bound *= 2; - } - let mut nodes: Vec = Vec::with_capacity(bound * 8); - for s in set { - nodes.push(s.to_owned()); - } - // pad - for _ in nodes.len()..bound { - nodes.push(nodes[set_size * 8 - 1].to_owned()); - } - - while nodes.len() > 8 { - let new_len = nodes.len() / 2; - let mut new_nodes: Vec = Vec::with_capacity(new_len); - for i in (0..nodes.len()).step_by(16) { - let inp = [ - &nodes[i], &nodes[i + 1], &nodes[i + 2], &nodes[i + 3], &nodes[i + 4], &nodes[i + 5], &nodes[i + 6], &nodes[i + 7], - &nodes[i + 8], &nodes[i + 9], &nodes[i + 10], &nodes[i + 11], &nodes[i + 12], &nodes[i + 13], &nodes[i + 14], &nodes[i + 15] - ]; - let dig = self.perm.compress(&inp); - - for j in 0..8 { - new_nodes.push(dig[j]); - } - - } - nodes = new_nodes; - } - vec![nodes[0].to_owned(), nodes[1].to_owned(), nodes[2].to_owned(), nodes[3].to_owned(), nodes[4].to_owned(), nodes[5].to_owned(), nodes[6].to_owned(), nodes[7].to_owned()] - } -} - -impl MerkleTreeHash for Poseidon2 { - fn compress(&self, input: &[&F]) -> Vec { - let p = self.permutation(&[ - input[0].to_owned(), input[1].to_owned(),input[2].to_owned(), input[3].to_owned(),input[4].to_owned(), input[5].to_owned(),input[6].to_owned(), input[7].to_owned(), - input[8].to_owned(), input[9].to_owned(),input[10].to_owned(), input[11].to_owned(),input[12].to_owned(), input[13].to_owned(),input[14].to_owned(), input[15].to_owned(), - F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO, F::ZERO - ]); - - vec![p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]] - } -} - -//--------------------- -lazy_static!{ -pub static ref MAT_DIAG24_M_1: Vec = vec![ - BabyBearElem::from(0x409133f0 as u32), - BabyBearElem::from(0x1667a8a1 as u32), - BabyBearElem::from(0x06a6c7b6 as u32), - BabyBearElem::from(0x6f53160e as u32), - BabyBearElem::from(0x273b11d1 as u32), - BabyBearElem::from(0x03176c5d as u32), - BabyBearElem::from(0x72f9bbf9 as u32), - BabyBearElem::from(0x73ceba91 as u32), - BabyBearElem::from(0x5cdef81d as u32), - BabyBearElem::from(0x01393285 as u32), - BabyBearElem::from(0x46daee06 as u32), - BabyBearElem::from(0x065d7ba6 as u32), - BabyBearElem::from(0x52d72d6f as u32), - BabyBearElem::from(0x05dd05e0 as u32), - BabyBearElem::from(0x3bab4b63 as u32), - BabyBearElem::from(0x6ada3842 as u32), - BabyBearElem::from(0x2fc5fbec as u32), - BabyBearElem::from(0x770d61b0 as u32), - BabyBearElem::from(0x5715aae9 as u32), - BabyBearElem::from(0x03ef0e90 as u32), - BabyBearElem::from(0x75b6c770 as u32), - BabyBearElem::from(0x242adf5f as u32), - BabyBearElem::from(0x00d0ca4c as u32), - BabyBearElem::from(0x36c0e388 as u32), - ]; - - pub static ref MAT_INTERNAL24: Vec> = vec![ - vec![BabyBearElem::from(0x409133f1 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x1667a8a2 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x06a6c7b7 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x6f53160f as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x273b11d2 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x03176c5e as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x72f9bbfa as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x73ceba92 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x5cdef81e as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x01393286 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x46daee07 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x065d7ba7 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x52d72d70 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x05dd05e1 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x3bab4b64 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x6ada3843 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x2fc5fbed as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x770d61b1 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x5715aaea as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x03ef0e91 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x75b6c771 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x242adf60 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00d0ca4d as u32), - BabyBearElem::from(0x00000001 as u32), - ], - vec![BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x00000001 as u32), - BabyBearElem::from(0x36c0e389 as u32), - ], - ]; - - pub static ref RC24: Vec> = vec![ - vec![BabyBearElem::from(0x0fa20c37 as u32), - BabyBearElem::from(0x0795bb97 as u32), - BabyBearElem::from(0x12c60b9c as u32), - BabyBearElem::from(0x0eabd88e as u32), - BabyBearElem::from(0x096485ca as u32), - BabyBearElem::from(0x07093527 as u32), - BabyBearElem::from(0x1b1d4e50 as u32), - BabyBearElem::from(0x30a01ace as u32), - BabyBearElem::from(0x3bd86f5a as u32), - BabyBearElem::from(0x69af7c28 as u32), - BabyBearElem::from(0x3f94775f as u32), - BabyBearElem::from(0x731560e8 as u32), - BabyBearElem::from(0x465a0ecd as u32), - BabyBearElem::from(0x574ef807 as u32), - BabyBearElem::from(0x62fd4870 as u32), - BabyBearElem::from(0x52ccfe44 as u32), - BabyBearElem::from(0x14772b14 as u32), - BabyBearElem::from(0x4dedf371 as u32), - BabyBearElem::from(0x260acd7c as u32), - BabyBearElem::from(0x1f51dc58 as u32), - BabyBearElem::from(0x75125532 as u32), - BabyBearElem::from(0x686a4d7b as u32), - BabyBearElem::from(0x54bac179 as u32), - BabyBearElem::from(0x31947706 as u32), - ], - vec![BabyBearElem::from(0x29799d3b as u32), - BabyBearElem::from(0x6e01ae90 as u32), - BabyBearElem::from(0x203a7a64 as u32), - BabyBearElem::from(0x4f7e25be as u32), - BabyBearElem::from(0x72503f77 as u32), - BabyBearElem::from(0x45bd3b69 as u32), - BabyBearElem::from(0x769bd6b4 as u32), - BabyBearElem::from(0x5a867f08 as u32), - BabyBearElem::from(0x4fdba082 as u32), - BabyBearElem::from(0x251c4318 as u32), - BabyBearElem::from(0x28f06201 as u32), - BabyBearElem::from(0x6788c43a as u32), - BabyBearElem::from(0x4c6d6a99 as u32), - BabyBearElem::from(0x357784a8 as u32), - BabyBearElem::from(0x2abaf051 as u32), - BabyBearElem::from(0x770f7de6 as u32), - BabyBearElem::from(0x1794b784 as u32), - BabyBearElem::from(0x4796c57a as u32), - BabyBearElem::from(0x724b7a10 as u32), - BabyBearElem::from(0x449989a7 as u32), - BabyBearElem::from(0x64935cf1 as u32), - BabyBearElem::from(0x59e14aac as u32), - BabyBearElem::from(0x0e620bb8 as u32), - BabyBearElem::from(0x3af5a33b as u32), - ], - vec![BabyBearElem::from(0x4465cc0e as u32), - BabyBearElem::from(0x019df68f as u32), - BabyBearElem::from(0x4af8d068 as u32), - BabyBearElem::from(0x08784f82 as u32), - BabyBearElem::from(0x0cefdeae as u32), - BabyBearElem::from(0x6337a467 as u32), - BabyBearElem::from(0x32fa7a16 as u32), - BabyBearElem::from(0x486f62d6 as u32), - BabyBearElem::from(0x386a7480 as u32), - BabyBearElem::from(0x20f17c4a as u32), - BabyBearElem::from(0x54e50da8 as u32), - BabyBearElem::from(0x2012cf03 as u32), - BabyBearElem::from(0x5fe52950 as u32), - BabyBearElem::from(0x09afb6cd as u32), - BabyBearElem::from(0x2523044e as u32), - BabyBearElem::from(0x5c54d0ef as u32), - BabyBearElem::from(0x71c01f3c as u32), - BabyBearElem::from(0x60b2c4fb as u32), - BabyBearElem::from(0x4050b379 as u32), - BabyBearElem::from(0x5e6a70a5 as u32), - BabyBearElem::from(0x418543f5 as u32), - BabyBearElem::from(0x71debe56 as u32), - BabyBearElem::from(0x1aad2994 as u32), - BabyBearElem::from(0x3368a483 as u32), - ], - vec![BabyBearElem::from(0x07a86f3a as u32), - BabyBearElem::from(0x5ea43ff1 as u32), - BabyBearElem::from(0x2443780e as u32), - BabyBearElem::from(0x4ce444f7 as u32), - BabyBearElem::from(0x146f9882 as u32), - BabyBearElem::from(0x3132b089 as u32), - BabyBearElem::from(0x197ea856 as u32), - BabyBearElem::from(0x667030c3 as u32), - BabyBearElem::from(0x2317d5dc as u32), - BabyBearElem::from(0x0c2c48a7 as u32), - BabyBearElem::from(0x56b2df66 as u32), - BabyBearElem::from(0x67bd81e9 as u32), - BabyBearElem::from(0x4fcdfb19 as u32), - BabyBearElem::from(0x4baaef32 as u32), - BabyBearElem::from(0x0328d30a as u32), - BabyBearElem::from(0x6235760d as u32), - BabyBearElem::from(0x12432912 as u32), - BabyBearElem::from(0x0a49e258 as u32), - BabyBearElem::from(0x030e1b70 as u32), - BabyBearElem::from(0x48caeb03 as u32), - BabyBearElem::from(0x49e4d9e9 as u32), - BabyBearElem::from(0x1051b5c6 as u32), - BabyBearElem::from(0x6a36dbbe as u32), - BabyBearElem::from(0x4cff27a5 as u32), - ], - vec![BabyBearElem::from(0x1da78ec2 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x730b0924 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x3eb56cf3 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x5bd93073 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x37204c97 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x51642d89 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x66e943e8 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x1a3e72de as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x70beb1e9 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x30ff3b3f as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x4240d1c4 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x12647b8d as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x65d86965 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x49ef4d7c as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x47785697 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x46b3969f as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x5c7b7a0e as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x7078fc60 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x4f22d482 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x482a9aee as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x6beb839d as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - BabyBearElem::from(0x00000000 as u32), - ], - vec![BabyBearElem::from(0x032959ad as u32), - BabyBearElem::from(0x2b18af6a as u32), - BabyBearElem::from(0x55d3dc8c as u32), - BabyBearElem::from(0x43bd26c8 as u32), - BabyBearElem::from(0x0c41595f as u32), - BabyBearElem::from(0x7048d2e2 as u32), - BabyBearElem::from(0x00db8983 as u32), - BabyBearElem::from(0x2af563d7 as u32), - BabyBearElem::from(0x6e84758f as u32), - BabyBearElem::from(0x611d64e1 as u32), - BabyBearElem::from(0x1f9977e2 as u32), - BabyBearElem::from(0x64163a0a as u32), - BabyBearElem::from(0x5c5fc27b as u32), - BabyBearElem::from(0x02e22561 as u32), - BabyBearElem::from(0x3a2d75db as u32), - BabyBearElem::from(0x1ba7b71a as u32), - BabyBearElem::from(0x34343f64 as u32), - BabyBearElem::from(0x7406b35d as u32), - BabyBearElem::from(0x19df8299 as u32), - BabyBearElem::from(0x6ff4480a as u32), - BabyBearElem::from(0x514a81c8 as u32), - BabyBearElem::from(0x57ab52ce as u32), - BabyBearElem::from(0x6ad69f52 as u32), - BabyBearElem::from(0x3e0c0e0d as u32), - ], - vec![BabyBearElem::from(0x48126114 as u32), - BabyBearElem::from(0x2a9d62cc as u32), - BabyBearElem::from(0x17441f23 as u32), - BabyBearElem::from(0x485762bb as u32), - BabyBearElem::from(0x2f218674 as u32), - BabyBearElem::from(0x06fdc64a as u32), - BabyBearElem::from(0x0861b7f2 as u32), - BabyBearElem::from(0x3b36eee6 as u32), - BabyBearElem::from(0x70a11040 as u32), - BabyBearElem::from(0x04b31737 as u32), - BabyBearElem::from(0x3722a872 as u32), - BabyBearElem::from(0x2a351c63 as u32), - BabyBearElem::from(0x623560dc as u32), - BabyBearElem::from(0x62584ab2 as u32), - BabyBearElem::from(0x382c7c04 as u32), - BabyBearElem::from(0x3bf9edc7 as u32), - BabyBearElem::from(0x0e38fe51 as u32), - BabyBearElem::from(0x376f3b10 as u32), - BabyBearElem::from(0x5381e178 as u32), - BabyBearElem::from(0x3afc61c7 as u32), - BabyBearElem::from(0x5c1bcb4d as u32), - BabyBearElem::from(0x6643ce1f as u32), - BabyBearElem::from(0x2d0af1c1 as u32), - BabyBearElem::from(0x08f583cc as u32), - ], - vec![BabyBearElem::from(0x5d6ff60f as u32), - BabyBearElem::from(0x6324c1e5 as u32), - BabyBearElem::from(0x74412fb7 as u32), - BabyBearElem::from(0x70c0192e as u32), - BabyBearElem::from(0x0b72f141 as u32), - BabyBearElem::from(0x4067a111 as u32), - BabyBearElem::from(0x57388c4f as u32), - BabyBearElem::from(0x351009ec as u32), - BabyBearElem::from(0x0974c159 as u32), - BabyBearElem::from(0x539a58b3 as u32), - BabyBearElem::from(0x038c0cff as u32), - BabyBearElem::from(0x476c0392 as u32), - BabyBearElem::from(0x3f7bc15f as u32), - BabyBearElem::from(0x4491dd2c as u32), - BabyBearElem::from(0x4d1fef55 as u32), - BabyBearElem::from(0x04936ae3 as u32), - BabyBearElem::from(0x58214dd4 as u32), - BabyBearElem::from(0x683c6aad as u32), - BabyBearElem::from(0x1b42f16b as u32), - BabyBearElem::from(0x6dc79135 as u32), - BabyBearElem::from(0x2d4e71ec as u32), - BabyBearElem::from(0x3e2946ea as u32), - BabyBearElem::from(0x59dce8db as u32), - BabyBearElem::from(0x6cee892a as u32), - ], - vec![BabyBearElem::from(0x47f07350 as u32), - BabyBearElem::from(0x7106ce93 as u32), - BabyBearElem::from(0x3bd4a7a9 as u32), - BabyBearElem::from(0x2bfe636a as u32), - BabyBearElem::from(0x430011e9 as u32), - BabyBearElem::from(0x001cd66a as u32), - BabyBearElem::from(0x307faf5b as u32), - BabyBearElem::from(0x0d9ef3fe as u32), - BabyBearElem::from(0x6d40043a as u32), - BabyBearElem::from(0x2e8f470c as u32), - BabyBearElem::from(0x1b6865e8 as u32), - BabyBearElem::from(0x0c0e6c01 as u32), - BabyBearElem::from(0x4d41981f as u32), - BabyBearElem::from(0x423b9d3d as u32), - BabyBearElem::from(0x410408cc as u32), - BabyBearElem::from(0x263f0884 as u32), - BabyBearElem::from(0x5311bbd0 as u32), - BabyBearElem::from(0x4dae58d8 as u32), - BabyBearElem::from(0x30401cea as u32), - BabyBearElem::from(0x09afa575 as u32), - BabyBearElem::from(0x4b3d5b42 as u32), - BabyBearElem::from(0x63ac0b37 as u32), - BabyBearElem::from(0x5fe5bb14 as u32), - BabyBearElem::from(0x5244e9d4 as u32), - ], - ]; - - pub static ref POSEIDON2_BABYBEAR_24_PARAMS: Arc> = Arc::new(Poseidon2Params::new(24, 7, 8, 21, &MAT_DIAG24_M_1, &MAT_INTERNAL24, &RC24)); - -} - -risc0_zkvm::guest::entry!(main); - -pub fn main() { - - let data: Vec = env::read(); - - let cycles1 = cycle_count(); - let mut hash_data: Vec = Vec::new(); - for i in 0..data.len() { - let a_uncompressed = BabyBearElem::from(*data.get(i).unwrap()); - hash_data.push(a_uncompressed); - } - let cycles2 = cycle_count(); - - - let permutation = Poseidon2::new(&POSEIDON2_BABYBEAR_24_PARAMS); - let mut merkle_tree = MerkleTree::new(permutation.clone()); - let cycles3 = cycle_count(); - let hash_final = merkle_tree.accumulate(&hash_data); - - let cycles4 = cycle_count(); - - let mut perm_seralised: Vec = Vec::new(); - for i in 0..8 { - let temp: u32 = hash_final.get(i).unwrap().into(); - perm_seralised.push(temp); - - } - let cycles6 = cycle_count(); - - env::commit(&perm_seralised); - - eprintln!("number of cycles for input builder: {:?}", cycles2 - cycles1); - eprintln!("number of cycles for hash permutation builder: {:?}", cycles3 - cycles2); - eprintln!("number of cycles for hash accumulation: {:?}", cycles4 - cycles3); - - eprintln!("number of cycles for permutation seralisation: {:?}", cycles6 - cycles4); - -} diff --git a/hash/risc0/bench/methods/guest/src/bin/poseidon2_bn128.rs b/hash/risc0/bench/methods/guest/src/bin/poseidon2_bn128.rs deleted file mode 100644 index e6bc443..0000000 --- a/hash/risc0/bench/methods/guest/src/bin/poseidon2_bn128.rs +++ /dev/null @@ -1,43 +0,0 @@ -#![no_main] -use risc0_zkvm::{guest::env/* , sha::Digest*/}; -// use sha3::{Digest as _, Keccak256}; -use zkhash::poseidon2::poseidon2; -use zkhash::poseidon2::poseidon2_instance_bn256::POSEIDON2_BN256_PARAMS; -use zkhash::merkle_tree::merkle_tree_fp::MerkleTree; -use zkhash::fields::bn256::FpBN256; -use ark_serialize::{CanonicalSerialize, CanonicalDeserialize}; -use risc0_zkvm::guest::env::cycle_count; - -risc0_zkvm::guest::entry!(main); - -pub fn main() { - - let data: Vec> = env::read(); - let cycles1 = cycle_count(); - let mut hash_data: Vec = Vec::new(); - for i in 0..data.len() { - let a_uncompressed = FpBN256::deserialize_uncompressed(&**data.get(i).unwrap()).unwrap(); - hash_data.push(a_uncompressed); - } - let cycles2 = cycle_count(); - - let permutation = poseidon2::Poseidon2::new(&POSEIDON2_BN256_PARAMS); - let mut merkle_tree = MerkleTree::new(permutation.clone()); - let cycles4 = cycle_count(); - let hash_final = merkle_tree.accumulate(&hash_data); - let cycles5 = cycle_count(); - - - let mut hash_bytes: Vec = Vec::new(); - hash_final.serialize_uncompressed(&mut hash_bytes).unwrap(); - - let cycles6 = cycle_count(); - - env::commit(&hash_bytes); - - eprintln!("number of cycles for input builder: {:?}", cycles2 - cycles1); - eprintln!("number of cycles for hash builder: {:?}", cycles4 - cycles2); - eprintln!("number of cycles for hash calculation: {:?}", cycles5 - cycles4); - eprintln!("number of cycles for hash serealisation: {:?}", cycles6 - cycles5); - -} diff --git a/hash/risc0/bench/methods/guest/src/bin/sha256.rs b/hash/risc0/bench/methods/guest/src/bin/sha256.rs deleted file mode 100644 index 185a9d7..0000000 --- a/hash/risc0/bench/methods/guest/src/bin/sha256.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![no_main] - -use risc0_zkvm::{guest::env, sha, sha::Sha256}; -risc0_zkvm::guest::entry!(main); -use risc0_zkvm::guest::env::cycle_count; - -pub fn main() { - - let data: Vec = env::read(); - let hash = sha::Impl::hash_bytes(&data); - eprintln!("total cycle count for hashing: {:?}",cycle_count()); - env::commit(&hash) -} - diff --git a/hash/risc0/bench/methods/guest/src/bin/sha256_accelerated.rs b/hash/risc0/bench/methods/guest/src/bin/sha256_accelerated.rs deleted file mode 100644 index 2162da4..0000000 --- a/hash/risc0/bench/methods/guest/src/bin/sha256_accelerated.rs +++ /dev/null @@ -1,21 +0,0 @@ - -// accelerated sha2 crate -#![no_main] - -use risc0_zkvm::guest::env; -use sha2::{Sha256, Digest}; -use risc0_zkvm::guest::env::cycle_count; -// use base16ct::lower::encode_str; -risc0_zkvm::guest::entry!(main); - -pub fn main() { - - let data: Vec = env::read(); - let result = Sha256::digest(data); - let c1 = cycle_count(); - eprintln!("total cycle count for hashing: {:?}",c1); - let result_bytes: [u8;32] = result.into(); - let c2 = cycle_count(); - eprintln!("cycle count to convert into bytes array: {:?}",c2-c1); - env::commit(&result_bytes) -} diff --git a/hash/risc0/bench/methods/src/lib.rs b/hash/risc0/bench/methods/src/lib.rs deleted file mode 100644 index 1bdb308..0000000 --- a/hash/risc0/bench/methods/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -include!(concat!(env!("OUT_DIR"), "/methods.rs")); diff --git a/hash/risc0/bench/run.sh b/hash/risc0/bench/run.sh deleted file mode 100755 index 79b7df8..0000000 --- a/hash/risc0/bench/run.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -if [ -z ${ZKBENCH_HASH_TYPE} ]; then -ZKBENCH_HASH_TYPE="sha256" -fi - -if [ -z ${ZKBENCH_INPUT_SIZE_BYTES} ]; then -ZKBENCH_INPUT_SIZE_BYTES=1024 -fi - -echo "Running benchmarks with the following configurations:" -echo "HASH = $ZKBENCH_HASH_TYPE" -echo "Input Size (Bytes) = $ZKBENCH_INPUT_SIZE_BYTES" - -# Run the benchmarks -./target/release/benchmark $ZKBENCH_HASH_TYPE $ZKBENCH_INPUT_SIZE_BYTES \ No newline at end of file diff --git a/hash/risc0/bench/run_tree.sh b/hash/risc0/bench/run_tree.sh deleted file mode 100755 index 81a0750..0000000 --- a/hash/risc0/bench/run_tree.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -if [ -z ${ZKBENCH_HASH_TYPE_TREE} ]; then -ZKBENCH_HASH_TYPE_TREE="poseidon2_babybear_native" -fi - -if [ -z ${ZKBENCH_TREE_DEPTH} ]; then -ZKBENCH_TREE_DEPTH=2 -fi - -echo "Running benchmarks with the following configurations:" -echo "HASH = $ZKBENCH_HASH_TYPE_TREE" -echo "Tree Depth = $ZKBENCH_TREE_DEPTH" - -# Run the benchmarks -./target/release/benchmark $ZKBENCH_HASH_TYPE_TREE $ZKBENCH_TREE_DEPTH \ No newline at end of file diff --git a/hash/risc0/bench/rust-toolchain.toml b/hash/risc0/bench/rust-toolchain.toml deleted file mode 100644 index 36614c3..0000000 --- a/hash/risc0/bench/rust-toolchain.toml +++ /dev/null @@ -1,4 +0,0 @@ -[toolchain] -channel = "stable" -components = ["rustfmt", "rust-src"] -profile = "minimal" diff --git a/hash/risc0/bench/src/benches/blake2b.rs b/hash/risc0/bench/src/benches/blake2b.rs deleted file mode 100644 index 75bbf05..0000000 --- a/hash/risc0/bench/src/benches/blake2b.rs +++ /dev/null @@ -1,32 +0,0 @@ -use benchmark_methods::{ - BLAKE2B_ELF, BLAKE2B_ID -}; -use risc0_zkvm::{default_prover, ExecutorEnv}; -use risc0_zkvm::{ sha}; -// use rand::RngCore; -use std::time::Instant; - -pub fn blake2b_bench(input: Vec) { - - let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); - - // Obtain the default prover. - let prover = default_prover(); - - let start_time = Instant::now(); - // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove(env, BLAKE2B_ELF).unwrap(); - - // For example: - let _output: sha::Digest = receipt.journal.decode().unwrap(); - - let elapsed_time1 = start_time.elapsed(); - // verify your receipt - receipt.verify(BLAKE2B_ID).unwrap(); - - let elapsed_time2 = start_time.elapsed(); - - eprintln!("Total time: {:?}", elapsed_time2); - eprintln!("verification time: {:?}", elapsed_time2 - elapsed_time1); - -} \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/blake3.rs b/hash/risc0/bench/src/benches/blake3.rs deleted file mode 100644 index 2f12a7f..0000000 --- a/hash/risc0/bench/src/benches/blake3.rs +++ /dev/null @@ -1,34 +0,0 @@ -use benchmark_methods::{ - BLAKE3_ELF, BLAKE3_ID -}; -use risc0_zkvm::{default_prover, ExecutorEnv}; -use risc0_zkvm::{ sha}; -// use rand::RngCore; -use std::time::Instant; - -pub fn blake3_bench(input: Vec) { - - - - let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); - - // Obtain the default prover. - let prover = default_prover(); - let start_time = Instant::now(); - - // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove(env, BLAKE3_ELF).unwrap(); - - // For example: - let _output: sha::Digest = receipt.journal.decode().unwrap(); - - let elapsed_time1 = start_time.elapsed(); - // verify your receipt - receipt.verify(BLAKE3_ID).unwrap(); - - let elapsed_time2 = start_time.elapsed(); - - eprintln!("Total time: {:?}", elapsed_time2); - eprintln!("verification time: {:?}", elapsed_time2 - elapsed_time1); - -} \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/keccak.rs b/hash/risc0/bench/src/benches/keccak.rs deleted file mode 100644 index 73c8506..0000000 --- a/hash/risc0/bench/src/benches/keccak.rs +++ /dev/null @@ -1,33 +0,0 @@ -use benchmark_methods::{ - KECCAK_ELF, KECCAK_ID -}; -use risc0_zkvm::{default_prover, ExecutorEnv}; -use risc0_zkvm::{ sha}; -// use rand::RngCore; -use std::time::Instant; - -pub fn keccak_bench(input: Vec) { - - let start_time = Instant::now(); - - let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); - - // Obtain the default prover. - let prover = default_prover(); - - // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove(env, KECCAK_ELF).unwrap(); - - // For example: - let _output: sha::Digest = receipt.journal.decode().unwrap(); - - let elapsed_time1 = start_time.elapsed(); - // verify your receipt - receipt.verify(KECCAK_ID).unwrap(); - - let elapsed_time2 = start_time.elapsed(); - - eprintln!("Total time: {:?}", elapsed_time2); - eprintln!("verification time: {:?}", elapsed_time2 - elapsed_time1); - -} \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/mod.rs b/hash/risc0/bench/src/benches/mod.rs deleted file mode 100644 index adeeccf..0000000 --- a/hash/risc0/bench/src/benches/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -pub mod sha256; -pub mod sha256_accelerated; -pub mod keccak; -pub mod blake2b; -pub mod blake3; -pub mod poseidon2_bn128; -pub mod poseidon2_babybear; -pub mod poseidon2_babybear_native; \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/poseidon2_babybear.rs b/hash/risc0/bench/src/benches/poseidon2_babybear.rs deleted file mode 100644 index 7e7a391..0000000 --- a/hash/risc0/bench/src/benches/poseidon2_babybear.rs +++ /dev/null @@ -1,66 +0,0 @@ -#![allow(non_snake_case)] -use benchmark_methods::{ - POSEIDON2_BABYBEAR_ELF, - POSEIDON2_BABYBEAR_ID -}; -use risc0_zkvm::{ - default_prover, - ExecutorEnv -}; -use zkhash::fields::{ - babybear::FpBabyBear, - utils::random_scalar - }; -use std::time::Instant; -use ark_serialize::{ - CanonicalSerialize, - CanonicalDeserialize -}; - - -pub fn poseidon2_babybear_bench(mt_depth: usize) { - - type Scalar = FpBabyBear; - - let t = (1 << mt_depth) * 8; - let mut input_scalar: Vec> = Vec::new(); - - for _ in 0..t { - let mut uncompressed_bytes = Vec::new(); - let a: Scalar = random_scalar(); - a.serialize_uncompressed(&mut uncompressed_bytes).unwrap(); - input_scalar.push(uncompressed_bytes); - } - - let env = ExecutorEnv::builder().write(&input_scalar).unwrap().build().unwrap(); - - // Obtain the default prover. - let prover = default_prover(); - - let start_time = Instant::now(); - // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove(env, POSEIDON2_BABYBEAR_ELF).unwrap(); - let elapsed_time = start_time.elapsed(); - - // verify your receipt - receipt.verify(POSEIDON2_BABYBEAR_ID).unwrap(); - - let elapsed_time2 = start_time.elapsed(); - - // For example: - let output: Vec> = receipt.journal.decode().unwrap(); - - let mut output_deseralised: Vec = Vec::new(); - - for i in 0..output.len() { - output_deseralised.push(Scalar::deserialize_uncompressed(&**output.get(i).unwrap()).unwrap()); - } - - eprintln!("hash: {:?}", output_deseralised); - eprintln!("Total time: {:?}", elapsed_time2); - eprintln!("Verification time: {:?}", elapsed_time2 - elapsed_time); - - // eprintln!("Hash: {:?}", hash_final); - - -} \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/poseidon2_babybear_native.rs b/hash/risc0/bench/src/benches/poseidon2_babybear_native.rs deleted file mode 100644 index d630f7f..0000000 --- a/hash/risc0/bench/src/benches/poseidon2_babybear_native.rs +++ /dev/null @@ -1,47 +0,0 @@ -#![allow(non_snake_case)] -use benchmark_methods::{ - POSEIDON2_BABYBEAR_NATIVE_ELF, - POSEIDON2_BABYBEAR_NATIVE_ID -}; -use risc0_zkvm::{ - default_prover, - ExecutorEnv -}; -use std::time::Instant; -use rand::Rng; - -pub fn poseidon2_babybear_native_bench(mt_depth: usize) { - - let t = (1 << mt_depth) * 8; - let mut input: Vec = Vec::new(); - - for _ in 0..t { - - let mut rng = rand::thread_rng(); - let random_u32: u32 = rng.gen(); - input.push(random_u32); - } - - let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); - - // Obtain the default prover. - let prover = default_prover(); - - let start_time = Instant::now(); - // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove(env, POSEIDON2_BABYBEAR_NATIVE_ELF).unwrap(); - let elapsed_time = start_time.elapsed(); - - // verify your receipt - receipt.verify(POSEIDON2_BABYBEAR_NATIVE_ID).unwrap(); - - let elapsed_time2 = start_time.elapsed(); - - let output: Vec = receipt.journal.decode().unwrap(); - - eprintln!("hash: {:?}", output); - - eprintln!("Total time: {:?}", elapsed_time2); - eprintln!("Verification time: {:?}", elapsed_time2 - elapsed_time); - -} \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/poseidon2_bn128.rs b/hash/risc0/bench/src/benches/poseidon2_bn128.rs deleted file mode 100644 index 3ceb77c..0000000 --- a/hash/risc0/bench/src/benches/poseidon2_bn128.rs +++ /dev/null @@ -1,48 +0,0 @@ -use benchmark_methods::{ - POSEIDON2_BN128_ELF, POSEIDON2_BN128_ID -}; -use risc0_zkvm::{default_prover, ExecutorEnv}; -use zkhash::{fields::{bn256::FpBN256, utils::random_scalar}/* , poseidon2::poseidon2_instance_bn256::POSEIDON2_BN256_PARAMS*/}; -use std::time::Instant; -use ark_serialize::{CanonicalSerialize, CanonicalDeserialize}; - - -pub fn poseidon2_bn128_bench(mt_depth: usize) { - - type Scalar = FpBN256; - - let mut input_scalar: Vec> = Vec::new(); - let number_of_leaves: u32 = 1 << mt_depth; - for _ in 0..number_of_leaves { - let mut uncompressed_bytes = Vec::new(); - let a: Scalar = random_scalar(); - a.serialize_uncompressed(&mut uncompressed_bytes).unwrap(); - input_scalar.push(uncompressed_bytes); - } - - let env = ExecutorEnv::builder().write(&input_scalar).unwrap().build().unwrap(); - - // Obtain the default prover. - let prover = default_prover(); - - let start_time = Instant::now(); - // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove(env, POSEIDON2_BN128_ELF).unwrap(); - let elapsed_time = start_time.elapsed(); - - - // verify your receipt - receipt.verify(POSEIDON2_BN128_ID).unwrap(); - - let elapsed_time2 = start_time.elapsed(); - - // For example: - let output: Vec = receipt.journal.decode().unwrap(); - - let hash_final = Scalar::deserialize_uncompressed(&*output).unwrap(); - - eprintln!("Hash: {:?}", hash_final); - eprintln!("Total time: {:?}", elapsed_time2); - eprintln!("Verification time: {:?}", elapsed_time2 - elapsed_time); - -} \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/sha256.rs b/hash/risc0/bench/src/benches/sha256.rs deleted file mode 100644 index 1777f56..0000000 --- a/hash/risc0/bench/src/benches/sha256.rs +++ /dev/null @@ -1,32 +0,0 @@ -use benchmark_methods::{ - SHA256_ELF, SHA256_ID -}; -use risc0_zkvm::{default_prover, ExecutorEnv}; -use risc0_zkvm::{ sha}; -use std::time::Instant; -pub fn sha_bench(input: Vec) { - - let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); - - // Obtain the default prover. - let prover = default_prover(); - eprintln!("\n------risc0_zkvm sha hashing------\n"); - - let start_time = Instant::now(); - // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove(env, SHA256_ELF).unwrap(); - let elapsed_time = start_time.elapsed(); - - // verify your receipt - receipt.verify(SHA256_ID).unwrap(); - - let elapsed_time2 = start_time.elapsed(); - - let _output: sha::Digest = receipt.journal.decode().unwrap(); - - eprintln!("Total time: {:?}", elapsed_time2); - eprintln!("Verification time: {:?}", elapsed_time2 - elapsed_time); - - eprintln!("Hash: {:?}", _output); - -} \ No newline at end of file diff --git a/hash/risc0/bench/src/benches/sha256_accelerated.rs b/hash/risc0/bench/src/benches/sha256_accelerated.rs deleted file mode 100644 index 6233cae..0000000 --- a/hash/risc0/bench/src/benches/sha256_accelerated.rs +++ /dev/null @@ -1,30 +0,0 @@ -use benchmark_methods::{ - SHA256_ACCELERATED_ELF, SHA256_ACCELERATED_ID -}; -use risc0_zkvm::{default_prover, ExecutorEnv}; -use std::time::Instant; -use hex::encode; -pub fn sha_accelerated_bench(input: Vec) { - - let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap(); - eprintln!("\n------RustCrypto sha hashing(accelerated)------\n"); - // Obtain the default prover. - let prover = default_prover(); - - let start_time = Instant::now(); - // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove(env, SHA256_ACCELERATED_ELF).unwrap(); - let elapsed_time = start_time.elapsed(); - - // verify your receipt - receipt.verify(SHA256_ACCELERATED_ID).unwrap(); - - let elapsed_time2 = start_time.elapsed(); - - let _output: [u8;32] = receipt.journal.decode().unwrap(); - let hash = encode(_output); - eprintln!("Total time: {:?}", elapsed_time2); - eprintln!("Verification time: {:?}", elapsed_time2 - elapsed_time); - - eprintln!("Hash: {:?}", hash); -} \ No newline at end of file diff --git a/hash/risc0/bench/src/main.rs b/hash/risc0/bench/src/main.rs deleted file mode 100644 index c5ba0f7..0000000 --- a/hash/risc0/bench/src/main.rs +++ /dev/null @@ -1,95 +0,0 @@ -mod benches; -use benches::{ - sha256::sha_bench, - sha256_accelerated::sha_accelerated_bench, - keccak::keccak_bench, - blake2b::blake2b_bench, - blake3::blake3_bench, - poseidon2_bn128::poseidon2_bn128_bench, - poseidon2_babybear::poseidon2_babybear_bench, - poseidon2_babybear_native::poseidon2_babybear_native_bench, -}; -use rand::Rng; -use std::process; - -fn generate_bytes(size: usize) -> Vec { - let mut rng = rand::thread_rng(); - (0..size).map(|_| rng.gen()).collect() -} - - - -fn main() { - let args: Vec = std::env::args().collect(); - - if args.len() != 3 { - println!("Wrong number of arguments! The program expects two arguments: and "); - // Exit the program with a non-zero exit code - process::exit(1); - } - - let hash_type = &args[1]; - let size = args[2].parse::().unwrap(); - - match hash_type.as_str() { - "sha256" => { - println!("SHA256 Benchmarking: "); - eprintln!("data size(bytes): {:?}", size); - let input = generate_bytes(size); - sha_bench(input.clone()); - } - "sha256_accelerated" => { - println!("Accelerated SHA256 Benchmarking: "); - eprintln!("data size(bytes): {:?}", size); - let input = generate_bytes(size); - sha_accelerated_bench(input.clone()); - } - "keccak" => { - println!("KECCAK Benchmarking: "); - eprintln!("data size(bytes): {:?}", size); - let input = generate_bytes(size); - keccak_bench(input.clone()); - } - - "blake2b" => { - println!("Blake2b Benchmarking: "); - eprintln!("data size(bytes): {:?}", size); - let input = generate_bytes(size); - blake2b_bench(input.clone()); - } - - "blake3" => { - println!("Blake3 Benchmarking: "); - eprintln!("data size(bytes): {:?}", size); - let input = generate_bytes(size); - blake3_bench(input.clone()); - } - - "poseidon2_bn128" => { - println!("Poseidon2 Benchmarking on the BN128 field: "); - eprintln!("Tree Depth: {:?}", size); - poseidon2_bn128_bench(size); - } - - "poseidon2_babybear" => { - println!("Poseidon2 Benchmarking on the BabyBear field: "); - eprintln!("Tree Depth: {:?}", size); - eprintln!("number of inputs {:?}", (1 << size) * 8); - poseidon2_babybear_bench(size); - } - - "poseidon2_babybear_native" => { - println!("Poseidon2 Benchmarking on the BabyBear field: "); - eprintln!("Tree Depth: {:?}", size); - eprintln!("number of inputs {:?}", (1 << size) * 8); - poseidon2_babybear_native_bench(size); - } - - _ => { - println!("Wrong Benchmark Name!"); - } - } - - println!("All Done!"); - -} diff --git a/hash/risc0/composition/Cargo.lock b/hash/risc0/composition/Cargo.lock deleted file mode 100644 index d2dff75..0000000 --- a/hash/risc0/composition/Cargo.lock +++ /dev/null @@ -1,2795 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addchain" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2e69442aa5628ea6951fa33e24efe8313f4321a91bd729fc2f75bdfc858570" -dependencies = [ - "num-bigint 0.3.3", - "num-integer", - "num-traits", -] - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "cpp_demangle", - "fallible-iterator", - "gimli", - "memmap2", - "object", - "rustc-demangle", - "smallvec", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "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 = "anyhow" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" - -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -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-crypto-primitives" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "blake2", - "derivative", - "digest", - "sha2", -] - -[[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", - "itertools 0.10.5", - "num-bigint 0.4.4", - "num-traits", - "paste", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "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", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-groth16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" -dependencies = [ - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[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-relations" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" -dependencies = [ - "ark-ff", - "ark-std", - "tracing", - "tracing-subscriber", -] - -[[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", - "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", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-snark" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" -dependencies = [ - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "autotools" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8da1805e028a172334c3b680f93e71126f2327622faef2ec3d893c0a4ad77" -dependencies = [ - "cc", -] - -[[package]] -name = "backtrace" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[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.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest", -] - -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bonsai-sdk" -version = "0.6.0-rc.2" -dependencies = [ - "reqwest", - "serde", - "thiserror", -] - -[[package]] -name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - -[[package]] -name = "bytemuck" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[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" -dependencies = [ - "serde", -] - -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "jobserver", - "libc", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "composition" -version = "0.1.0" -dependencies = [ - "composition-methods", - "inner_proof", - "risc0-zkvm", - "serde", -] - -[[package]] -name = "composition-methods" -version = "0.1.0" -dependencies = [ - "risc0-build", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "core-graphics-types" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "libc", -] - -[[package]] -name = "cpp_demangle" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "rand_core", - "subtle", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "cust" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6cc71911e179f12483b9734120b45bd00bf64fab085cc4818428523eedd469" -dependencies = [ - "bitflags 1.3.2", - "bytemuck", - "cust_core", - "cust_derive", - "cust_raw", - "find_cuda_helper", -] - -[[package]] -name = "cust_core" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "039f79662cb8f890cbf335e818cd522d6e3a53fe63f61d1aaaf859cd3d975f06" -dependencies = [ - "cust_derive", - "glam", - "mint", - "vek", -] - -[[package]] -name = "cust_derive" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a3bc95fe629aed92b2423de6ccff9e40174b21d19cb6ee6281a4d04ac72f66" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "cust_raw" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf40d6ade12cb9828bbc844b9875c7b93d25e67a3c9bf61c7aa3ae09e402bf8" -dependencies = [ - "find_cuda_helper", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "directories" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - -[[package]] -name = "docker-generate" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "downloader" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05213e96f184578b5f70105d4d0a644a168e99e12d7bea0b200c15d67b5c182" -dependencies = [ - "digest", - "futures", - "rand", - "reqwest", - "thiserror", - "tokio", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "elf" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" - -[[package]] -name = "encoding_rs" -version = "0.8.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "erased-serde" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55d05712b2d8d88102bc9868020c9e5c7a1f5527c452b9b97450a1d006140ba7" -dependencies = [ - "serde", -] - -[[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 = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - -[[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", - "byteorder", - "ff_derive", - "rand_core", - "subtle", -] - -[[package]] -name = "ff_derive" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f54704be45ed286151c5e11531316eaef5b8f5af7d597b806fdb8af108d84a" -dependencies = [ - "addchain", - "cfg-if", - "num-bigint 0.3.3", - "num-integer", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "find_cuda_helper" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f9e65c593dd01ac77daad909ea4ad17f0d6d1776193fc8ea766356177abdad" -dependencies = [ - "glob", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flate2" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" -dependencies = [ - "foreign-types-macros", - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-macros" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "foreign-types-shared" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -dependencies = [ - "fallible-iterator", - "stable_deref_trait", -] - -[[package]] -name = "glam" -version = "0.20.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43e957e744be03f5801a55472f593d43fabdebf25a4585db250f04d86b1675f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "h2" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[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.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "http" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "human-repr" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" - -[[package]] -name = "hyper" -version = "0.14.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http", - "hyper", - "rustls", - "tokio", - "tokio-rustls", -] - -[[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 = "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 = "inner_proof" -version = "0.1.0" -dependencies = [ - "inner_proof-methods", - "rand", - "risc0-zkvm", - "serde", -] - -[[package]] -name = "inner_proof-methods" -version = "0.1.0" -dependencies = [ - "risc0-build", -] - -[[package]] -name = "inventory" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8573b2b1fb643a372c73b23f4da5f888677feef3305146d68a539250a9bccc7" - -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[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.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "jobserver" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "lazy-regex" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d12be4595afdf58bd19e4a9f4e24187da2a66700786ff660a418e9059937a4c" -dependencies = [ - "lazy-regex-proc_macros", - "once_cell", - "regex", -] - -[[package]] -name = "lazy-regex-proc_macros" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bcd58e6c97a7fcbaffcdc95728b393b8d98933bfadad49ed4097845b57ef0b" -dependencies = [ - "proc-macro2", - "quote", - "regex", - "syn 2.0.48", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.152" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" - -[[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.2", - "libc", - "redox_syscall", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - -[[package]] -name = "matrixmultiply" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" -dependencies = [ - "autocfg", - "rawpointer", -] - -[[package]] -name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - -[[package]] -name = "metal" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "550b24b0cd4cf923f36bae78eca457b3a10d8a6a14a9c84cb2687b527e6a84af" -dependencies = [ - "bitflags 1.3.2", - "block", - "core-graphics-types", - "foreign-types", - "log", - "objc", - "paste", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "mint" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff" - -[[package]] -name = "mio" -version = "0.8.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.48.0", -] - -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - -[[package]] -name = "ndarray" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" -dependencies = [ - "matrixmultiply", - "num-complex", - "num-integer", - "num-traits", - "rawpointer", - "rayon", -] - -[[package]] -name = "num-bigint" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" -dependencies = [ - "autocfg", - "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", - "num-integer", - "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-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", - "objc_exception", -] - -[[package]] -name = "objc_exception" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" -dependencies = [ - "cc", -] - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "flate2", - "memchr", - "ruzstd", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[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 = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "prettyplease" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" -dependencies = [ - "proc-macro2", - "syn 2.0.48", -] - -[[package]] -name = "proc-macro2" -version = "1.0.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prost" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" -dependencies = [ - "bytes", - "heck", - "itertools 0.11.0", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn 2.0.48", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" -dependencies = [ - "anyhow", - "itertools 0.11.0", - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "prost-types" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" -dependencies = [ - "prost", -] - -[[package]] -name = "protobuf-src" -version = "1.1.0+21.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" -dependencies = [ - "autotools", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[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", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - -[[package]] -name = "rayon" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[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", - "libredox", - "thiserror", -] - -[[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", -] - -[[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", -] - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "reqwest" -version = "0.11.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" -dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "system-configuration", - "tokio", - "tokio-rustls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots", - "winreg", -] - -[[package]] -name = "ring" -version = "0.17.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" -dependencies = [ - "cc", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.48.0", -] - -[[package]] -name = "risc0-binfmt" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "elf", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "tracing", -] - -[[package]] -name = "risc0-build" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "cargo_metadata", - "docker-generate", - "risc0-binfmt", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "serde_json", - "tempfile", -] - -[[package]] -name = "risc0-build-kernel" -version = "0.20.0-rc.2" -dependencies = [ - "cc", - "directories", - "hex", - "sha2", - "tempfile", -] - -[[package]] -name = "risc0-circuit-recursion" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "bytemuck", - "cust", - "downloader", - "metal", - "rand", - "rayon", - "risc0-circuit-recursion-sys", - "risc0-core", - "risc0-zkp", - "sha2", - "tracing", - "zip", -] - -[[package]] -name = "risc0-circuit-recursion-sys" -version = "0.20.0-rc.2" -dependencies = [ - "glob", - "risc0-build-kernel", - "risc0-core", -] - -[[package]] -name = "risc0-circuit-rv32im" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "cust", - "metal", - "rand", - "rayon", - "risc0-circuit-rv32im-sys", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "tracing", -] - -[[package]] -name = "risc0-circuit-rv32im-sys" -version = "0.20.0-rc.2" -dependencies = [ - "glob", - "risc0-build-kernel", - "risc0-core", -] - -[[package]] -name = "risc0-core" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "rand_core", -] - -[[package]] -name = "risc0-sppark" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be1d1ff7fe501c9f420654bc1ff7461909b85e7f8fb3698a8812c0a8a787306" -dependencies = [ - "cc", - "which", -] - -[[package]] -name = "risc0-sys" -version = "0.20.0-rc.2" -dependencies = [ - "cc", - "cust", - "risc0-build-kernel", - "risc0-sppark", -] - -[[package]] -name = "risc0-zkp" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "blake2", - "bytemuck", - "cust", - "digest", - "ff", - "hex", - "lazy_static", - "metal", - "ndarray", - "paste", - "rand", - "rand_core", - "rayon", - "risc0-core", - "risc0-sys", - "risc0-zkvm-platform", - "serde", - "sha2", - "tracing", -] - -[[package]] -name = "risc0-zkvm" -version = "0.20.0-rc.2" -dependencies = [ - "addr2line", - "anyhow", - "ark-bn254", - "ark-groth16", - "ark-serialize", - "bincode", - "bonsai-sdk", - "bytemuck", - "bytes", - "cfg-if", - "crypto-bigint", - "elf", - "getrandom", - "hex", - "human-repr", - "lazy-regex", - "num-bigint 0.4.4", - "num-derive", - "num-traits", - "prost", - "prost-build", - "protobuf-src", - "rayon", - "risc0-binfmt", - "risc0-circuit-recursion", - "risc0-circuit-rv32im", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "rrs-lib", - "rustc-demangle", - "semver", - "serde", - "sha2", - "tempfile", - "tracing", - "typetag", -] - -[[package]] -name = "risc0-zkvm-platform" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "getrandom", - "libm", -] - -[[package]] -name = "rrs-lib" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" -dependencies = [ - "downcast-rs", - "paste", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.38.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" -dependencies = [ - "bitflags 2.4.2", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.21.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" -dependencies = [ - "log", - "ring", - "rustls-webpki", - "sct", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "ruzstd" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" -dependencies = [ - "byteorder", - "derive_more", - "twox-hash", -] - -[[package]] -name = "ryu" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "semver" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.195" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.195" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "serde_json" -version = "1.0.111" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b187f0231d56fe41bfb12034819dd2bf336422a5866de41bc3fec4b2e3883e8" - -[[package]] -name = "socket2" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tempfile" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys 0.52.0", -] - -[[package]] -name = "thiserror" -version = "1.0.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[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" -version = "1.35.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "pin-project-lite", - "socket2", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "log", - "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", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "tracing-core", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "static_assertions", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "typetag" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43148481c7b66502c48f35b8eef38b6ccdc7a9f04bd4cc294226d901ccc9bc7" -dependencies = [ - "erased-serde", - "inventory", - "once_cell", - "serde", - "typetag-impl", -] - -[[package]] -name = "typetag-impl" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291db8a81af4840c10d636e047cac67664e343be44e24dfdbd1492df9a5d3390" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[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 = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vek" -version = "0.15.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8085882662f9bc47fc8b0cdafa5e19df8f592f650c02b9083da8d45ac9eebd17" -dependencies = [ - "approx", - "num-integer", - "num-traits", - "rustc_version", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[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.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.48", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" - -[[package]] -name = "web-sys" -version = "0.3.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" - -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - -[[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.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.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.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.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.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 = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[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", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "byteorder", - "crc32fast", - "crossbeam-utils", - "flate2", -] diff --git a/hash/risc0/composition/Cargo.toml b/hash/risc0/composition/Cargo.toml deleted file mode 100644 index 9dd76d2..0000000 --- a/hash/risc0/composition/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "composition" -version = "0.1.0" -edition = "2021" - -[dependencies] -composition-methods = { path = "methods" } -inner_proof = { path = "../inner_proof" } -risc0-zkvm = { path = "../external/risc0/risc0/zkvm" } -serde = "1.0" - -[features] -cuda = ["risc0-zkvm/cuda"] -default = [] -metal = ["risc0-zkvm/metal"] -prove = ["risc0-zkvm/prove"] diff --git a/hash/risc0/composition/build.sh b/hash/risc0/composition/build.sh deleted file mode 100755 index 7f1b114..0000000 --- a/hash/risc0/composition/build.sh +++ /dev/null @@ -1 +0,0 @@ -cargo build --release \ No newline at end of file diff --git a/hash/risc0/composition/methods/Cargo.toml b/hash/risc0/composition/methods/Cargo.toml deleted file mode 100644 index be6e230..0000000 --- a/hash/risc0/composition/methods/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "composition-methods" -version = "0.1.0" -edition = "2021" - -[build-dependencies] -risc0-build = { path = "../../external/risc0/risc0/build" } - -[package.metadata.risc0] -methods = ["guest"] diff --git a/hash/risc0/composition/methods/build.rs b/hash/risc0/composition/methods/build.rs deleted file mode 100644 index a4aa256..0000000 --- a/hash/risc0/composition/methods/build.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -fn main() { - risc0_build::embed_methods(); -} diff --git a/hash/risc0/composition/methods/guest/Cargo.lock b/hash/risc0/composition/methods/guest/Cargo.lock deleted file mode 100644 index 4077f62..0000000 --- a/hash/risc0/composition/methods/guest/Cargo.lock +++ /dev/null @@ -1,1100 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "anyhow" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" - -[[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-crypto-primitives" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "blake2", - "derivative", - "digest", - "sha2", -] - -[[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", - "itertools", - "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", - "itertools", - "num-bigint", - "num-traits", - "paste", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "syn 1.0.107", -] - -[[package]] -name = "ark-ff-macros" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "ark-groth16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" -dependencies = [ - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[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", -] - -[[package]] -name = "ark-relations" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" -dependencies = [ - "ark-ff", - "ark-std", - "tracing", - "tracing-subscriber", -] - -[[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", - "num-bigint", -] - -[[package]] -name = "ark-serialize-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "ark-snark" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" -dependencies = [ - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[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 = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest", -] - -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bytemuck" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "composition-method" -version = "0.1.0" -dependencies = [ - "bytemuck", - "inner_proof-methods", - "risc0-zkvm", -] - -[[package]] -name = "const-oid" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "docker-generate" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "elf" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b183d6ce6ca4cf30e3db37abf5b52568b5f9015c97d9fbdd7026aa5dcdd758" - -[[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 = "fastrand" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "human-repr" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" - -[[package]] -name = "inner_proof-methods" -version = "0.1.0" -dependencies = [ - "risc0-build", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "libc" -version = "0.2.151" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" - -[[package]] -name = "libm" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" - -[[package]] -name = "linux-raw-sys" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "num-bigint" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "paste" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro2" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "rand_chacha", - "rand_core", -] - -[[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", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[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 = "risc0-binfmt" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "elf", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "tracing", -] - -[[package]] -name = "risc0-build" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "cargo_metadata", - "docker-generate", - "risc0-binfmt", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "serde_json", - "tempfile", -] - -[[package]] -name = "risc0-circuit-recursion" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "bytemuck", - "risc0-core", - "risc0-zkp", - "tracing", -] - -[[package]] -name = "risc0-circuit-rv32im" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "tracing", -] - -[[package]] -name = "risc0-core" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "rand_core", -] - -[[package]] -name = "risc0-zkp" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "blake2", - "bytemuck", - "digest", - "hex", - "paste", - "rand_core", - "risc0-core", - "risc0-zkvm-platform", - "serde", - "sha2", - "tracing", -] - -[[package]] -name = "risc0-zkvm" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "ark-bn254", - "ark-groth16", - "ark-serialize", - "bytemuck", - "cfg-if", - "getrandom", - "hex", - "human-repr", - "num-bigint", - "num-derive", - "num-traits", - "risc0-binfmt", - "risc0-circuit-recursion", - "risc0-circuit-rv32im", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "rrs-lib", - "semver", - "serde", - "sha2", - "tracing", -] - -[[package]] -name = "risc0-zkvm-platform" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "getrandom", - "libm", -] - -[[package]] -name = "rrs-lib" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" -dependencies = [ - "downcast-rs", - "paste", -] - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.38.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" -dependencies = [ - "bitflags 2.4.1", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "ryu" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "semver" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" -dependencies = [ - "serde", -] - -[[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_derive" -version = "1.0.193" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" -dependencies = [ - "proc-macro2", - "quote", - "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.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys 0.48.0", -] - -[[package]] -name = "thiserror" -version = "1.0.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "tracing" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "tracing-core" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "tracing-core", -] - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[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 = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[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.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.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.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.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.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 = "zerocopy" -version = "0.7.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" -dependencies = [ - "proc-macro2", - "quote", - "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", - "quote", - "syn 2.0.39", -] diff --git a/hash/risc0/composition/methods/guest/Cargo.toml b/hash/risc0/composition/methods/guest/Cargo.toml deleted file mode 100644 index 6dd09c0..0000000 --- a/hash/risc0/composition/methods/guest/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "composition-method" -version = "0.1.0" -edition = "2021" - -[workspace] - -[dependencies] -risc0-zkvm = { path = "../../../external/risc0/risc0/zkvm", features = ["std"], default-features = false } -inner_proof-methods = { path = "../../../inner_proof/methods" } -bytemuck = "1.14" diff --git a/hash/risc0/composition/methods/guest/src/main.rs b/hash/risc0/composition/methods/guest/src/main.rs deleted file mode 100644 index c575ece..0000000 --- a/hash/risc0/composition/methods/guest/src/main.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use inner_proof_methods::INNER_PROOF_METHOD_ID; -use risc0_zkvm::{guest::env, serde}; -use risc0_zkvm::sha; -fn main() { - let c1 = env::cycle_count(); - let hash: sha::Digest = env::read(); - let hash2: sha::Digest = env::read(); - let c2 = env::cycle_count(); - - env::verify(INNER_PROOF_METHOD_ID, &serde::to_vec(&hash).unwrap()).unwrap(); - env::verify(INNER_PROOF_METHOD_ID, &serde::to_vec(&hash2).unwrap()).unwrap(); - let c3 = env::cycle_count(); - eprintln!("cycles for input builder: {:?}", c2 - c1); - eprintln!("cycles for inner_proof verification inside guest: {:?}", c3 - c2); - env::commit(&hash); -} - diff --git a/hash/risc0/composition/methods/src/lib.rs b/hash/risc0/composition/methods/src/lib.rs deleted file mode 100644 index ae9d61e..0000000 --- a/hash/risc0/composition/methods/src/lib.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -include!(concat!(env!("OUT_DIR"), "/methods.rs")); diff --git a/hash/risc0/composition/run.sh b/hash/risc0/composition/run.sh deleted file mode 100755 index bd6dfec..0000000 --- a/hash/risc0/composition/run.sh +++ /dev/null @@ -1 +0,0 @@ -./target/release/composition 32 \ No newline at end of file diff --git a/hash/risc0/composition/src/main.rs b/hash/risc0/composition/src/main.rs deleted file mode 100644 index 9a6a17b..0000000 --- a/hash/risc0/composition/src/main.rs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use composition_methods::{COMPOSITION_METHOD_ELF, COMPOSITION_METHOD_ID}; -use inner_proof::sha_bench; -use risc0_zkvm::{default_prover, ExecutorEnv}; -use risc0_zkvm::sha; -use std::time::Instant; -use std::process; - -fn main() { - - let args: Vec = std::env::args().collect(); - - if args.len() != 2 { - println!("Wrong number of arguments! The program expects one arguments: "); - // Exit the program with a non-zero exit code - process::exit(1); - } - - let data_size = args[1].parse::().unwrap(); - - let t0 = Instant::now(); - - let (hash_receipt, hash) = sha_bench(data_size.try_into().unwrap()); - let (hash_receipt2, hash2) = sha_bench(data_size.try_into().unwrap()); - - let env = ExecutorEnv::builder() - // add_assumption makes the receipt to be verified available to the prover. - .add_assumption(hash_receipt) - .write(&hash) - .unwrap() - .add_assumption(hash_receipt2) - .write(&hash2) - .unwrap() - .build() - .unwrap(); - - let t1 = t0.elapsed(); - - let receipt = default_prover().prove(env, COMPOSITION_METHOD_ELF).unwrap(); - - let t2 = t0.elapsed(); - - receipt.verify(COMPOSITION_METHOD_ID).unwrap(); - - let t3 = t0.elapsed(); - - let hash: sha::Digest = receipt.journal.decode().unwrap(); - eprintln!("hash: {:?}", hash); - eprintln!("ExecutorEnv Builder time: {:?}", t1); - eprintln!("Proof generation + receiving receipt time: {:?}", t2 - t1); - eprintln!("Verification time: {:?}", t3 - t2); -} diff --git a/hash/risc0/external/risc0 b/hash/risc0/external/risc0 deleted file mode 160000 index 02fad7a..0000000 --- a/hash/risc0/external/risc0 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 02fad7a498764d5c6cc851f246813b73b41c30b8 diff --git a/hash/risc0/inner_proof/Cargo.lock b/hash/risc0/inner_proof/Cargo.lock deleted file mode 100644 index 943cc8f..0000000 --- a/hash/risc0/inner_proof/Cargo.lock +++ /dev/null @@ -1,2778 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addchain" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2e69442aa5628ea6951fa33e24efe8313f4321a91bd729fc2f75bdfc858570" -dependencies = [ - "num-bigint 0.3.3", - "num-integer", - "num-traits", -] - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "cpp_demangle", - "fallible-iterator", - "gimli", - "memmap2", - "object", - "rustc-demangle", - "smallvec", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "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 = "anyhow" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" - -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -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-crypto-primitives" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "blake2", - "derivative", - "digest", - "sha2", -] - -[[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", - "itertools 0.10.5", - "num-bigint 0.4.4", - "num-traits", - "paste", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "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", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-groth16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" -dependencies = [ - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[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-relations" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" -dependencies = [ - "ark-ff", - "ark-std", - "tracing", - "tracing-subscriber", -] - -[[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", - "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", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-snark" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" -dependencies = [ - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "autotools" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8da1805e028a172334c3b680f93e71126f2327622faef2ec3d893c0a4ad77" -dependencies = [ - "cc", -] - -[[package]] -name = "backtrace" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[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.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest", -] - -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bonsai-sdk" -version = "0.6.0-rc.2" -dependencies = [ - "reqwest", - "serde", - "thiserror", -] - -[[package]] -name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - -[[package]] -name = "bytemuck" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[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" -dependencies = [ - "serde", -] - -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "jobserver", - "libc", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "core-graphics-types" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "libc", -] - -[[package]] -name = "cpp_demangle" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "rand_core", - "subtle", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "cust" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6cc71911e179f12483b9734120b45bd00bf64fab085cc4818428523eedd469" -dependencies = [ - "bitflags 1.3.2", - "bytemuck", - "cust_core", - "cust_derive", - "cust_raw", - "find_cuda_helper", -] - -[[package]] -name = "cust_core" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "039f79662cb8f890cbf335e818cd522d6e3a53fe63f61d1aaaf859cd3d975f06" -dependencies = [ - "cust_derive", - "glam", - "mint", - "vek", -] - -[[package]] -name = "cust_derive" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a3bc95fe629aed92b2423de6ccff9e40174b21d19cb6ee6281a4d04ac72f66" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "cust_raw" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf40d6ade12cb9828bbc844b9875c7b93d25e67a3c9bf61c7aa3ae09e402bf8" -dependencies = [ - "find_cuda_helper", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "directories" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - -[[package]] -name = "docker-generate" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "downloader" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05213e96f184578b5f70105d4d0a644a168e99e12d7bea0b200c15d67b5c182" -dependencies = [ - "digest", - "futures", - "rand", - "reqwest", - "thiserror", - "tokio", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "elf" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" - -[[package]] -name = "encoding_rs" -version = "0.8.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "erased-serde" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55d05712b2d8d88102bc9868020c9e5c7a1f5527c452b9b97450a1d006140ba7" -dependencies = [ - "serde", -] - -[[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 = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - -[[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", - "byteorder", - "ff_derive", - "rand_core", - "subtle", -] - -[[package]] -name = "ff_derive" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f54704be45ed286151c5e11531316eaef5b8f5af7d597b806fdb8af108d84a" -dependencies = [ - "addchain", - "cfg-if", - "num-bigint 0.3.3", - "num-integer", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "find_cuda_helper" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f9e65c593dd01ac77daad909ea4ad17f0d6d1776193fc8ea766356177abdad" -dependencies = [ - "glob", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flate2" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" -dependencies = [ - "foreign-types-macros", - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-macros" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "foreign-types-shared" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -dependencies = [ - "fallible-iterator", - "stable_deref_trait", -] - -[[package]] -name = "glam" -version = "0.20.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43e957e744be03f5801a55472f593d43fabdebf25a4585db250f04d86b1675f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "h2" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[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.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "http" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "human-repr" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" - -[[package]] -name = "hyper" -version = "0.14.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http", - "hyper", - "rustls", - "tokio", - "tokio-rustls", -] - -[[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 = "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 = "inner_proof" -version = "0.1.0" -dependencies = [ - "inner_proof-methods", - "rand", - "risc0-zkvm", - "serde", -] - -[[package]] -name = "inner_proof-methods" -version = "0.1.0" -dependencies = [ - "risc0-build", -] - -[[package]] -name = "inventory" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8573b2b1fb643a372c73b23f4da5f888677feef3305146d68a539250a9bccc7" - -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[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.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "jobserver" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "lazy-regex" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d12be4595afdf58bd19e4a9f4e24187da2a66700786ff660a418e9059937a4c" -dependencies = [ - "lazy-regex-proc_macros", - "once_cell", - "regex", -] - -[[package]] -name = "lazy-regex-proc_macros" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bcd58e6c97a7fcbaffcdc95728b393b8d98933bfadad49ed4097845b57ef0b" -dependencies = [ - "proc-macro2", - "quote", - "regex", - "syn 2.0.48", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.152" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" - -[[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.2", - "libc", - "redox_syscall", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - -[[package]] -name = "matrixmultiply" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" -dependencies = [ - "autocfg", - "rawpointer", -] - -[[package]] -name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - -[[package]] -name = "metal" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "550b24b0cd4cf923f36bae78eca457b3a10d8a6a14a9c84cb2687b527e6a84af" -dependencies = [ - "bitflags 1.3.2", - "block", - "core-graphics-types", - "foreign-types", - "log", - "objc", - "paste", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "mint" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff" - -[[package]] -name = "mio" -version = "0.8.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.48.0", -] - -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - -[[package]] -name = "ndarray" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" -dependencies = [ - "matrixmultiply", - "num-complex", - "num-integer", - "num-traits", - "rawpointer", - "rayon", -] - -[[package]] -name = "num-bigint" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" -dependencies = [ - "autocfg", - "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", - "num-integer", - "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-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", - "objc_exception", -] - -[[package]] -name = "objc_exception" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" -dependencies = [ - "cc", -] - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "flate2", - "memchr", - "ruzstd", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[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 = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "prettyplease" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" -dependencies = [ - "proc-macro2", - "syn 2.0.48", -] - -[[package]] -name = "proc-macro2" -version = "1.0.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prost" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" -dependencies = [ - "bytes", - "heck", - "itertools 0.11.0", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn 2.0.48", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" -dependencies = [ - "anyhow", - "itertools 0.11.0", - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "prost-types" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" -dependencies = [ - "prost", -] - -[[package]] -name = "protobuf-src" -version = "1.1.0+21.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" -dependencies = [ - "autotools", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[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", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - -[[package]] -name = "rayon" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[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", - "libredox", - "thiserror", -] - -[[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", -] - -[[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", -] - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "reqwest" -version = "0.11.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" -dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "system-configuration", - "tokio", - "tokio-rustls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots", - "winreg", -] - -[[package]] -name = "ring" -version = "0.17.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" -dependencies = [ - "cc", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.48.0", -] - -[[package]] -name = "risc0-binfmt" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "elf", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "tracing", -] - -[[package]] -name = "risc0-build" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "cargo_metadata", - "docker-generate", - "risc0-binfmt", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "serde_json", - "tempfile", -] - -[[package]] -name = "risc0-build-kernel" -version = "0.20.0-rc.2" -dependencies = [ - "cc", - "directories", - "hex", - "sha2", - "tempfile", -] - -[[package]] -name = "risc0-circuit-recursion" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "bytemuck", - "cust", - "downloader", - "metal", - "rand", - "rayon", - "risc0-circuit-recursion-sys", - "risc0-core", - "risc0-zkp", - "sha2", - "tracing", - "zip", -] - -[[package]] -name = "risc0-circuit-recursion-sys" -version = "0.20.0-rc.2" -dependencies = [ - "glob", - "risc0-build-kernel", - "risc0-core", -] - -[[package]] -name = "risc0-circuit-rv32im" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "cust", - "metal", - "rand", - "rayon", - "risc0-circuit-rv32im-sys", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "tracing", -] - -[[package]] -name = "risc0-circuit-rv32im-sys" -version = "0.20.0-rc.2" -dependencies = [ - "glob", - "risc0-build-kernel", - "risc0-core", -] - -[[package]] -name = "risc0-core" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "rand_core", -] - -[[package]] -name = "risc0-sppark" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be1d1ff7fe501c9f420654bc1ff7461909b85e7f8fb3698a8812c0a8a787306" -dependencies = [ - "cc", - "which", -] - -[[package]] -name = "risc0-sys" -version = "0.20.0-rc.2" -dependencies = [ - "cc", - "cust", - "risc0-build-kernel", - "risc0-sppark", -] - -[[package]] -name = "risc0-zkp" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "blake2", - "bytemuck", - "cust", - "digest", - "ff", - "hex", - "lazy_static", - "metal", - "ndarray", - "paste", - "rand", - "rand_core", - "rayon", - "risc0-core", - "risc0-sys", - "risc0-zkvm-platform", - "serde", - "sha2", - "tracing", -] - -[[package]] -name = "risc0-zkvm" -version = "0.20.0-rc.2" -dependencies = [ - "addr2line", - "anyhow", - "ark-bn254", - "ark-groth16", - "ark-serialize", - "bincode", - "bonsai-sdk", - "bytemuck", - "bytes", - "cfg-if", - "crypto-bigint", - "elf", - "getrandom", - "hex", - "human-repr", - "lazy-regex", - "num-bigint 0.4.4", - "num-derive", - "num-traits", - "prost", - "prost-build", - "protobuf-src", - "rayon", - "risc0-binfmt", - "risc0-circuit-recursion", - "risc0-circuit-rv32im", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "rrs-lib", - "rustc-demangle", - "semver", - "serde", - "sha2", - "tempfile", - "tracing", - "typetag", -] - -[[package]] -name = "risc0-zkvm-platform" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "getrandom", - "libm", -] - -[[package]] -name = "rrs-lib" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" -dependencies = [ - "downcast-rs", - "paste", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.38.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" -dependencies = [ - "bitflags 2.4.2", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.21.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" -dependencies = [ - "log", - "ring", - "rustls-webpki", - "sct", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "ruzstd" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" -dependencies = [ - "byteorder", - "derive_more", - "twox-hash", -] - -[[package]] -name = "ryu" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "semver" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.195" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.195" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "serde_json" -version = "1.0.111" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b187f0231d56fe41bfb12034819dd2bf336422a5866de41bc3fec4b2e3883e8" - -[[package]] -name = "socket2" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tempfile" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys 0.52.0", -] - -[[package]] -name = "thiserror" -version = "1.0.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[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" -version = "1.35.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "pin-project-lite", - "socket2", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "log", - "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", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "tracing-core", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "static_assertions", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "typetag" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43148481c7b66502c48f35b8eef38b6ccdc7a9f04bd4cc294226d901ccc9bc7" -dependencies = [ - "erased-serde", - "inventory", - "once_cell", - "serde", - "typetag-impl", -] - -[[package]] -name = "typetag-impl" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291db8a81af4840c10d636e047cac67664e343be44e24dfdbd1492df9a5d3390" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[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 = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vek" -version = "0.15.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8085882662f9bc47fc8b0cdafa5e19df8f592f650c02b9083da8d45ac9eebd17" -dependencies = [ - "approx", - "num-integer", - "num-traits", - "rustc_version", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[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.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.48", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" - -[[package]] -name = "web-sys" -version = "0.3.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" - -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - -[[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.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.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.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.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.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 = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[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", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "byteorder", - "crc32fast", - "crossbeam-utils", - "flate2", -] diff --git a/hash/risc0/inner_proof/Cargo.toml b/hash/risc0/inner_proof/Cargo.toml deleted file mode 100644 index c935ed6..0000000 --- a/hash/risc0/inner_proof/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -name = "inner_proof" -version = "0.1.0" -edition = "2021" - -[dependencies] -inner_proof-methods = { path = "methods" } -risc0-zkvm = { path = "../external/risc0/risc0/zkvm" } -serde = "1.0" -rand = "0.8.3" - - -[features] -cuda = ["risc0-zkvm/cuda"] -default = [] -metal = ["risc0-zkvm/metal"] -prove = ["risc0-zkvm/prove"] diff --git a/hash/risc0/inner_proof/methods/Cargo.toml b/hash/risc0/inner_proof/methods/Cargo.toml deleted file mode 100644 index b187021..0000000 --- a/hash/risc0/inner_proof/methods/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "inner_proof-methods" -version = "0.1.0" -edition = "2021" - -[build-dependencies] -risc0-build = { path = "../../external/risc0/risc0/build" } - -[package.metadata.risc0] -methods = ["guest"] diff --git a/hash/risc0/inner_proof/methods/build.rs b/hash/risc0/inner_proof/methods/build.rs deleted file mode 100644 index 08a8a4e..0000000 --- a/hash/risc0/inner_proof/methods/build.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - risc0_build::embed_methods(); -} diff --git a/hash/risc0/inner_proof/methods/guest/Cargo.lock b/hash/risc0/inner_proof/methods/guest/Cargo.lock deleted file mode 100644 index da9ea78..0000000 --- a/hash/risc0/inner_proof/methods/guest/Cargo.lock +++ /dev/null @@ -1,791 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "anyhow" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" - -[[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-crypto-primitives" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "blake2", - "derivative", - "digest", - "sha2", -] - -[[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", - "itertools", - "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", - "itertools", - "num-bigint", - "num-traits", - "paste", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "syn 1.0.107", -] - -[[package]] -name = "ark-ff-macros" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "ark-groth16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" -dependencies = [ - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[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", -] - -[[package]] -name = "ark-relations" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" -dependencies = [ - "ark-ff", - "ark-std", - "tracing", - "tracing-subscriber", -] - -[[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", - "num-bigint", -] - -[[package]] -name = "ark-serialize-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "ark-snark" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" -dependencies = [ - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest", -] - -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bytemuck" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c041d3eab048880cb0b86b256447da3f18859a163c3b8d8893f4e6368abe6393" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "const-oid" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "elf" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b183d6ce6ca4cf30e3db37abf5b52568b5f9015c97d9fbdd7026aa5dcdd758" - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "human-repr" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" - -[[package]] -name = "inner_proof_method" -version = "0.1.0" -dependencies = [ - "risc0-zkvm", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "libc" -version = "0.2.149" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" - -[[package]] -name = "libm" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "num-bigint" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "paste" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro2" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "rand_chacha", - "rand_core", -] - -[[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", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[package]] -name = "risc0-binfmt" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "elf", - "risc0-zkp", - "risc0-zkvm-platform", - "serde", - "tracing", -] - -[[package]] -name = "risc0-circuit-recursion" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "bytemuck", - "risc0-core", - "risc0-zkp", - "tracing", -] - -[[package]] -name = "risc0-circuit-rv32im" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "tracing", -] - -[[package]] -name = "risc0-core" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "rand_core", -] - -[[package]] -name = "risc0-zkp" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "blake2", - "bytemuck", - "digest", - "hex", - "paste", - "rand_core", - "risc0-core", - "risc0-zkvm-platform", - "serde", - "sha2", - "tracing", -] - -[[package]] -name = "risc0-zkvm" -version = "0.20.0-rc.2" -dependencies = [ - "anyhow", - "ark-bn254", - "ark-groth16", - "ark-serialize", - "bytemuck", - "cfg-if", - "getrandom", - "hex", - "human-repr", - "num-bigint", - "num-derive", - "num-traits", - "risc0-binfmt", - "risc0-circuit-recursion", - "risc0-circuit-rv32im", - "risc0-core", - "risc0-zkp", - "risc0-zkvm-platform", - "rrs-lib", - "semver", - "serde", - "sha2", - "tracing", -] - -[[package]] -name = "risc0-zkvm-platform" -version = "0.20.0-rc.2" -dependencies = [ - "bytemuck", - "getrandom", - "libm", -] - -[[package]] -name = "rrs-lib" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" -dependencies = [ - "downcast-rs", - "paste", -] - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "semver" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" - -[[package]] -name = "serde" -version = "1.0.171" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.171" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "sha2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tracing" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "tracing-core" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "tracing-core", -] - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[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 = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "zerocopy" -version = "0.7.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" -dependencies = [ - "proc-macro2", - "quote", - "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", - "quote", - "syn 2.0.39", -] diff --git a/hash/risc0/inner_proof/methods/guest/Cargo.toml b/hash/risc0/inner_proof/methods/guest/Cargo.toml deleted file mode 100644 index faac96e..0000000 --- a/hash/risc0/inner_proof/methods/guest/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "inner_proof_method" -version = "0.1.0" -edition = "2021" - -[workspace] - -[dependencies] -risc0-zkvm = { path = "../../../external/risc0/risc0/zkvm", default-features = false, features = ["std"]} diff --git a/hash/risc0/inner_proof/methods/guest/src/main.rs b/hash/risc0/inner_proof/methods/guest/src/main.rs deleted file mode 100644 index 28fc0ac..0000000 --- a/hash/risc0/inner_proof/methods/guest/src/main.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![no_main] - -use risc0_zkvm::{guest::env, sha, sha::Sha256}; - -risc0_zkvm::guest::entry!(main); - -fn main() { - let data: String = env::read(); - let hash = sha::Impl::hash_bytes(&data.as_bytes()); - env::commit(&hash) -} - - diff --git a/hash/risc0/inner_proof/methods/src/lib.rs b/hash/risc0/inner_proof/methods/src/lib.rs deleted file mode 100644 index 1bdb308..0000000 --- a/hash/risc0/inner_proof/methods/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -include!(concat!(env!("OUT_DIR"), "/methods.rs")); diff --git a/hash/risc0/inner_proof/src/lib.rs b/hash/risc0/inner_proof/src/lib.rs deleted file mode 100644 index 6c6ab88..0000000 --- a/hash/risc0/inner_proof/src/lib.rs +++ /dev/null @@ -1,42 +0,0 @@ -use inner_proof_methods::INNER_PROOF_METHOD_ELF; -use risc0_zkvm::{default_prover, ExecutorEnv, Receipt}; -use risc0_zkvm::{ sha}; -use rand::Rng; - - -pub fn generate_bytes(size: u32) -> String { - let mut rng = rand::thread_rng(); - let random_bytes: Vec = (0..(size/2)).map(|_| rng.gen()).collect(); - - let random_string: String = random_bytes - .iter() - .map(|byte| format!("{:02X}", byte)) // Convert each byte to a two-digit hexadecimal string - .collect(); - - // eprintln!("bytes: {:?}", random_string.as_bytes().len()); - random_string - -} - -pub fn sha_bench(size: u32) -> (Receipt, sha::Digest) { - - let input = generate_bytes(size); - - let env = ExecutorEnv::builder() - .write(&input) - .unwrap() - .build() - .unwrap(); - - // Obtain the default prover. - let prover = default_prover(); - - // Produce a receipt by proving the specified ELF binary. - let receipt = prover.prove(env, INNER_PROOF_METHOD_ELF).unwrap(); - - let _output: sha::Digest = receipt.journal.decode().expect( - "cannot deserialise", - ); - - (receipt, _output) -} \ No newline at end of file diff --git a/hash/risc0/inner_proof/src/main.rs b/hash/risc0/inner_proof/src/main.rs deleted file mode 100644 index 0bb1c0d..0000000 --- a/hash/risc0/inner_proof/src/main.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -use inner_proof::sha_bench; -use inner_proof_methods::INNER_PROOF_METHOD_ID; -use std::process; - -fn main() { - - let args: Vec = std::env::args().collect(); - - if args.len() != 2 { - println!("Wrong number of arguments! The program expects two arguments: and "); - // Exit the program with a non-zero exit code - process::exit(1); - } - - let data_size = args[1].parse::().unwrap(); - - let (receipt, _output) = sha_bench(data_size.try_into().unwrap()); - - // Verify receipt, panic if it's wrong - receipt.verify(INNER_PROOF_METHOD_ID).expect( - "cannot verify", - ); - - eprintln!("hash: {:?}", _output); -} From 568aca520e6b77f1b7fc5860705db23b28cbeb54 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Wed, 31 Jul 2024 22:55:58 +0530 Subject: [PATCH 39/41] code cleaning and building/running script modified with rust flags for faster run --- hash/plonky2/bench/build.sh | 4 ++- hash/plonky2/bench/run.sh | 2 +- .../bench/src/bench/keccak256/keccak.rs | 33 +++++++++++-------- hash/plonky2/bench/src/bench/sha256/sha.rs | 2 ++ 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/hash/plonky2/bench/build.sh b/hash/plonky2/bench/build.sh index 749ad6c..7d27c85 100755 --- a/hash/plonky2/bench/build.sh +++ b/hash/plonky2/bench/build.sh @@ -4,5 +4,7 @@ rustup override set nightly # Build -cargo build +# RUSTFLAGS=-Ctarget-cpu=native cargo build +RUSTFLAGS=-Ctarget-cpu=native cargo build --release --bin plonky2_hash_benchmarks + diff --git a/hash/plonky2/bench/run.sh b/hash/plonky2/bench/run.sh index 9f1d247..8d21b7e 100755 --- a/hash/plonky2/bench/run.sh +++ b/hash/plonky2/bench/run.sh @@ -12,4 +12,4 @@ echo "HASH = $ZKBENCH_HASH_TYPE" echo "Input Size (Bytes) = $ZKBENCH_INPUT_SIZE_BYTES" # Run the benchmarks -./target/debug/plonky2_hash_benchmarks $ZKBENCH_HASH_TYPE $ZKBENCH_INPUT_SIZE_BYTES \ No newline at end of file +./target/release/plonky2_hash_benchmarks $ZKBENCH_HASH_TYPE $ZKBENCH_INPUT_SIZE_BYTES \ No newline at end of file diff --git a/hash/plonky2/bench/src/bench/keccak256/keccak.rs b/hash/plonky2/bench/src/bench/keccak256/keccak.rs index b287fa1..930059d 100644 --- a/hash/plonky2/bench/src/bench/keccak256/keccak.rs +++ b/hash/plonky2/bench/src/bench/keccak256/keccak.rs @@ -251,23 +251,28 @@ pub fn keccak_bench(size: usize) -> Result<()>{ for i in 0..256 { pw.set_bool_target(output_t[i], exptected_output_bits[i]); } - - println!("circuit size: {:?}", builder.num_gates()); + let circuit_size = builder.num_gates(); + let data = builder.build::(); - let now = Instant::now(); - let proof = data.prove(pw)?; - - println!("time = {:?}", now.elapsed()); - println!( - "degree = {}, degree_bits= {}", - data.common.degree(), - data.common.degree_bits() - ); - - data.verify(proof)?; - Ok(()) + let (proof_generation_time, proof) = { + let now = Instant::now(); + let proof = data.prove(pw)?; + (now.elapsed(), proof) + }; + let proof_size = proof.to_bytes().len(); + let (verification_time, verification_result) = { + let now = Instant::now(); + let res = data.verify(proof); + (now.elapsed(), res) + }; + + eprintln!("circuit size: {}", circuit_size); + eprintln!("proof generation time: {:?}", proof_generation_time); + eprintln!("verification time: {:?}", verification_time); + eprintln!("proof size: {:?}", proof_size); + verification_result } fn generate_data(size: usize) -> Vec { diff --git a/hash/plonky2/bench/src/bench/sha256/sha.rs b/hash/plonky2/bench/src/bench/sha256/sha.rs index 36e1b12..3a862de 100644 --- a/hash/plonky2/bench/src/bench/sha256/sha.rs +++ b/hash/plonky2/bench/src/bench/sha256/sha.rs @@ -227,6 +227,7 @@ pub fn sha256_bench(size: usize) -> Result<()> { let end = start.elapsed(); (end, proof) }; + let proof_size = proof.to_bytes().len(); let (verification_time, res) = { let start = std::time::Instant::now(); @@ -237,6 +238,7 @@ pub fn sha256_bench(size: usize) -> Result<()> { eprintln!("Proof Generation Time: {:?}", proof_time); eprintln!("Verification Time: {:?}", verification_time); + eprintln!("Proof size: {:?}", proof_size); res From 29472e63a6a9fe0fada09cc751de2b61e038f779 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Thu, 1 Aug 2024 14:22:17 +0530 Subject: [PATCH 40/41] test for correctness of polygon keccak, separate script for running poseidon hash added --- hash/plonky2/bench/build.sh | 1 - hash/plonky2/bench/run.sh | 4 +- hash/plonky2/bench/run_tree.sh | 15 +++++ .../src/bench/keccak256/keccak_polygon.rs | 61 ++++++++++++++++++- hash/plonky2/bench/src/bench/poseidon.rs | 2 +- hash/plonky2/bench/src/main.rs | 1 - hash/plonky2/external/zk_evm | 2 +- 7 files changed, 78 insertions(+), 8 deletions(-) create mode 100755 hash/plonky2/bench/run_tree.sh diff --git a/hash/plonky2/bench/build.sh b/hash/plonky2/bench/build.sh index 7d27c85..7f06aa8 100755 --- a/hash/plonky2/bench/build.sh +++ b/hash/plonky2/bench/build.sh @@ -4,7 +4,6 @@ rustup override set nightly # Build -# RUSTFLAGS=-Ctarget-cpu=native cargo build RUSTFLAGS=-Ctarget-cpu=native cargo build --release --bin plonky2_hash_benchmarks diff --git a/hash/plonky2/bench/run.sh b/hash/plonky2/bench/run.sh index 8d21b7e..82d817e 100755 --- a/hash/plonky2/bench/run.sh +++ b/hash/plonky2/bench/run.sh @@ -1,10 +1,10 @@ #!/bin/bash if [ -z ${ZKBENCH_HASH_TYPE} ]; then -ZKBENCH_HASH_TYPE="poseidon" +ZKBENCH_HASH_TYPE="sha256" fi if [ -z ${ZKBENCH_INPUT_SIZE_BYTES} ]; then -ZKBENCH_INPUT_SIZE_BYTES=4 +ZKBENCH_INPUT_SIZE_BYTES=256 fi echo "Running benchmarks with the following configurations:" diff --git a/hash/plonky2/bench/run_tree.sh b/hash/plonky2/bench/run_tree.sh new file mode 100755 index 0000000..e1e33d6 --- /dev/null +++ b/hash/plonky2/bench/run_tree.sh @@ -0,0 +1,15 @@ +#!/bin/bash +if [ -z ${ZKBENCH_HASH_TYPE_TREE} ]; then +ZKBENCH_HASH_TYPE_TREE="poseidon" +fi + +if [ -z ${ZKBENCH_TREE_DEPTH} ]; then +ZKBENCH_TREE_DEPTH=4 +fi + +echo "Running benchmarks with the following configurations:" +echo "HASH = $ZKBENCH_HASH_TYPE_TREE" +echo "Tree Depth = $ZKBENCH_TREE_DEPTH" + +# Run the benchmarks +./target/release/plonky2_hash_benchmarks $ZKBENCH_HASH_TYPE_TREE $ZKBENCH_TREE_DEPTH \ No newline at end of file diff --git a/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs b/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs index 8deed2f..3d3282c 100644 --- a/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs +++ b/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs @@ -25,9 +25,23 @@ use env_logger::{ try_init_from_env }; -const NUM_INPUTS: usize = 25; +#[allow(dead_code)] +/// Number of rounds in a Keccak permutation. +pub(crate) const NUM_ROUNDS: usize = 24; -pub fn keccak_polygon_bench(num_perms: usize) -> Result<()> { +/// Number of 64-bit elements in the Keccak permutation input. +pub(crate) const NUM_INPUTS: usize = 25; + +fn ceil_div(a: usize, b: usize) -> usize { + (a + b - 1) / b +} + +pub fn keccak_polygon_bench(size: usize) -> Result<()> { + // here input in in terms of block + let mut num_perms = 1; + if size > 25 * 64/8 { + num_perms = ceil_div(size, 25 * 64/8) as usize; + } const D: usize = 2; type C = PoseidonGoldilocksConfig; @@ -99,4 +113,47 @@ pub fn keccak_polygon_bench(num_perms: usize) -> Result<()> { fn init_logger() { let _ = try_init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "debug")); +} + +#[cfg(test)] +mod tests { + use anyhow::Result; + use plonky2::field::types::PrimeField64; + use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig}; + use tiny_keccak::keccakf; + use evm_arithmetization::keccak::columns::reg_output_limb; + use super::*; + const NUM_ROUNDS: usize = 24; + + #[test] + fn keccak_correctness_test() -> Result<()> { + let input: [u64; NUM_INPUTS] = rand::random(); + + const D: usize = 2; + type C = PoseidonGoldilocksConfig; + type F = >::F; + type S = KeccakStark; + + let stark: KeccakStark<>::F, 2> = S::default(); + + let rows = stark.generate_trace_rows(vec![(input, 0)], 8); + let last_row = rows[NUM_ROUNDS - 1]; + let output = (0..NUM_INPUTS) + .map(|i| { + let hi = last_row[reg_output_limb(2 * i + 1)].to_canonical_u64(); + let lo = last_row[reg_output_limb(2 * i)].to_canonical_u64(); + (hi << 32) | lo + }) + .collect::>(); + + let expected = { + let mut state = input; + keccakf(&mut state); + state + }; + + assert_eq!(output, expected); + + Ok(()) + } } \ No newline at end of file diff --git a/hash/plonky2/bench/src/bench/poseidon.rs b/hash/plonky2/bench/src/bench/poseidon.rs index fed9508..8867ff6 100644 --- a/hash/plonky2/bench/src/bench/poseidon.rs +++ b/hash/plonky2/bench/src/bench/poseidon.rs @@ -41,7 +41,7 @@ pub fn poseidon_bench(depth: usize) -> Result<()> { let hash = builder.hash_or_noop::(initial.clone()); // Public inputs are the initial value (provided below) and the result (which is generated). - // builder.register_public_inputs(initial.clone().as_slice()); + builder.register_public_inputs(initial.clone().as_slice()); builder.register_public_input(hash.elements[0]); builder.register_public_input(hash.elements[1]); builder.register_public_input(hash.elements[2]); diff --git a/hash/plonky2/bench/src/main.rs b/hash/plonky2/bench/src/main.rs index a5853f8..e804c69 100644 --- a/hash/plonky2/bench/src/main.rs +++ b/hash/plonky2/bench/src/main.rs @@ -58,7 +58,6 @@ fn main() { "keccak-polygon" => { println!("Running keccak of plolygon zk_evm: "); - eprintln!("number of permutation: {:?}", size); let _ = keccak_polygon_bench(size); } diff --git a/hash/plonky2/external/zk_evm b/hash/plonky2/external/zk_evm index 29f8620..5511569 160000 --- a/hash/plonky2/external/zk_evm +++ b/hash/plonky2/external/zk_evm @@ -1 +1 @@ -Subproject commit 29f8620338f2b3bb8be62def5666a2d9d7ba5331 +Subproject commit 5511569d166c29cc85211df31bb9485870ca53ab From ac7eeb75cdac0cfa5838d7729dda0e1ec9b2f9f6 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Thu, 1 Aug 2024 19:13:51 +0530 Subject: [PATCH 41/41] readme and cfg files added --- hash/plonky2/bench/README.md | 11 +++++++++++ hash/plonky2/bench/bench.cfg | 11 +++++++++++ hash/plonky2/bench/bench_tree.cfg | 10 ++++++++++ .../bench/src/bench/keccak256/keccak_polygon.rs | 2 ++ 4 files changed, 34 insertions(+) create mode 100644 hash/plonky2/bench/README.md create mode 100644 hash/plonky2/bench/bench.cfg create mode 100644 hash/plonky2/bench/bench_tree.cfg diff --git a/hash/plonky2/bench/README.md b/hash/plonky2/bench/README.md new file mode 100644 index 0000000..cded41d --- /dev/null +++ b/hash/plonky2/bench/README.md @@ -0,0 +1,11 @@ +Plonky2 Hash Circuit Benchmarking +-------------------------------- +- The `plonky2/bench` contains the following hash circuit benchamrking code: sha256, keccak256 and poseidon. +- The code for sha256 is taken from [plonky2-sha256](https://github.com/polymerdao/plonky2-sha256). +- The keccak hash has two different implementation taken from [plonky2-keccak256](https://github.com/qope/plonky2-keccak256) and Polygon-zero [zk_evm](https://github.com/0xPolygonZero/zk_evm/tree/develop). +- The `build.sh` script builds the whole code. You need rust nightly version to build the code. The script overrides the default rust version to nightly. +- `run.sh` and `run_tree.sh` runs the benchmark. (`run.sh` for sha256, keccak, and keccak-polygon and `run_tree.sh` for poseidon) +- Benchmarks can be parameterized using environment variables. By convention, we start the names of these environment variables with the `ZKBENCH_` prefix. +- By default the `run.sh` will run the sha256 benchmark over 256 Bytes of data. other hashes can be run by settig the environment variables accordingly. +- By default the `run_tree.sh` will run the poseidon benchmark over tree depth 4. +- Additional files `bench.cfg` and `bench_tree.cfg` specifies the configurations and parameters. \ No newline at end of file diff --git a/hash/plonky2/bench/bench.cfg b/hash/plonky2/bench/bench.cfg new file mode 100644 index 0000000..1a0d6ea --- /dev/null +++ b/hash/plonky2/bench/bench.cfg @@ -0,0 +1,11 @@ +name: "Plonky2 hashes circuit benchmarking" +author: +timeout: 200 +params: + [ HASH_TYPE: [ "sha256", "keccak", "keccak-polygon"] + , INPUT_SIZE_BYTES: [ 256, 512, 1024, 2048 ] + ] +tags: plonky2, $HASH_TYPE + +comments: + The benchmarks includes for sha256, keccak and poseidon hash. \ No newline at end of file diff --git a/hash/plonky2/bench/bench_tree.cfg b/hash/plonky2/bench/bench_tree.cfg new file mode 100644 index 0000000..b34d338 --- /dev/null +++ b/hash/plonky2/bench/bench_tree.cfg @@ -0,0 +1,10 @@ +name: "Plonky2 hashes circuit benchmarking" +author: +timeout: 100 +params: + [ HASH_TYPE_TREE: [ "poseidon"] + , TREE_DEPTH: [ 2, 4, 8, 16 ] + ] +tags: plonky2, $HASH_TYPE_TREE +comments: + The benchmarks includes for poseidon hash. \ No newline at end of file diff --git a/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs b/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs index 3d3282c..c136491 100644 --- a/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs +++ b/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs @@ -1,3 +1,5 @@ +// original source: https://github.com/0xPolygonZero/zk_evm/tree/develop + use evm_arithmetization::{ keccak::keccak_stark::KeccakStark, prover::prove_single_table,