From dd178737ea1dda5c90f2ae6ef7041b0a42089d42 Mon Sep 17 00:00:00 2001 From: "Mayeul@Zama" <69792125+mayeul-zama@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:10:57 +0100 Subject: [PATCH 1/3] chore: upgrade wasm-bindgen --- Cargo.toml | 13 ++++--------- Makefile | 6 +++--- tfhe/Cargo.toml | 12 ++++++++++-- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d6b7cc369d..743bf0e998 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,13 +11,10 @@ members = [ "backends/tfhe-cuda-backend", "utils/tfhe-versionable", "utils/tfhe-versionable-derive", - "tests" + "tests", ] -exclude = [ - "tests/backward_compatibility_tests", - "utils/tfhe-lints", -] +exclude = ["tests/backward_compatibility_tests", "utils/tfhe-lints"] [workspace.dependencies] aligned-vec = { version = "0.6", default-features = false } bytemuck = "1.14.3" @@ -28,7 +25,7 @@ pulp = { version = "0.20.0", default-features = false } rand = "0.8" rayon = "1" serde = { version = "1.0", default-features = false } -wasm-bindgen = ">=0.2.86,<0.2.94" +wasm-bindgen = "0.2.100" [profile.bench] lto = "fat" @@ -48,6 +45,4 @@ lto = "off" debug-assertions = false [workspace.metadata.dylint] -libraries = [ - { path = "utils/tfhe-lints" } -] +libraries = [{ path = "utils/tfhe-lints" }] diff --git a/Makefile b/Makefile index 54062ca4ca..79e85a30a0 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,7 @@ install_wasm_bindgen_cli: install_rs_build_toolchain .PHONY: install_wasm_pack # Install wasm-pack to build JS packages install_wasm_pack: install_rs_build_toolchain @wasm-pack --version | grep "$(WASM_PACK_VERSION)" > /dev/null 2>&1 || \ - cargo $(CARGO_RS_BUILD_TOOLCHAIN) install --locked wasm-pack@0.13.1 || \ + cargo $(CARGO_RS_BUILD_TOOLCHAIN) install --locked wasm-pack@$(WASM_PACK_VERSION) || \ ( echo "Unable to install cargo wasm-pack, unknown error." && exit 1 ) .PHONY: install_node # Install last version of NodeJS via nvm @@ -521,11 +521,11 @@ build_web_js_api: install_rs_build_toolchain install_wasm_pack build_web_js_api_parallel: install_rs_check_toolchain install_wasm_pack cd tfhe && \ rustup component add rust-src --toolchain $(RS_CHECK_TOOLCHAIN) && \ - RUSTFLAGS="$(WASM_RUSTFLAGS) -C target-feature=+atomics,+bulk-memory,+mutable-globals" rustup run $(RS_CHECK_TOOLCHAIN) \ + RUSTFLAGS="$(WASM_RUSTFLAGS) -C target-feature=+atomics,+bulk-memory" rustup run $(RS_CHECK_TOOLCHAIN) \ wasm-pack build --release --target=web \ -- --features=boolean-client-js-wasm-api,shortint-client-js-wasm-api,integer-client-js-wasm-api,parallel-wasm-api,zk-pok \ -Z build-std=panic_abort,std && \ - find pkg/snippets -type f -iname workerHelpers.worker.js -exec sed -i "s|from '..\/..\/..\/';|from '..\/..\/..\/tfhe.js';|" {} \; + find pkg/snippets -type f -iname workerHelpers.js -exec sed -i "s|const pkg = await import('..\/..\/..');|const pkg = await import('..\/..\/..\/tfhe.js');|" {} \; jq '.files += ["snippets"]' tfhe/pkg/package.json > tmp_pkg.json && mv -f tmp_pkg.json tfhe/pkg/package.json .PHONY: build_node_js_api # Build the js API targeting nodejs diff --git a/tfhe/Cargo.toml b/tfhe/Cargo.toml index 7788ccc7af..a177496824 100644 --- a/tfhe/Cargo.toml +++ b/tfhe/Cargo.toml @@ -76,7 +76,7 @@ tfhe-versionable = { version = "0.4.0", path = "../utils/tfhe-versionable" } wasm-bindgen = { workspace = true, features = [ "serde-serialize", ], optional = true } -wasm-bindgen-rayon = { version = "=1.2.2", optional = true } +wasm-bindgen-rayon = { version = "1.3.0", optional = true } js-sys = { version = "0.3", optional = true } console_error_panic_hook = { version = "0.1.7", optional = true } serde-wasm-bindgen = { version = "0.6.0", optional = true } @@ -130,7 +130,15 @@ software-prng = ["tfhe-csprng/software-prng"] [package.metadata.docs.rs] # TODO: manage builds for docs.rs based on their documentation https://docs.rs/about -features = ["boolean", "shortint", "integer", "gpu", "zk-pok", "software-prng", "strings"] +features = [ + "boolean", + "shortint", + "integer", + "gpu", + "zk-pok", + "software-prng", + "strings", +] rustdoc-args = ["--html-in-header", "katex-header.html"] ########### From 9fe198ef5e85b6bd9b0e0b772ae396b7744e0f85 Mon Sep 17 00:00:00 2001 From: "Mayeul@Zama" <69792125+mayeul-zama@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:11:08 +0100 Subject: [PATCH 2/3] chore: update toolchain --- toolchain.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain.txt b/toolchain.txt index e56b2c71eb..a18e771185 100644 --- a/toolchain.txt +++ b/toolchain.txt @@ -1 +1 @@ -nightly-2024-11-29 +nightly-2025-01-17 From 8a5357b65c9c254336ebb96ab5cfcbe51e934f67 Mon Sep 17 00:00:00 2001 From: "Mayeul@Zama" <69792125+mayeul-zama@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:53:26 +0100 Subject: [PATCH 3/3] chore: update rust dependencies --- Cargo.toml | 4 ++-- backends/tfhe-cuda-backend/Cargo.toml | 2 +- tfhe-fft/Cargo.toml | 2 +- tfhe-ntt/Cargo.toml | 2 +- tfhe/Cargo.toml | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 743bf0e998..13b3f0d3ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,9 +19,9 @@ exclude = ["tests/backward_compatibility_tests", "utils/tfhe-lints"] aligned-vec = { version = "0.6", default-features = false } bytemuck = "1.14.3" dyn-stack = { version = "0.11", default-features = false } -itertools = "0.13" +itertools = "0.14" num-complex = "0.4" -pulp = { version = "0.20.0", default-features = false } +pulp = { version = "0.21", default-features = false } rand = "0.8" rayon = "1" serde = { version = "1.0", default-features = false } diff --git a/backends/tfhe-cuda-backend/Cargo.toml b/backends/tfhe-cuda-backend/Cargo.toml index 205f6cd86d..e64edd7e88 100644 --- a/backends/tfhe-cuda-backend/Cargo.toml +++ b/backends/tfhe-cuda-backend/Cargo.toml @@ -14,4 +14,4 @@ keywords = ["fully", "homomorphic", "encryption", "fhe", "cryptography"] [build-dependencies] cmake = { version = "0.1" } pkg-config = { version = "0.3" } -bindgen = "0.70.1" +bindgen = "0.71" diff --git a/tfhe-fft/Cargo.toml b/tfhe-fft/Cargo.toml index 5c65e1fb7f..040ec8276e 100644 --- a/tfhe-fft/Cargo.toml +++ b/tfhe-fft/Cargo.toml @@ -43,7 +43,7 @@ getrandom = { version = "0.2", features = ["js"] } rug = "1.19.1" [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] -criterion = "0.4" +criterion = "0.5" fftw-sys = { version = "0.6", default-features = false, features = ["system"] } [[bench]] diff --git a/tfhe-ntt/Cargo.toml b/tfhe-ntt/Cargo.toml index 83da92aa0b..5f5b8baed8 100644 --- a/tfhe-ntt/Cargo.toml +++ b/tfhe-ntt/Cargo.toml @@ -22,7 +22,7 @@ std = ["pulp/std", "aligned-vec/std"] nightly = ["pulp/nightly"] [dev-dependencies] -criterion = "0.4" +criterion = "0.5" rand = { workspace = true } serde = "1.0.163" serde_json = "1.0.96" diff --git a/tfhe/Cargo.toml b/tfhe/Cargo.toml index a177496824..1d01e4c211 100644 --- a/tfhe/Cargo.toml +++ b/tfhe/Cargo.toml @@ -32,20 +32,20 @@ serde_json = "1.0.94" clap = { version = "=4.4.4", features = ["derive"] } # Used in user documentation fs2 = { version = "0.4.3" } -statrs = "0.16" +statrs = "0.18" # For erf and normality test libm = "0.2.6" # Begin regex-engine deps test-case = "3.1.0" combine = "4.6.6" -env_logger = "0.10.0" +env_logger = "0.11" log = "0.4.19" hex = "0.4.3" # End regex-engine deps strum = { version = "0.26", features = ["derive"] } [build-dependencies] -cbindgen = { version = "0.26.0", optional = true } +cbindgen = { version = "0.28", optional = true } [dependencies] tfhe-csprng = { version = "0.5.0", path = "../tfhe-csprng", features = [