mirror of
https://github.com/logos-storage/zk-benchmarks.git
synced 2026-01-06 07:43:09 +00:00
proof composition initial commit, risc0 added as a submodule, changes done according to pre-release version 0.20.0-rc.2
This commit is contained in:
parent
e38c4cf72a
commit
3dcd604b5f
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -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
|
||||
|
||||
2
hash/cpu/external/Blake3
vendored
2
hash/cpu/external/Blake3
vendored
@ -1 +1 @@
|
||||
Subproject commit dd30dcb00221591db3a983e0215b81d86cff941d
|
||||
Subproject commit 4d32708f511fd85c6b0fb131295cc73224246738
|
||||
2
hash/cpu/external/constantine
vendored
2
hash/cpu/external/constantine
vendored
@ -1 +1 @@
|
||||
Subproject commit 4dd0a02f1afd338f5207e40a47cac6705196b490
|
||||
Subproject commit dbd2630daa6d599a9e78ad247e6858baf41664da
|
||||
2
hash/cpu/external/zikkurat-algebra
vendored
2
hash/cpu/external/zikkurat-algebra
vendored
@ -1 +1 @@
|
||||
Subproject commit 96e349786bd004e64a9cf50e0122f89863b24e92
|
||||
Subproject commit 0fb198a9087531f32bb00bd13d4feaf813bc473a
|
||||
469
hash/risc0/bench/Cargo.lock
generated
469
hash/risc0/bench/Cargo.lock
generated
@ -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"
|
||||
|
||||
@ -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" }
|
||||
|
||||
@ -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"]
|
||||
|
||||
259
hash/risc0/bench/methods/guest/Cargo.lock
generated
259
hash/risc0/bench/methods/guest/Cargo.lock
generated
@ -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"
|
||||
|
||||
@ -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"
|
||||
@ -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<Vec<u8>> = env::read();
|
||||
|
||||
let cycles1 = env::get_cycle_count();
|
||||
let cycles1 = cycle_count();
|
||||
let mut hash_data: Vec<FpBabyBear> = 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<u8>> = 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);
|
||||
|
||||
|
||||
@ -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<u32> = env::read();
|
||||
|
||||
let cycles1 = env::get_cycle_count();
|
||||
let cycles1 = cycle_count();
|
||||
let mut hash_data: Vec<BabyBearElem> = 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<u32> = 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);
|
||||
|
||||
|
||||
@ -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<Vec<u8>> = env::read();
|
||||
let cycles1 = env::get_cycle_count();
|
||||
let cycles1 = cycle_count();
|
||||
let mut hash_data: Vec<FpBN256> = 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<u8> = Vec::new();
|
||||
hash_final.serialize_uncompressed(&mut hash_bytes).unwrap();
|
||||
|
||||
let cycles6 = env::get_cycle_count();
|
||||
let cycles6 = cycle_count();
|
||||
|
||||
env::commit(&hash_bytes);
|
||||
|
||||
|
||||
@ -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<u8> = 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)
|
||||
}
|
||||
|
||||
|
||||
@ -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<u8> = 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)
|
||||
}
|
||||
|
||||
@ -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<u8>) {
|
||||
|
||||
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();
|
||||
|
||||
@ -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<u8>) {
|
||||
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();
|
||||
|
||||
@ -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<u8>) {
|
||||
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();
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
|
||||
@ -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<u8>) {
|
||||
|
||||
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<u8>) {
|
||||
|
||||
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
|
||||
|
||||
2795
hash/risc0/composition/Cargo.lock
generated
Normal file
2795
hash/risc0/composition/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
16
hash/risc0/composition/Cargo.toml
Normal file
16
hash/risc0/composition/Cargo.toml
Normal file
@ -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"]
|
||||
10
hash/risc0/composition/methods/Cargo.toml
Normal file
10
hash/risc0/composition/methods/Cargo.toml
Normal file
@ -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"]
|
||||
17
hash/risc0/composition/methods/build.rs
Normal file
17
hash/risc0/composition/methods/build.rs
Normal file
@ -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();
|
||||
}
|
||||
1100
hash/risc0/composition/methods/guest/Cargo.lock
generated
Normal file
1100
hash/risc0/composition/methods/guest/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
11
hash/risc0/composition/methods/guest/Cargo.toml
Normal file
11
hash/risc0/composition/methods/guest/Cargo.toml
Normal file
@ -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"
|
||||
26
hash/risc0/composition/methods/guest/src/main.rs
Normal file
26
hash/risc0/composition/methods/guest/src/main.rs
Normal file
@ -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);
|
||||
}
|
||||
|
||||
15
hash/risc0/composition/methods/src/lib.rs
Normal file
15
hash/risc0/composition/methods/src/lib.rs
Normal file
@ -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"));
|
||||
38
hash/risc0/composition/src/main.rs
Normal file
38
hash/risc0/composition/src/main.rs
Normal file
@ -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);
|
||||
|
||||
}
|
||||
1
hash/risc0/external/risc0
vendored
Submodule
1
hash/risc0/external/risc0
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit a4d2b5d95685554ee34a39d60b40fa2c5deff57a
|
||||
2778
hash/risc0/inner_proof/Cargo.lock
generated
Normal file
2778
hash/risc0/inner_proof/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
17
hash/risc0/inner_proof/Cargo.toml
Normal file
17
hash/risc0/inner_proof/Cargo.toml
Normal file
@ -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"]
|
||||
10
hash/risc0/inner_proof/methods/Cargo.toml
Normal file
10
hash/risc0/inner_proof/methods/Cargo.toml
Normal file
@ -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"]
|
||||
17
hash/risc0/inner_proof/methods/build.rs
Normal file
17
hash/risc0/inner_proof/methods/build.rs
Normal file
@ -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();
|
||||
}
|
||||
791
hash/risc0/inner_proof/methods/guest/Cargo.lock
generated
Normal file
791
hash/risc0/inner_proof/methods/guest/Cargo.lock
generated
Normal file
@ -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",
|
||||
]
|
||||
9
hash/risc0/inner_proof/methods/guest/Cargo.toml
Normal file
9
hash/risc0/inner_proof/methods/guest/Cargo.toml
Normal file
@ -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"]}
|
||||
27
hash/risc0/inner_proof/methods/guest/src/main.rs
Normal file
27
hash/risc0/inner_proof/methods/guest/src/main.rs
Normal file
@ -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<u8> = env::read();
|
||||
let hash = sha::Impl::hash_bytes(&data);
|
||||
env::commit(&hash)
|
||||
}
|
||||
|
||||
|
||||
15
hash/risc0/inner_proof/methods/src/lib.rs
Normal file
15
hash/risc0/inner_proof/methods/src/lib.rs
Normal file
@ -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"));
|
||||
47
hash/risc0/inner_proof/src/lib.rs
Normal file
47
hash/risc0/inner_proof/src/lib.rs
Normal file
@ -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<u8> {
|
||||
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)
|
||||
}
|
||||
26
hash/risc0/inner_proof/src/main.rs
Normal file
26
hash/risc0/inner_proof/src/main.rs
Normal file
@ -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",
|
||||
);
|
||||
}
|
||||
2
hash/snark/external/hash-circuits
vendored
2
hash/snark/external/hash-circuits
vendored
@ -1 +1 @@
|
||||
Subproject commit e6b99b20f038f27390f590313ce7de227d6dd42a
|
||||
Subproject commit 3ae1517526f1061a8d37a159270cc15727e6b503
|
||||
Loading…
x
Reference in New Issue
Block a user