From eb539d80ad61af3720b5a9dccb5e2e5040b8333d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Wed, 7 Feb 2024 17:58:53 +0100 Subject: [PATCH] feat: update tfhe-rs to 0.5.1 --- package-lock.json | 28 ++++++++++++++-------------- package.json | 4 ++-- src/tfhe.ts | 6 ++++-- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 569cfb9..d2ad056 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,9 +14,9 @@ "ethers": "^6.6.4", "libsodium": "^0.7.11", "libsodium-wrappers": "^0.7.11", - "node-tfhe": "^0.4.1", + "node-tfhe": "^0.5.1", "sha3": "^2.1.4", - "tfhe": "^0.4.1" + "tfhe": "^0.5.1" }, "bin": { "fhevm": "bin/fhevm.js" @@ -4519,9 +4519,9 @@ "dev": true }, "node_modules/node-tfhe": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/node-tfhe/-/node-tfhe-0.4.1.tgz", - "integrity": "sha512-GysZYDRnvL8UyywaK/+/Rvqvpdk5pIRR8MaCqEJmaG3rGo/8OXwPzb6WJaAyYNZz2VmimCGBxznkuNVRviFHMQ==" + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/node-tfhe/-/node-tfhe-0.5.1.tgz", + "integrity": "sha512-jSPB9gsEoPL21Q5gNWTxxedJ0YxKDfnb7W3uIcKjEGvsw0QMMV4uD/NsACNltDplQ2cmIsK/z+4jC5LJxfw5kQ==" }, "node_modules/normalize-path": { "version": "3.0.0", @@ -5467,9 +5467,9 @@ } }, "node_modules/tfhe": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/tfhe/-/tfhe-0.4.1.tgz", - "integrity": "sha512-Ok8CrrryBjtgCbPliDG3YuAFX0oJLS4y9pCajF6TSORyKYIDVtfOKbVntG2gZFOeUukUTHSI5FVofqhX5GkPTw==" + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/tfhe/-/tfhe-0.5.1.tgz", + "integrity": "sha512-OZt4nnz8YW/IjmrVNyNBRkiNuO2WFmDh5zPKTL8UiUzUHsVN+4Nqnz2XqetbbCfCXGrVfTTNkXU8zkuGXIV0BA==" }, "node_modules/tmpl": { "version": "1.0.5", @@ -9462,9 +9462,9 @@ "dev": true }, "node-tfhe": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/node-tfhe/-/node-tfhe-0.4.1.tgz", - "integrity": "sha512-GysZYDRnvL8UyywaK/+/Rvqvpdk5pIRR8MaCqEJmaG3rGo/8OXwPzb6WJaAyYNZz2VmimCGBxznkuNVRviFHMQ==" + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/node-tfhe/-/node-tfhe-0.5.1.tgz", + "integrity": "sha512-jSPB9gsEoPL21Q5gNWTxxedJ0YxKDfnb7W3uIcKjEGvsw0QMMV4uD/NsACNltDplQ2cmIsK/z+4jC5LJxfw5kQ==" }, "normalize-path": { "version": "3.0.0", @@ -10142,9 +10142,9 @@ } }, "tfhe": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/tfhe/-/tfhe-0.4.1.tgz", - "integrity": "sha512-Ok8CrrryBjtgCbPliDG3YuAFX0oJLS4y9pCajF6TSORyKYIDVtfOKbVntG2gZFOeUukUTHSI5FVofqhX5GkPTw==" + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/tfhe/-/tfhe-0.5.1.tgz", + "integrity": "sha512-OZt4nnz8YW/IjmrVNyNBRkiNuO2WFmDh5zPKTL8UiUzUHsVN+4Nqnz2XqetbbCfCXGrVfTTNkXU8zkuGXIV0BA==" }, "tmpl": { "version": "1.0.5", diff --git a/package.json b/package.json index a88e5fe..115ed9f 100644 --- a/package.json +++ b/package.json @@ -44,9 +44,9 @@ "ethers": "^6.6.4", "libsodium": "^0.7.11", "libsodium-wrappers": "^0.7.11", - "node-tfhe": "^0.4.1", + "node-tfhe": "^0.5.1", "sha3": "^2.1.4", - "tfhe": "^0.4.1" + "tfhe": "^0.5.1" }, "devDependencies": { "@rollup/plugin-alias": "^5.0.0", diff --git a/src/tfhe.ts b/src/tfhe.ts index 899c1be..aa41e3d 100644 --- a/src/tfhe.ts +++ b/src/tfhe.ts @@ -11,8 +11,10 @@ export const createTfheKeypair = () => { const block_params = new ShortintParameters( ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS, ); - let config = TfheConfigBuilder.all_disabled() - .enable_custom_integers(block_params) + // const configBuilder = new TfheConfigBuilder(); + // const config = configBuilder.use_custom_parameters(block_params).build(); + const config = TfheConfigBuilder.default() + .use_custom_parameters(block_params) .build(); let clientKey = TfheClientKey.generate(config); let publicKey = TfheCompactPublicKey.new(clientKey);