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 }} diff --git a/package-lock.json b/package-lock.json index 569cfb9..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", @@ -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..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", @@ -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);