diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cd0868a3d..8642a52e3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ env: SUPPORT_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/e3-support CIPHERNODE_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/ciphernode NODE_VERSION: 22 - RUST_TOOLCHAIN: 1.86.0 + RUST_TOOLCHAIN: 1.91.1 NOIR_TOOLCHAIN: v1.0.0-beta.16 BB_VERSION: 3.0.0-nightly.20260102 HARDHAT_VAR_MNEMONIC: 'test test test test test test test test test test test junk' @@ -143,7 +143,7 @@ jobs: run: | sudo add-apt-repository ppa:ethereum/ethereum \ && sudo apt-get update -y \ - && sudo apt-get install -y solc + && sudo apt-get install -y solc protobuf-compiler - name: pnpm-setup uses: pnpm/action-setup@v4 @@ -196,7 +196,7 @@ jobs: run: | sudo add-apt-repository ppa:ethereum/ethereum \ && sudo apt-get update -y \ - && sudo apt-get install -y solc + && sudo apt-get install -y solc protobuf-compiler - name: pnpm-setup uses: pnpm/action-setup@v4 @@ -234,7 +234,7 @@ jobs: run: | sudo add-apt-repository ppa:ethereum/ethereum \ && sudo apt-get update -y \ - && sudo apt-get install -y solc + && sudo apt-get install -y solc protobuf-compiler - name: pnpm-setup uses: pnpm/action-setup@v4 @@ -440,7 +440,7 @@ jobs: run: | sudo add-apt-repository ppa:ethereum/ethereum \ && sudo apt-get update -y \ - && sudo apt-get install -y solc + && sudo apt-get install -y solc protobuf-compiler - name: 'Install the dependencies' run: 'pnpm install --frozen-lockfile' @@ -573,7 +573,7 @@ jobs: run: | sudo add-apt-repository ppa:ethereum/ethereum \ && sudo apt-get update -y \ - && sudo apt-get install -y solc + && sudo apt-get install -y solc protobuf-compiler - name: Build enclave CLI run: cargo install --locked --path crates/cli --bin enclave @@ -635,7 +635,7 @@ jobs: run: | sudo add-apt-repository ppa:ethereum/ethereum \ && sudo apt-get update -y \ - && sudo apt-get install -y solc + && sudo apt-get install -y solc protobuf-compiler - name: Install Nargo if: matrix.test-suite == 'test:circuits' @@ -721,7 +721,7 @@ jobs: run: | sudo add-apt-repository ppa:ethereum/ethereum \ && sudo apt-get update -y \ - && sudo apt-get install -y solc + && sudo apt-get install -y solc protobuf-compiler - name: Install yq run: | @@ -809,6 +809,9 @@ jobs: with: toolchain: ${{ env.NOIR_TOOLCHAIN }} + - name: Install protoc + run: sudo apt-get update -y && sudo apt-get install -y protobuf-compiler + - name: Cache Barretenberg binary id: cache-bb uses: actions/cache@v4 @@ -896,7 +899,7 @@ jobs: run: | sudo add-apt-repository ppa:ethereum/ethereum \ && sudo apt-get update -y \ - && sudo apt-get install -y solc + && sudo apt-get install -y solc protobuf-compiler - name: Install Barretenberg (bb) if: steps.cache-bb.outputs.cache-hit != 'true' @@ -968,6 +971,8 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ env.RUST_TOOLCHAIN }} + - name: Install protoc + run: sudo apt-get update -y && sudo apt-get install -y protobuf-compiler - name: Build support scripts run: cd templates/default && cargo build --locked --bin e3-support-scripts-dev - name: Verify build artifacts @@ -1016,12 +1021,24 @@ jobs: toolchain: ${{ env.RUST_TOOLCHAIN }} targets: wasm32-unknown-unknown + - name: Install protoc + run: sudo apt-get update -y && sudo apt-get install -y protobuf-compiler + - name: Install node dependencies run: pnpm install --frozen-lockfile - name: Build the sdk run: pnpm sdk:build + - name: Install Chrome for WASM browser smoke tests + uses: browser-actions/setup-chrome@v1 + + - name: WASM browser smoke test (e3-wasm) + run: | + cd crates/wasm + pnpm build + pnpm test:browser + - name: Run the tests run: pnpm sdk:test @@ -1072,6 +1089,9 @@ jobs: toolchain: ${{ env.RUST_TOOLCHAIN }} targets: wasm32-unknown-unknown + - name: Install protoc + run: sudo apt-get update -y && sudo apt-get install -y protobuf-compiler + - name: Install node dependencies run: pnpm install --frozen-lockfile @@ -1079,6 +1099,15 @@ jobs: working-directory: ./examples/CRISP run: pnpm build:sdk + - name: Install Chrome for WASM browser smoke tests + uses: browser-actions/setup-chrome@v1 + + - name: WASM browser smoke test (crisp-zk-inputs) + working-directory: ./examples/CRISP + run: | + pnpm -C packages/crisp-zk-inputs build + pnpm -C packages/crisp-zk-inputs test:browser + - name: Upload SDK artifacts uses: actions/upload-artifact@v4 with: @@ -1118,6 +1147,9 @@ jobs: with: toolchain: ${{ env.RUST_TOOLCHAIN }} + - name: Install protoc + run: sudo apt-get update -y && sudo apt-get install -y protobuf-compiler + - name: Install node dependencies run: pnpm install --frozen-lockfile diff --git a/Cargo.lock b/Cargo.lock index b20013f402..a6a92b350c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -365,6 +365,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "aligned-vec" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b" +dependencies = [ + "equator", +] + [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -1226,7 +1235,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -1237,7 +1246,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2822,7 +2831,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ab67060fc6b8ef687992d439ca0fa36e7ed17e9a0b16b25b601e8757df720de" dependencies = [ "data-encoding", - "syn 1.0.109", + "syn 2.0.116", ] [[package]] @@ -2985,7 +2994,7 @@ dependencies = [ "libc", "option-ext", "redox_users 0.5.2", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -3084,7 +3093,7 @@ dependencies = [ "e3-zk-helpers", "fhe", "fhe-traits", - "rand 0.8.5", + "rand 0.9.2", "thiserror 1.0.69", ] @@ -3160,6 +3169,7 @@ dependencies = [ "petname", "phf", "rand 0.8.5", + "rand 0.9.2", "serde", "serde_json", "tokio", @@ -3210,7 +3220,7 @@ dependencies = [ "figment", "path-clean", "petname", - "rand 0.8.5", + "rand 0.9.2", "serde", "serde_yaml", "shellexpand", @@ -3236,7 +3246,7 @@ dependencies = [ "async-trait", "bincode 1.3.3", "e3-utils", - "rand 0.8.5", + "rand 0.9.2", "serde", "tokio", "tracing", @@ -3320,8 +3330,8 @@ dependencies = [ "hex", "libp2p", "phf", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", "reqwest", "serde", "serde_json", @@ -3358,7 +3368,7 @@ dependencies = [ "hex", "once_cell", "proptest", - "rand 0.8.5", + "rand 0.9.2", "serde", "sha2", "strum 0.27.2", @@ -3437,8 +3447,8 @@ dependencies = [ "fhe", "fhe-traits", "fhe-util", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", "serde", "tracing", ] @@ -3455,8 +3465,8 @@ dependencies = [ "fhe-traits", "num-bigint", "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", "serde", "thiserror 1.0.69", ] @@ -3496,7 +3506,7 @@ dependencies = [ "eyre", "fhe", "fhe-traits", - "rand 0.8.5", + "rand 0.9.2", "serde", "thiserror 1.0.69", "tokio", @@ -3543,8 +3553,9 @@ dependencies = [ "fhe", "fhe-traits", "ndarray", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", + "rand_core 0.9.5", "serde", "tracing", "zeroize", @@ -3582,7 +3593,7 @@ dependencies = [ "fhe-traits", "ndarray", "num-bigint", - "rand 0.8.5", + "rand 0.9.2", "rayon", "thiserror 1.0.69", "tokio", @@ -3610,7 +3621,7 @@ dependencies = [ "futures", "hex", "libp2p", - "rand 0.8.5", + "rand 0.9.2", "serde", "sha2", "tokio", @@ -3637,7 +3648,6 @@ dependencies = [ "bincode 1.3.3", "criterion", "fhe-math", - "ndarray", "num-bigint", "num-traits", "serde", @@ -3731,7 +3741,7 @@ dependencies = [ "e3-utils", "num", "num-bigint", - "rand 0.8.5", + "rand 0.9.2", "serde", "tokio", "tracing", @@ -3793,8 +3803,8 @@ dependencies = [ "fhe-traits", "hex", "libp2p", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", "tokio", "tracing", "tracing-subscriber", @@ -3839,8 +3849,8 @@ dependencies = [ "fhe-traits", "fhe-util", "num-bigint", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", "serde_json", "serial_test", "tempfile", @@ -3870,8 +3880,8 @@ dependencies = [ "ndarray", "num-bigint", "petname", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", "serde", "tokio", "tracing", @@ -3890,8 +3900,8 @@ dependencies = [ "e3-committee-hash", "e3-utils-derive", "hex", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", "regex", "serde", "tokio", @@ -3915,6 +3925,7 @@ dependencies = [ "e3-bfv-client", "e3-fhe-params", "getrandom 0.2.17", + "getrandom 0.3.4", "serde", "serde-wasm-bindgen", "wasm-bindgen", @@ -3941,7 +3952,7 @@ dependencies = [ "num-bigint", "num-integer", "num-traits", - "rand 0.8.5", + "rand 0.9.2", "rayon", "serde", "serde_json", @@ -3991,7 +4002,7 @@ dependencies = [ "num-bigint", "num-traits", "paste", - "rand 0.8.5", + "rand 0.9.2", "reqwest", "serde", "serde_json", @@ -4150,6 +4161,26 @@ dependencies = [ "syn 2.0.116", ] +[[package]] +name = "equator" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc" +dependencies = [ + "equator-macro", +] + +[[package]] +name = "equator-macro" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.116", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -4163,7 +4194,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -4249,71 +4280,73 @@ dependencies = [ [[package]] name = "fhe" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#5f24d0b62a7329b789db07a065b68accd614a47b" +version = "0.2.0" +source = "git+https://github.com/gnosisguild/fhe.rs#a92478b39625f4c18b91a5033928b35d8a0090cf" dependencies = [ "bincode 1.3.3", "doc-comment", "fhe-math", "fhe-traits", "fhe-util", - "itertools 0.12.1", + "itertools 0.14.0", "ndarray", "num-bigint", "num-traits", - "prost 0.12.6", - "prost-build 0.12.6", - "rand 0.8.5", - "rand_chacha 0.3.1", + "prost 0.14.3", + "prost-build 0.14.3", + "rand 0.9.2", + "rand_chacha 0.9.0", "rand_distr", "rayon", "serde", - "thiserror 1.0.69", + "thiserror 2.0.18", "zeroize", "zeroize_derive", ] [[package]] name = "fhe-math" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#5f24d0b62a7329b789db07a065b68accd614a47b" +version = "0.2.0" +source = "git+https://github.com/gnosisguild/fhe.rs#a92478b39625f4c18b91a5033928b35d8a0090cf" dependencies = [ "ethnum", "fhe-traits", "fhe-util", - "itertools 0.12.1", + "itertools 0.14.0", "ndarray", "num-bigint", "num-bigint-dig", "num-traits", - "prost 0.12.6", - "prost-build 0.12.6", - "rand 0.8.5", - "rand_chacha 0.3.1", + "prost 0.14.3", + "prost-build 0.14.3", + "pulp", + "rand 0.9.2", + "rand_chacha 0.9.0", "serde", "sha2", - "thiserror 1.0.69", + "tfhe-ntt", + "thiserror 2.0.18", "zeroize", ] [[package]] name = "fhe-traits" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#5f24d0b62a7329b789db07a065b68accd614a47b" +version = "0.1.1" +source = "git+https://github.com/gnosisguild/fhe.rs#a92478b39625f4c18b91a5033928b35d8a0090cf" dependencies = [ - "rand 0.8.5", + "rand 0.9.2", ] [[package]] name = "fhe-util" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#5f24d0b62a7329b789db07a065b68accd614a47b" +version = "0.1.1" +source = "git+https://github.com/gnosisguild/fhe.rs#a92478b39625f4c18b91a5033928b35d8a0090cf" dependencies = [ - "itertools 0.12.1", "num-bigint-dig", "num-traits", "prime_factorization", "rand 0.8.5", + "rand 0.9.2", "rand_distr", "rayon", ] @@ -5458,7 +5491,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -5481,15 +5514,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -5628,9 +5652,6 @@ name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -dependencies = [ - "spin 0.9.8", -] [[package]] name = "lean-imt" @@ -6397,14 +6418,16 @@ dependencies = [ [[package]] name = "ndarray" -version = "0.15.6" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d" dependencies = [ "matrixmultiply", "num-complex", "num-integer", "num-traits", + "portable-atomic", + "portable-atomic-util", "rawpointer", "serde", ] @@ -6716,16 +6739,16 @@ dependencies = [ [[package]] name = "num-bigint-dig" -version = "0.8.6" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7" +checksum = "a7f9a86e097b0d187ad0e65667c2f58b9254671e86e7dbb78036b16692eae099" dependencies = [ - "lazy_static", "libm", "num-integer", "num-iter", "num-traits", - "rand 0.8.5", + "once_cell", + "rand 0.9.2", "serde", "smallvec", ] @@ -6736,6 +6759,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ + "bytemuck", "num-traits", ] @@ -7027,7 +7051,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.61.2", ] [[package]] @@ -7434,6 +7458,15 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" +[[package]] +name = "portable-atomic-util" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" +dependencies = [ + "portable-atomic", +] + [[package]] name = "potential_utf" version = "0.1.4" @@ -7596,40 +7629,39 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.6" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" dependencies = [ "bytes", - "prost-derive 0.12.6", + "prost-derive 0.13.5", ] [[package]] name = "prost" -version = "0.13.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" +checksum = "d2ea70524a2f82d518bce41317d0fae74151505651af45faf1ffbd6fd33f0568" dependencies = [ "bytes", - "prost-derive 0.13.5", + "prost-derive 0.14.3", ] [[package]] name = "prost-build" -version = "0.12.6" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" dependencies = [ - "bytes", - "heck 0.4.1", - "itertools 0.12.1", + "heck 0.5.0", + "itertools 0.14.0", "log", "multimap", "once_cell", "petgraph 0.6.5", "prettyplease", - "prost 0.12.6", - "prost-types 0.12.6", + "prost 0.13.5", + "prost-types 0.13.5", "regex", "syn 2.0.116", "tempfile", @@ -7637,19 +7669,18 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.13.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" +checksum = "343d3bd7056eda839b03204e68deff7d1b13aba7af2b2fd16890697274262ee7" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "itertools 0.14.0", "log", "multimap", - "once_cell", - "petgraph 0.6.5", + "petgraph 0.8.3", "prettyplease", - "prost 0.13.5", - "prost-types 0.13.5", + "prost 0.14.3", + "prost-types 0.14.3", "regex", "syn 2.0.116", "tempfile", @@ -7657,12 +7688,12 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.6" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools 0.14.0", "proc-macro2", "quote", "syn 2.0.116", @@ -7670,9 +7701,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.13.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" +checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b" dependencies = [ "anyhow", "itertools 0.14.0", @@ -7683,20 +7714,20 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.6" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" dependencies = [ - "prost 0.12.6", + "prost 0.13.5", ] [[package]] name = "prost-types" -version = "0.13.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" +checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" dependencies = [ - "prost 0.13.5", + "prost 0.14.3", ] [[package]] @@ -7763,6 +7794,29 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95067976aca6421a523e491fce939a3e65249bac4b977adee0ee9771568e8aa3" +[[package]] +name = "pulp" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e205bb30d5b916c55e584c22201771bcf2bad9aabd5d4127f38387140c38632" +dependencies = [ + "bytemuck", + "cfg-if", + "libm", + "num-complex", + "paste", + "pulp-wasm-simd-flag", + "raw-cpuid", + "reborrow", + "version_check", +] + +[[package]] +name = "pulp-wasm-simd-flag" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40e24eee682d89fb193496edf918a7f407d30175b2e785fe057e4392dfd182e0" + [[package]] name = "quick-error" version = "1.2.3" @@ -7932,12 +7986,12 @@ dependencies = [ [[package]] name = "rand_distr" -version = "0.4.3" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +checksum = "6a8615d50dcf34fa31f7ab52692afec947c4dd0ab803cc87cb3b0b4570ff7463" dependencies = [ "num-traits", - "rand 0.8.5", + "rand 0.9.2", ] [[package]] @@ -7973,6 +8027,15 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "973443cf09a9c8656b574a866ab68dfa19f0867d0340648c7d2f6a71b8a8ea68" +[[package]] +name = "raw-cpuid" +version = "11.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" +dependencies = [ + "bitflags 2.10.0", +] + [[package]] name = "rawpointer" version = "0.2.1" @@ -8011,6 +8074,12 @@ dependencies = [ "yasna", ] +[[package]] +name = "reborrow" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03251193000f4bd3b042892be858ee50e8b3719f2b08e5833ac4353724632430" + [[package]] name = "recvmsg" version = "1.0.0" @@ -8209,7 +8278,7 @@ dependencies = [ "cc", "libc", "once_cell", - "spin 0.5.2", + "spin", "untrusted 0.7.1", "web-sys", "winapi", @@ -8405,7 +8474,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -9096,12 +9165,6 @@ 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 = "spki" version = "0.7.3" @@ -9291,7 +9354,7 @@ dependencies = [ "getrandom 0.3.4", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -9303,6 +9366,17 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "tfhe-ntt" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10650c743ade46b166c698c8349902ed5986784a7db418c51f810bea25f09e3d" +dependencies = [ + "aligned-vec", + "bytemuck", + "pulp", +] + [[package]] name = "thiserror" version = "1.0.69" @@ -10261,7 +10335,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.61.2", ] [[package]] @@ -10797,9 +10871,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" dependencies = [ "zeroize_derive", ] diff --git a/Cargo.toml b/Cargo.toml index 9a16241a6f..9dd34edf5c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] members = [ - "crates/aggregator", + "crates/aggregator", "crates/bfv-client", "crates/ciphernode-builder", "crates/cli", @@ -8,27 +8,27 @@ members = [ "crates/compute-provider", "crates/config", "crates/console", - "crates/dashboard", + "crates/dashboard", "crates/crypto", "crates/data", "crates/enclaveup", "crates/entrypoint", "crates/events", - "crates/evm", + "crates/evm", "crates/evm-helpers", "crates/fhe", "crates/fhe-params", - "crates/fs", - "crates/hamt", + "crates/fs", + "crates/hamt", "crates/indexer", - "crates/init", + "crates/init", "crates/keyshare", "crates/logger", "crates/multithread", - "crates/net", + "crates/net", "crates/parity-matrix", "crates/polynomial", - "crates/program-server", + "crates/program-server", "crates/request", "crates/safe", "crates/sdk", @@ -51,12 +51,12 @@ exclude = [ "examples/CRISP/server", "examples/CRISP/program", # client needs to be able to build crates/support independently - "crates/support", + "crates/support", "crates/support-scripts/dev", "templates/default" ] resolver = "3" -msrv = "1.86.0" +msrv = "1.91.1" [workspace.metadata.release] shared-version = true @@ -167,7 +167,7 @@ num = "=0.4.3" num-bigint = { version = "=0.4.6" } num-traits = "=0.2.19" num-integer = "0.1.46" -ndarray = { version = "=0.15.6", features = ["serde"] } +ndarray = { version = "=0.17.2", features = ["serde"] } once_cell = "=1.21.3" opentelemetry = "=0.29.0" opentelemetry-otlp = { version = "=0.29.0", features = ["grpc-tonic"] } @@ -179,10 +179,11 @@ phf = { version = "=0.11.3", features = ["macros"] } proptest = "=1.9.0" proc-macro2 = "=1.0.106" quote = "=1.0.44" -rand_chacha = "=0.3.1" -rand = "=0.8.5" +rand_chacha = "=0.9.0" +rand = "=0.9.2" +rand_core = "=0.9.5" rayon = "=1.10.0" -regex = "=1.11.1" +regex = "=1.11.1" reqwest = { version = "=0.12.22", features = ["json"] } serde = { version = "=1.0.228", features = ["derive"] } serde-wasm-bindgen = "=0.6.5" @@ -217,5 +218,4 @@ libp2p = { version = "=0.54.1", features = [ "request-response", "cbor" ]} -zeroize = "=1.8.1" - +zeroize = "=1.8.2" diff --git a/README.md b/README.md index 6071550e26..400c7698f4 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,7 @@ pnpm test:integration --no-prebuild ## Minimum Rust version -This workspace's minimum supported rustc version is 1.86.0. +This workspace's minimum supported rustc version is 1.91.1. ## Architecture diff --git a/circuits/benchmarks/results_insecure_no_agg_micro/benchmark_run_meta.json b/circuits/benchmarks/results_insecure_no_agg_micro/benchmark_run_meta.json index ac9e71558b..466ef0e61c 100644 --- a/circuits/benchmarks/results_insecure_no_agg_micro/benchmark_run_meta.json +++ b/circuits/benchmarks/results_insecure_no_agg_micro/benchmark_run_meta.json @@ -1,11 +1,14 @@ { "benchmark_mode": "insecure", "bfv_preset_subdir": "insecure-512", + "committee": "micro", "proof_aggregation": false, "multithread_jobs": 13, "verbose": true, "nodes_spawned": 20, "committee_size_n": 3, + "committee_size_h": 3, + "committee_threshold_t": 1, "network_model": "in_process_bus", "testmode_harness": true } diff --git a/circuits/benchmarks/results_insecure_no_agg_micro/crisp_verify_gas.json b/circuits/benchmarks/results_insecure_no_agg_micro/crisp_verify_gas.json index 3bbcf80c49..2b50b53ebe 100644 --- a/circuits/benchmarks/results_insecure_no_agg_micro/crisp_verify_gas.json +++ b/circuits/benchmarks/results_insecure_no_agg_micro/crisp_verify_gas.json @@ -1,7 +1,7 @@ { "verify_gas": { "dkg": null, - "user": 2972989, + "user": 2973025, "dec": null }, "source": "folded_proof_export_plus_crisp_verify_test", @@ -46,37 +46,37 @@ "proof_aggregation_enabled": false, "multithread": { "rayon_threads": 13, "max_simultaneous_rayon_tasks": 13, "cores_available": 14 }, "operation_timings": [ - { "name": "CalculateDecryptionKey", "avg_seconds": 0.004193153, "runs": 3, "total_seconds": 0.012579459 }, - { "name": "CalculateDecryptionShare", "avg_seconds": 0.020384319, "runs": 3, "total_seconds": 0.061152958 }, - { "name": "CalculateThresholdDecryption", "avg_seconds": 0.019784084, "runs": 1, "total_seconds": 0.019784084 }, - { "name": "GenEsiSss", "avg_seconds": 0.006832208, "runs": 3, "total_seconds": 0.020496625 }, - { "name": "GenPkShareAndSkSss", "avg_seconds": 0.010738166, "runs": 3, "total_seconds": 0.032214499 }, - { "name": "ZkDecryptedSharesAggregation", "avg_seconds": 1.581275625, "runs": 1, "total_seconds": 1.581275625 }, - { "name": "ZkDkgShareDecryption", "avg_seconds": 1.348800493, "runs": 6, "total_seconds": 8.092802958 }, - { "name": "ZkPkAggregation", "avg_seconds": 0.704008084, "runs": 1, "total_seconds": 0.704008084 }, - { "name": "ZkPkBfv", "avg_seconds": 0.222331778, "runs": 3, "total_seconds": 0.666995335 }, - { "name": "ZkPkGeneration", "avg_seconds": 2.461834375, "runs": 3, "total_seconds": 7.385503126 }, - { "name": "ZkShareComputation", "avg_seconds": 2.481999513, "runs": 6, "total_seconds": 14.891997083 }, - { "name": "ZkShareEncryption", "avg_seconds": 4.130910402, "runs": 24, "total_seconds": 99.141849665 }, - { "name": "ZkThresholdShareDecryption", "avg_seconds": 3.425231986, "runs": 3, "total_seconds": 10.275695958 }, - { "name": "ZkVerifyShareDecryptionProofs", "avg_seconds": 0.102147833, "runs": 3, "total_seconds": 0.306443501 }, - { "name": "ZkVerifyShareProofs", "avg_seconds": 0.272140033, "runs": 5, "total_seconds": 1.360700167 } + { "name": "CalculateDecryptionKey", "avg_seconds": 0.004797222, "runs": 3, "total_seconds": 0.014391667 }, + { "name": "CalculateDecryptionShare", "avg_seconds": 0.021573222, "runs": 3, "total_seconds": 0.064719667 }, + { "name": "CalculateThresholdDecryption", "avg_seconds": 0.021547625, "runs": 1, "total_seconds": 0.021547625 }, + { "name": "GenEsiSss", "avg_seconds": 0.006366944, "runs": 3, "total_seconds": 0.019100834 }, + { "name": "GenPkShareAndSkSss", "avg_seconds": 0.010935486, "runs": 3, "total_seconds": 0.032806458 }, + { "name": "ZkDecryptedSharesAggregation", "avg_seconds": 1.547001292, "runs": 1, "total_seconds": 1.547001292 }, + { "name": "ZkDkgShareDecryption", "avg_seconds": 1.347646736, "runs": 6, "total_seconds": 8.085880416 }, + { "name": "ZkPkAggregation", "avg_seconds": 0.530280667, "runs": 1, "total_seconds": 0.530280667 }, + { "name": "ZkPkBfv", "avg_seconds": 0.222952805, "runs": 3, "total_seconds": 0.668858417 }, + { "name": "ZkPkGeneration", "avg_seconds": 3.525033361, "runs": 3, "total_seconds": 10.575100083 }, + { "name": "ZkShareComputation", "avg_seconds": 2.408907521, "runs": 6, "total_seconds": 14.453445126 }, + { "name": "ZkShareEncryption", "avg_seconds": 3.855207475, "runs": 24, "total_seconds": 92.524979417 }, + { "name": "ZkThresholdShareDecryption", "avg_seconds": 3.332289111, "runs": 3, "total_seconds": 9.996867333 }, + { "name": "ZkVerifyShareDecryptionProofs", "avg_seconds": 0.092222375, "runs": 3, "total_seconds": 0.276667125 }, + { "name": "ZkVerifyShareProofs", "avg_seconds": 0.242743866, "runs": 5, "total_seconds": 1.213719334 } ], - "operation_timings_total_seconds": 144.553499127, + "operation_timings_total_seconds": 140.025365461, "operation_timings_metric": "tracked_job_wall", "phase_timings": [ { "label": "Starting trbfv actor test", "seconds": 0e-9, "metric": "wall_clock" }, - { "label": "Setup completed", "seconds": 2.701572083, "metric": "wall_clock" }, - { "label": "Committee Setup Completed", "seconds": 20.090864792, "metric": "wall_clock" }, - { "label": "Committee Finalization Complete", "seconds": 0.001990708, "metric": "wall_clock" }, - { "label": "Aggregator P2: PkAggregation pending -> PublicKeyAggregated (wall)", "seconds": 0.706576, "metric": "wall_clock" }, - { "label": "ThresholdShares -> PublicKeyAggregated", "seconds": 13.62430675, "metric": "wall_clock" }, - { "label": "E3Request -> PublicKeyAggregated", "seconds": 14.129209875, "metric": "wall_clock" }, - { "label": "Application CT Gen", "seconds": 0.009638083, "metric": "wall_clock" }, - { "label": "Running FHE Application", "seconds": 0.000051333, "metric": "wall_clock" }, - { "label": "Aggregator P4: Aggregation pending -> PlaintextAggregated (wall)", "seconds": 1.588489, "metric": "wall_clock" }, - { "label": "Ciphertext published -> PlaintextAggregated", "seconds": 5.418986167, "metric": "wall_clock" }, - { "label": "Entire Test", "seconds": 42.353041667, "metric": "wall_clock" } + { "label": "Setup completed", "seconds": 2.7456785, "metric": "wall_clock" }, + { "label": "Committee Setup Completed", "seconds": 20.090236084, "metric": "wall_clock" }, + { "label": "Committee Finalization Complete", "seconds": 0.006925375, "metric": "wall_clock" }, + { "label": "Aggregator P2: PkAggregation pending -> PublicKeyAggregated (wall)", "seconds": 0.5328, "metric": "wall_clock" }, + { "label": "ThresholdShares -> PublicKeyAggregated", "seconds": 12.921990041, "metric": "wall_clock" }, + { "label": "E3Request -> PublicKeyAggregated", "seconds": 13.433982917, "metric": "wall_clock" }, + { "label": "Application CT Gen", "seconds": 0.0092785, "metric": "wall_clock" }, + { "label": "Running FHE Application", "seconds": 0.000057416, "metric": "wall_clock" }, + { "label": "Aggregator P4: Aggregation pending -> PlaintextAggregated (wall)", "seconds": 1.554546, "metric": "wall_clock" }, + { "label": "Ciphertext published -> PlaintextAggregated", "seconds": 5.304683917, "metric": "wall_clock" }, + { "label": "Entire Test", "seconds": 41.587390625, "metric": "wall_clock" } ], "folded_artifacts": null }, diff --git a/circuits/benchmarks/results_insecure_no_agg_micro/integration_summary.json b/circuits/benchmarks/results_insecure_no_agg_micro/integration_summary.json index 0b7e790e10..e70aaaae5e 100644 --- a/circuits/benchmarks/results_insecure_no_agg_micro/integration_summary.json +++ b/circuits/benchmarks/results_insecure_no_agg_micro/integration_summary.json @@ -23,96 +23,96 @@ "operation_timings": [ { "name": "CalculateDecryptionKey", - "avg_seconds": 0.004193153, + "avg_seconds": 0.004797222, "runs": 3, - "total_seconds": 0.012579459 + "total_seconds": 0.014391667 }, { "name": "CalculateDecryptionShare", - "avg_seconds": 0.020384319, + "avg_seconds": 0.021573222, "runs": 3, - "total_seconds": 0.061152958 + "total_seconds": 0.064719667 }, { "name": "CalculateThresholdDecryption", - "avg_seconds": 0.019784084, + "avg_seconds": 0.021547625, "runs": 1, - "total_seconds": 0.019784084 + "total_seconds": 0.021547625 }, { "name": "GenEsiSss", - "avg_seconds": 0.006832208, + "avg_seconds": 0.006366944, "runs": 3, - "total_seconds": 0.020496625 + "total_seconds": 0.019100834 }, { "name": "GenPkShareAndSkSss", - "avg_seconds": 0.010738166, + "avg_seconds": 0.010935486, "runs": 3, - "total_seconds": 0.032214499 + "total_seconds": 0.032806458 }, { "name": "ZkDecryptedSharesAggregation", - "avg_seconds": 1.581275625, + "avg_seconds": 1.547001292, "runs": 1, - "total_seconds": 1.581275625 + "total_seconds": 1.547001292 }, { "name": "ZkDkgShareDecryption", - "avg_seconds": 1.348800493, + "avg_seconds": 1.347646736, "runs": 6, - "total_seconds": 8.092802958 + "total_seconds": 8.085880416 }, { "name": "ZkPkAggregation", - "avg_seconds": 0.704008084, + "avg_seconds": 0.530280667, "runs": 1, - "total_seconds": 0.704008084 + "total_seconds": 0.530280667 }, { "name": "ZkPkBfv", - "avg_seconds": 0.222331778, + "avg_seconds": 0.222952805, "runs": 3, - "total_seconds": 0.666995335 + "total_seconds": 0.668858417 }, { "name": "ZkPkGeneration", - "avg_seconds": 2.461834375, + "avg_seconds": 3.525033361, "runs": 3, - "total_seconds": 7.385503126 + "total_seconds": 10.575100083 }, { "name": "ZkShareComputation", - "avg_seconds": 2.481999513, + "avg_seconds": 2.408907521, "runs": 6, - "total_seconds": 14.891997083 + "total_seconds": 14.453445126 }, { "name": "ZkShareEncryption", - "avg_seconds": 4.130910402, + "avg_seconds": 3.855207475, "runs": 24, - "total_seconds": 99.141849665 + "total_seconds": 92.524979417 }, { "name": "ZkThresholdShareDecryption", - "avg_seconds": 3.425231986, + "avg_seconds": 3.332289111, "runs": 3, - "total_seconds": 10.275695958 + "total_seconds": 9.996867333 }, { "name": "ZkVerifyShareDecryptionProofs", - "avg_seconds": 0.102147833, + "avg_seconds": 0.092222375, "runs": 3, - "total_seconds": 0.306443501 + "total_seconds": 0.276667125 }, { "name": "ZkVerifyShareProofs", - "avg_seconds": 0.272140033, + "avg_seconds": 0.242743866, "runs": 5, - "total_seconds": 1.360700167 + "total_seconds": 1.213719334 } ], - "operation_timings_total_seconds": 144.553499127, + "operation_timings_total_seconds": 140.025365461, "operation_timings_metric": "tracked_job_wall", "phase_timings": [ { @@ -122,57 +122,57 @@ }, { "label": "Setup completed", - "seconds": 2.701572083, + "seconds": 2.7456785, "metric": "wall_clock" }, { "label": "Committee Setup Completed", - "seconds": 20.090864792, + "seconds": 20.090236084, "metric": "wall_clock" }, { "label": "Committee Finalization Complete", - "seconds": 0.001990708, + "seconds": 0.006925375, "metric": "wall_clock" }, { "label": "Aggregator P2: PkAggregation pending -> PublicKeyAggregated (wall)", - "seconds": 0.706576, + "seconds": 0.5328, "metric": "wall_clock" }, { "label": "ThresholdShares -> PublicKeyAggregated", - "seconds": 13.62430675, + "seconds": 12.921990041, "metric": "wall_clock" }, { "label": "E3Request -> PublicKeyAggregated", - "seconds": 14.129209875, + "seconds": 13.433982917, "metric": "wall_clock" }, { "label": "Application CT Gen", - "seconds": 0.009638083, + "seconds": 0.0092785, "metric": "wall_clock" }, { "label": "Running FHE Application", - "seconds": 0.000051333, + "seconds": 0.000057416, "metric": "wall_clock" }, { "label": "Aggregator P4: Aggregation pending -> PlaintextAggregated (wall)", - "seconds": 1.588489, + "seconds": 1.554546, "metric": "wall_clock" }, { "label": "Ciphertext published -> PlaintextAggregated", - "seconds": 5.418986167, + "seconds": 5.304683917, "metric": "wall_clock" }, { "label": "Entire Test", - "seconds": 42.353041667, + "seconds": 41.587390625, "metric": "wall_clock" } ], diff --git a/circuits/benchmarks/results_insecure_no_agg_micro/report.md b/circuits/benchmarks/results_insecure_no_agg_micro/report.md index 5eba6523a9..59a92d1060 100644 --- a/circuits/benchmarks/results_insecure_no_agg_micro/report.md +++ b/circuits/benchmarks/results_insecure_no_agg_micro/report.md @@ -1,9 +1,9 @@ # Enclave ZK Circuit Benchmarks -**Generated:** 2026-05-27 13:34:36 UTC +**Generated:** 2026-05-28 18:55:25 UTC -**Git Branch:** `params/dyn-conf` -**Git Commit:** `fc3edc2c86446f20d46b875ca1fca5352645119e` +**Git Branch:** `main` +**Git Commit:** `a817b886a3482d68c9ed7882d2d794d78bc3b7e2` **Committee Size:** `H=3`, `N=3`, `T=1` @@ -74,39 +74,39 @@ Single-circuit `bb prove` on the benchmark oracle witness (not the integration a | Circuit | Constraints | Prove (s) | Verify (ms) | Proof (KB) | | -------------------- | ----------- | --------- | ----------- | ---------- | -| C0 | 6847 | 0.12 | 26.76 | 15.88 | -| C1 | 57818 | 0.33 | 25.96 | 15.88 | -| C2a | 41244 | 0.30 | 26.35 | 15.88 | -| C2b | 79591 | 0.49 | 25.77 | 15.88 | -| C3a | 120114 | 0.56 | 26.36 | 15.88 | -| C3b | 120114 | 0.56 | 26.36 | 15.88 | -| C4a | 67494 | 0.46 | 26.59 | 15.88 | -| C4b | 67494 | 0.46 | 26.59 | 15.88 | -| C5 | 123624 | 0.55 | 27.16 | 15.88 | -| user_data_encryption | 53732 | 0.34 | 25.92 | 15.88 | -| C6 | 86927 | 0.51 | 25.47 | 15.88 | -| C7 | 90841 | 0.46 | 26.23 | 15.88 | +| C0 | 6847 | 0.13 | 28.79 | 15.88 | +| C1 | 57818 | 0.33 | 23.45 | 15.88 | +| C2a | 41244 | 0.34 | 26.81 | 15.88 | +| C2b | 79591 | 0.49 | 27.21 | 15.88 | +| C3a | 120114 | 0.53 | 23.67 | 15.88 | +| C3b | 120114 | 0.53 | 23.67 | 15.88 | +| C4a | 67494 | 0.46 | 27.61 | 15.88 | +| C4b | 67494 | 0.46 | 27.61 | 15.88 | +| C5 | 123624 | 0.56 | 27.28 | 15.88 | +| user_data_encryption | 53732 | 0.34 | 24.18 | 15.88 | +| C6 | 86927 | 0.51 | 24.22 | 15.88 | +| C7 | 90841 | 0.47 | 26.18 | 15.88 | ### Artifacts | Artifact | Proof size | Public input size | Verify gas | Calldata gas | Total gas | | -------- | ---------- | ----------------- | ---------- | ------------ | --------- | -| Π_DKG | 15.88 KB | 0.12 KB | N/A | 174988 | N/A | -| Π_user | 15.88 KB | 0.12 KB | 2972989 | 170284 | 3143273 | -| Π_dec | 15.88 KB | 3.25 KB | N/A | 188268 | N/A | +| Π_DKG | 15.88 KB | 0.12 KB | N/A | 174976 | N/A | +| Π_user | 15.88 KB | 0.12 KB | 2973025 | 170416 | 3143441 | +| Π_dec | 15.88 KB | 3.25 KB | N/A | 188280 | N/A | ### Role / Phase / Activity | Role | Phase | Activity | Metric | Duration | Proof size | Bandwidth | | --------------- | ----- | ----------------------------------------- | -------------- | -------- | ---------- | --------- | -| Each ciphernode | P1 | one-time DKG participation (test harness) | wall_clock | 13.62 s | 127.00 KB | 128.19 KB | -| Aggregator | P2 | C5 + Π_DKG fold (aggregator span) | wall_clock | 0.71 s | 15.88 KB | 16.00 KB | -| User | P3 | per user input | isolated_nargo | 0.65 s | 15.88 KB | 16.00 KB | +| Each ciphernode | P1 | one-time DKG participation (test harness) | wall_clock | 13.11 s | 127.00 KB | 128.19 KB | +| Aggregator | P2 | C5 + Π_DKG fold (aggregator span) | wall_clock | 0.53 s | 15.88 KB | 16.00 KB | +| User | P3 | per user input | isolated_nargo | 0.68 s | 15.88 KB | 16.00 KB | | Each ciphernode | P4 | per computation output (C6) | isolated_nargo | 0.51 s | 15.88 KB | 16.00 KB | -| Aggregator | P4 | C7 + Π_dec fold (full publish→aggregate) | wall_clock | 5.42 s | 15.88 KB | 19.12 KB | -| Aggregator | P4 | C7 + fold only (pending→plaintext span) | wall_clock | 1.59 s | 15.88 KB | 19.12 KB | +| Aggregator | P4 | C7 + Π_dec fold (full publish→aggregate) | wall_clock | 5.30 s | 15.88 KB | 19.12 KB | +| Aggregator | P4 | C7 + fold only (pending→plaintext span) | wall_clock | 1.55 s | 15.88 KB | 19.12 KB | -_P2 **tracked_job_wall** sum (ZkDkgAggregation + ZkPkAggregation, parallelizable): **0.70 s** — not +_P2 **tracked_job_wall** sum (ZkDkgAggregation + ZkPkAggregation, parallelizable): **0.53 s** — not comparable to P2 wall_clock row above._ ## Integration test (`test_trbfv_actor`) @@ -116,39 +116,39 @@ comparable to P2 wall_clock row above._ | Phase | Metric | Duration (s) | | ------------------------------------------------------------------ | ------------ | ------------ | | Starting trbfv actor test | `wall_clock` | 0.00 | -| Setup completed | `wall_clock` | 2.70 | +| Setup completed | `wall_clock` | 2.73 | | Committee Setup Completed | `wall_clock` | 20.09 | -| Committee Finalization Complete | `wall_clock` | 0.00 | -| Aggregator P2: PkAggregation pending -> PublicKeyAggregated (wall) | `wall_clock` | 0.71 | -| ThresholdShares -> PublicKeyAggregated | `wall_clock` | 13.62 | -| E3Request -> PublicKeyAggregated | `wall_clock` | 14.13 | +| Committee Finalization Complete | `wall_clock` | 0.01 | +| Aggregator P2: PkAggregation pending -> PublicKeyAggregated (wall) | `wall_clock` | 0.53 | +| ThresholdShares -> PublicKeyAggregated | `wall_clock` | 13.11 | +| E3Request -> PublicKeyAggregated | `wall_clock` | 13.62 | | Application CT Gen | `wall_clock` | 0.01 | | Running FHE Application | `wall_clock` | 0.00 | -| Aggregator P4: Aggregation pending -> PlaintextAggregated (wall) | `wall_clock` | 1.59 | -| Ciphertext published -> PlaintextAggregated | `wall_clock` | 5.42 | -| Entire Test | `wall_clock` | 42.35 | +| Aggregator P4: Aggregation pending -> PlaintextAggregated (wall) | `wall_clock` | 1.55 | +| Ciphertext published -> PlaintextAggregated | `wall_clock` | 5.30 | +| Entire Test | `wall_clock` | 41.75 | ### Multithread job timings (`tracked_job_wall`) | Name | Avg (s) | Runs | Total (s) | | ----------------------------- | ------- | ---- | --------- | -| CalculateDecryptionKey | 0.00 | 3 | 0.01 | +| CalculateDecryptionKey | 0.24 | 3 | 0.71 | | CalculateDecryptionShare | 0.02 | 3 | 0.06 | | CalculateThresholdDecryption | 0.02 | 1 | 0.02 | | GenEsiSss | 0.01 | 3 | 0.02 | | GenPkShareAndSkSss | 0.01 | 3 | 0.03 | -| ZkDecryptedSharesAggregation | 1.58 | 1 | 1.58 | -| ZkDkgShareDecryption | 1.35 | 6 | 8.09 | -| ZkPkAggregation | 0.70 | 1 | 0.70 | -| ZkPkBfv | 0.22 | 3 | 0.67 | -| ZkPkGeneration | 2.46 | 3 | 7.39 | -| ZkShareComputation | 2.48 | 6 | 14.89 | -| ZkShareEncryption | 4.13 | 24 | 99.14 | -| ZkThresholdShareDecryption | 3.43 | 3 | 10.28 | -| ZkVerifyShareDecryptionProofs | 0.10 | 3 | 0.31 | -| ZkVerifyShareProofs | 0.27 | 5 | 1.36 | - -Sum of tracked job wall time: **144.55 s** — **not** end-to-end latency (jobs run in parallel up to +| ZkDecryptedSharesAggregation | 1.53 | 1 | 1.53 | +| ZkDkgShareDecryption | 1.07 | 6 | 6.44 | +| ZkPkAggregation | 0.53 | 1 | 0.53 | +| ZkPkBfv | 0.23 | 3 | 0.70 | +| ZkPkGeneration | 4.05 | 3 | 12.14 | +| ZkShareComputation | 2.40 | 6 | 14.39 | +| ZkShareEncryption | 3.73 | 24 | 89.49 | +| ZkThresholdShareDecryption | 3.38 | 3 | 10.13 | +| ZkVerifyShareDecryptionProofs | 0.10 | 3 | 0.29 | +| ZkVerifyShareProofs | 0.25 | 5 | 1.27 | + +Sum of tracked job wall time: **137.76 s** — **not** end-to-end latency (jobs run in parallel up to `BENCHMARK_MULTITHREAD_JOBS`). _Baseline run: node DKG folds and folded Π_DKG / Π_dec export are disabled. Compare with @@ -158,10 +158,10 @@ _Baseline run: node DKG folds and folded Π_DKG / Π_dec export are disabled. Co | Operation | Avg (s) | Runs | Total (s) | | ---------------------------- | ------- | ---- | --------- | -| ZkDecryptedSharesAggregation | 1.58 | 1 | 1.58 | -| ZkPkAggregation | 0.70 | 1 | 0.70 | +| ZkDecryptedSharesAggregation | 1.53 | 1 | 1.53 | +| ZkPkAggregation | 0.53 | 1 | 0.53 | -Sum of aggregation job tracked time: **2.29 s** (parallel CPU work; not P1/P2 wall clock). +Sum of aggregation job tracked time: **2.06 s** (parallel CPU work; not P1/P2 wall clock). ## Raw circuit benchmark JSON (Nargo) diff --git a/crates/Dockerfile b/crates/Dockerfile index dbd86839e3..90a434e5c1 100644 --- a/crates/Dockerfile +++ b/crates/Dockerfile @@ -17,7 +17,7 @@ RUN corepack enable RUN cd packages/enclave-contracts && pnpm install && pnpm compile:contracts # Build stage -FROM rust:1.86 AS ciphernode-builder +FROM rust:1.91 AS ciphernode-builder # Force incremental ENV CARGO_INCREMENTAL=1 @@ -25,7 +25,7 @@ ENV RUSTC_FORCE_INCREMENTAL=1 ENV CARGO_BUILD_JOBS=8 # Install deps -RUN apt-get update && apt-get install -y --no-install-recommends jq +RUN apt-get update && apt-get install -y --no-install-recommends jq protobuf-compiler RUN wget https://github.com/argotorg/solidity/releases/download/v0.8.27/solc-static-linux \ && chmod +x solc-static-linux \ && mv solc-static-linux /usr/local/bin/solc \ diff --git a/crates/aggregator/src/publickey_aggregator.rs b/crates/aggregator/src/publickey_aggregator.rs index 1ddf1a4535..61a83b3fc8 100644 --- a/crates/aggregator/src/publickey_aggregator.rs +++ b/crates/aggregator/src/publickey_aggregator.rs @@ -7,7 +7,7 @@ use crate::committee::committee_addresses_in_party_order; use actix::prelude::*; use alloy::primitives::Address; -use anyhow::{anyhow, bail, ensure, Context as _, Result}; +use anyhow::{anyhow, ensure, Context as _, Result}; use e3_data::Persistable; use e3_events::{ prelude::*, BusHandle, CircuitName, ComputeRequest, ComputeRequestError, ComputeResponse, diff --git a/crates/aggregator/src/threshold_plaintext_aggregator.rs b/crates/aggregator/src/threshold_plaintext_aggregator.rs index cdbbdead4d..08b8e6e254 100644 --- a/crates/aggregator/src/threshold_plaintext_aggregator.rs +++ b/crates/aggregator/src/threshold_plaintext_aggregator.rs @@ -588,7 +588,8 @@ impl ThresholdPlaintextAggregator { mismatched.insert(*party_id); continue; }; - let Ok(poly) = e3_trbfv::helpers::try_poly_from_bytes(share_bytes, &threshold_params) + let Ok(poly) = + e3_trbfv::helpers::try_poly_pb_from_bytes(share_bytes, &threshold_params) else { warn!( "Could not deserialize share for party {} — marking as mismatched", diff --git a/crates/bfv-client/src/client.rs b/crates/bfv-client/src/client.rs index 15927c93ed..ee8819b3d5 100644 --- a/crates/bfv-client/src/client.rs +++ b/crates/bfv-client/src/client.rs @@ -12,7 +12,7 @@ use e3_zk_helpers::circuits::Computation; use fhe::bfv::{Ciphertext, Encoding, Plaintext, PublicKey, SecretKey}; use fhe::Error as FheError; use fhe_traits::{DeserializeParametrized, FheEncoder, FheEncrypter, Serialize}; -use rand::thread_rng; +use rand::rng; /// Encrypt some data using BFV homomorphic encryption /// @@ -51,7 +51,7 @@ where .map_err(|e: FheError| anyhow!("Error encoding plaintext: {e}"))?; let ct = pk - .try_encrypt(&pt, &mut thread_rng()) + .try_encrypt(&pt, &mut rng()) .map_err(|e| anyhow!("Error encrypting data: {e}"))?; let encrypted_data = ct.to_bytes(); @@ -135,7 +135,7 @@ pub fn generate_public_key( let params = build_bfv_params_arc(degree, plaintext_modulus, &moduli, None); // Generate keys. - let mut rng = thread_rng(); + let mut rng = rng(); let sk = SecretKey::random(¶ms, &mut rng); let pk = PublicKey::new(&sk, &mut rng); @@ -184,6 +184,7 @@ pub fn compute_ct_commitment( mod tests { use e3_fhe_params::DEFAULT_BFV_PRESET; use e3_fhe_params::{build_bfv_params_from_set_arc, BfvParamSet}; + use fhe_traits::FheDecoder; use super::*; @@ -197,7 +198,7 @@ mod tests { let degree = param_set.degree; let plaintext_modulus = param_set.plaintext_modulus; let moduli = param_set.moduli; - let mut rng = thread_rng(); + let mut rng = rng(); let sk = SecretKey::random(¶ms, &mut rng); let pk = PublicKey::new(&sk, &mut rng); @@ -208,7 +209,8 @@ mod tests { let ct = Ciphertext::from_bytes(&encrypted_data, ¶ms).unwrap(); let pt = sk.try_decrypt(&ct).unwrap(); - assert_eq!(pt.value[0], num[0]); + let decoded = Vec::::try_decode(&pt, Encoding::poly()).unwrap(); + assert_eq!(decoded[0], num[0]); } #[test] @@ -221,7 +223,7 @@ mod tests { let degree = param_set.degree; let plaintext_modulus = param_set.plaintext_modulus; let moduli = param_set.moduli; - let mut rng = thread_rng(); + let mut rng = rng(); let sk = SecretKey::random(¶ms, &mut rng); let pk = PublicKey::new(&sk, &mut rng); @@ -238,8 +240,9 @@ mod tests { let ct = Ciphertext::from_bytes(&encrypted_data, ¶ms).unwrap(); let pt = sk.try_decrypt(&ct).unwrap(); - assert_eq!(pt.value[0], num[0]); - assert_eq!(pt.value[1], num[1]); + let decoded = Vec::::try_decode(&pt, Encoding::poly()).unwrap(); + assert_eq!(decoded[0], num[0]); + assert_eq!(decoded[1], num[1]); } #[test] @@ -252,7 +255,7 @@ mod tests { let degree = param_set.degree; let plaintext_modulus = param_set.plaintext_modulus; let moduli = param_set.moduli; - let mut rng = thread_rng(); + let mut rng = rand::rng(); let sk = SecretKey::random(¶ms, &mut rng); let pk = PublicKey::new(&sk, &mut rng); @@ -269,7 +272,8 @@ mod tests { let ct = Ciphertext::from_bytes(&encrypted_data.encrypted_data, ¶ms).unwrap(); let pt = sk.try_decrypt(&ct).unwrap(); - assert_eq!(pt.value[0], num[0]); + let decoded = Vec::::try_decode(&pt, Encoding::poly()).unwrap(); + assert_eq!(decoded[0], num[0]); } #[test] @@ -282,7 +286,7 @@ mod tests { let degree = param_set.degree; let plaintext_modulus = param_set.plaintext_modulus; let moduli = param_set.moduli; - let mut rng = thread_rng(); + let mut rng = rand::rng(); let sk = SecretKey::random(¶ms, &mut rng); let pk = PublicKey::new(&sk, &mut rng); @@ -299,7 +303,8 @@ mod tests { let ct = Ciphertext::from_bytes(&encrypted_data.encrypted_data, ¶ms).unwrap(); let pt = sk.try_decrypt(&ct).unwrap(); - assert_eq!(pt.value[0], num[0]); - assert_eq!(pt.value[1], num[1]); + let decoded = Vec::::try_decode(&pt, Encoding::poly()).unwrap(); + assert_eq!(decoded[0], num[0]); + assert_eq!(decoded[1], num[1]); } } diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index c40224e62d..009c796a7e 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -42,6 +42,7 @@ opentelemetry-otlp = { workspace = true } opentelemetry-stdout = { workspace = true } opentelemetry_sdk = { workspace = true } petname = { workspace = true } +rand08 = { package = "rand", version = "=0.8.5", features = ["std", "std_rng"] } phf = { workspace = true } rand = { workspace = true } serde = { workspace = true } diff --git a/crates/cli/src/helpers/compile_id.rs b/crates/cli/src/helpers/compile_id.rs index 4be69990c0..c02aaf529e 100644 --- a/crates/cli/src/helpers/compile_id.rs +++ b/crates/cli/src/helpers/compile_id.rs @@ -5,8 +5,8 @@ // or FITNESS FOR A PARTICULAR PURPOSE. use petname::{Generator, Petnames}; -use rand::rngs::StdRng; -use rand::SeedableRng; +use rand08::rngs::StdRng; +use rand08::SeedableRng; static COMPILE_ID: u64 = compile_time::unix!(); diff --git a/crates/crypto/src/cipher.rs b/crates/crypto/src/cipher.rs index fd4ac9fa4d..34d60e614a 100644 --- a/crates/crypto/src/cipher.rs +++ b/crates/crypto/src/cipher.rs @@ -12,7 +12,7 @@ use aes_gcm::{ }; use anyhow::{anyhow, Result}; use argon2::{Algorithm, Argon2, Params, Version}; -use rand::{rngs::OsRng, RngCore}; +use rand::RngCore; use tracing::trace; use zeroize::{Zeroize, Zeroizing}; @@ -61,7 +61,7 @@ fn encrypt_data(derived_key: &Zeroizing>, data: &mut Vec) -> Result< // Generate a random nonce for AES-GCM let mut nonce_bytes = [0u8; AES_NONCE_LEN]; - OsRng.fill_bytes(&mut nonce_bytes); + rand::rng().fill_bytes(&mut nonce_bytes); let nonce = Nonce::from_slice(&nonce_bytes); // Create AES-GCM cipher diff --git a/crates/entrypoint/src/start/start.rs b/crates/entrypoint/src/start/start.rs index cadfbddefb..95c06bca7d 100644 --- a/crates/entrypoint/src/start/start.rs +++ b/crates/entrypoint/src/start/start.rs @@ -4,19 +4,21 @@ // without even the implied warranty of MERCHANTABILITY // or FITNESS FOR A PARTICULAR PURPOSE. -use anyhow::Result; +use anyhow::{Context, Result}; use e3_ciphernode_builder::{CiphernodeBuilder, CiphernodeHandle}; use e3_config::AppConfig; use e3_crypto::Cipher; use e3_zk_prover::ZkBackend; use rand::SeedableRng; -use rand_chacha::rand_core::OsRng; +use rand_chacha::ChaCha20Rng; use std::sync::{Arc, Mutex}; use tracing::{info, instrument}; #[instrument(name = "app", skip_all)] pub async fn execute(config: &AppConfig) -> Result { - let rng = Arc::new(Mutex::new(rand_chacha::ChaCha20Rng::from_rng(OsRng)?)); + let rng = Arc::new(Mutex::new( + ChaCha20Rng::try_from_os_rng().context("failed to seed ChaCha20 RNG from OS")?, + )); let cipher = Arc::new(Cipher::from_file(&config.key_file()).await?); let backend = ZkBackend::new(config.bb_binary(), config.circuits_dir(), config.work_dir()); diff --git a/crates/keyshare/Cargo.toml b/crates/keyshare/Cargo.toml index becd731686..91e4bad6c7 100644 --- a/crates/keyshare/Cargo.toml +++ b/crates/keyshare/Cargo.toml @@ -26,6 +26,7 @@ fhe = { workspace = true } fhe-traits = { workspace = true } rand = { workspace = true } rand_chacha = { workspace = true } +rand_core = { workspace = true } serde = { workspace = true } tracing = { workspace = true } ndarray = { workspace = true } diff --git a/crates/keyshare/src/threshold_keyshare.rs b/crates/keyshare/src/threshold_keyshare.rs index 76b542cfd0..94e0520a41 100644 --- a/crates/keyshare/src/threshold_keyshare.rs +++ b/crates/keyshare/src/threshold_keyshare.rs @@ -43,6 +43,7 @@ use fhe::bfv::{PublicKey, SecretKey}; use fhe_traits::{DeserializeParametrized, Serialize}; use ndarray::Array2; use rand::rngs::OsRng; +use rand_core::UnwrapErr; use std::{ collections::{BTreeSet, HashMap, HashSet}, mem, @@ -902,7 +903,8 @@ impl ThresholdKeyshare { let _ = self.ensure_encryption_key_collector(address.clone()); let params = BfvParamSet::from(self.share_enc_preset.clone()).build_arc(); - let mut rng = OsRng; + // OS RNG for BFV keygen (not thread-local `rand::rng()` / ThreadRng). + let mut rng = UnwrapErr(OsRng); let sk_bfv = SecretKey::random(¶ms, &mut rng); let pk_bfv = PublicKey::new(&sk_bfv, &mut rng); @@ -1291,7 +1293,7 @@ impl ThresholdKeyshare { // BFV-encrypt shares to all recipients except own slot (own share is bound via C2, // consumed locally by C4). Returns per-row randomness for C3 proofs. - let mut rng = OsRng; + let mut rng = UnwrapErr(OsRng); let (encrypted_sk_sss, sk_witnesses) = BfvEncryptedShares::encrypt_all_extended_for_share_indices( &decrypted_sk_sss, diff --git a/crates/multithread/src/multithread.rs b/crates/multithread/src/multithread.rs index 43d24bbbef..283f9c5e08 100644 --- a/crates/multithread/src/multithread.rs +++ b/crates/multithread/src/multithread.rs @@ -48,8 +48,9 @@ use e3_trbfv::calculate_threshold_decryption::calculate_threshold_decryption; use e3_trbfv::gen_esi_sss::gen_esi_sss; use e3_trbfv::gen_pk_share_and_sk_sss::gen_pk_share_and_sk_sss; use e3_trbfv::helpers::deserialize_secret_key; -use e3_trbfv::helpers::try_poly_from_bytes; use e3_trbfv::helpers::try_poly_from_sensitive_bytes; +use e3_trbfv::helpers::try_poly_ntt_from_bytes; +use e3_trbfv::helpers::try_poly_pb_from_bytes; use e3_trbfv::shares::SharedSecret; use e3_trbfv::{TrBFVError, TrBFVRequest, TrBFVResponse}; use e3_utils::SharedRng; @@ -76,10 +77,10 @@ use e3_zk_prover::{ }; use fhe::bfv::{Ciphertext, Encoding, Plaintext, PublicKey, SecretKey}; use fhe::mbfv::PublicKeyShare; +use fhe_math::rq::PowerBasis; use fhe_traits::{DeserializeParametrized, FheEncoder}; use ndarray::Array2; use num_bigint::BigInt; -use rand::rngs::OsRng; use rand::Rng; use tracing::{error, info}; @@ -447,7 +448,7 @@ fn handle_threshold_share_decryption_proof( let e = CrtPolynomial::from_fhe_polynomial(&e_poly); // Deserialize d_share → Poly → CrtPolynomial - let d_share_poly = try_poly_from_bytes(&req.d_share_bytes[i], &threshold_params) + let d_share_poly = try_poly_pb_from_bytes(&req.d_share_bytes[i], &threshold_params) .map_err(|e| make_zk_error(&request, format!("d_share[{}] deserialize: {}", i, e)))?; let d_share = CrtPolynomial::from_fhe_polynomial(&d_share_poly); @@ -515,7 +516,7 @@ fn handle_compute_request( request: ComputeRequest, report: Option>, ) -> (Result, Duration) { - let id: u8 = rand::thread_rng().gen(); + let id: u8 = rand::rng().random(); match request.request.clone() { ComputeRequestKind::TrBFV(trbfv_req) => { @@ -840,7 +841,7 @@ fn handle_share_computation_proof( .map_err(|e| make_zk_error(&request, format!("secret_sss_raw decrypt: {}", e)))?; // 3. Deserialize secret polynomial - let secret_poly = try_poly_from_bytes(&secret_bytes, &threshold_params) + let secret_poly = try_poly_pb_from_bytes(&secret_bytes, &threshold_params) .map_err(|e| make_zk_error(&request, format!("secret_raw: {}", e)))?; let mut secret = CrtPolynomial::from_fhe_polynomial(&secret_poly); if req.dkg_input_type == DkgInputType::SecretKey { @@ -931,16 +932,16 @@ fn handle_pk_generation_proof( .map_err(|e| make_zk_error(&request, format!("e_sm decrypt: {}", e)))?; // 3. Deserialize raw polynomial bytes → Poly - let pk0_share_poly = try_poly_from_bytes(&req.pk0_share, ¶ms) + let pk0_share_poly = try_poly_ntt_from_bytes(&req.pk0_share, ¶ms) .map_err(|e| make_zk_error(&request, format!("pk0_share: {}", e)))?; - let sk_poly = try_poly_from_bytes(&sk_bytes, ¶ms) + let sk_poly = try_poly_pb_from_bytes(&sk_bytes, ¶ms) .map_err(|e| make_zk_error(&request, format!("sk: {}", e)))?; - let eek_poly = try_poly_from_bytes(&eek_bytes, ¶ms) + let eek_poly = try_poly_ntt_from_bytes(&eek_bytes, ¶ms) .map_err(|e| make_zk_error(&request, format!("eek: {}", e)))?; - let e_sm_poly = try_poly_from_bytes(&e_sm_bytes, ¶ms) + let e_sm_poly = try_poly_pb_from_bytes(&e_sm_bytes, ¶ms) .map_err(|e| make_zk_error(&request, format!("e_sm: {}", e)))?; // 3. Convert Poly → CrtPolynomial @@ -1075,15 +1076,15 @@ fn handle_share_encryption_proof( .map_err(|e| make_zk_error(&request, format!("ciphertext: {:?}", e)))?; let public_key = PublicKey::from_bytes(&req.recipient_pk_raw, &dkg_params) .map_err(|e| make_zk_error(&request, format!("recipient_pk: {:?}", e)))?; - let u_rns = try_poly_from_bytes(&u_rns_bytes, &dkg_params) + let u_rns = try_poly_ntt_from_bytes(&u_rns_bytes, &dkg_params) .map_err(|e| make_zk_error(&request, format!("u_rns: {}", e)))?; - let e0_rns = try_poly_from_bytes(&e0_rns_bytes, &dkg_params) + let e0_rns = try_poly_ntt_from_bytes(&e0_rns_bytes, &dkg_params) .map_err(|e| make_zk_error(&request, format!("e0_rns: {}", e)))?; - let e1_rns = try_poly_from_bytes(&e1_rns_bytes, &dkg_params) + let e1_rns = try_poly_ntt_from_bytes(&e1_rns_bytes, &dkg_params) .map_err(|e| make_zk_error(&request, format!("e1_rns: {}", e)))?; // 4. Dummy SecretKey (not used by Inputs::compute) - let dummy_sk = SecretKey::random(&dkg_params, &mut OsRng); + let dummy_sk = SecretKey::random(&dkg_params, &mut rand::rng()); // 5. Build circuit data let circuit_data = ShareEncryptionCircuitData { @@ -1485,10 +1486,10 @@ fn handle_decrypted_shares_aggregation_proof( // 4. For each ciphertext index, build circuit data and generate proof for i in 0..num_indices { // a. Extract per-party shares for index i, deserialize to Poly - let d_share_polys: Vec = req + let d_share_polys: Vec> = req .d_share_polys .iter() - .map(|(_, shares)| try_poly_from_bytes(&shares[i], &threshold_params)) + .map(|(_, shares)| try_poly_pb_from_bytes(&shares[i], &threshold_params)) .collect::>() .map_err(|e| { make_zk_error(&request, format!("d_share_polys[{}] deserialize: {}", i, e)) diff --git a/crates/net/tests/Dockerfile b/crates/net/tests/Dockerfile index 7c60d6d798..2620701fb7 100644 --- a/crates/net/tests/Dockerfile +++ b/crates/net/tests/Dockerfile @@ -1,11 +1,11 @@ # syntax=docker/dockerfile:1-labs -FROM rust:1.86 AS builder +FROM rust:1.91 AS builder WORKDIR /app RUN apt-get update && apt-get install -y --no-install-recommends \ jq \ - software-properties-common \ + protobuf-compiler \ && rm -rf /var/lib/apt/lists/* RUN curl -L https://github.com/ethereum/solidity/releases/download/v0.8.27/solc-static-linux -o /usr/local/bin/solc \ diff --git a/crates/polynomial/Cargo.toml b/crates/polynomial/Cargo.toml index 68f2808416..c952f73a11 100644 --- a/crates/polynomial/Cargo.toml +++ b/crates/polynomial/Cargo.toml @@ -13,7 +13,6 @@ serde = { workspace = true, optional = true, features = ["rc"] } bincode = { workspace = true, optional = true } thiserror = { workspace = true } fhe-math = { workspace = true } -ndarray = { workspace = true } [dev-dependencies] criterion = "0.5" diff --git a/crates/polynomial/src/crt_polynomial.rs b/crates/polynomial/src/crt_polynomial.rs index 237e081b3d..c0382f9bfb 100644 --- a/crates/polynomial/src/crt_polynomial.rs +++ b/crates/polynomial/src/crt_polynomial.rs @@ -8,11 +8,11 @@ use std::sync::Arc; +use crate::fhe_poly::ToPowerBasisPoly; use crate::polynomial::Polynomial; use crate::utils::reduce; use fhe_math::rq::traits::TryConvertFrom; -use fhe_math::rq::{Context, Poly, Representation}; -use ndarray::Array2; +use fhe_math::rq::{Context, Poly, PowerBasis}; use num_bigint::BigInt; use num_traits::{ToPrimitive, Zero}; #[cfg(feature = "serde")] @@ -84,12 +84,8 @@ impl CrtPolynomial { /// # Arguments /// /// * `p` - An fhe-math polynomial (any representation). - pub fn from_fhe_polynomial(p: &Poly) -> Self { - let mut p = p.clone(); - - if *p.representation() != Representation::PowerBasis { - p.change_representation(Representation::PowerBasis); - } + pub fn from_fhe_polynomial(p: &impl ToPowerBasisPoly) -> Self { + let p = p.to_power_basis_poly(); let limbs = p .coefficients() @@ -100,7 +96,7 @@ impl CrtPolynomial { Self { limbs } } - /// Builds an fhe-math `Poly` in PowerBasis representation (inverse of [`Self::from_fhe_polynomial`]). + /// Builds an fhe-math `Poly` (inverse of [`Self::from_fhe_polynomial`]). /// /// Coefficients are reduced to `[0, q_i)` per limb using `moduli[i]` before packing the RNS buffer. /// `ctx` must match the TRBFV/BFV context: `ctx.q.len()` equals limb count, and each limb has @@ -108,13 +104,13 @@ impl CrtPolynomial { /// /// # Errors /// - /// Returns [`fhe_math::Error`] if limb counts or coefficient lengths disagree with `ctx`, ndarray - /// layout fails, a coefficient does not fit `u64`, or `Poly::try_convert_from` fails. + /// Returns [`fhe_math::Error`] if limb counts or coefficient lengths disagree with `ctx`, + /// a coefficient does not fit `u64`, or `Poly::try_convert_from` fails. pub fn to_fhe_polynomial( &self, ctx: &Arc, moduli: &[u64], - ) -> Result { + ) -> Result, fhe_math::Error> { let degree = ctx.degree; let l = ctx.q.len(); if self.limbs.len() != l { @@ -145,10 +141,7 @@ impl CrtPolynomial { data.push(u); } } - let arr = Array2::from_shape_vec((l, degree), data).map_err(|e| { - fhe_math::Error::Default(format!("CrtPolynomial::to_fhe_polynomial: ndarray {e}")) - })?; - Poly::try_convert_from(arr, ctx, false, Representation::PowerBasis) + Poly::::try_convert_from(data, ctx, false) } /// Reverses the coefficient order of every limb in-place. diff --git a/crates/polynomial/src/fhe_poly.rs b/crates/polynomial/src/fhe_poly.rs new file mode 100644 index 0000000000..dcb3811bb5 --- /dev/null +++ b/crates/polynomial/src/fhe_poly.rs @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: LGPL-3.0-only +// +// This file is provided WITHOUT ANY WARRANTY; +// without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. + +//! Helpers for converting fhe-math `Poly` values. + +use fhe_math::rq::{Ntt, NttShoup, Poly, PowerBasis}; + +/// Borrowed conversion of any RNS polynomial to power-basis form. +pub trait ToPowerBasisPoly { + /// Returns a power-basis copy suitable for coefficient extraction. + fn to_power_basis_poly(&self) -> Poly; +} + +impl ToPowerBasisPoly for Poly { + fn to_power_basis_poly(&self) -> Poly { + self.clone() + } +} + +impl ToPowerBasisPoly for Poly { + fn to_power_basis_poly(&self) -> Poly { + self.to_power_basis() + } +} + +impl ToPowerBasisPoly for Poly { + fn to_power_basis_poly(&self) -> Poly { + self.to_power_basis() + } +} + +impl ToPowerBasisPoly for &T { + fn to_power_basis_poly(&self) -> Poly { + (*self).to_power_basis_poly() + } +} diff --git a/crates/polynomial/src/lib.rs b/crates/polynomial/src/lib.rs index 6faee034ca..2fdf89df6e 100644 --- a/crates/polynomial/src/lib.rs +++ b/crates/polynomial/src/lib.rs @@ -26,9 +26,11 @@ //! - Zero-knowledge proofs: Polynomial commitment schemes. pub mod crt_polynomial; +mod fhe_poly; pub mod polynomial; pub mod utils; pub use crt_polynomial::{CrtPolynomial, CrtPolynomialError}; +pub use fhe_poly::ToPowerBasisPoly; pub use polynomial::{Polynomial, PolynomialError}; pub use utils::*; diff --git a/crates/polynomial/src/polynomial.rs b/crates/polynomial/src/polynomial.rs index 883acecf99..369e605800 100644 --- a/crates/polynomial/src/polynomial.rs +++ b/crates/polynomial/src/polynomial.rs @@ -6,8 +6,8 @@ //! Polynomial arithmetic implementation. +use crate::fhe_poly::ToPowerBasisPoly; use crate::utils::{center, reduce}; -use fhe_math::rq::{Poly, Representation}; use num_bigint::{BigInt, BigUint, ToBigInt}; use num_traits::{One, Zero}; use std::fmt; @@ -132,12 +132,8 @@ impl Polynomial { } /// Creates a new polynomial from a fhe-math `Poly` (CRT-reconstructed mod Q). - pub fn from_fhe_polynomial(p: &Poly) -> Self { - let mut p = p.clone(); - - if *p.representation() == Representation::Ntt { - p.change_representation(Representation::PowerBasis); - } + pub fn from_fhe_polynomial(p: &impl ToPowerBasisPoly) -> Self { + let p = p.to_power_basis_poly(); let coefficients: Vec = Vec::::from(&p); let bigints: Vec = coefficients diff --git a/crates/support/Cargo.toml b/crates/support/Cargo.toml index 49ba45a1f5..247b353c5c 100644 --- a/crates/support/Cargo.toml +++ b/crates/support/Cargo.toml @@ -1,6 +1,6 @@ [workspace] resolver = "3" -msrv = "1.86.0" +msrv = "1.91.1" members = ["app", "host", "methods", "types"] exclude = ["methods/guest"] @@ -52,4 +52,3 @@ dotenvy = { version = "=0.15.7" } [profile.release] debug = 1 lto = true - diff --git a/crates/support/Dockerfile b/crates/support/Dockerfile index c624ff607f..d32c990567 100644 --- a/crates/support/Dockerfile +++ b/crates/support/Dockerfile @@ -1,4 +1,4 @@ -ARG RUST_VERSION=1.86.0 +ARG RUST_VERSION=1.91.1 ARG RISC0_VERSION=3.0.3 ARG RISC0_TOOLCHAIN=1.88.0 ARG SKIP_SOLIDITY=0 @@ -14,7 +14,8 @@ RUN apt-get update && \ libssl-dev \ curl \ sudo \ - ca-certificates && \ + ca-certificates \ + protobuf-compiler && \ rm -rf /var/lib/apt/lists/* # Create user diff --git a/crates/test-helpers/src/application.rs b/crates/test-helpers/src/application.rs index a1681a5f13..f7683cda47 100644 --- a/crates/test-helpers/src/application.rs +++ b/crates/test-helpers/src/application.rs @@ -6,23 +6,23 @@ //! Test Application //! The following simulates a user application for testing -use rand::{distributions::Uniform, prelude::Distribution, thread_rng}; +use rand::distr::{Distribution, Uniform}; use fhe_traits::{FheEncoder, FheEncrypter}; use std::sync::Arc; -use fhe::bfv::{self, Ciphertext, Encoding, Plaintext, PublicKey}; +use fhe::bfv::{Ciphertext, Encoding, Plaintext, PublicKey}; /// Each Voter encrypts `num_votes_per_voter` random bits and returns the ciphertexts along with /// the underlying plaintexts for verification. pub fn generate_ciphertexts( pk: &PublicKey, - params: Arc, num_voters: usize, num_votes_per_voter: usize, ) -> (Vec>, Vec>) { - let dist = Uniform::new_inclusive(0, 1); - let mut rng = thread_rng(); + let params = &pk.par; + let dist = Uniform::new_inclusive(0, 1).expect("valid uniform range"); + let mut rng = rand::rng(); println!("generating ciphertexts..."); let numbers: Vec> = (0..num_voters) .map(|_| { @@ -37,12 +37,12 @@ pub fn generate_ciphertexts( .iter() .enumerate() .map(|(ni, vals)| { - let mut rng = thread_rng(); + let mut rng = rand::rng(); vals.iter() .enumerate() .map(|(i, &val)| { println!("Encrypting {}/{}/{}", i, ni, nl); - let pt = Plaintext::try_encode(&[val], Encoding::poly(), ¶ms).unwrap(); + let pt = Plaintext::try_encode(&[val], Encoding::poly(), params).unwrap(); pk.try_encrypt(&pt, &mut rng).unwrap() }) .collect() @@ -55,7 +55,7 @@ pub fn generate_ciphertexts( /// Tally the submitted ciphertexts column-wise to produce aggregated sums. pub fn run_application( ciphertexts: &[Vec], - params: Arc, + pk: &PublicKey, num_votes_per_voter: usize, ) -> Vec> { println!("Running application"); @@ -64,7 +64,7 @@ pub fn run_application( } let mut sums: Vec = (0..num_votes_per_voter) - .map(|_| Ciphertext::zero(¶ms)) + .map(|_| Ciphertext::zero(&pk.par)) .collect(); for ct_group in ciphertexts { diff --git a/crates/test-helpers/src/lib.rs b/crates/test-helpers/src/lib.rs index aa552deeb0..2cef72aed0 100644 --- a/crates/test-helpers/src/lib.rs +++ b/crates/test-helpers/src/lib.rs @@ -32,7 +32,7 @@ use libp2p_mock::Libp2pMock; pub use plaintext_writer::*; pub use public_key_writer::*; use rand::Rng; -use rand_chacha::rand_core::SeedableRng; +use rand::SeedableRng; use rand_chacha::ChaCha20Rng; use std::sync::Arc; pub use utils::*; @@ -208,7 +208,7 @@ pub async fn simulate_libp2p_net(nodes: &[CiphernodeHandle]) { /// NOTE: THESE ARE NOT ACTUAL ADDRESSES JUST RANDOM DATA pub fn create_random_eth_addrs(how_many: u32) -> Vec { (0..how_many) - .map(|_| Address::from_slice(&rand::thread_rng().gen::<[u8; 20]>()).to_string()) + .map(|_| Address::from_slice(&rand::rng().random::<[u8; 20]>()).to_string()) .collect() } diff --git a/crates/test-helpers/src/usecase_helpers.rs b/crates/test-helpers/src/usecase_helpers.rs index f844838eb8..c3b2df1cf4 100644 --- a/crates/test-helpers/src/usecase_helpers.rs +++ b/crates/test-helpers/src/usecase_helpers.rs @@ -26,7 +26,7 @@ use fhe::{ mbfv::{AggregateIter, CommonRandomPoly, PublicKeyShare}, }; use fhe_traits::Serialize; -use rand::rngs::OsRng; +use rand::Rng; // The following functions are designed to aid testing our usecases @@ -35,6 +35,9 @@ pub struct GeneratedShares { pub shares: HashMap, /// BFV secret keys for each party (for decryption in tests) pub bfv_secret_keys: Vec, + /// The Arc used to create the secret keys and encrypt shares. + /// Must be reused when decrypting (try_decrypt uses Arc::ptr_eq). + pub bfv_params: Arc, } pub fn generate_shares_hash_map( @@ -47,7 +50,7 @@ pub fn generate_shares_hash_map( // First, generate BFV encryption keys for all parties let bfv_params = BfvParamSet::from(BfvPreset::InsecureDkg512).build_arc(); - let mut bfv_rng = OsRng; + let mut bfv_rng = rand::rng(); let mut bfv_secret_keys = Vec::with_capacity(threshold_n); let mut bfv_public_keys = Vec::with_capacity(threshold_n); @@ -126,6 +129,7 @@ pub fn generate_shares_hash_map( Ok(GeneratedShares { shares: shares_hash_map, bfv_secret_keys, + bfv_params, }) } @@ -152,9 +156,9 @@ pub fn get_decryption_keys( bfv_secret_keys: &[SecretKey], cipher: &Cipher, trbfv_config: &TrBFVConfig, + bfv_params: &Arc, ) -> Result, SensitiveBytes)>> { let threshold_n = trbfv_config.num_parties() as usize; - let bfv_params = BfvParamSet::from(BfvPreset::InsecureDkg512).build_arc(); let degree = bfv_params.degree(); // Individualize based on node - each party decrypts their share from each sender diff --git a/crates/tests/tests/integration.rs b/crates/tests/tests/integration.rs index 27e3d5c3c9..4d79572daf 100644 --- a/crates/tests/tests/integration.rs +++ b/crates/tests/tests/integration.rs @@ -1651,7 +1651,6 @@ async fn test_trbfv_actor() -> Result<()> { let num_voters = 30; let (inputs, numbers) = e3_test_helpers::application::generate_ciphertexts( &pubkey, - params_raw.clone(), num_voters, num_votes_per_voter, ); @@ -1659,11 +1658,8 @@ async fn test_trbfv_actor() -> Result<()> { let running_app_timer = Instant::now(); println!("Running application to generate outputs..."); - let outputs = e3_test_helpers::application::run_application( - &inputs, - params_raw.clone(), - num_votes_per_voter, - ); + let outputs = + e3_test_helpers::application::run_application(&inputs, &pubkey, num_votes_per_voter); report.push(("Running FHE Application", running_app_timer.elapsed())); let publishing_ct_timer = Instant::now(); diff --git a/crates/trbfv/src/calculate_decryption_key.rs b/crates/trbfv/src/calculate_decryption_key.rs index adc0d7e324..2e2104d3ab 100644 --- a/crates/trbfv/src/calculate_decryption_key.rs +++ b/crates/trbfv/src/calculate_decryption_key.rs @@ -13,7 +13,7 @@ use anyhow::Result; use anyhow::*; use e3_crypto::{Cipher, SensitiveBytes}; use fhe::trbfv::ShareManager; -use fhe_math::rq::Poly; +use fhe_math::rq::{Poly, PowerBasis}; use fhe_traits::Serialize; use ndarray::Array2; use tracing::info; @@ -69,8 +69,8 @@ pub struct CalculateDecryptionKeyResponse { } struct InnerResponse { - pub sk_poly_sum: Poly, - pub es_poly_sum: Vec, + pub sk_poly_sum: Poly, + pub es_poly_sum: Vec>, } impl TryFrom<(&Cipher, InnerResponse)> for CalculateDecryptionKeyResponse { diff --git a/crates/trbfv/src/calculate_decryption_share.rs b/crates/trbfv/src/calculate_decryption_share.rs index cc7cdcb18f..43d285aaa9 100644 --- a/crates/trbfv/src/calculate_decryption_share.rs +++ b/crates/trbfv/src/calculate_decryption_share.rs @@ -14,7 +14,7 @@ use anyhow::*; use e3_crypto::{Cipher, SensitiveBytes}; use e3_utils::utility_types::ArcBytes; use fhe::{bfv::Ciphertext, trbfv::ShareManager}; -use fhe_math::rq::Poly; +use fhe_math::rq::{Ntt, Poly, PowerBasis}; use fhe_traits::DeserializeParametrized; use fhe_traits::Serialize; use tracing::info; @@ -39,9 +39,9 @@ struct InnerRequest { /// One or more Ciphertexts to decrypt pub ciphertexts: Vec, /// A single summed polynomial for this nodes secret key. - pub sk_poly_sum: Poly, + pub sk_poly_sum: Poly, /// A vector of summed polynomials for this parties smudging noise - pub es_poly_sum: Vec, + pub es_poly_sum: Vec>, } impl TryFrom<(&Cipher, CalculateDecryptionShareRequest)> for InnerRequest { @@ -84,7 +84,7 @@ pub struct CalculateDecryptionShareResponse { } struct InnerResponse { - pub d_share_poly: Vec, + pub d_share_poly: Vec>, } impl From for CalculateDecryptionShareResponse { @@ -127,12 +127,12 @@ pub fn calculate_decryption_share( share_manager .decryption_share( Arc::new(ciphertext), - sk_poly_sum.clone(), + sk_poly_sum.clone().into_ntt(), es_poly_sum[es_idx].clone(), ) .context(format!("Could not decrypt ciphertext {}", index)) }) - .collect::>>()?; + .collect::>>>()?; info!("Returning successful result..."); Ok(InnerResponse { d_share_poly }.into()) diff --git a/crates/trbfv/src/calculate_threshold_decryption.rs b/crates/trbfv/src/calculate_threshold_decryption.rs index e4e4dbc414..8af32d91fc 100644 --- a/crates/trbfv/src/calculate_threshold_decryption.rs +++ b/crates/trbfv/src/calculate_threshold_decryption.rs @@ -7,13 +7,13 @@ use std::sync::Arc; /// This module defines event payloads that will dcrypt a ciphertext with a threshold quorum of decryption shares -use crate::{helpers::try_poly_from_bytes, PartyId, TrBFVConfig}; +use crate::{helpers::try_poly_pb_from_bytes, PartyId, TrBFVConfig}; use anyhow::*; use e3_bfv_client::{decode_plaintext_to_vec_u64, encode_vec_u64_to_bytes}; use e3_utils::utility_types::ArcBytes; use fhe::bfv::Plaintext; use fhe::{bfv::Ciphertext, trbfv::ShareManager}; -use fhe_math::rq::Poly; +use fhe_math::rq::{Poly, PowerBasis}; use fhe_traits::DeserializeParametrized; use tracing::info; @@ -23,7 +23,7 @@ type SinglePartysDecryptionShares = Vec; /// Decoded shamir shares for decrypting a single ciphertext from all parties /// shares[i] is a single parties share for a single ciphertext -type AllPartysDecodedShares = Vec; +type AllPartysDecodedShares = Vec>; #[derive(Clone, Debug, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)] pub struct CalculateThresholdDecryptionRequest { @@ -74,9 +74,9 @@ impl TryFrom for InnerRequest { let mut reconstructing_parties = Vec::with_capacity(capacity); for (party_id, vec_of_bytes) in ordered_polys { - let polys: Vec = vec_of_bytes + let polys: Vec> = vec_of_bytes .iter() - .map(|bytes| try_poly_from_bytes(&bytes, ¶ms)) + .map(|bytes| try_poly_pb_from_bytes(&bytes, ¶ms)) .collect::>>()?; d_share_polys.push(polys); diff --git a/crates/trbfv/src/gen_esi_sss.rs b/crates/trbfv/src/gen_esi_sss.rs index e9950d449b..bae8979461 100644 --- a/crates/trbfv/src/gen_esi_sss.rs +++ b/crates/trbfv/src/gen_esi_sss.rs @@ -5,7 +5,7 @@ // or FITNESS FOR A PARTICULAR PURPOSE. use crate::{ - helpers::try_poly_from_bytes, + helpers::try_poly_pb_from_bytes, shares::{Encrypted, SharedSecret}, TrBFVConfig, }; @@ -83,7 +83,7 @@ pub fn gen_esi_sss( let e_sm_raw = req.e_sm_raw; info!("gen_esi_sss:mapping..."); - let e_sm_poly = try_poly_from_bytes(&e_sm_raw, ¶ms)?; + let e_sm_poly = try_poly_pb_from_bytes(&e_sm_raw, ¶ms)?; let mut share_manager = ShareManager::new(num_ciphernodes, threshold, params.clone()); info!("gen_esi_sss:generate_secret_shares_from_poly..."); diff --git a/crates/trbfv/src/helpers.rs b/crates/trbfv/src/helpers.rs index a36ef9c1cf..badb4d3d1b 100644 --- a/crates/trbfv/src/helpers.rs +++ b/crates/trbfv/src/helpers.rs @@ -12,7 +12,8 @@ use fhe::{ bfv::{self, BfvParameters, SecretKey}, trbfv::{SmudgingBoundCalculator, SmudgingBoundCalculatorConfig}, }; -use fhe_math::rq::Poly; +use fhe_math::rq::{Ntt, Poly, PowerBasis, RepresentationTag}; +use fhe_traits::Serialize as FheSerialize; use fhe_traits::{DeserializeWithContext, Serialize}; use num_bigint::BigUint; use petname::Petnames; @@ -42,23 +43,30 @@ pub fn deserialize_secret_key(bytes: &[u8], params: &Arc) -> Resu Ok(SecretKey::new(data.coeffs.to_vec(), params)) } -pub fn try_poly_from_bytes(bytes: &[u8], params: &BfvParameters) -> Result { - Ok(Poly::from_bytes(bytes, params.ctx_at_level(0)?)?) +pub fn try_poly_pb_from_bytes(bytes: &[u8], params: &BfvParameters) -> Result> { + Ok(Poly::::from_bytes( + bytes, + params.context_at_level(0)?, + )?) +} + +pub fn try_poly_ntt_from_bytes(bytes: &[u8], params: &BfvParameters) -> Result> { + Ok(Poly::::from_bytes(bytes, params.context_at_level(0)?)?) } pub fn try_poly_from_sensitive_bytes( bytes: SensitiveBytes, params: Arc, cipher: &Cipher, -) -> Result { - try_poly_from_bytes(&bytes.access(cipher)?, ¶ms) +) -> Result> { + try_poly_pb_from_bytes(&bytes.access(cipher)?, ¶ms) } pub fn try_polys_from_sensitive_bytes_vec( bytes_vec: Vec, params: Arc, cipher: &Cipher, -) -> Result> { +) -> Result>> { bytes_vec .into_iter() .map(|s| try_poly_from_sensitive_bytes(s, params.clone(), cipher)) @@ -76,7 +84,7 @@ pub fn calculate_error_size( Ok(calculator.calculate_sm_bound()?) } -pub fn stringify_poly(name: &str, poly: &Poly) -> String { +pub fn stringify_poly(name: &str, poly: &Poly) -> String { format!("{}=Poly({})", name, hash_to_petname(hash_poly(poly))) } @@ -118,7 +126,7 @@ pub fn hash_to_colored_petname(hash: u64) -> String { format!("{} {} {}", hash_to_bg_color(hash), petname, reset_color()) } -fn hash_poly(poly: &Poly) -> u64 { +fn hash_poly(poly: &Poly) -> u64 { hash_bytes(&poly.to_bytes()) } diff --git a/crates/trbfv/src/shares/bfv_encrypted.rs b/crates/trbfv/src/shares/bfv_encrypted.rs index be1d8dffef..cc54508f50 100644 --- a/crates/trbfv/src/shares/bfv_encrypted.rs +++ b/crates/trbfv/src/shares/bfv_encrypted.rs @@ -8,7 +8,7 @@ use anyhow::{bail, Context, Result}; use derivative::Derivative; use e3_utils::utility_types::ArcBytes; use fhe::bfv::{BfvParameters, Ciphertext, Encoding, Plaintext, PublicKey, SecretKey}; -use fhe_math::rq::Poly; +use fhe_math::rq::{Ntt, Poly}; use fhe_traits::{ DeserializeParametrized, FheDecoder, FheDecrypter, FheEncoder, FheEncrypter, Serialize as FheSerialize, @@ -43,11 +43,11 @@ pub struct BfvEncryptionWitness { /// The BFV ciphertext produced. pub ciphertext: Ciphertext, /// Encryption randomness u (RNS form). - pub u_rns: Poly, + pub u_rns: Poly, /// Encryption error e0 (RNS form). - pub e0_rns: Poly, + pub e0_rns: Poly, /// Encryption error e1 (RNS form). - pub e1_rns: Poly, + pub e1_rns: Poly, } /// Debug helper for Vec @@ -349,12 +349,12 @@ impl Default for BfvEncryptedShares { mod tests { use super::*; use e3_fhe_params::{BfvParamSet, BfvPreset}; - use rand::rngs::OsRng; + use rand::Rng; #[test] fn test_encrypt_decrypt_share() { let params = BfvParamSet::from(BfvPreset::InsecureDkg512).build_arc(); - let mut rng = OsRng; + let mut rng = rand::rng(); // Generate key pair let sk = SecretKey::random(¶ms, &mut rng); @@ -385,7 +385,7 @@ mod tests { #[test] fn test_secret_key_serialization() { let params = BfvParamSet::from(BfvPreset::InsecureDkg512).build_arc(); - let mut rng = OsRng; + let mut rng = rand::rng(); // Generate a secret key let sk = SecretKey::random(¶ms, &mut rng); @@ -404,7 +404,7 @@ mod tests { #[test] fn test_encrypt_all_extended_for_share_indices_uses_real_share_rows() { let params = BfvParamSet::from(BfvPreset::InsecureDkg512).build_arc(); - let mut rng = OsRng; + let mut rng = rand::rng(); let _sk_one = SecretKey::random(¶ms, &mut rng); let pk_one = PublicKey::new(&_sk_one, &mut rng); diff --git a/crates/trbfv/tests/integration.rs b/crates/trbfv/tests/integration.rs index 19b68646af..7d320bfe44 100644 --- a/crates/trbfv/tests/integration.rs +++ b/crates/trbfv/tests/integration.rs @@ -62,22 +62,19 @@ async fn test_trbfv_isolation() -> Result<()> { &generated.bfv_secret_keys, &cipher, &trbfv_config, + &generated.bfv_params, )?; // Create the inputs let num_votes_per_voter = 3; let num_voters = 30; let (inputs, numbers) = e3_test_helpers::application::generate_ciphertexts( &pubkey, - params_raw.clone(), num_voters, num_votes_per_voter, ); - let outputs = e3_test_helpers::application::run_application( - &inputs, - params_raw.clone(), - num_votes_per_voter, - ); + let outputs = + e3_test_helpers::application::run_application(&inputs, &pubkey, num_votes_per_voter); // Encrypt the plaintext let ciphertexts = outputs diff --git a/crates/wasm/.cargo/config.toml b/crates/wasm/.cargo/config.toml new file mode 100644 index 0000000000..86adbb5711 --- /dev/null +++ b/crates/wasm/.cargo/config.toml @@ -0,0 +1,3 @@ +# getrandom 0.3 wasm_js backend (see getrandom README "Opt-in backends"). +[target.wasm32-unknown-unknown] +rustflags = ["--cfg", "getrandom_backend=\"wasm_js\""] diff --git a/crates/wasm/Cargo.toml b/crates/wasm/Cargo.toml index e5b5551dc5..8ba60b9c3e 100644 --- a/crates/wasm/Cargo.toml +++ b/crates/wasm/Cargo.toml @@ -14,5 +14,6 @@ e3-bfv-client.workspace = true e3-fhe-params.workspace = true serde.workspace = true serde-wasm-bindgen.workspace = true -getrandom = { version = "0.2", features = ["js"] } +getrandom = { version = "0.3", features = ["wasm_js"] } +getrandom2 = { package = "getrandom", version = "0.2", features = ["js"] } wasm-bindgen = "0.2.99" diff --git a/crates/wasm/package.json b/crates/wasm/package.json index 5bd86aca0f..b6777f3e64 100644 --- a/crates/wasm/package.json +++ b/crates/wasm/package.json @@ -19,6 +19,7 @@ }, "scripts": { "build": "rm -rf dist && node scripts/build.js", + "test:browser": "node scripts/browser-smoke.mjs", "prerelease": "pnpm build", "release": "pnpm publish --access=public" }, @@ -68,8 +69,9 @@ "license": "LGPL-3.0-only", "packageManager": "pnpm@10.7.1+sha512.2d92c86b7928dc8284f53494fb4201f983da65f0fb4f0d40baafa5cf628fa31dae3e5968f12466f17df7e97310e30f343a648baea1b9b350685dafafffdf5808", "devDependencies": { - "wasm-pack": "^0.13.1", "execa": "^8.0.1", - "replace-in-file": "^7.2.0" + "playwright": "1.52.0", + "replace-in-file": "^7.2.0", + "wasm-pack": "^0.13.1" } } diff --git a/crates/wasm/scripts/browser-smoke.mjs b/crates/wasm/scripts/browser-smoke.mjs new file mode 100644 index 0000000000..d18c899578 --- /dev/null +++ b/crates/wasm/scripts/browser-smoke.mjs @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: LGPL-3.0-only +// +// Browser smoke test: load built e3-wasm in headless Chrome and run one BFV encryption. + +import { createServer } from 'node:http' +import { readFile } from 'node:fs/promises' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { chromium } from 'playwright' + +const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '..') + +const mime = { + '.html': 'text/html; charset=utf-8', + '.js': 'text/javascript; charset=utf-8', + '.wasm': 'application/wasm', +} + +function startServer() { + return new Promise((resolve) => { + const server = createServer(async (req, res) => { + try { + const urlPath = req.url?.split('?')[0] ?? '/' + const rel = urlPath === '/' ? '/smoke.html' : urlPath + const filePath = path.join(root, rel) + if (!filePath.startsWith(root)) { + res.writeHead(403) + res.end() + return + } + const body = await readFile(filePath) + const ext = path.extname(filePath) + res.writeHead(200, { 'Content-Type': mime[ext] ?? 'application/octet-stream' }) + res.end(body) + } catch { + res.writeHead(404) + res.end() + } + }) + server.listen(0, '127.0.0.1', () => { + const { port } = server.address() + resolve({ server, port }) + }) + }) +} + +async function main() { + const { server, port } = await startServer() + const launchOptions = { headless: true } + if (process.env.CHROME_BIN) { + launchOptions.executablePath = process.env.CHROME_BIN + } + + try { + const browser = await chromium.launch(launchOptions) + const page = await browser.newPage() + page.on('pageerror', (err) => console.error('page error:', err)) + page.on('console', (msg) => { + if (msg.type() === 'error') console.error('console:', msg.text()) + }) + + const failed = [] + page.on('requestfailed', (req) => { + failed.push(`${req.url()} — ${req.failure()?.errorText}`) + }) + + await page.goto(`http://127.0.0.1:${port}/smoke.html`, { waitUntil: 'load' }) + await page.waitForFunction(() => window.__wasmSmoke !== undefined, null, { timeout: 120_000 }) + + const result = await page.evaluate(() => window.__wasmSmoke) + if (result !== 'ok') { + const detail = failed.length ? `\nFailed requests:\n${failed.join('\n')}` : '' + throw new Error(`WASM smoke failed: ${result}${detail}`) + } + console.log('e3-wasm browser smoke: ok (generate_public_key + bfv_encrypt_number)') + await browser.close() + } finally { + server.close() + } +} + +main().catch((err) => { + console.error(err) + process.exit(1) +}) diff --git a/crates/wasm/smoke.html b/crates/wasm/smoke.html new file mode 100644 index 0000000000..51502dd7fe --- /dev/null +++ b/crates/wasm/smoke.html @@ -0,0 +1,31 @@ + + + + + e3-wasm browser smoke + + + + + diff --git a/crates/zk-helpers/src/circuits/commitments.rs b/crates/zk-helpers/src/circuits/commitments.rs index 747371ec59..41264d1951 100644 --- a/crates/zk-helpers/src/circuits/commitments.rs +++ b/crates/zk-helpers/src/circuits/commitments.rs @@ -692,15 +692,16 @@ mod tests { use fhe::bfv::SecretKey; use fhe::mbfv::PublicKeyShare; use fhe_traits::Serialize; - use rand::rngs::OsRng; + use rand::Rng; let preset = BfvPreset::InsecureThreshold512; let (params, _) = build_pair_for_preset(preset).unwrap(); let crp = create_deterministic_crp_from_default_seed(¶ms); + let mut rng = rand::rng(); // Generate a real keyshare - let sk = SecretKey::random(¶ms, &mut OsRng); - let pk_share = PublicKeyShare::new(&sk, crp.clone(), &mut OsRng).unwrap(); + let sk = SecretKey::random(¶ms, &mut rng); + let pk_share = PublicKeyShare::new(&sk, crp.clone(), &mut rng).unwrap(); let ks_bytes = pk_share.to_bytes(); // Compute commitment via the helper diff --git a/crates/zk-helpers/src/circuits/dkg/pk/computation.rs b/crates/zk-helpers/src/circuits/dkg/pk/computation.rs index 75bdcffbd5..db2d041dd1 100644 --- a/crates/zk-helpers/src/circuits/dkg/pk/computation.rs +++ b/crates/zk-helpers/src/circuits/dkg/pk/computation.rs @@ -146,8 +146,8 @@ impl Computation for Inputs { build_pair_for_preset(preset).map_err(|e| CircuitsErrors::Sample(e.to_string()))?; let moduli = dkg_params.moduli(); - let pk0is = crate::math::fhe_poly_to_crt_centered(&data.public_key.c.c[0], moduli)?; - let pk1is = crate::math::fhe_poly_to_crt_centered(&data.public_key.c.c[1], moduli)?; + let pk0is = crate::math::fhe_poly_to_crt_centered(&data.public_key.c[0], moduli)?; + let pk1is = crate::math::fhe_poly_to_crt_centered(&data.public_key.c[1], moduli)?; Ok(Inputs { pk0is, pk1is }) } diff --git a/crates/zk-helpers/src/circuits/dkg/pk/sample.rs b/crates/zk-helpers/src/circuits/dkg/pk/sample.rs index 6addad3453..599cfdb001 100644 --- a/crates/zk-helpers/src/circuits/dkg/pk/sample.rs +++ b/crates/zk-helpers/src/circuits/dkg/pk/sample.rs @@ -11,7 +11,6 @@ use crate::CircuitsErrors; use e3_fhe_params::build_pair_for_preset; use e3_fhe_params::BfvPreset; use fhe::bfv::{PublicKey, SecretKey}; -use rand::thread_rng; impl PkCircuitData { /// Generates sample data for the pk circuit. @@ -20,7 +19,7 @@ impl PkCircuitData { CircuitsErrors::Sample(format!("Failed to build pair for preset: {:?}", e)) })?; - let mut rng = thread_rng(); + let mut rng = rand::rng(); let dkg_secret_key = SecretKey::random(&dkg_params, &mut rng); let dkg_public_key = PublicKey::new(&dkg_secret_key, &mut rng); @@ -39,6 +38,6 @@ mod tests { fn test_generate_pk_sample() { let sample = PkCircuitData::generate_sample(BfvPreset::InsecureThreshold512).unwrap(); - assert_eq!(sample.public_key.c.c.len(), 2); + assert_eq!(sample.public_key.c.len(), 2); } } diff --git a/crates/zk-helpers/src/circuits/dkg/share_computation/sample.rs b/crates/zk-helpers/src/circuits/dkg/share_computation/sample.rs index 37cede3770..abc79fd65e 100644 --- a/crates/zk-helpers/src/circuits/dkg/share_computation/sample.rs +++ b/crates/zk-helpers/src/circuits/dkg/share_computation/sample.rs @@ -10,6 +10,7 @@ use crate::circuits::dkg::share_computation::utils::compute_parity_matrix; use crate::computation::DkgInputType; use crate::dkg::share_computation::ShareComputationCircuitData; +use crate::math::array2_u64_to_bigint; use crate::CiphernodesCommittee; use crate::CircuitsErrors; use e3_fhe_params::build_pair_for_preset; @@ -18,7 +19,6 @@ use e3_polynomial::CrtPolynomial; use fhe::bfv::SecretKey; use fhe::trbfv::{ShareManager, TRBFV}; use num_bigint::BigInt; -use rand::thread_rng; pub type SecretShares = Vec>; @@ -35,7 +35,7 @@ impl ShareComputationCircuitData { let sd = preset .search_defaults() .ok_or_else(|| CircuitsErrors::Sample("Preset has no search defaults".into()))?; - let mut rng = thread_rng(); + let mut rng = rand::rng(); let trbfv = TRBFV::new(committee.n, committee.threshold, threshold_params.clone()) .map_err(|e| CircuitsErrors::Sample(format!("Failed to create TRBFV: {:?}", e)))?; @@ -62,14 +62,14 @@ impl ShareComputationCircuitData { })?; let sk_sss_u64 = share_manager - .generate_secret_shares_from_poly(sk_poly.clone(), rng) + .generate_secret_shares_from_poly(sk_poly.clone(), &mut rng) .map_err(|e| { CircuitsErrors::Sample(format!("Failed to generate secret shares: {:?}", e)) })?; let secret_sss: SecretShares = sk_sss_u64 .into_iter() - .map(|arr| arr.mapv(BigInt::from)) + .map(|arr| array2_u64_to_bigint(&arr)) .collect(); let sk_coeffs: Vec = threshold_secret_key @@ -97,14 +97,14 @@ impl ShareComputationCircuitData { .unwrap(); let esi_poly = share_manager.bigints_to_poly(&esi_coeffs).unwrap(); let esi_sss_u64 = share_manager - .generate_secret_shares_from_poly(esi_poly.clone(), rng) + .generate_secret_shares_from_poly(esi_poly.clone(), &mut rng) .map_err(|e| { CircuitsErrors::Sample(format!("Failed to generate error shares: {:?}", e)) }) .unwrap(); let secret_sss: SecretShares = esi_sss_u64 .into_iter() - .map(|arr| arr.mapv(BigInt::from)) + .map(|arr| array2_u64_to_bigint(&arr)) .collect(); let mut secret_crt = diff --git a/crates/zk-helpers/src/circuits/dkg/share_decryption/computation.rs b/crates/zk-helpers/src/circuits/dkg/share_decryption/computation.rs index d1508af66f..096527fc31 100644 --- a/crates/zk-helpers/src/circuits/dkg/share_decryption/computation.rs +++ b/crates/zk-helpers/src/circuits/dkg/share_decryption/computation.rs @@ -22,6 +22,7 @@ use crate::circuits::commitments::compute_share_encryption_commitment_from_message; use crate::dkg::share_decryption::ShareDecryptionCircuit; use crate::dkg::share_decryption::ShareDecryptionCircuitData; +use crate::math::plaintext_poly_u64; use crate::CircuitsErrors; use crate::{bigint_2d_to_json_values, poly_coefficients_to_toml_json}; use crate::{compute_modulus_bit, compute_msg_bit}; @@ -32,8 +33,6 @@ use e3_polynomial::Polynomial; use fhe_traits::FheDecrypter; use num_bigint::BigInt; use serde::{Deserialize, Serialize}; -use std::ops::Deref; - /// Output of [`CircuitComputation::compute`] for [`ShareDecryptionCircuit`]: bounds, bit widths, and input. #[derive(Debug)] pub struct ShareDecryptionOutput { @@ -208,8 +207,8 @@ impl Computation for Inputs { mod_idx, e )) })?; - let share_coeffs = decrypted_pt.value.deref().to_vec(); - // Reverse to match C3's `pt.value.reversed()` commitment convention. + let share_coeffs = plaintext_poly_u64(&decrypted_pt)?; + // Reverse to match C3's reversed commitment convention. let mut reversed_coeffs = share_coeffs.clone(); reversed_coeffs.reverse(); party_commitments.push(compute_share_encryption_commitment_from_message( @@ -375,7 +374,7 @@ mod tests { Some(party_cts) => { let decrypted_pt = sample.secret_key.try_decrypt(&party_cts[mod_idx]).unwrap(); - decrypted_pt.value.deref().to_vec() + plaintext_poly_u64(&decrypted_pt).unwrap() } None => sample.own_plaintext_share[mod_idx].clone(), }; diff --git a/crates/zk-helpers/src/circuits/dkg/share_decryption/sample.rs b/crates/zk-helpers/src/circuits/dkg/share_decryption/sample.rs index 2761847987..084de37f17 100644 --- a/crates/zk-helpers/src/circuits/dkg/share_decryption/sample.rs +++ b/crates/zk-helpers/src/circuits/dkg/share_decryption/sample.rs @@ -19,7 +19,6 @@ use fhe::bfv::{PublicKey, SecretKey}; use fhe::trbfv::{ShareManager, TRBFV}; use fhe_traits::FheEncoder; use fhe_traits::FheEncrypter; -use rand::thread_rng; impl ShareDecryptionCircuitData { /// Generates sample data for the share-decryption circuit (decrypts a sum of honest ciphertexts under DKG secret key). @@ -35,7 +34,7 @@ impl ShareDecryptionCircuitData { .search_defaults() .ok_or_else(|| CircuitsErrors::Sample("Preset has no search defaults".into()))?; - let mut rng = thread_rng(); + let mut rng = rand::rng(); let dkg_secret_key = SecretKey::random(&dkg_params, &mut rng); let dkg_public_key = PublicKey::new(&dkg_secret_key, &mut rng); diff --git a/crates/zk-helpers/src/circuits/dkg/share_encryption/circuit.rs b/crates/zk-helpers/src/circuits/dkg/share_encryption/circuit.rs index 8e9e805890..0ccd9359e6 100644 --- a/crates/zk-helpers/src/circuits/dkg/share_encryption/circuit.rs +++ b/crates/zk-helpers/src/circuits/dkg/share_encryption/circuit.rs @@ -13,7 +13,7 @@ use fhe::bfv::Ciphertext; use fhe::bfv::Plaintext; use fhe::bfv::PublicKey; use fhe::bfv::SecretKey; -use fhe_math::rq::Poly; +use fhe_math::rq::{Ntt, Poly}; /// Share-encryption circuit: proves correct encryption of a (secret or smudging) share under the DKG public key. #[derive(Debug)] @@ -38,11 +38,11 @@ pub struct ShareEncryptionCircuitData { /// Secret key (for input; not revealed in proof). pub secret_key: SecretKey, /// Encryption randomness u in RNS form (from try_encrypt_extended). - pub u_rns: Poly, + pub u_rns: Poly, /// Encryption error e0 in RNS form. - pub e0_rns: Poly, + pub e0_rns: Poly, /// Encryption error e1 in RNS form. - pub e1_rns: Poly, + pub e1_rns: Poly, /// Type of DKG input (SecretKey or SmudgingNoise) to determine which circuit variant to use. pub dkg_input_type: DkgInputType, } diff --git a/crates/zk-helpers/src/circuits/dkg/share_encryption/computation.rs b/crates/zk-helpers/src/circuits/dkg/share_encryption/computation.rs index 84ba0a0678..a0c6c3e042 100644 --- a/crates/zk-helpers/src/circuits/dkg/share_encryption/computation.rs +++ b/crates/zk-helpers/src/circuits/dkg/share_encryption/computation.rs @@ -13,17 +13,15 @@ use crate::circuits::commitments::{ compute_dkg_pk_commitment, compute_share_encryption_commitment_from_message, }; -use crate::{compute_q_mod_t, compute_q_product}; -use std::ops::Deref; - use crate::dkg::share_encryption::ShareEncryptionCircuit; use crate::dkg::share_encryption::ShareEncryptionCircuitData; -use crate::math::{compute_k0is, compute_q_mod_t_centered}; +use crate::math::{compute_k0is, compute_q_mod_t_centered, plaintext_poly_u64}; use crate::math::{cyclotomic_polynomial, decompose_residue}; use crate::polynomial_to_toml_json; use crate::utils::{compute_modulus_bit, compute_msg_bit}; use crate::CircuitsErrors; use crate::{calculate_bit_width, crt_polynomial_to_toml_json}; +use crate::{compute_q_mod_t, compute_q_product}; use crate::{CircuitComputation, Computation}; use e3_fhe_params::build_pair_for_preset; use e3_fhe_params::BfvPreset; @@ -227,7 +225,7 @@ impl Computation for Bounds { build_pair_for_preset(preset).map_err(|e| CircuitsErrors::Sample(e.to_string()))?; let n = BigInt::from(dkg_params.degree()); - let ctx = dkg_params.ctx_at_level(0)?; + let ctx = dkg_params.context_at_level(0)?; let t = BigInt::from(dkg_params.plaintext()); @@ -262,11 +260,7 @@ impl Computation for Bounds { }; // Calculate bounds for each CRT basis - let moduli: Vec = ctx - .moduli_operators() - .into_iter() - .map(|q| q.modulus()) - .collect(); + let moduli: Vec = ctx.moduli_operators().into_iter().map(|q| **q).collect(); let k0is = compute_k0is(&moduli, dkg_params.plaintext())?; let mut pk_bounds: Vec = Vec::new(); @@ -277,7 +271,7 @@ impl Computation for Bounds { let mut p2_bounds: Vec = Vec::new(); for (i, qi) in ctx.moduli_operators().into_iter().enumerate() { - let qi_bigint = BigInt::from(qi.modulus()); + let qi_bigint = BigInt::from(**qi); let qi_bound = (&qi_bigint - BigInt::from(1)) / BigInt::from(2); let k0qi = BigInt::from(k0is[i]); @@ -355,7 +349,7 @@ impl Computation for Inputs { let e0 = &data.e0_rns; let e1 = &data.e1_rns; - let ctx = dkg_params.ctx_at_level(pt.level())?; + let ctx = dkg_params.context_at_level(pt.level())?; let moduli = dkg_params.moduli(); #[allow(non_snake_case)] @@ -371,7 +365,7 @@ impl Computation for Inputs { e0_mod_q.reverse(); e0_mod_q.center(&modulus_q); - let mut k1_u64 = pt.value.deref().to_vec(); + let mut k1_u64 = plaintext_poly_u64(&pt)?; Modulus::new(t) .map_err(|e| CircuitsErrors::Fhe(fhe::Error::from(e)))? .scalar_mul_vec(&mut k1_u64, q_mod_t); @@ -380,7 +374,7 @@ impl Computation for Inputs { k1.reverse(); k1.center(&BigInt::from(t)); - let mut message = Polynomial::from_u64_vector(pt.value.deref().to_vec()); + let mut message = Polynomial::from_u64_vector(plaintext_poly_u64(&pt)?); message.reverse(); let mut u = CrtPolynomial::from_fhe_polynomial(u).limb(0).clone(); @@ -392,10 +386,10 @@ impl Computation for Inputs { e1.center(&BigInt::from(moduli[0])); e1.reverse(); - let mut ct0 = CrtPolynomial::from_fhe_polynomial(&ct.c[0]); - let mut ct1 = CrtPolynomial::from_fhe_polynomial(&ct.c[1]); - let mut pk0 = CrtPolynomial::from_fhe_polynomial(&pk.c.c[0]); - let mut pk1 = CrtPolynomial::from_fhe_polynomial(&pk.c.c[1]); + let mut ct0 = CrtPolynomial::from_fhe_polynomial(&ct[0]); + let mut ct1 = CrtPolynomial::from_fhe_polynomial(&ct[1]); + let mut pk0 = CrtPolynomial::from_fhe_polynomial(&pk.c[0]); + let mut pk1 = CrtPolynomial::from_fhe_polynomial(&pk.c[1]); let mut e0_crt = CrtPolynomial::from_fhe_polynomial(e0); ct0.reverse(); @@ -427,7 +421,7 @@ impl Computation for Inputs { .enumerate() .par_bridge() .map(|(i, (qi, ct0i, ct1i, pk0i, pk1i, e0i))| { - let qi_bigint = BigInt::from(qi.modulus()); + let qi_bigint = BigInt::from(**qi); let diff = e0_mod_q.sub(&e0i); let qi_poly = Polynomial::constant(qi_bigint.clone()); @@ -657,7 +651,8 @@ mod tests { let inputs = Inputs::compute(BfvPreset::InsecureThreshold512, &sample).unwrap(); // inputs.message is plaintext coefficients (reversed, as used in circuit) - let expected_message = Polynomial::from_u64_vector(sample.plaintext.value.deref().to_vec()); + let expected_message = + Polynomial::from_u64_vector(plaintext_poly_u64(&sample.plaintext).unwrap()); let mut expected = expected_message; expected.reverse(); diff --git a/crates/zk-helpers/src/circuits/dkg/share_encryption/sample.rs b/crates/zk-helpers/src/circuits/dkg/share_encryption/sample.rs index 8b39ebdde6..568024a977 100644 --- a/crates/zk-helpers/src/circuits/dkg/share_encryption/sample.rs +++ b/crates/zk-helpers/src/circuits/dkg/share_encryption/sample.rs @@ -18,7 +18,6 @@ use fhe::bfv::Plaintext; use fhe::bfv::{PublicKey, SecretKey}; use fhe::trbfv::{ShareManager, TRBFV}; use fhe_traits::FheEncoder; -use rand::thread_rng; impl ShareEncryptionCircuitData { /// Generates sample data for the share-encryption circuit (encrypts a share row under DKG pk). @@ -33,7 +32,7 @@ impl ShareEncryptionCircuitData { CircuitsErrors::Sample(format!("Failed to build pair for preset: {:?}", e)) })?; - let mut rng = thread_rng(); + let mut rng = rand::rng(); let dkg_secret_key = SecretKey::random(&dkg_params, &mut rng); let dkg_public_key = PublicKey::new(&dkg_secret_key, &mut rng); @@ -131,12 +130,14 @@ mod tests { ) .unwrap(); - assert_eq!(sample.public_key.c.c.len(), 2); + assert_eq!(sample.public_key.c.len(), 2); assert_eq!( - sample.plaintext.value.len(), + crate::math::plaintext_poly_u64(&sample.plaintext) + .unwrap() + .len(), BfvPreset::InsecureThreshold512.metadata().degree ); - assert_eq!(sample.ciphertext.c.len(), 2); + assert_eq!(sample.ciphertext.len(), 2); assert_eq!( sample.u_rns.coefficients().len(), BfvPreset::InsecureThreshold512.metadata().degree @@ -164,8 +165,8 @@ mod tests { ) .unwrap(); - assert_eq!(sample.public_key.c.c.len(), 2); - assert_eq!(sample.ciphertext.c.len(), 2); + assert_eq!(sample.public_key.c.len(), 2); + assert_eq!(sample.ciphertext.len(), 2); assert_eq!( sample.u_rns.coefficients().len(), BfvPreset::InsecureThreshold512.metadata().degree diff --git a/crates/zk-helpers/src/circuits/threshold/decrypted_shares_aggregation/circuit.rs b/crates/zk-helpers/src/circuits/threshold/decrypted_shares_aggregation/circuit.rs index 53b7e2a2d0..727cf9009c 100644 --- a/crates/zk-helpers/src/circuits/threshold/decrypted_shares_aggregation/circuit.rs +++ b/crates/zk-helpers/src/circuits/threshold/decrypted_shares_aggregation/circuit.rs @@ -8,7 +8,7 @@ use crate::computation::DkgInputType; use crate::registry::Circuit; use crate::CiphernodesCommittee; use e3_fhe_params::ParameterType; -use fhe_math::rq::Poly; +use fhe_math::rq::{Poly, PowerBasis}; /// Circuit identifier for threshold decrypted-shares aggregation (Noir circuit 7). #[derive(Debug)] @@ -27,7 +27,7 @@ impl Circuit for DecryptedSharesAggregationCircuit { pub struct DecryptedSharesAggregationCircuitData { pub committee: CiphernodesCommittee, /// Decryption shares from T+1 parties (Poly in RNS form). - pub d_share_polys: Vec, + pub d_share_polys: Vec>, /// Party IDs (1-based: 1, 2, ..., T+1) for the reconstructing parties. pub reconstructing_parties: Vec, /// Decoded message polynomial coefficients. diff --git a/crates/zk-helpers/src/circuits/threshold/decrypted_shares_aggregation/computation.rs b/crates/zk-helpers/src/circuits/threshold/decrypted_shares_aggregation/computation.rs index c07dc9f525..6d1c718c2b 100644 --- a/crates/zk-helpers/src/circuits/threshold/decrypted_shares_aggregation/computation.rs +++ b/crates/zk-helpers/src/circuits/threshold/decrypted_shares_aggregation/computation.rs @@ -28,7 +28,7 @@ use e3_fhe_params::build_pair_for_preset; use e3_fhe_params::BfvPreset; use e3_polynomial::reduce; use e3_polynomial::{CrtPolynomial, Polynomial}; -use fhe_math::rq::{Poly, Representation}; +use fhe_math::rq::{Poly, PowerBasis}; use num_bigint::{BigInt, BigUint}; use num_traits::Zero; use serde::{Deserialize, Serialize}; @@ -136,11 +136,11 @@ impl Computation for Bits { let (threshold_params, _) = build_pair_for_preset(preset).map_err(|e| CircuitsErrors::Other(e.to_string()))?; let ctx = threshold_params - .ctx_at_level(0) - .map_err(|e| CircuitsErrors::Other(format!("ctx_at_level: {:?}", e)))?; + .context_at_level(0) + .map_err(|e| CircuitsErrors::Other(format!("context_at_level: {:?}", e)))?; let mut d_native_bit = 0u32; for qi in ctx.moduli_operators() { - let q = BigInt::from(qi.modulus()); + let q = BigInt::from(**qi); d_native_bit = d_native_bit.max(calculate_bit_width(q - 1)); } Ok(Bits { @@ -207,24 +207,15 @@ impl Computation for Inputs { let (threshold_params, _) = build_pair_for_preset(preset).map_err(|e| CircuitsErrors::Other(e.to_string()))?; let ctx = threshold_params - .ctx_at_level(0) - .map_err(|e| CircuitsErrors::Other(format!("ctx_at_level: {:?}", e)))?; + .context_at_level(0) + .map_err(|e| CircuitsErrors::Other(format!("context_at_level: {:?}", e)))?; let num_moduli = ctx.moduli().len(); let degree = ctx.degree; let threshold = data.committee.threshold; let max_msg_non_zero_coeffs = configs.max_msg_non_zero_coeffs; let moduli = ctx.moduli(); - // Copy to PowerBasis for coefficient extraction - let d_share_polys: Vec = data - .d_share_polys - .iter() - .map(|p| { - let mut copy = p.clone(); - copy.change_representation(Representation::PowerBasis); - copy - }) - .collect(); + let d_share_polys: Vec> = data.d_share_polys.clone(); if d_share_polys.len() < threshold + 1 { return Err(CircuitsErrors::Other(format!( diff --git a/crates/zk-helpers/src/circuits/threshold/decrypted_shares_aggregation/sample.rs b/crates/zk-helpers/src/circuits/threshold/decrypted_shares_aggregation/sample.rs index 2164ddeb2b..375b15d19c 100644 --- a/crates/zk-helpers/src/circuits/threshold/decrypted_shares_aggregation/sample.rs +++ b/crates/zk-helpers/src/circuits/threshold/decrypted_shares_aggregation/sample.rs @@ -21,11 +21,10 @@ use e3_fhe_params::{build_pair_for_preset, create_deterministic_crp_from_default use fhe::bfv::{Encoding, Plaintext, PublicKey, SecretKey}; use fhe::mbfv::{AggregateIter, PublicKeyShare}; use fhe::trbfv::{ShareManager, TRBFV}; -use fhe_math::rq::{Poly, Representation}; +use fhe_math::rq::{Poly, PowerBasis}; use fhe_traits::FheDecoder; use fhe_traits::{FheEncoder, FheEncrypter}; use ndarray::Array2; -use rand::rngs::OsRng; use std::sync::Arc; struct Party { @@ -34,8 +33,8 @@ struct Party { esi_sss: Vec>, sk_sss_collected: Vec>, es_sss_collected: Vec>, - sk_poly_sum: Poly, - es_poly_sum: Poly, + sk_poly_sum: Poly, + es_poly_sum: Poly, } impl DecryptedSharesAggregationCircuitData { @@ -61,18 +60,17 @@ impl DecryptedSharesAggregationCircuitData { let trbfv = TRBFV::new(num_parties, threshold, threshold_params.clone()) .map_err(|e| CircuitsErrors::Sample(format!("Failed to create TRBFV: {:?}", e)))?; - let mut rng = OsRng; - let mut thread_rng = rand::thread_rng(); + let mut rng = rand::rng(); let crp = create_deterministic_crp_from_default_seed(&threshold_params); - let ctx = threshold_params.ctx_at_level(0).unwrap(); + let ctx = threshold_params.context_at_level(0).unwrap(); let mut parties: Vec = (0..num_parties) .map(|_| -> Result { let sk_share = SecretKey::random(&threshold_params, &mut rng); - let pk_share = PublicKeyShare::new(&sk_share, crp.clone(), &mut thread_rng) - .map_err(|e| { + let pk_share = + PublicKeyShare::new(&sk_share, crp.clone(), &mut rng).map_err(|e| { CircuitsErrors::Sample(format!( "Failed to create public key share: {:?}", e @@ -115,8 +113,8 @@ impl DecryptedSharesAggregationCircuitData { let sk_sss_collected = Vec::with_capacity(num_parties); let es_sss_collected = Vec::with_capacity(num_parties); - let sk_poly_sum = Poly::zero(&ctx, Representation::PowerBasis); - let es_poly_sum = Poly::zero(&ctx, Representation::PowerBasis); + let sk_poly_sum = Poly::::zero(&ctx); + let es_poly_sum = Poly::::zero(&ctx); Ok(Party { pk_share, @@ -213,14 +211,14 @@ impl DecryptedSharesAggregationCircuitData { let pt = Plaintext::try_encode(&message, Encoding::poly(), &threshold_params) .map_err(|e| CircuitsErrors::Sample(format!("Failed to encode plaintext: {:?}", e)))?; let ciphertext = public_key - .try_encrypt(&pt, &mut thread_rng) + .try_encrypt(&pt, &mut rng) .map_err(|e| CircuitsErrors::Sample(format!("Failed to encrypt: {:?}", e)))?; let ciphertext = Arc::new(ciphertext); // Decryption shares from T+1 parties (1-based party IDs) let honest_parties = threshold + 1; - let mut d_share_polys: Vec = Vec::with_capacity(honest_parties); + let mut d_share_polys: Vec> = Vec::with_capacity(honest_parties); for party in parties.iter().take(honest_parties) { let share_manager = ShareManager::new(num_parties, threshold, threshold_params.clone()); @@ -228,7 +226,7 @@ impl DecryptedSharesAggregationCircuitData { let d_share = share_manager .decryption_share( Arc::clone(&ciphertext), - party.sk_poly_sum.clone(), + party.sk_poly_sum.clone().into_ntt(), party.es_poly_sum.clone(), ) .map_err(|e| { diff --git a/crates/zk-helpers/src/circuits/threshold/pk_aggregation/computation.rs b/crates/zk-helpers/src/circuits/threshold/pk_aggregation/computation.rs index 6ec4b6a28a..df3ae3aed4 100644 --- a/crates/zk-helpers/src/circuits/threshold/pk_aggregation/computation.rs +++ b/crates/zk-helpers/src/circuits/threshold/pk_aggregation/computation.rs @@ -161,8 +161,8 @@ impl Computation for Inputs { // pk1 is the same (common random polynomial a) for all parties let mut pk1: Vec = (0..data.committee.h).map(|_| data.a.clone()).collect(); // Extract pk0_agg and pk1_agg from aggregated public key (c[1] = a) - let mut pk0_agg = CrtPolynomial::from_fhe_polynomial(&data.public_key.c.c[0]); - let mut pk1_agg = CrtPolynomial::from_fhe_polynomial(&data.public_key.c.c[1]); + let mut pk0_agg = CrtPolynomial::from_fhe_polynomial(&data.public_key.c[0]); + let mut pk1_agg = CrtPolynomial::from_fhe_polynomial(&data.public_key.c[1]); // Compute expected_threshold_pk_commitments for each honest party // Each commitment is computed from pk0[i] and pk1[i] for party i diff --git a/crates/zk-helpers/src/circuits/threshold/pk_aggregation/sample.rs b/crates/zk-helpers/src/circuits/threshold/pk_aggregation/sample.rs index 6e61cd5ea5..94dd7bb930 100644 --- a/crates/zk-helpers/src/circuits/threshold/pk_aggregation/sample.rs +++ b/crates/zk-helpers/src/circuits/threshold/pk_aggregation/sample.rs @@ -16,8 +16,6 @@ use e3_fhe_params::{build_pair_for_preset, create_deterministic_crp_from_default use e3_polynomial::CrtPolynomial; use fhe::bfv::{PublicKey, SecretKey}; use fhe::mbfv::{AggregateIter, PublicKeyShare}; -use rand::rngs::OsRng; -use rand::thread_rng; impl PkAggregationCircuitData { pub fn generate_sample( @@ -28,8 +26,7 @@ impl PkAggregationCircuitData { CircuitsErrors::Sample(format!("Failed to build pair for preset: {:?}", e)) })?; - let mut rng = OsRng; - let mut thread_rng = thread_rng(); + let mut rng = rand::rng(); let crp = create_deterministic_crp_from_default_seed(&threshold_params); @@ -40,7 +37,7 @@ impl PkAggregationCircuitData { for _ in 0..committee.h { let sk = SecretKey::random(&threshold_params, &mut rng); // Create PublicKeyShare - this generates the p0_share with a specific error term - let pk_share = PublicKeyShare::new(&sk, crp.clone(), &mut thread_rng).map_err(|e| { + let pk_share = PublicKeyShare::new(&sk, crp.clone(), &mut rng).map_err(|e| { CircuitsErrors::Sample(format!("Failed to create public key share: {:?}", e)) })?; diff --git a/crates/zk-helpers/src/circuits/threshold/pk_generation/computation.rs b/crates/zk-helpers/src/circuits/threshold/pk_generation/computation.rs index 2376c7193e..307fef9402 100644 --- a/crates/zk-helpers/src/circuits/threshold/pk_generation/computation.rs +++ b/crates/zk-helpers/src/circuits/threshold/pk_generation/computation.rs @@ -179,7 +179,7 @@ impl Computation for Bounds { let committee_n = committee.n; let n = BigInt::from(threshold_params.degree()); - let ctx = threshold_params.ctx_at_level(0)?; + let ctx = threshold_params.context_at_level(0)?; let cbd_bound = (threshold_params.variance() * 2) as u64; @@ -209,10 +209,10 @@ impl Computation for Bounds { let mut pk_bound_max = BigInt::from(0); for (i, qi) in ctx.moduli_operators().iter().enumerate() { - let qi_bigint = BigInt::from(qi.modulus()); + let qi_bigint = BigInt::from(**qi); let qi_bound = (&qi_bigint - 1u32) / 2u32; - moduli.push(qi.modulus()); + moduli.push(**qi); r2_bounds[i] = qi_bound.clone(); diff --git a/crates/zk-helpers/src/circuits/threshold/pk_generation/sample.rs b/crates/zk-helpers/src/circuits/threshold/pk_generation/sample.rs index dd05c2e4a6..118f1807df 100644 --- a/crates/zk-helpers/src/circuits/threshold/pk_generation/sample.rs +++ b/crates/zk-helpers/src/circuits/threshold/pk_generation/sample.rs @@ -19,7 +19,6 @@ use fhe::{ bfv::SecretKey, trbfv::{ShareManager, TRBFV}, }; -use rand::thread_rng; use std::ops::Deref; impl PkGenerationCircuitData { @@ -31,7 +30,7 @@ impl PkGenerationCircuitData { CircuitsErrors::Sample(format!("Failed to build pair for preset: {:?}", e)) })?; - let mut rng = thread_rng(); + let mut rng = rand::rng(); let secret_key = SecretKey::random(&threshold_params, &mut rng); let crp = create_deterministic_crp_from_default_seed(&threshold_params); diff --git a/crates/zk-helpers/src/circuits/threshold/share_decryption/computation.rs b/crates/zk-helpers/src/circuits/threshold/share_decryption/computation.rs index 7b0bcfbb48..98830b1bae 100644 --- a/crates/zk-helpers/src/circuits/threshold/share_decryption/computation.rs +++ b/crates/zk-helpers/src/circuits/threshold/share_decryption/computation.rs @@ -203,7 +203,7 @@ impl Computation for Bounds { let n = BigInt::from(threshold_params.degree()); // Get cyclotomic degree and context at provided level - let ctx = threshold_params.ctx_at_level(0)?; + let ctx = threshold_params.context_at_level(0)?; // Calculate bounds for each CRT basis let mut r1_bounds: Vec = Vec::new(); @@ -211,10 +211,10 @@ impl Computation for Bounds { let mut moduli: Vec = Vec::new(); for qi in ctx.moduli_operators() { - let qi_bigint = BigInt::from(qi.modulus()); + let qi_bigint = BigInt::from(**qi); let qi_bound = (&qi_bigint - BigInt::from(1)) / BigInt::from(2); - moduli.push(qi.modulus()); + moduli.push(**qi); // r_2j bounds: [- (q_j-1)/2 , (q_j-1)/2] (cyclotomic quotients) r2_bounds.push(qi_bound.clone()); @@ -261,8 +261,8 @@ impl Computation for Inputs { let n = threshold_params.degree() as u64; // Extract and convert ciphertext polynomials - let ct0 = CrtPolynomial::from_fhe_polynomial(&data.ciphertext.c[0]); - let ct1 = CrtPolynomial::from_fhe_polynomial(&data.ciphertext.c[1]); + let ct0 = CrtPolynomial::from_fhe_polynomial(&data.ciphertext[0]); + let ct1 = CrtPolynomial::from_fhe_polynomial(&data.ciphertext[1]); // Create cyclotomic polynomial x^N + 1 let mut cyclo = vec![BigInt::from(0u64); (n + 1) as usize]; @@ -437,7 +437,7 @@ mod tests { use crate::circuits::commitments::compute_threshold_decryption_share_commitment; use crate::threshold::share_decryption::ShareDecryptionCircuitData; use crate::CiphernodesCommitteeSize; - use fhe_math::rq::{Poly, Representation}; + use fhe_math::rq::{Poly, PowerBasis}; use fhe_traits::{DeserializeWithContext, Serialize as FheSer}; use num_traits::ToPrimitive; @@ -480,10 +480,10 @@ mod tests { arr[[i, j]] = v; } } - let ctx = threshold_params.ctx_at_level(0).unwrap(); - let mut poly = Poly::zero(&ctx, Representation::PowerBasis); + let ctx = threshold_params.context_at_level(0).unwrap(); + let mut poly = Poly::::zero(&ctx); poly.set_coefficients(arr); - let poly_rt = Poly::from_bytes(&poly.to_bytes(), &ctx).unwrap(); + let poly_rt = Poly::::from_bytes(&poly.to_bytes(), &ctx).unwrap(); let crt_rt = CrtPolynomial::from_fhe_polynomial(&poly_rt); let from_bytes = compute_threshold_decryption_share_commitment( &crt_rt, diff --git a/crates/zk-helpers/src/circuits/threshold/share_decryption/sample.rs b/crates/zk-helpers/src/circuits/threshold/share_decryption/sample.rs index d25e377d3b..60c9603c6d 100644 --- a/crates/zk-helpers/src/circuits/threshold/share_decryption/sample.rs +++ b/crates/zk-helpers/src/circuits/threshold/share_decryption/sample.rs @@ -23,8 +23,6 @@ use fhe::{ }; use fhe_traits::{FheEncoder, FheEncrypter}; use ndarray::ArrayView; -use rand::{rngs::OsRng, thread_rng}; - impl ShareDecryptionCircuitData { /// Generates a random secret key, public key, and plaintext for the given BFV parameters. pub fn generate_sample( @@ -39,8 +37,7 @@ impl ShareDecryptionCircuitData { .search_defaults() .ok_or_else(|| CircuitsErrors::Sample("Preset has no search defaults".into()))?; - let mut rng = OsRng; - let mut thread_rng = thread_rng(); + let mut rng = rand::rng(); let num_parties = committee.n; let threshold = committee.threshold; @@ -61,7 +58,7 @@ impl ShareDecryptionCircuitData { for _ in 0..num_parties { let sk = fhe::bfv::SecretKey::random(&threshold_params, &mut rng); - let pk_share = PublicKeyShare::new(&sk, crp.clone(), &mut thread_rng).map_err(|e| { + let pk_share = PublicKeyShare::new(&sk, crp.clone(), &mut rng).map_err(|e| { CircuitsErrors::Sample(format!("Failed to create public key share: {:?}", e)) })?; party_secret_keys.push(sk); @@ -77,7 +74,7 @@ impl ShareDecryptionCircuitData { let message = 1u64; let pt = Plaintext::try_encode(&[message], Encoding::poly(), &threshold_params) .map_err(|e| CircuitsErrors::Sample(format!("Failed to encode plaintext: {:?}", e)))?; - let ciphertext = public_key.try_encrypt(&pt, &mut thread_rng)?; + let ciphertext = public_key.try_encrypt(&pt, &mut rng)?; // Simulate party 0's perspective: // - Each party has their own secret key @@ -102,7 +99,7 @@ impl ShareDecryptionCircuitData { let temp_trbfv = trbfv.clone(); let sk_sss = temp_trbfv - .generate_secret_shares_from_poly(sk_poly, rng) + .generate_secret_shares_from_poly(sk_poly, &mut rng) .map_err(|e| { CircuitsErrors::Sample(format!("Failed to generate SK shares: {:?}", e)) })?; @@ -118,7 +115,7 @@ impl ShareDecryptionCircuitData { CircuitsErrors::Sample(format!("Failed to convert error to poly: {:?}", e)) })?; let esi_sss = share_manager - .generate_secret_shares_from_poly(esi_poly, rng) + .generate_secret_shares_from_poly(esi_poly, &mut rng) .map_err(|e| { CircuitsErrors::Sample(format!("Failed to generate error shares: {:?}", e)) })?; @@ -181,7 +178,7 @@ impl ShareDecryptionCircuitData { // Aggregate collected shares to get s and e polynomials // First, sum across parties for each modulus, then restructure to match // the format expected by aggregate_collected_shares: one Array2 of shape [num_moduli, degree] - let ctx = threshold_params.ctx_at_level(0)?; + let ctx = threshold_params.context_at_level(0)?; let num_moduli = sk_sss_collected.len(); // Sum across parties for each modulus to create [num_moduli, degree] matrices @@ -225,7 +222,7 @@ impl ShareDecryptionCircuitData { .clone() .decryption_share( Arc::new(ciphertext.clone()), - sk_poly_sum.clone(), + sk_poly_sum.clone().into_ntt(), es_poly_sum.clone(), ) .map_err(|e| { @@ -260,12 +257,12 @@ mod tests { let num_moduli = PRESET.metadata().num_moduli; assert_eq!( - sample.public_key.c.c.len(), + sample.public_key.c.len(), 2, "BFV public key has two components" ); assert_eq!( - sample.ciphertext.c.len(), + sample.ciphertext.len(), 2, "BFV ciphertext has two components" ); @@ -314,7 +311,7 @@ mod tests { let a = ShareDecryptionCircuitData::generate_sample(PRESET, committee.clone()).unwrap(); let b = ShareDecryptionCircuitData::generate_sample(PRESET, committee).unwrap(); - assert_eq!(a.public_key.c.c.len(), b.public_key.c.c.len()); + assert_eq!(a.public_key.c.len(), b.public_key.c.len()); assert_eq!(a.s.limbs.len(), b.s.limbs.len()); assert_eq!(a.e.limbs.len(), b.e.limbs.len()); assert_eq!(a.d_share.limbs.len(), b.d_share.limbs.len()); diff --git a/crates/zk-helpers/src/circuits/threshold/user_data_encryption/computation.rs b/crates/zk-helpers/src/circuits/threshold/user_data_encryption/computation.rs index 607b40070d..e45cd45d7a 100644 --- a/crates/zk-helpers/src/circuits/threshold/user_data_encryption/computation.rs +++ b/crates/zk-helpers/src/circuits/threshold/user_data_encryption/computation.rs @@ -12,7 +12,7 @@ use crate::calculate_bit_width; use crate::get_zkp_modulus; use crate::math::compute_k0is; -use crate::math::{cyclotomic_polynomial, decompose_residue}; +use crate::math::{cyclotomic_polynomial, decompose_residue, plaintext_poly_u64}; use crate::threshold::user_data_encryption::circuit::UserDataEncryptionCircuit; use crate::threshold::user_data_encryption::circuit::UserDataEncryptionCircuitData; use crate::CircuitsErrors; @@ -30,12 +30,9 @@ use num_bigint::BigUint; use num_bigint::ToBigInt; use num_traits::Signed; use num_traits::ToPrimitive; -use rand::thread_rng; use rayon::iter::ParallelIterator; use rayon::prelude::ParallelBridge; use serde::{Deserialize, Serialize}; -use std::ops::Deref; - /// Output of [`CircuitComputation::compute`] for [`UserDataEncryptionCircuit`]: bounds, bit widths, and inputs. #[derive(Debug)] pub struct UserDataEncryptionComputationOutput { @@ -217,7 +214,7 @@ impl Computation for Bounds { build_pair_for_preset(preset).map_err(|e| CircuitsErrors::Sample(e.to_string()))?; let n = BigInt::from(threshold_params.degree()); - let ctx = threshold_params.ctx_at_level(0)?; + let ctx = threshold_params.context_at_level(0)?; let t = BigInt::from(threshold_params.plaintext()); @@ -252,11 +249,7 @@ impl Computation for Bounds { let k1_up_bound: BigInt = ptxt_up_bound.clone(); // Calculate bounds for each CRT basis - let moduli: Vec = ctx - .moduli_operators() - .into_iter() - .map(|q| q.modulus()) - .collect(); + let moduli: Vec = ctx.moduli_operators().into_iter().map(|q| **q).collect(); let k0is = compute_k0is(&moduli, threshold_params.plaintext())?; let mut pk_bounds: Vec = Vec::new(); @@ -267,7 +260,7 @@ impl Computation for Bounds { let mut p2_bounds: Vec = Vec::new(); for (i, qi) in ctx.moduli_operators().into_iter().enumerate() { - let qi_bigint = BigInt::from(qi.modulus()); + let qi_bigint = BigInt::from(**qi); let qi_bound = (&qi_bigint - BigInt::from(1)) / BigInt::from(2); let k0qi = BigInt::from(k0is[i]); @@ -343,7 +336,7 @@ impl Computation for Inputs { let pt = data.plaintext.clone(); // Context and plaintext modulus (use same ctx for e0 reconstruction and loop). - let ctx = threshold_params.ctx_at_level(0)?; + let ctx = threshold_params.context_at_level(0)?; #[allow(non_snake_case)] let modulus_q = BigInt::from(ctx.modulus().clone()); @@ -359,7 +352,7 @@ impl Computation for Inputs { // Encrypt using the provided public key to ensure ciphertext matches the key. let (ct, u, e0, e1) = data .public_key - .try_encrypt_extended(&data.plaintext, &mut thread_rng())?; + .try_encrypt_extended(&data.plaintext, &mut rand::rng())?; // Reconstruct e0 coefficients mod Q (CRT) for e0_quotient computation. let mut e0_mod_q = Polynomial::from_fhe_polynomial(&e0); @@ -368,7 +361,7 @@ impl Computation for Inputs { e0_mod_q.center(&modulus_q); // Reconstruct k1 from plaintext polynomial. - let mut k1_u64 = pt.value.deref().to_vec(); // m + let mut k1_u64 = plaintext_poly_u64(&pt)?; // m Modulus::new(t) .map_err(|e| CircuitsErrors::Fhe(fhe::Error::from(e)))? @@ -389,10 +382,10 @@ impl Computation for Inputs { e1.center(&BigInt::from(moduli[0])); e1.reverse(); - let mut ct0 = CrtPolynomial::from_fhe_polynomial(&ct.c[0]); - let mut ct1 = CrtPolynomial::from_fhe_polynomial(&ct.c[1]); - let mut pk0 = CrtPolynomial::from_fhe_polynomial(&pk.c.c[0]); - let mut pk1 = CrtPolynomial::from_fhe_polynomial(&pk.c.c[1]); + let mut ct0 = CrtPolynomial::from_fhe_polynomial(&ct[0]); + let mut ct1 = CrtPolynomial::from_fhe_polynomial(&ct[1]); + let mut pk0 = CrtPolynomial::from_fhe_polynomial(&pk.c[0]); + let mut pk1 = CrtPolynomial::from_fhe_polynomial(&pk.c[1]); let mut e0 = CrtPolynomial::from_fhe_polynomial(&e0); ct0.reverse(); @@ -427,7 +420,7 @@ impl Computation for Inputs { .enumerate() .par_bridge() .map(|(i, (qi, ct0i, ct1i, pk0i, pk1i, e0i))| { - let qi_bigint = BigInt::from(qi.modulus()); + let qi_bigint = BigInt::from(**qi); // Compute e0_quotients[i] = (e0 - e0i) / qi for each coefficient // This is used for CRT consistency check: e0[j] = e0i[j] + e0_quotients[i][j] * qi diff --git a/crates/zk-helpers/src/circuits/threshold/user_data_encryption/sample.rs b/crates/zk-helpers/src/circuits/threshold/user_data_encryption/sample.rs index d4e79897c9..21e8678053 100644 --- a/crates/zk-helpers/src/circuits/threshold/user_data_encryption/sample.rs +++ b/crates/zk-helpers/src/circuits/threshold/user_data_encryption/sample.rs @@ -15,7 +15,6 @@ use crate::{ use e3_fhe_params::{build_pair_for_preset, BfvPreset}; use fhe::bfv::{Encoding, Plaintext, PublicKey, SecretKey}; use fhe_traits::FheEncoder; -use rand::thread_rng; impl UserDataEncryptionCircuitData { /// Generates a random secret key, public key, and plaintext for the given BFV parameters. @@ -24,7 +23,7 @@ impl UserDataEncryptionCircuitData { CircuitsErrors::Sample(format!("Failed to build pair for preset: {:?}", e)) })?; - let mut rng = thread_rng(); + let mut rng = rand::rng(); let secret_key = SecretKey::random(&threshold_params, &mut rng); let public_key = PublicKey::new(&secret_key, &mut rng); @@ -50,9 +49,11 @@ mod tests { UserDataEncryptionCircuitData::generate_sample(BfvPreset::InsecureThreshold512) .unwrap(); - assert_eq!(sample.public_key.c.c.len(), 2); + assert_eq!(sample.public_key.c.len(), 2); assert_eq!( - sample.plaintext.value.len(), + crate::math::plaintext_poly_u64(&sample.plaintext) + .unwrap() + .len(), BfvPreset::InsecureThreshold512.metadata().degree ); } diff --git a/crates/zk-helpers/src/circuits/threshold/user_data_encryption/utils.rs b/crates/zk-helpers/src/circuits/threshold/user_data_encryption/utils.rs index 1ffacf9c80..4d264cf95c 100644 --- a/crates/zk-helpers/src/circuits/threshold/user_data_encryption/utils.rs +++ b/crates/zk-helpers/src/circuits/threshold/user_data_encryption/utils.rs @@ -29,8 +29,8 @@ pub fn bfv_ciphertext_to_greco( ) -> Result<(CrtPolynomial, CrtPolynomial), CrtPolynomialError> { let moduli = params.moduli(); - let ct0is = fhe_poly_to_crt_centered(&ciphertext.c[0], moduli)?; - let ct1is = fhe_poly_to_crt_centered(&ciphertext.c[1], moduli)?; + let ct0is = fhe_poly_to_crt_centered(&ciphertext[0], moduli)?; + let ct1is = fhe_poly_to_crt_centered(&ciphertext[1], moduli)?; Ok((ct0is, ct1is)) } @@ -53,8 +53,8 @@ pub fn bfv_public_key_to_greco( public_key: &PublicKey, ) -> Result<(CrtPolynomial, CrtPolynomial), CrtPolynomialError> { let moduli = params.moduli(); - let mut pk0is = CrtPolynomial::from_fhe_polynomial(&public_key.c.c[0]); - let mut pk1is = CrtPolynomial::from_fhe_polynomial(&public_key.c.c[1]); + let mut pk0is = CrtPolynomial::from_fhe_polynomial(&public_key.c[0]); + let mut pk1is = CrtPolynomial::from_fhe_polynomial(&public_key.c[1]); pk0is.reverse(); pk1is.reverse(); pk0is.center(moduli)?; diff --git a/crates/zk-helpers/src/math.rs b/crates/zk-helpers/src/math.rs index c8741dd5d2..88301dc1f9 100644 --- a/crates/zk-helpers/src/math.rs +++ b/crates/zk-helpers/src/math.rs @@ -9,14 +9,32 @@ use crate::CircuitsErrors; use e3_polynomial::center; -use e3_polynomial::{CrtPolynomial, CrtPolynomialError, Polynomial}; -use fhe_math::rq::Poly; +use e3_polynomial::{CrtPolynomial, CrtPolynomialError, Polynomial, ToPowerBasisPoly}; +use fhe::bfv::{Encoding, Plaintext}; use fhe_math::zq::Modulus; +use fhe_traits::FheDecoder; +use ndarray::Array2; use num_bigint::{BigInt, BigUint}; use num_integer::Integer; use num_traits::{ToPrimitive, Zero}; -// ---------- BFV / TRBFV parameter math ---------- +/// Encoded plaintext coefficients in poly encoding (u64 limb values). +pub fn plaintext_poly_u64(pt: &Plaintext) -> Result, CircuitsErrors> { + Vec::::try_decode(pt, Encoding::poly()) + .map_err(|e| CircuitsErrors::Fhe(fhe::Error::from(e))) +} + +/// Copy an `Array2` into workspace `ndarray` with `BigInt` coefficients. +pub fn array2_u64_to_bigint(arr: &Array2) -> Array2 { + let (rows, cols) = arr.dim(); + let mut out = Array2::::zeros((rows, cols)); + for i in 0..rows { + for j in 0..cols { + out[[i, j]] = BigInt::from(arr[[i, j]]); + } + } + out +} /// Product Q = q_0 * q_1 * ... * q_{L-1} of CRT moduli. pub fn compute_q_product(moduli: &[u64]) -> BigUint { @@ -129,7 +147,7 @@ pub fn compute_k0is(moduli: &[u64], plaintext_modulus: u64) -> Result, /// Converts an FHE polynomial to CRT form with reverse + center (no ZKP reduce). pub fn fhe_poly_to_crt_centered( - poly: &Poly, + poly: &impl ToPowerBasisPoly, moduli: &[u64], ) -> Result { let mut crt = CrtPolynomial::from_fhe_polynomial(poly); diff --git a/crates/zk-prover/tests/local_e2e_tests.rs b/crates/zk-prover/tests/local_e2e_tests.rs index 72e4bcf097..d260f2b4e9 100644 --- a/crates/zk-prover/tests/local_e2e_tests.rs +++ b/crates/zk-prover/tests/local_e2e_tests.rs @@ -847,7 +847,7 @@ async fn test_c4_c6_sk_commitment_aligned_transcript_e2e() { let committee = CiphernodesCommitteeSize::Micro.values(); let (threshold_params, _) = build_pair_for_preset(preset).unwrap(); - let ctx = threshold_params.ctx_at_level(0).unwrap(); + let ctx = threshold_params.context_at_level(0).unwrap(); let moduli = threshold_params.moduli(); let dkg_out = DkgShareDecryptionCircuit::compute(preset, &dkg_sample).unwrap(); @@ -855,7 +855,8 @@ async fn test_c4_c6_sk_commitment_aligned_transcript_e2e() { let sk_poly = agg_sk .to_fhe_polynomial(&ctx, moduli) - .expect("agg_sk -> Poly"); + .expect("agg_sk -> Poly") + .into_ntt(); let es_poly = c6_sample .e .to_fhe_polynomial(&ctx, moduli) diff --git a/crates/zk-prover/tests/slashing_integration_tests.rs b/crates/zk-prover/tests/slashing_integration_tests.rs index 879fc866d3..843cd4d049 100644 --- a/crates/zk-prover/tests/slashing_integration_tests.rs +++ b/crates/zk-prover/tests/slashing_integration_tests.rs @@ -520,6 +520,7 @@ fn sign_vote_with_deadline( fn encode_attestation_evidence( proof_type: u8, mut votes: Vec<(Address, FixedBytes<32>, Bytes)>, + evidence: Bytes, deadline: U256, ) -> Bytes { votes.sort_by_key(|(addr, _, _)| *addr); @@ -530,7 +531,14 @@ fn encode_attestation_evidence( // `abi_encode_params` matches Solidity `abi.encode(a,b,...)`; `abi_encode` adds an extra // outer offset word that breaks `abi.decode(proof, (uint256))` in `proposeSlash`. - (U256::from(proof_type), voters, data_hashes, deadline, sigs) + ( + U256::from(proof_type), + voters, + data_hashes, + evidence, + deadline, + sigs, + ) .abi_encode_params() .into() } @@ -676,6 +684,8 @@ fn test_vote_signing_roundtrip() { /// First ABI word of attestation evidence must be `proofType` (SlashingManager decodes only that). #[test] fn test_evidence_leading_word_is_proof_type() { + let raw_evidence = Bytes::from(vec![0u8; 32]); + let dh: FixedBytes<32> = keccak256(&raw_evidence).into(); let evidence = encode_attestation_evidence( 0, vec![ @@ -683,17 +693,18 @@ fn test_evidence_leading_word_is_proof_type() { "0x1111111111111111111111111111111111111111" .parse() .unwrap(), - FixedBytes::from([1u8; 32]), + dh, Bytes::from(vec![0u8; 65]), ), ( "0x2222222222222222222222222222222222222222" .parse() .unwrap(), - FixedBytes::from([2u8; 32]), + dh, Bytes::from(vec![0u8; 65]), ), ], + raw_evidence, VOTE_NO_EXPIRY, ); let leading = U256::from_be_slice(&evidence[..32]); @@ -720,7 +731,8 @@ fn test_attestation_evidence_encoding() { let accusation_id = compute_accusation_id(chain_id, e3_id, operator, proof_type); - let data_hash = FixedBytes::from([0xab; 32]); + let raw_evidence = Bytes::from(vec![0xab; 32]); + let data_hash: FixedBytes<32> = keccak256(&raw_evidence).into(); let (voter1, sig1) = sign_vote( &signer1, chain_id, @@ -741,15 +753,23 @@ fn test_attestation_evidence_encoding() { let evidence = encode_attestation_evidence( proof_type, vec![(voter1, data_hash, sig1), (voter2, data_hash, sig2)], + raw_evidence.clone(), VOTE_NO_EXPIRY, ); - // Decode and verify structure: (uint256, address[], bytes32[], uint256, bytes[]) - type AttestationTuple = (U256, Vec
, Vec>, U256, Vec); + // Decode and verify structure: (uint256, address[], bytes32[], bytes, uint256, bytes[]) + type AttestationTuple = ( + U256, + Vec
, + Vec>, + Bytes, + U256, + Vec, + ); let decoded = AttestationTuple::abi_decode_params(&evidence).expect("evidence should ABI-decode"); - let (dec_proof_type, dec_voters, dec_hashes, dec_deadline, dec_sigs) = decoded; + let (dec_proof_type, dec_voters, dec_hashes, dec_evidence, dec_deadline, dec_sigs) = decoded; assert_eq!(dec_proof_type, U256::from(proof_type), "proofType mismatch"); assert_eq!(dec_voters.len(), 2, "should have 2 voters"); assert!( @@ -757,6 +777,7 @@ fn test_attestation_evidence_encoding() { "voters should be sorted ascending" ); assert_eq!(dec_hashes.len(), 2, "should have 2 data hashes"); + assert_eq!(dec_evidence, raw_evidence, "evidence bytes mismatch"); assert_eq!(dec_deadline, VOTE_NO_EXPIRY, "deadline mismatch"); assert_eq!(dec_sigs.len(), 2, "should have 2 signatures"); assert!( @@ -928,7 +949,8 @@ async fn test_onchain_valid_attestation_executes_slash() { // All 3 voters sign accusation votes let accusation_id = compute_accusation_id(chain_id, e3_id, operator_addr, proof_type); - let data_hash = FixedBytes::from([0xaa; 32]); + let raw_evidence = Bytes::from(vec![0xaa; 32]); + let data_hash: FixedBytes<32> = keccak256(&raw_evidence).into(); let (v1, s1) = sign_vote( &voter_signer1, @@ -962,6 +984,7 @@ async fn test_onchain_valid_attestation_executes_slash() { (v2, data_hash, s2), (v3, data_hash, s3), ], + raw_evidence, VOTE_NO_EXPIRY, ); @@ -1096,7 +1119,8 @@ async fn test_onchain_insufficient_attestations_reverts() { // Only 1 vote (below threshold M=2) let accusation_id = compute_accusation_id(chain_id, e3_id, operator_addr, proof_type); - let data_hash = FixedBytes::from([0xbb; 32]); + let raw_evidence = Bytes::from(vec![0xbb; 32]); + let data_hash: FixedBytes<32> = keccak256(&raw_evidence).into(); let (v1, s1) = sign_vote( &voter_signer1, @@ -1107,8 +1131,12 @@ async fn test_onchain_insufficient_attestations_reverts() { data_hash, ); - let evidence = - encode_attestation_evidence(proof_type, vec![(v1, data_hash, s1)], VOTE_NO_EXPIRY); + let evidence = encode_attestation_evidence( + proof_type, + vec![(v1, data_hash, s1)], + raw_evidence, + VOTE_NO_EXPIRY, + ); let result = slashing_mgr .proposeSlash(U256::from(e3_id), operator_addr, evidence) @@ -1210,7 +1238,8 @@ async fn test_onchain_voter_not_in_committee_reverts() { // Outsider signs a vote (valid signature, but not a committee member) let accusation_id = compute_accusation_id(chain_id, e3_id, operator_addr, proof_type); - let data_hash = FixedBytes::from([0xcc; 32]); + let raw_evidence = Bytes::from(vec![0xcc; 32]); + let data_hash: FixedBytes<32> = keccak256(&raw_evidence).into(); let (v_out, s_out) = sign_vote( &outsider_signer, @@ -1221,8 +1250,12 @@ async fn test_onchain_voter_not_in_committee_reverts() { data_hash, ); - let evidence = - encode_attestation_evidence(proof_type, vec![(v_out, data_hash, s_out)], VOTE_NO_EXPIRY); + let evidence = encode_attestation_evidence( + proof_type, + vec![(v_out, data_hash, s_out)], + raw_evidence, + VOTE_NO_EXPIRY, + ); let result = slashing_mgr .proposeSlash(U256::from(e3_id), operator_addr, evidence) @@ -1324,7 +1357,8 @@ async fn test_onchain_invalid_vote_signature_reverts() { // Impersonator signs the vote with their key, but we claim it's from victim_signer let accusation_id = compute_accusation_id(chain_id, e3_id, operator_addr, proof_type); - let data_hash = FixedBytes::from([0xdd; 32]); + let raw_evidence = Bytes::from(vec![0xdd; 32]); + let data_hash: FixedBytes<32> = keccak256(&raw_evidence).into(); // Sign using impersonator's key but construct the digest for victim_signer's address let digest = compute_vote_digest( @@ -1345,6 +1379,7 @@ async fn test_onchain_invalid_vote_signature_reverts() { U256::from(proof_type), vec![victim_signer.address()], vec![data_hash], + raw_evidence, VOTE_NO_EXPIRY, vec![Bytes::from(bad_sig.as_bytes().to_vec())], ) @@ -1452,7 +1487,8 @@ async fn test_onchain_duplicate_voter_reverts() { // Create TWO votes from the same voter (duplicate addresses) let accusation_id = compute_accusation_id(chain_id, e3_id, operator_addr, proof_type); - let data_hash = FixedBytes::from([0xee; 32]); + let raw_evidence = Bytes::from(vec![0xee; 32]); + let data_hash: FixedBytes<32> = keccak256(&raw_evidence).into(); let (voter, sig) = sign_vote( &voter_signer, @@ -1469,6 +1505,7 @@ async fn test_onchain_duplicate_voter_reverts() { U256::from(proof_type), vec![voter, voter], vec![data_hash, data_hash], + raw_evidence, VOTE_NO_EXPIRY, vec![sig.clone(), sig], ) @@ -1577,7 +1614,8 @@ async fn test_onchain_duplicate_evidence_reverts() { .unwrap(); let accusation_id = compute_accusation_id(chain_id, e3_id, operator_addr, proof_type); - let data_hash = FixedBytes::from([0xff; 32]); + let raw_evidence = Bytes::from(vec![0xff; 32]); + let data_hash: FixedBytes<32> = keccak256(&raw_evidence).into(); let (v1, s1) = sign_vote( &voter_signer1, @@ -1599,6 +1637,7 @@ async fn test_onchain_duplicate_evidence_reverts() { let evidence = encode_attestation_evidence( proof_type, vec![(v1, data_hash, s1), (v2, data_hash, s2)], + raw_evidence, VOTE_NO_EXPIRY, ); @@ -1735,7 +1774,9 @@ async fn test_onchain_actor_signed_vote_accepted() { .await .unwrap(); - let data_hash = FixedBytes::from([0xee; 32]); + // evidence bytes whose keccak256 becomes the data_hash voters sign + let raw_evidence_bytes: Bytes = Bytes::from(vec![0xee; 32]); + let data_hash: FixedBytes<32> = keccak256(&raw_evidence_bytes).into(); // Pick a deadline far in the future so the on-chain check passes // regardless of Anvil's block.timestamp at submission time. @@ -1782,7 +1823,7 @@ async fn test_onchain_actor_signed_vote_accepted() { proof_type: ProofType::C0PkBfv, votes_for, outcome: AccusationOutcome::AccusedFaulted, - evidence: Bytes::new(), // audit metadata only; not on chain + evidence: raw_evidence_bytes.into(), }; let evidence = encode_attestation_evidence(&quorum) .expect("encode_attestation_evidence must produce bytes for nonempty votes_for"); diff --git a/docs/pages/quick-start.mdx b/docs/pages/quick-start.mdx index d3d6f6e154..7e5cdf896e 100644 --- a/docs/pages/quick-start.mdx +++ b/docs/pages/quick-start.mdx @@ -16,7 +16,7 @@ Make sure you have the required software installed: # Check versions node --version # Should be 22.10.0+ pnpm --version # Should be 10.7.1+ -rustc --version # Should be 1.86.0+ +rustc --version # Should be 1.91.1+ enclave --version # Confirm CLI is installed ``` diff --git a/examples/CRISP/Cargo.lock b/examples/CRISP/Cargo.lock index 5d5632c58d..3290336b20 100644 --- a/examples/CRISP/Cargo.lock +++ b/examples/CRISP/Cargo.lock @@ -272,6 +272,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "aligned-vec" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b" +dependencies = [ + "equator", +] + [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -1128,7 +1137,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -1139,7 +1148,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -1704,6 +1713,12 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" + [[package]] name = "byteorder" version = "1.5.0" @@ -2059,7 +2074,7 @@ dependencies = [ "log", "num-bigint", "once_cell", - "rand 0.8.5", + "rand 0.9.2", "reqwest", "serde", "serde_json", @@ -2086,6 +2101,7 @@ dependencies = [ "e3-fhe-params", "e3-polynomial", "getrandom 0.2.17", + "getrandom 0.3.4", "js-sys", "num-bigint", "serde_json", @@ -2362,7 +2378,7 @@ dependencies = [ "e3-zk-helpers", "fhe", "fhe-traits", - "rand 0.8.5", + "rand 0.9.2", "thiserror 1.0.69", ] @@ -2421,8 +2437,8 @@ dependencies = [ "fhe", "num-bigint", "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", "serde", "thiserror 1.0.69", ] @@ -2457,7 +2473,6 @@ name = "e3-polynomial" version = "0.1.15" dependencies = [ "fhe-math", - "ndarray", "num-bigint", "num-traits", "serde", @@ -2532,8 +2547,8 @@ dependencies = [ "e3-committee-hash", "e3-utils-derive", "hex", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", "regex", "serde", "tokio", @@ -2571,7 +2586,7 @@ dependencies = [ "num-bigint", "num-integer", "num-traits", - "rand 0.8.5", + "rand 0.9.2", "rayon", "serde", "serde_json", @@ -2693,6 +2708,26 @@ dependencies = [ "log", ] +[[package]] +name = "equator" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc" +dependencies = [ + "equator-macro", +] + +[[package]] +name = "equator-macro" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" +dependencies = [ + "proc-macro2 1.0.106", + "quote 1.0.44", + "syn 2.0.116", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -2706,7 +2741,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -2774,71 +2809,73 @@ dependencies = [ [[package]] name = "fhe" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#5f24d0b62a7329b789db07a065b68accd614a47b" +version = "0.2.0" +source = "git+https://github.com/gnosisguild/fhe.rs#a92478b39625f4c18b91a5033928b35d8a0090cf" dependencies = [ "bincode", "doc-comment", "fhe-math", "fhe-traits", "fhe-util", - "itertools 0.12.1", + "itertools 0.14.0", "ndarray", "num-bigint", "num-traits", "prost", "prost-build", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", "rand_distr", "rayon", "serde", - "thiserror 1.0.69", + "thiserror 2.0.18", "zeroize", "zeroize_derive", ] [[package]] name = "fhe-math" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#5f24d0b62a7329b789db07a065b68accd614a47b" +version = "0.2.0" +source = "git+https://github.com/gnosisguild/fhe.rs#a92478b39625f4c18b91a5033928b35d8a0090cf" dependencies = [ "ethnum", "fhe-traits", "fhe-util", - "itertools 0.12.1", + "itertools 0.14.0", "ndarray", "num-bigint", "num-bigint-dig", "num-traits", "prost", "prost-build", - "rand 0.8.5", - "rand_chacha 0.3.1", + "pulp", + "rand 0.9.2", + "rand_chacha 0.9.0", "serde", "sha2", - "thiserror 1.0.69", + "tfhe-ntt", + "thiserror 2.0.18", "zeroize", ] [[package]] name = "fhe-traits" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#5f24d0b62a7329b789db07a065b68accd614a47b" +version = "0.1.1" +source = "git+https://github.com/gnosisguild/fhe.rs#a92478b39625f4c18b91a5033928b35d8a0090cf" dependencies = [ - "rand 0.8.5", + "rand 0.9.2", ] [[package]] name = "fhe-util" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#5f24d0b62a7329b789db07a065b68accd614a47b" +version = "0.1.1" +source = "git+https://github.com/gnosisguild/fhe.rs#a92478b39625f4c18b91a5033928b35d8a0090cf" dependencies = [ - "itertools 0.12.1", "num-bigint-dig", "num-traits", "prime_factorization", "rand 0.8.5", + "rand 0.9.2", "rand_distr", "rayon", ] @@ -2863,9 +2900,9 @@ dependencies = [ [[package]] name = "fixedbitset" -version = "0.4.2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "flate2" @@ -3611,15 +3648,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -3743,9 +3771,6 @@ name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -dependencies = [ - "spin", -] [[package]] name = "lean-imt" @@ -3942,14 +3967,16 @@ dependencies = [ [[package]] name = "ndarray" -version = "0.15.6" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d" dependencies = [ "matrixmultiply", "num-complex", "num-integer", "num-traits", + "portable-atomic", + "portable-atomic-util", "rawpointer", "serde", ] @@ -3992,16 +4019,16 @@ dependencies = [ [[package]] name = "num-bigint-dig" -version = "0.8.6" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7" +checksum = "a7f9a86e097b0d187ad0e65667c2f58b9254671e86e7dbb78036b16692eae099" dependencies = [ - "lazy_static", "libm", "num-integer", "num-iter", "num-traits", - "rand 0.8.5", + "once_cell", + "rand 0.9.2", "serde", "smallvec", ] @@ -4012,6 +4039,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ + "bytemuck", "num-traits", ] @@ -4321,11 +4349,12 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" dependencies = [ "fixedbitset", + "hashbrown 0.15.5", "indexmap 2.13.0", ] @@ -4528,9 +4557,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.6" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +checksum = "d2ea70524a2f82d518bce41317d0fae74151505651af45faf1ffbd6fd33f0568" dependencies = [ "bytes", "prost-derive", @@ -4538,16 +4567,14 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.6" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +checksum = "343d3bd7056eda839b03204e68deff7d1b13aba7af2b2fd16890697274262ee7" dependencies = [ - "bytes", "heck", - "itertools 0.12.1", + "itertools 0.14.0", "log", "multimap", - "once_cell", "petgraph", "prettyplease", "prost", @@ -4559,12 +4586,12 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.6" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools 0.14.0", "proc-macro2 1.0.106", "quote 1.0.44", "syn 2.0.116", @@ -4572,13 +4599,36 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.6" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" dependencies = [ "prost", ] +[[package]] +name = "pulp" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e205bb30d5b916c55e584c22201771bcf2bad9aabd5d4127f38387140c38632" +dependencies = [ + "bytemuck", + "cfg-if 1.0.4", + "libm", + "num-complex", + "paste", + "pulp-wasm-simd-flag", + "raw-cpuid", + "reborrow", + "version_check", +] + +[[package]] +name = "pulp-wasm-simd-flag" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40e24eee682d89fb193496edf918a7f407d30175b2e785fe057e4392dfd182e0" + [[package]] name = "quick-error" version = "1.2.3" @@ -4734,12 +4784,12 @@ dependencies = [ [[package]] name = "rand_distr" -version = "0.4.3" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +checksum = "6a8615d50dcf34fa31f7ab52692afec947c4dd0ab803cc87cb3b0b4570ff7463" dependencies = [ "num-traits", - "rand 0.8.5", + "rand 0.9.2", ] [[package]] @@ -4751,6 +4801,15 @@ dependencies = [ "rand_core 0.9.5", ] +[[package]] +name = "raw-cpuid" +version = "11.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" +dependencies = [ + "bitflags 2.11.0", +] + [[package]] name = "rawpointer" version = "0.2.1" @@ -4777,6 +4836,12 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "reborrow" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03251193000f4bd3b042892be858ee50e8b3719f2b08e5833ac4353724632430" + [[package]] name = "recvmsg" version = "1.0.0" @@ -5036,7 +5101,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -5479,12 +5544,6 @@ dependencies = [ "windows-sys 0.60.2", ] -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "spki" version = "0.7.3" @@ -5644,7 +5703,18 @@ dependencies = [ "getrandom 0.3.4", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.61.2", +] + +[[package]] +name = "tfhe-ntt" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10650c743ade46b166c698c8349902ed5986784a7db418c51f810bea25f09e3d" +dependencies = [ + "aligned-vec", + "bytemuck", + "pulp", ] [[package]] @@ -6795,7 +6865,7 @@ dependencies = [ "itertools 0.14.0", "num-bigint", "num-traits", - "rand 0.8.5", + "rand 0.9.2", "rayon", "serde", "serde_json", diff --git a/examples/CRISP/Cargo.toml b/examples/CRISP/Cargo.toml index ba7b78b1c9..63909ef6cf 100644 --- a/examples/CRISP/Cargo.toml +++ b/examples/CRISP/Cargo.toml @@ -49,8 +49,8 @@ serde = { version = "=1.0.228", features = ["derive", "std"] } serde_json = "=1.0.141" fhe = { git = "https://github.com/gnosisguild/fhe.rs" } fhe-traits = { git = "https://github.com/gnosisguild/fhe.rs" } -fhe-math = { git = "https://github.com/gnosisguild/fhe.rs.git" } +fhe-math = { git = "https://github.com/gnosisguild/fhe.rs" } fhe-util = { git = "https://github.com/gnosisguild/fhe.rs" } tokio = { version = "=1.46.1", features = ["full"] } -rand = { version = "=0.8.5" } +rand = { version = "0.9" } tracing-subscriber = { version = "=0.3.19", features = ["env-filter"] } diff --git a/examples/CRISP/Dockerfile b/examples/CRISP/Dockerfile index bfc356a4ef..89a7b0056e 100644 --- a/examples/CRISP/Dockerfile +++ b/examples/CRISP/Dockerfile @@ -4,7 +4,7 @@ FROM ubuntu:24.04 ARG CPP_VERSION=2024.1.5 -ARG RUST_VERSION=1.86.0 +ARG RUST_VERSION=1.91.1 # ──────────────────────────────────────────────────────────────────────────────── # OS packages diff --git a/examples/CRISP/crates/zk-inputs-wasm/Cargo.toml b/examples/CRISP/crates/zk-inputs-wasm/Cargo.toml index c82c87f3b6..63e5fee47c 100644 --- a/examples/CRISP/crates/zk-inputs-wasm/Cargo.toml +++ b/examples/CRISP/crates/zk-inputs-wasm/Cargo.toml @@ -15,7 +15,8 @@ zk-inputs = { path = "../zk-inputs" } wasm-bindgen = "0.2" js-sys = "0.3" web-sys = "0.3" -getrandom = { version = "0.2", features = ["js"] } +getrandom = { version = "0.3", features = ["wasm_js"] } +getrandom2 = { package = "getrandom", version = "0.2", features = ["js"] } serde_json.workspace = true num-bigint = "0.4.6" diff --git a/examples/CRISP/crates/zk-inputs/Cargo.toml b/examples/CRISP/crates/zk-inputs/Cargo.toml index e5f9cf1304..e6b1d556d1 100644 --- a/examples/CRISP/crates/zk-inputs/Cargo.toml +++ b/examples/CRISP/crates/zk-inputs/Cargo.toml @@ -20,7 +20,7 @@ serde_json.workspace = true num-bigint = "0.4.6" num-traits = "0.2" rayon = "1.10.0" -rand = "0.8.5" +rand = "0.9" hex = "0.4.3" itertools = "0.14.0" eyre.workspace = true diff --git a/examples/CRISP/crates/zk-inputs/src/ciphertext_addition.rs b/examples/CRISP/crates/zk-inputs/src/ciphertext_addition.rs index 5fea64ddb5..c99e206a2c 100644 --- a/examples/CRISP/crates/zk-inputs/src/ciphertext_addition.rs +++ b/examples/CRISP/crates/zk-inputs/src/ciphertext_addition.rs @@ -48,12 +48,12 @@ impl CiphertextAdditionWitness { let moduli = params.moduli(); let mut crt_polynomials = [ - CrtPolynomial::from_fhe_polynomial(&prev_ct.c[0]), - CrtPolynomial::from_fhe_polynomial(&prev_ct.c[1]), - CrtPolynomial::from_fhe_polynomial(&ct.c[0]), - CrtPolynomial::from_fhe_polynomial(&ct.c[1]), - CrtPolynomial::from_fhe_polynomial(&sum_ct.c[0]), - CrtPolynomial::from_fhe_polynomial(&sum_ct.c[1]), + CrtPolynomial::from_fhe_polynomial(&prev_ct[0]), + CrtPolynomial::from_fhe_polynomial(&prev_ct[1]), + CrtPolynomial::from_fhe_polynomial(&ct[0]), + CrtPolynomial::from_fhe_polynomial(&ct[1]), + CrtPolynomial::from_fhe_polynomial(&sum_ct[0]), + CrtPolynomial::from_fhe_polynomial(&sum_ct[1]), ]; // fhe-math stores coefficients in ascending degree (c_0, c_1, …). But here we want diff --git a/examples/CRISP/crates/zk-inputs/src/lib.rs b/examples/CRISP/crates/zk-inputs/src/lib.rs index 58e48aaf93..cb23c356f8 100644 --- a/examples/CRISP/crates/zk-inputs/src/lib.rs +++ b/examples/CRISP/crates/zk-inputs/src/lib.rs @@ -28,7 +28,7 @@ use fhe_traits::FheDecrypter; use fhe_traits::{DeserializeParametrized, FheEncoder, Serialize}; use num_bigint::BigInt; use num_traits::Zero; -use rand::thread_rng; +use rand::rng; use std::sync::Arc; mod ciphertext_addition; mod utils; @@ -215,7 +215,7 @@ impl ZKInputsGenerator { .with_context(|| "Failed to encode plaintext")?; let (ct, _u_rns, _e0_rns, _e1_rns) = pk - .try_encrypt_extended(&pt, &mut thread_rng()) + .try_encrypt_extended(&pt, &mut rng()) .with_context(|| "Failed to encrypt plaintext")?; Ok(ct.to_bytes()) @@ -253,7 +253,7 @@ impl ZKInputsGenerator { /// Tuple containing the secret key bytes and public key bytes pub fn generate_keys(&self) -> Result<(Vec, Vec)> { // Generate keys. - let mut rng = thread_rng(); + let mut rng = rng(); let sk = SecretKey::random(&self.bfv_params, &mut rng); let pk = PublicKey::new(&sk, &mut rng); diff --git a/examples/CRISP/packages/crisp-zk-inputs/package.json b/examples/CRISP/packages/crisp-zk-inputs/package.json index 975565df73..2fa67e3d12 100644 --- a/examples/CRISP/packages/crisp-zk-inputs/package.json +++ b/examples/CRISP/packages/crisp-zk-inputs/package.json @@ -26,10 +26,12 @@ "access": "public" }, "scripts": { - "build": "rm -rf dist && node scripts/build.js" + "build": "rm -rf dist && node scripts/build.js", + "test:browser": "node scripts/browser-smoke.mjs" }, "devDependencies": { "execa": "^8.0.1", + "playwright": "1.52.0", "replace-in-file": "^7.2.0", "wasm-pack": "^0.13.1" } diff --git a/examples/CRISP/packages/crisp-zk-inputs/scripts/browser-smoke.mjs b/examples/CRISP/packages/crisp-zk-inputs/scripts/browser-smoke.mjs new file mode 100644 index 0000000000..49d17fea50 --- /dev/null +++ b/examples/CRISP/packages/crisp-zk-inputs/scripts/browser-smoke.mjs @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: LGPL-3.0-only +// +// Browser smoke test: load crisp-zk-inputs WASM in headless Chrome and encrypt once. + +import { createServer } from 'node:http' +import { readFile } from 'node:fs/promises' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { chromium } from 'playwright' + +const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '..') + +const mime = { + '.html': 'text/html; charset=utf-8', + '.js': 'text/javascript; charset=utf-8', +} + +function startServer() { + return new Promise((resolve) => { + const server = createServer(async (req, res) => { + try { + const urlPath = req.url?.split('?')[0] ?? '/' + const rel = urlPath === '/' ? '/smoke.html' : urlPath + const filePath = path.join(root, rel) + if (!filePath.startsWith(root)) { + res.writeHead(403) + res.end() + return + } + const body = await readFile(filePath) + const ext = path.extname(filePath) + res.writeHead(200, { 'Content-Type': mime[ext] ?? 'application/octet-stream' }) + res.end(body) + } catch { + res.writeHead(404) + res.end() + } + }) + server.listen(0, '127.0.0.1', () => { + const { port } = server.address() + resolve({ server, port }) + }) + }) +} + +async function main() { + const { server, port } = await startServer() + const launchOptions = { headless: true } + if (process.env.CHROME_BIN) { + launchOptions.executablePath = process.env.CHROME_BIN + } + + try { + const browser = await chromium.launch(launchOptions) + const page = await browser.newPage() + page.on('pageerror', (err) => console.error('page error:', err)) + + await page.goto(`http://127.0.0.1:${port}/smoke.html`, { waitUntil: 'networkidle' }) + await page.waitForFunction(() => window.__wasmSmoke !== undefined, null, { timeout: 180_000 }) + + const result = await page.evaluate(() => window.__wasmSmoke) + if (result !== 'ok') { + throw new Error(`WASM smoke failed: ${result}`) + } + console.log('crisp-zk-inputs browser smoke: ok (generateKeys + encryptVote)') + await browser.close() + } finally { + server.close() + } +} + +main().catch((err) => { + console.error(err) + process.exit(1) +}) diff --git a/examples/CRISP/packages/crisp-zk-inputs/smoke.html b/examples/CRISP/packages/crisp-zk-inputs/smoke.html new file mode 100644 index 0000000000..ada6698df4 --- /dev/null +++ b/examples/CRISP/packages/crisp-zk-inputs/smoke.html @@ -0,0 +1,32 @@ + + + + + crisp-zk-inputs browser smoke + + + + + diff --git a/examples/CRISP/rust-toolchain.toml b/examples/CRISP/rust-toolchain.toml index 8ac30442c3..1c491a3590 100644 --- a/examples/CRISP/rust-toolchain.toml +++ b/examples/CRISP/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.86.0" +channel = "1.91.1" components = ["rustfmt", "rust-src"] profile = "minimal" diff --git a/examples/CRISP/server/Cargo.toml b/examples/CRISP/server/Cargo.toml index 51ff572e15..2ed3ac4396 100644 --- a/examples/CRISP/server/Cargo.toml +++ b/examples/CRISP/server/Cargo.toml @@ -3,7 +3,7 @@ name = "crisp" version = { workspace = true } edition = { workspace = true } resolver = "3" -rust-version = "1.86.0" +rust-version = "1.91.1" [[bin]] name = "server" diff --git a/examples/CRISP/server/Dockerfile b/examples/CRISP/server/Dockerfile index c8fd2bc4b3..33127da3bf 100644 --- a/examples/CRISP/server/Dockerfile +++ b/examples/CRISP/server/Dockerfile @@ -1,5 +1,5 @@ ############### stage 0: base-dev ############### -ARG RUST_VERSION=1.88.0 +ARG RUST_VERSION=1.91.1 ARG SKIP_SOLIDITY=0 FROM rust:${RUST_VERSION}-slim-bullseye AS base-dev @@ -8,7 +8,7 @@ ENV CARGO_HOME=/usr/local/cargo RUN apt-get update && \ apt-get install -y --no-install-recommends \ - jq pkg-config libssl-dev curl wget ca-certificates && \ + jq pkg-config libssl-dev curl wget ca-certificates protobuf-compiler && \ rm -rf /var/lib/apt/lists/* RUN wget https://github.com/argotorg/solidity/releases/download/v0.8.27/solc-static-linux \ diff --git a/packages/enclave-contracts/deployed_contracts.json b/packages/enclave-contracts/deployed_contracts.json index 8dc23a00ac..da39132d29 100644 --- a/packages/enclave-contracts/deployed_contracts.json +++ b/packages/enclave-contracts/deployed_contracts.json @@ -125,4 +125,4 @@ "address": "0xB37D0DFc2967423786466489A5E44fe6b3b0c116" } } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0cd3f4d710..2e46ec978a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,6 +63,9 @@ importers: execa: specifier: ^8.0.1 version: 8.0.1 + playwright: + specifier: 1.52.0 + version: 1.52.0 replace-in-file: specifier: ^7.2.0 version: 7.2.0 @@ -171,7 +174,7 @@ importers: version: 1.13.2 connectkit: specifier: ^1.9.0 - version: 1.9.1(@babel/core@7.28.5)(@tanstack/react-query@5.90.6(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)) + version: 1.9.1(@babel/core@7.28.5)(@tanstack/react-query@5.90.6(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76)) ethers: specifier: ^6.12.0 version: 6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) @@ -192,7 +195,7 @@ importers: version: 15.6.6(react@18.3.1) viem: specifier: 2.38.6 - version: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) + version: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) vite-plugin-node-polyfills: specifier: ^0.22.0 version: 0.22.0(rollup@4.52.5)(vite@5.4.21(@types/node@22.7.5)) @@ -204,7 +207,7 @@ importers: version: 4.3.2(typescript@5.8.3)(vite@5.4.21(@types/node@22.7.5)) wagmi: specifier: ^2.14.16 - version: 2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) + version: 2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76) devDependencies: '@tailwindcss/typography': specifier: ^0.5.12 @@ -344,7 +347,7 @@ importers: version: 5.8.3 viem: specifier: 2.38.6 - version: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + version: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) examples/CRISP/packages/crisp-sdk: dependencies: @@ -397,6 +400,9 @@ importers: execa: specifier: ^8.0.1 version: 8.0.1 + playwright: + specifier: 1.52.0 + version: 1.52.0 replace-in-file: specifier: ^7.2.0 version: 7.2.0 @@ -535,7 +541,7 @@ importers: version: 3.0.11(bufferutil@4.0.9)(utf-8-validate@5.0.10) hardhat-gas-reporter: specifier: ^2.2.0 - version: 2.3.0(bufferutil@4.0.9)(hardhat@3.0.11(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typescript@5.8.3)(utf-8-validate@5.0.10) + version: 2.3.0(bufferutil@4.0.9)(hardhat@3.0.11(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) lodash: specifier: ^4.17.21 version: 4.17.21 @@ -639,7 +645,7 @@ importers: version: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) wagmi: specifier: ^2.14.16 - version: 2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) + version: 2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) devDependencies: '@enclave-e3/config': specifier: workspace:* @@ -3316,6 +3322,7 @@ packages: '@safe-global/safe-gateway-typescript-sdk@3.23.1': resolution: {integrity: sha512-6ORQfwtEJYpalCeVO21L4XXGSdbEMfyp2hEv6cP82afKXSwvse6d3sdelgaPWUxHIsFRkWvHDdzh8IyyKHZKxw==} engines: {node: '>=16'} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. '@scure/base@1.1.9': resolution: {integrity: sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==} @@ -4226,6 +4233,7 @@ packages: '@ungap/structured-clone@1.3.0': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} + deprecated: Potential CWE-502 - Update to 1.3.1 or higher '@viem/anvil@0.0.7': resolution: {integrity: sha512-F+3ljCT1bEt8T4Fzm9gWpIgO3Dc7bzG1TtUtkStkJFMuummqZ8kvYc3UFMo5j3F51fSWZZvEkjs3+i7qf0AOqQ==} @@ -9770,14 +9778,17 @@ packages: uuid@10.0.0: resolution: {integrity: sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==} + deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). hasBin: true uuid@8.3.2: resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). hasBin: true uuid@9.0.1: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} + deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). hasBin: true uvu@0.5.6: @@ -11094,16 +11105,16 @@ snapshots: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.28.5 - '@base-org/account@2.4.0(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(utf-8-validate@5.0.10)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)': + '@base-org/account@2.4.0(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(utf-8-validate@5.0.10)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76)': dependencies: '@coinbase/cdp-sdk': 1.38.5(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)(utf-8-validate@5.0.10)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@noble/hashes': 1.4.0 clsx: 1.2.1 eventemitter3: 5.0.1 idb-keyval: 6.2.1 - ox: 0.6.9(typescript@5.8.3)(zod@4.1.12) + ox: 0.6.9(typescript@5.8.3)(zod@3.25.76) preact: 10.24.2 - viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) zustand: 5.0.3(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(use-sync-external-store@1.4.0(react@18.3.1)) transitivePeerDependencies: - '@types/react' @@ -11206,6 +11217,26 @@ snapshots: transitivePeerDependencies: - supports-color + '@coinbase/wallet-sdk@4.3.6(@types/react@18.3.26)(bufferutil@4.0.9)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@noble/hashes': 1.4.0 + clsx: 1.2.1 + eventemitter3: 5.0.1 + idb-keyval: 6.2.1 + ox: 0.6.9(typescript@5.8.3)(zod@3.25.76) + preact: 10.24.2 + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + zustand: 5.0.3(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(use-sync-external-store@1.4.0(react@18.3.1)) + transitivePeerDependencies: + - '@types/react' + - bufferutil + - immer + - react + - typescript + - use-sync-external-store + - utf-8-validate + - zod + '@coinbase/wallet-sdk@4.3.6(@types/react@18.3.26)(bufferutil@4.0.9)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: '@noble/hashes': 1.4.0 @@ -11918,6 +11949,14 @@ snapshots: '@semaphore-protocol/contracts': 4.14.0 solady: 0.1.4 + '@gemini-wallet/core@0.3.1(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))': + dependencies: + '@metamask/rpc-errors': 7.0.2 + eventemitter3: 5.0.1 + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + transitivePeerDependencies: + - supports-color + '@gemini-wallet/core@0.3.1(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))': dependencies: '@metamask/rpc-errors': 7.0.2 @@ -13006,6 +13045,17 @@ snapshots: - utf-8-validate - zod + '@reown/appkit-common@1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + big.js: 6.2.2 + dayjs: 1.11.13 + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + transitivePeerDependencies: + - bufferutil + - typescript + - utf-8-validate + - zod + '@reown/appkit-common@1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: big.js: 6.2.2 @@ -13017,6 +13067,41 @@ snapshots: - utf-8-validate - zod + '@reown/appkit-controllers@1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@reown/appkit-common': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-wallet': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10) + '@walletconnect/universal-provider': 2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + valtio: 1.13.2(@types/react@18.3.26)(react@18.3.1) + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - react + - typescript + - uploadthing + - utf-8-validate + - zod + '@reown/appkit-controllers@1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: '@reown/appkit-common': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) @@ -13052,6 +13137,42 @@ snapshots: - utf-8-validate - zod + '@reown/appkit-pay@1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@reown/appkit-common': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-controllers': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-ui': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-utils': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(valtio@1.13.2(@types/react@18.3.26)(react@18.3.1))(zod@3.25.76) + lit: 3.3.0 + valtio: 1.13.2(@types/react@18.3.26)(react@18.3.1) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - react + - typescript + - uploadthing + - utf-8-validate + - zod + '@reown/appkit-pay@1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: '@reown/appkit-common': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) @@ -13092,6 +13213,43 @@ snapshots: dependencies: buffer: 6.0.3 + '@reown/appkit-scaffold-ui@1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(valtio@1.13.2(@types/react@18.3.26)(react@18.3.1))(zod@3.25.76)': + dependencies: + '@reown/appkit-common': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-controllers': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-ui': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-utils': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(valtio@1.13.2(@types/react@18.3.26)(react@18.3.1))(zod@3.25.76) + '@reown/appkit-wallet': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10) + lit: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - react + - typescript + - uploadthing + - utf-8-validate + - valtio + - zod + '@reown/appkit-scaffold-ui@1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(valtio@1.13.2(@types/react@18.3.26)(react@18.3.1))(zod@4.1.12)': dependencies: '@reown/appkit-common': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) @@ -13129,6 +13287,41 @@ snapshots: - valtio - zod + '@reown/appkit-ui@1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@reown/appkit-common': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-controllers': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-wallet': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10) + lit: 3.3.0 + qrcode: 1.5.3 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - react + - typescript + - uploadthing + - utf-8-validate + - zod + '@reown/appkit-ui@1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: '@reown/appkit-common': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) @@ -13164,6 +13357,44 @@ snapshots: - utf-8-validate - zod + '@reown/appkit-utils@1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(valtio@1.13.2(@types/react@18.3.26)(react@18.3.1))(zod@3.25.76)': + dependencies: + '@reown/appkit-common': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-controllers': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-polyfills': 1.7.8 + '@reown/appkit-wallet': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10) + '@walletconnect/logger': 2.1.2 + '@walletconnect/universal-provider': 2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + valtio: 1.13.2(@types/react@18.3.26)(react@18.3.1) + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - react + - typescript + - uploadthing + - utf-8-validate + - zod + '@reown/appkit-utils@1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(valtio@1.13.2(@types/react@18.3.26)(react@18.3.1))(zod@4.1.12)': dependencies: '@reown/appkit-common': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) @@ -13213,6 +13444,49 @@ snapshots: - typescript - utf-8-validate + '@reown/appkit@1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@reown/appkit-common': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-controllers': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-pay': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-polyfills': 1.7.8 + '@reown/appkit-scaffold-ui': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(valtio@1.13.2(@types/react@18.3.26)(react@18.3.1))(zod@3.25.76) + '@reown/appkit-ui': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@reown/appkit-utils': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(valtio@1.13.2(@types/react@18.3.26)(react@18.3.1))(zod@3.25.76) + '@reown/appkit-wallet': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10) + '@walletconnect/types': 2.21.0 + '@walletconnect/universal-provider': 2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + bs58: 6.0.0 + valtio: 1.13.2(@types/react@18.3.26)(react@18.3.1) + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - react + - typescript + - uploadthing + - utf-8-validate + - zod + '@reown/appkit@1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: '@reown/appkit-common': 1.7.8(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) @@ -13385,9 +13659,9 @@ snapshots: transitivePeerDependencies: - '@types/node' - '@safe-global/safe-apps-provider@0.18.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': + '@safe-global/safe-apps-provider@0.18.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': dependencies: - '@safe-global/safe-apps-sdk': 9.1.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) + '@safe-global/safe-apps-sdk': 9.1.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) events: 3.3.0 transitivePeerDependencies: - bufferutil @@ -13395,10 +13669,30 @@ snapshots: - utf-8-validate - zod - '@safe-global/safe-apps-sdk@9.1.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': + '@safe-global/safe-apps-provider@0.18.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: - '@safe-global/safe-gateway-typescript-sdk': 3.23.1 - viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) + '@safe-global/safe-apps-sdk': 9.1.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) + events: 3.3.0 + transitivePeerDependencies: + - bufferutil + - typescript + - utf-8-validate + - zod + + '@safe-global/safe-apps-sdk@9.1.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@safe-global/safe-gateway-typescript-sdk': 3.23.1 + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + transitivePeerDependencies: + - bufferutil + - typescript + - utf-8-validate + - zod + + '@safe-global/safe-apps-sdk@9.1.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': + dependencies: + '@safe-global/safe-gateway-typescript-sdk': 3.23.1 + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) transitivePeerDependencies: - bufferutil - typescript @@ -14836,9 +15130,9 @@ snapshots: '@vue/shared@3.5.22': {} - '@wagmi/connectors@6.1.3(0b1a0c7e1852d0f2478f1048dd2722c1)': + '@wagmi/connectors@6.1.3(615998432ed1538eed571631714b7da2)': dependencies: - '@base-org/account': 2.4.0(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(utf-8-validate@5.0.10)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) + '@base-org/account': 2.4.0(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(utf-8-validate@5.0.10)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) '@coinbase/wallet-sdk': 4.3.6(@types/react@18.3.26)(bufferutil@4.0.9)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(utf-8-validate@5.0.10)(zod@4.1.12) '@gemini-wallet/core': 0.3.1(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)) '@metamask/sdk': 0.33.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) @@ -14847,7 +15141,7 @@ snapshots: '@wagmi/core': 2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)) '@walletconnect/ethereum-provider': 2.21.1(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) cbw-sdk: '@coinbase/wallet-sdk@3.9.3' - porto: 0.2.35(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(@wagmi/core@2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)))(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)) + porto: 0.2.35(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(@wagmi/core@2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)))(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)) viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) optionalDependencies: typescript: 5.8.3 @@ -14890,19 +15184,19 @@ snapshots: - ws - zod - '@wagmi/connectors@6.1.3(615998432ed1538eed571631714b7da2)': + '@wagmi/connectors@6.1.3(d4aa626e1ce01c77feebfbcfe6b62584)': dependencies: - '@base-org/account': 2.4.0(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(utf-8-validate@5.0.10)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) - '@coinbase/wallet-sdk': 4.3.6(@types/react@18.3.26)(bufferutil@4.0.9)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(utf-8-validate@5.0.10)(zod@4.1.12) - '@gemini-wallet/core': 0.3.1(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)) + '@base-org/account': 2.4.0(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(utf-8-validate@5.0.10)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76) + '@coinbase/wallet-sdk': 4.3.6(@types/react@18.3.26)(bufferutil@4.0.9)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(utf-8-validate@5.0.10)(zod@3.25.76) + '@gemini-wallet/core': 0.3.1(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)) '@metamask/sdk': 0.33.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) - '@safe-global/safe-apps-provider': 0.18.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) - '@safe-global/safe-apps-sdk': 9.1.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) - '@wagmi/core': 2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)) - '@walletconnect/ethereum-provider': 2.21.1(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) + '@safe-global/safe-apps-provider': 0.18.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@safe-global/safe-apps-sdk': 9.1.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@wagmi/core': 2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)) + '@walletconnect/ethereum-provider': 2.21.1(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) cbw-sdk: '@coinbase/wallet-sdk@3.9.3' - porto: 0.2.35(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(@wagmi/core@2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)))(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)) - viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) + porto: 0.2.35(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(@wagmi/core@2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)))(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76)) + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) optionalDependencies: typescript: 5.8.3 transitivePeerDependencies: @@ -14944,6 +15238,21 @@ snapshots: - ws - zod + '@wagmi/core@2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))': + dependencies: + eventemitter3: 5.0.1 + mipd: 0.0.7(typescript@5.8.3) + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + zustand: 5.0.0(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(use-sync-external-store@1.4.0(react@18.3.1)) + optionalDependencies: + '@tanstack/query-core': 5.90.6 + typescript: 5.8.3 + transitivePeerDependencies: + - '@types/react' + - immer + - react + - use-sync-external-store + '@wagmi/core@2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))': dependencies: eventemitter3: 5.0.1 @@ -14959,6 +15268,50 @@ snapshots: - react - use-sync-external-store + '@walletconnect/core@2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@walletconnect/heartbeat': 1.2.2 + '@walletconnect/jsonrpc-provider': 1.0.14 + '@walletconnect/jsonrpc-types': 1.0.4 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/jsonrpc-ws-connection': 1.0.16(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@walletconnect/keyvaluestorage': 1.1.1 + '@walletconnect/logger': 2.1.2 + '@walletconnect/relay-api': 1.0.11 + '@walletconnect/relay-auth': 1.1.0 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.21.0 + '@walletconnect/utils': 2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@walletconnect/window-getters': 1.0.1 + es-toolkit: 1.33.0 + events: 3.3.0 + uint8arrays: 3.1.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - ioredis + - typescript + - uploadthing + - utf-8-validate + - zod + '@walletconnect/core@2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: '@walletconnect/heartbeat': 1.2.2 @@ -15003,6 +15356,50 @@ snapshots: - utf-8-validate - zod + '@walletconnect/core@2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@walletconnect/heartbeat': 1.2.2 + '@walletconnect/jsonrpc-provider': 1.0.14 + '@walletconnect/jsonrpc-types': 1.0.4 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/jsonrpc-ws-connection': 1.0.16(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@walletconnect/keyvaluestorage': 1.1.1 + '@walletconnect/logger': 2.1.2 + '@walletconnect/relay-api': 1.0.11 + '@walletconnect/relay-auth': 1.1.0 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.21.1 + '@walletconnect/utils': 2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@walletconnect/window-getters': 1.0.1 + es-toolkit: 1.33.0 + events: 3.3.0 + uint8arrays: 3.1.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - ioredis + - typescript + - uploadthing + - utf-8-validate + - zod + '@walletconnect/core@2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: '@walletconnect/heartbeat': 1.2.2 @@ -15051,6 +15448,47 @@ snapshots: dependencies: tslib: 1.14.1 + '@walletconnect/ethereum-provider@2.21.1(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@reown/appkit': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@walletconnect/jsonrpc-http-connection': 1.0.8 + '@walletconnect/jsonrpc-provider': 1.0.14 + '@walletconnect/jsonrpc-types': 1.0.4 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/keyvaluestorage': 1.1.1 + '@walletconnect/sign-client': 2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@walletconnect/types': 2.21.1 + '@walletconnect/universal-provider': 2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@walletconnect/utils': 2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - react + - typescript + - uploadthing + - utf-8-validate + - zod + '@walletconnect/ethereum-provider@2.21.1(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: '@reown/appkit': 1.7.8(@types/react@18.3.26)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) @@ -15185,6 +15623,42 @@ snapshots: dependencies: tslib: 1.14.1 + '@walletconnect/sign-client@2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@walletconnect/core': 2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@walletconnect/events': 1.0.1 + '@walletconnect/heartbeat': 1.2.2 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/logger': 2.1.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.21.0 + '@walletconnect/utils': 2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - ioredis + - typescript + - uploadthing + - utf-8-validate + - zod + '@walletconnect/sign-client@2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: '@walletconnect/core': 2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) @@ -15221,6 +15695,42 @@ snapshots: - utf-8-validate - zod + '@walletconnect/sign-client@2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@walletconnect/core': 2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@walletconnect/events': 1.0.1 + '@walletconnect/heartbeat': 1.2.2 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/logger': 2.1.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.21.1 + '@walletconnect/utils': 2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - ioredis + - typescript + - uploadthing + - utf-8-validate + - zod + '@walletconnect/sign-client@2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: '@walletconnect/core': 2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) @@ -15319,6 +15829,46 @@ snapshots: - ioredis - uploadthing + '@walletconnect/universal-provider@2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@walletconnect/events': 1.0.1 + '@walletconnect/jsonrpc-http-connection': 1.0.8 + '@walletconnect/jsonrpc-provider': 1.0.14 + '@walletconnect/jsonrpc-types': 1.0.4 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/keyvaluestorage': 1.1.1 + '@walletconnect/logger': 2.1.2 + '@walletconnect/sign-client': 2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@walletconnect/types': 2.21.0 + '@walletconnect/utils': 2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + es-toolkit: 1.33.0 + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - typescript + - uploadthing + - utf-8-validate + - zod + '@walletconnect/universal-provider@2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: '@walletconnect/events': 1.0.1 @@ -15359,6 +15909,46 @@ snapshots: - utf-8-validate - zod + '@walletconnect/universal-provider@2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@walletconnect/events': 1.0.1 + '@walletconnect/jsonrpc-http-connection': 1.0.8 + '@walletconnect/jsonrpc-provider': 1.0.14 + '@walletconnect/jsonrpc-types': 1.0.4 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/keyvaluestorage': 1.1.1 + '@walletconnect/logger': 2.1.2 + '@walletconnect/sign-client': 2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@walletconnect/types': 2.21.1 + '@walletconnect/utils': 2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + es-toolkit: 1.33.0 + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - typescript + - uploadthing + - utf-8-validate + - zod + '@walletconnect/universal-provider@2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: '@walletconnect/events': 1.0.1 @@ -15399,6 +15989,50 @@ snapshots: - utf-8-validate - zod + '@walletconnect/utils@2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@noble/ciphers': 1.2.1 + '@noble/curves': 1.8.1 + '@noble/hashes': 1.7.1 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/keyvaluestorage': 1.1.1 + '@walletconnect/relay-api': 1.0.11 + '@walletconnect/relay-auth': 1.1.0 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.21.0 + '@walletconnect/window-getters': 1.0.1 + '@walletconnect/window-metadata': 1.0.1 + bs58: 6.0.0 + detect-browser: 5.3.0 + query-string: 7.1.3 + uint8arrays: 3.1.0 + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - ioredis + - typescript + - uploadthing + - utf-8-validate + - zod + '@walletconnect/utils@2.21.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: '@noble/ciphers': 1.2.1 @@ -15443,6 +16077,50 @@ snapshots: - utf-8-validate - zod + '@walletconnect/utils@2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)': + dependencies: + '@noble/ciphers': 1.2.1 + '@noble/curves': 1.8.1 + '@noble/hashes': 1.7.1 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/keyvaluestorage': 1.1.1 + '@walletconnect/relay-api': 1.0.11 + '@walletconnect/relay-auth': 1.1.0 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.21.1 + '@walletconnect/window-getters': 1.0.1 + '@walletconnect/window-metadata': 1.0.1 + bs58: 6.0.0 + detect-browser: 5.3.0 + query-string: 7.1.3 + uint8arrays: 3.1.0 + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - ioredis + - typescript + - uploadthing + - utf-8-validate + - zod + '@walletconnect/utils@2.21.1(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)': dependencies: '@noble/ciphers': 1.2.1 @@ -16359,6 +17037,26 @@ snapshots: ini: 1.3.8 proto-list: 1.2.4 + connectkit@1.9.1(@babel/core@7.28.5)(@tanstack/react-query@5.90.6(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76)): + dependencies: + '@tanstack/react-query': 5.90.6(react@18.3.1) + buffer: 6.0.3 + detect-browser: 5.3.0 + family: 0.1.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76)) + framer-motion: 6.5.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + qrcode: 1.5.4 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + react-transition-state: 1.1.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-use-measure: 2.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + resize-observer-polyfill: 1.5.1 + styled-components: 5.3.11(@babel/core@7.28.5)(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1) + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + wagmi: 2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76) + transitivePeerDependencies: + - '@babel/core' + - react-is + connectkit@1.9.1(@babel/core@7.28.5)(@tanstack/react-query@5.90.6(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)): dependencies: '@tanstack/react-query': 5.90.6(react@18.3.1) @@ -17497,6 +18195,13 @@ snapshots: eyes@0.1.8: {} + family@0.1.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76)): + optionalDependencies: + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) + wagmi: 2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76) + family@0.1.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)): optionalDependencies: react: 18.3.1 @@ -18009,7 +18714,7 @@ snapshots: - debug - utf-8-validate - hardhat-gas-reporter@2.3.0(bufferutil@4.0.9)(hardhat@3.0.11(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typescript@5.8.3)(utf-8-validate@5.0.10): + hardhat-gas-reporter@2.3.0(bufferutil@4.0.9)(hardhat@3.0.11(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76): dependencies: '@ethersproject/abi': 5.8.0 '@ethersproject/bytes': 5.8.0 @@ -18026,7 +18731,7 @@ snapshots: lodash: 4.17.21 markdown-table: 2.0.0 sha1: 1.1.1 - viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.22.4) + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) transitivePeerDependencies: - bufferutil - debug @@ -20065,6 +20770,20 @@ snapshots: os-browserify@0.3.0: {} + ox@0.6.9(typescript@5.8.3)(zod@3.25.76): + dependencies: + '@adraffy/ens-normalize': 1.11.1 + '@noble/curves': 1.9.7 + '@noble/hashes': 1.8.0 + '@scure/bip32': 1.7.0 + '@scure/bip39': 1.6.0 + abitype: 1.1.1(typescript@5.8.3)(zod@3.25.76) + eventemitter3: 5.0.1 + optionalDependencies: + typescript: 5.8.3 + transitivePeerDependencies: + - zod + ox@0.6.9(typescript@5.8.3)(zod@4.1.12): dependencies: '@adraffy/ens-normalize': 1.11.1 @@ -20373,21 +21092,21 @@ snapshots: style-value-types: 5.0.0 tslib: 2.8.1 - porto@0.2.35(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(@wagmi/core@2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)))(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)): + porto@0.2.35(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(@wagmi/core@2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)))(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76)): dependencies: - '@wagmi/core': 2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)) + '@wagmi/core': 2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)) hono: 4.10.4 idb-keyval: 6.2.2 mipd: 0.0.7(typescript@5.8.3) ox: 0.9.14(typescript@5.8.3)(zod@4.1.12) - viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) zod: 4.1.12 zustand: 5.0.8(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(use-sync-external-store@1.4.0(react@18.3.1)) optionalDependencies: '@tanstack/react-query': 5.90.6(react@18.3.1) react: 18.3.1 typescript: 5.8.3 - wagmi: 2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) + wagmi: 2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76) transitivePeerDependencies: - '@types/react' - immer @@ -22338,14 +23057,14 @@ snapshots: vscode-uri@3.1.0: {} - wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12): + wagmi@2.19.2(@tanstack/query-core@5.90.6)(@tanstack/react-query@5.90.6(react@18.3.1))(@types/react@18.3.26)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76): dependencies: '@tanstack/react-query': 5.90.6(react@18.3.1) - '@wagmi/connectors': 6.1.3(0b1a0c7e1852d0f2478f1048dd2722c1) - '@wagmi/core': 2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12)) + '@wagmi/connectors': 6.1.3(d4aa626e1ce01c77feebfbcfe6b62584) + '@wagmi/core': 2.22.1(@tanstack/query-core@5.90.6)(@types/react@18.3.26)(immer@10.0.2)(react@18.3.1)(typescript@5.8.3)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76)) react: 18.3.1 use-sync-external-store: 1.4.0(react@18.3.1) - viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) + viem: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) optionalDependencies: typescript: 5.8.3 transitivePeerDependencies: diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 24238bd606..243c111a76 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.86.0" +channel = "1.91.1" components = ["rustfmt"] targets = ["wasm32-unknown-unknown"] diff --git a/templates/default/Cargo.lock b/templates/default/Cargo.lock index 6cbc4ee596..a674642a6f 100644 --- a/templates/default/Cargo.lock +++ b/templates/default/Cargo.lock @@ -221,6 +221,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "aligned-vec" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b" +dependencies = [ + "equator", +] + [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -413,7 +422,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -424,7 +433,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -880,6 +889,12 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" + [[package]] name = "byteorder" version = "1.5.0" @@ -1230,8 +1245,8 @@ dependencies = [ "e3-zk-helpers", "fhe", "fhe-traits", - "rand 0.8.5", - "thiserror", + "rand 0.9.2", + "thiserror 1.0.69", ] [[package]] @@ -1264,10 +1279,10 @@ dependencies = [ "fhe", "num-bigint", "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1277,7 +1292,7 @@ dependencies = [ "num-bigint", "num-traits", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1285,11 +1300,10 @@ name = "e3-polynomial" version = "0.1.15" dependencies = [ "fhe-math", - "ndarray", "num-bigint", "num-traits", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1338,7 +1352,7 @@ dependencies = [ "e3-fhe-params", "fhe", "fhe-traits", - "rand 0.8.5", + "rand 0.9.2", ] [[package]] @@ -1362,11 +1376,11 @@ dependencies = [ "num-bigint", "num-integer", "num-traits", - "rand 0.8.5", + "rand 0.9.2", "rayon", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "toml", ] @@ -1450,6 +1464,26 @@ dependencies = [ "syn 2.0.116", ] +[[package]] +name = "equator" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc" +dependencies = [ + "equator-macro", +] + +[[package]] +name = "equator-macro" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.116", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -1463,7 +1497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1512,71 +1546,73 @@ dependencies = [ [[package]] name = "fhe" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#5f24d0b62a7329b789db07a065b68accd614a47b" +version = "0.2.0" +source = "git+https://github.com/gnosisguild/fhe.rs#a92478b39625f4c18b91a5033928b35d8a0090cf" dependencies = [ "bincode", "doc-comment", "fhe-math", "fhe-traits", "fhe-util", - "itertools 0.12.1", + "itertools 0.14.0", "ndarray", "num-bigint", "num-traits", "prost", "prost-build", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", "rand_distr", "rayon", "serde", - "thiserror", + "thiserror 2.0.18", "zeroize", "zeroize_derive", ] [[package]] name = "fhe-math" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#5f24d0b62a7329b789db07a065b68accd614a47b" +version = "0.2.0" +source = "git+https://github.com/gnosisguild/fhe.rs#a92478b39625f4c18b91a5033928b35d8a0090cf" dependencies = [ "ethnum", "fhe-traits", "fhe-util", - "itertools 0.12.1", + "itertools 0.14.0", "ndarray", "num-bigint", "num-bigint-dig", "num-traits", "prost", "prost-build", - "rand 0.8.5", - "rand_chacha 0.3.1", + "pulp", + "rand 0.9.2", + "rand_chacha 0.9.0", "serde", "sha2", - "thiserror", + "tfhe-ntt", + "thiserror 2.0.18", "zeroize", ] [[package]] name = "fhe-traits" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#5f24d0b62a7329b789db07a065b68accd614a47b" +version = "0.1.1" +source = "git+https://github.com/gnosisguild/fhe.rs#a92478b39625f4c18b91a5033928b35d8a0090cf" dependencies = [ - "rand 0.8.5", + "rand 0.9.2", ] [[package]] name = "fhe-util" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#5f24d0b62a7329b789db07a065b68accd614a47b" +version = "0.1.1" +source = "git+https://github.com/gnosisguild/fhe.rs#a92478b39625f4c18b91a5033928b35d8a0090cf" dependencies = [ - "itertools 0.12.1", "num-bigint-dig", "num-traits", "prime_factorization", "rand 0.8.5", + "rand 0.9.2", "rand_distr", "rayon", ] @@ -1601,9 +1637,9 @@ dependencies = [ [[package]] name = "fixedbitset" -version = "0.4.2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "flate2" @@ -2150,15 +2186,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -2241,15 +2268,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -dependencies = [ - "spin", -] - [[package]] name = "lean-imt" version = "0.1.2" @@ -2280,7 +2298,7 @@ dependencies = [ "ark-bn254 0.4.0", "ark-ff 0.4.2", "num-bigint", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2407,14 +2425,16 @@ dependencies = [ [[package]] name = "ndarray" -version = "0.15.6" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d" dependencies = [ "matrixmultiply", "num-complex", "num-integer", "num-traits", + "portable-atomic", + "portable-atomic-util", "rawpointer", "serde", ] @@ -2447,16 +2467,16 @@ dependencies = [ [[package]] name = "num-bigint-dig" -version = "0.8.6" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7" +checksum = "a7f9a86e097b0d187ad0e65667c2f58b9254671e86e7dbb78036b16692eae099" dependencies = [ - "lazy_static", "libm", "num-integer", "num-iter", "num-traits", - "rand 0.8.5", + "once_cell", + "rand 0.9.2", "serde", "smallvec", ] @@ -2467,6 +2487,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ + "bytemuck", "num-traits", ] @@ -2657,11 +2678,12 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" dependencies = [ "fixedbitset", + "hashbrown 0.15.5", "indexmap", ] @@ -2693,6 +2715,21 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + +[[package]] +name = "portable-atomic-util" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" +dependencies = [ + "portable-atomic", +] + [[package]] name = "potential_utf" version = "0.1.4" @@ -2810,9 +2847,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.6" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +checksum = "d2ea70524a2f82d518bce41317d0fae74151505651af45faf1ffbd6fd33f0568" dependencies = [ "bytes", "prost-derive", @@ -2820,16 +2857,14 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.6" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +checksum = "343d3bd7056eda839b03204e68deff7d1b13aba7af2b2fd16890697274262ee7" dependencies = [ - "bytes", "heck", - "itertools 0.12.1", + "itertools 0.14.0", "log", "multimap", - "once_cell", "petgraph", "prettyplease", "prost", @@ -2841,12 +2876,12 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.6" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools 0.14.0", "proc-macro2", "quote", "syn 2.0.116", @@ -2854,13 +2889,36 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.6" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" dependencies = [ "prost", ] +[[package]] +name = "pulp" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e205bb30d5b916c55e584c22201771bcf2bad9aabd5d4127f38387140c38632" +dependencies = [ + "bytemuck", + "cfg-if", + "libm", + "num-complex", + "paste", + "pulp-wasm-simd-flag", + "raw-cpuid", + "reborrow", + "version_check", +] + +[[package]] +name = "pulp-wasm-simd-flag" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40e24eee682d89fb193496edf918a7f407d30175b2e785fe057e4392dfd182e0" + [[package]] name = "quick-error" version = "1.2.3" @@ -2951,12 +3009,12 @@ dependencies = [ [[package]] name = "rand_distr" -version = "0.4.3" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +checksum = "6a8615d50dcf34fa31f7ab52692afec947c4dd0ab803cc87cb3b0b4570ff7463" dependencies = [ "num-traits", - "rand 0.8.5", + "rand 0.9.2", ] [[package]] @@ -2968,6 +3026,15 @@ dependencies = [ "rand_core 0.9.5", ] +[[package]] +name = "raw-cpuid" +version = "11.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" +dependencies = [ + "bitflags", +] + [[package]] name = "rawpointer" version = "0.2.1" @@ -2994,6 +3061,12 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "reborrow" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03251193000f4bd3b042892be858ee50e8b3719f2b08e5833ac4353724632430" + [[package]] name = "redox_syscall" version = "0.5.18" @@ -3192,7 +3265,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -3497,12 +3570,6 @@ dependencies = [ "windows-sys 0.60.2", ] -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "spki" version = "0.7.3" @@ -3641,7 +3708,18 @@ dependencies = [ "getrandom 0.3.4", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.61.2", +] + +[[package]] +name = "tfhe-ntt" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10650c743ade46b166c698c8349902ed5986784a7db418c51f810bea25f09e3d" +dependencies = [ + "aligned-vec", + "bytemuck", + "pulp", ] [[package]] @@ -3650,7 +3728,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", ] [[package]] @@ -3664,6 +3751,17 @@ dependencies = [ "syn 2.0.116", ] +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.116", +] + [[package]] name = "time" version = "0.3.45" diff --git a/templates/default/Cargo.toml b/templates/default/Cargo.toml index a7aad2d571..5a94678ec8 100644 --- a/templates/default/Cargo.toml +++ b/templates/default/Cargo.toml @@ -7,11 +7,11 @@ members = [ [workspace.dependencies] e3-user-program = { path = "./program" } -fhe = { package = "fhe", git = "https://github.com/gnosisguild/fhe.rs" } +fhe = { git = "https://github.com/gnosisguild/fhe.rs" } fhe-traits = { git = "https://github.com/gnosisguild/fhe.rs" } e3-program-server = { path = "../../crates/program-server" } e3-bfv-client = { path = "../../crates/bfv-client" } e3-fhe-params = { path = "../../crates/fhe-params" } e3-compute-provider = { path = "../../crates/compute-provider" } -rand = "0.8.5" +rand = "0.9" anyhow = "1.0.86" diff --git a/templates/default/deployed_contracts.json b/templates/default/deployed_contracts.json index 9a88530760..6ecd6fa949 100644 --- a/templates/default/deployed_contracts.json +++ b/templates/default/deployed_contracts.json @@ -47,7 +47,7 @@ "proxyAdminAddress": "0x9bd03768a7DCc129555dE410FF8E85528A4F88b5", "implementationAddress": "0x0165878A594ca255338adfa4d48449f69242Eb8F" }, - "blockNumber": 11, + "blockNumber": 10, "address": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853" }, "BondingRegistry": { @@ -113,7 +113,7 @@ "address": "0x5eb3Bc0a489C5A8288765d2336659EbCA68FCd00" }, "MockDecryptionVerifier": { - "blockNumber": 53, + "blockNumber": 52, "address": "0x36C02dA8a0983159322a80FFE9F24b1acfF8B570" }, "MockPkVerifier": { diff --git a/templates/default/enclave.config.yaml b/templates/default/enclave.config.yaml index 784aff2d81..69362b3cdd 100644 --- a/templates/default/enclave.config.yaml +++ b/templates/default/enclave.config.yaml @@ -10,7 +10,7 @@ chains: deploy_block: 16 ciphernode_registry: address: "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853" - deploy_block: 11 + deploy_block: 10 bonding_registry: address: "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" deploy_block: 12 diff --git a/templates/default/flake.nix b/templates/default/flake.nix index fe716e8148..39200698bb 100644 --- a/templates/default/flake.nix +++ b/templates/default/flake.nix @@ -19,7 +19,7 @@ inherit system overlays; }; - rustToolchain = pkgs.rust-bin.stable."1.86.0".default.override { + rustToolchain = pkgs.rust-bin.stable."1.91.1".default.override { targets = ["wasm32-unknown-unknown"]; }; in { diff --git a/tests/integration/enclave.config.yaml b/tests/integration/enclave.config.yaml index e93ecf649d..bfc30da4f3 100644 --- a/tests/integration/enclave.config.yaml +++ b/tests/integration/enclave.config.yaml @@ -4,23 +4,23 @@ chains: rpc_url: "ws://localhost:8545" contracts: e3_program: - address: "0x851356ae760d987E095750cCeb3bC6014560891C" - deploy_block: 23 + address: "0x4c5859f0F772848b2D91F1D83E2Fe57935348029" + deploy_block: 37 enclave: - address: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e" - deploy_block: 16 + address: "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0" + deploy_block: 18 ciphernode_registry: address: "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853" - deploy_block: 12 + deploy_block: 13 bonding_registry: address: "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" - deploy_block: 13 + deploy_block: 14 slashing_manager: address: "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707" - deploy_block: 11 + deploy_block: 12 fee_token: address: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512" - deploy_block: 7 + deploy_block: 8 program: dev: true