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 1/3] 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); From d4f5b21a62345ca7211e83ab981cced4d9ac8ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Wed, 7 Feb 2024 17:59:54 +0100 Subject: [PATCH 2/3] chore: update prerelease and release workflow --- .github/workflows/publish.yml | 2 +- .github/workflows/publishprerelease.yml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publishprerelease.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 399db8e..cc727ae 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,6 +1,6 @@ on: release: - types: [created] + types: [released] jobs: publish: diff --git a/.github/workflows/publishprerelease.yml b/.github/workflows/publishprerelease.yml new file mode 100644 index 0000000..182d085 --- /dev/null +++ b/.github/workflows/publishprerelease.yml @@ -0,0 +1,20 @@ +on: + release: + types: [prereleased] + +jobs: + publish: + if: github.event_name == 'release' && github.event.action == 'published' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + - run: npm ci + - run: npm test + - run: npm run build + - uses: JS-DevTools/npm-publish@0f451a94170d1699fd50710966d48fb26194d939 + with: + tag: prerelease + token: ${{ secrets.NPM_TOKEN }} From b83b45c48341432516fc9a1fb4995682328a295a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Wed, 7 Feb 2024 18:00:21 +0100 Subject: [PATCH 3/3] 0.4.0-0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d2ad056..902f0db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "fhevmjs", - "version": "0.3.2", + "version": "0.4.0-0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "fhevmjs", - "version": "0.3.2", + "version": "0.4.0-0", "license": "BSD-3-Clause-Clear", "dependencies": { "commander": "^11.0.0", diff --git a/package.json b/package.json index 115ed9f..1982202 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fhevmjs", - "version": "0.3.2", + "version": "0.4.0-0", "description": "fhEVM SDK for blockchain using TFHE", "main": "lib/node.cjs", "types": "lib/node.d.ts",