@fhevm/sdk 1.1.0-alpha.4 → 1.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_cjs/core/_version.js +1 -1
- package/_cjs/core/actions/base/canDecryptPublicValue.js +1 -1
- package/_cjs/core/actions/base/canDecryptPublicValue.js.map +1 -1
- package/_cjs/core/actions/base/canDecryptPublicValues.js +1 -1
- package/_cjs/core/actions/base/canDecryptPublicValues.js.map +1 -1
- package/_cjs/core/actions/base/{fetchKmsSignedcryptedShares.js → fetchKmsSigncryptedShares.js} +5 -5
- package/_cjs/core/actions/base/fetchKmsSigncryptedShares.js.map +1 -0
- package/_cjs/core/actions/base/index.js +3 -3
- package/_cjs/core/actions/base/index.js.map +1 -1
- package/_cjs/core/actions/base/readKmsSignersContext.js +2 -1
- package/_cjs/core/actions/base/readKmsSignersContext.js.map +1 -1
- package/_cjs/core/actions/chain/parseTransportKeyPair.js.map +1 -1
- package/_cjs/core/actions/decrypt/decryptKmsSigncryptedShares.js +13 -0
- package/_cjs/core/actions/decrypt/decryptKmsSigncryptedShares.js.map +1 -0
- package/_cjs/core/actions/decrypt/decryptValue.js +3 -1
- package/_cjs/core/actions/decrypt/decryptValue.js.map +1 -1
- package/_cjs/core/actions/decrypt/decryptValues.js +3 -1
- package/_cjs/core/actions/decrypt/decryptValues.js.map +1 -1
- package/_cjs/core/actions/decrypt/decryptValuesFromPairs.js +3 -1
- package/_cjs/core/actions/decrypt/decryptValuesFromPairs.js.map +1 -1
- package/_cjs/core/actions/decrypt/generateTransportKeyPair.js +3 -1
- package/_cjs/core/actions/decrypt/generateTransportKeyPair.js.map +1 -1
- package/_cjs/core/actions/decrypt/index.js +3 -3
- package/_cjs/core/actions/decrypt/index.js.map +1 -1
- package/_cjs/core/actions/encrypt/encryptValue.js +3 -1
- package/_cjs/core/actions/encrypt/encryptValue.js.map +1 -1
- package/_cjs/core/actions/encrypt/encryptValues.js +3 -1
- package/_cjs/core/actions/encrypt/encryptValues.js.map +1 -1
- package/_cjs/core/actions/encrypt/generateZkProof.js +5 -1
- package/_cjs/core/actions/encrypt/generateZkProof.js.map +1 -1
- package/_cjs/core/actions/host/readFhevmExecutorContractData.js +7 -7
- package/_cjs/core/actions/host/readFhevmExecutorContractData.js.map +1 -1
- package/_cjs/core/actions/host/readInputVerifierContractData.js +1 -1
- package/_cjs/core/actions/host/readInputVerifierContractData.js.map +1 -1
- package/_cjs/core/actions/host/readKmsVerifierContractData.js +6 -5
- package/_cjs/core/actions/host/readKmsVerifierContractData.js.map +1 -1
- package/_cjs/core/actions/host/resolveFhevmConfig.js +7 -1
- package/_cjs/core/actions/host/resolveFhevmConfig.js.map +1 -1
- package/_cjs/core/base/object.js +23 -0
- package/_cjs/core/base/object.js.map +1 -1
- package/_cjs/core/base/semver.js +166 -0
- package/_cjs/core/base/semver.js.map +1 -0
- package/_cjs/core/base/uint.js +20 -3
- package/_cjs/core/base/uint.js.map +1 -1
- package/_cjs/core/chains/definitions/localTestnet.js +3 -0
- package/_cjs/core/chains/definitions/localTestnet.js.map +1 -1
- package/_cjs/core/chains/definitions/mainnet.js +1 -0
- package/_cjs/core/chains/definitions/mainnet.js.map +1 -1
- package/_cjs/core/chains/definitions/sepolia.js +1 -0
- package/_cjs/core/chains/definitions/sepolia.js.map +1 -1
- package/_cjs/core/clients/decorators/base.js +5 -0
- package/_cjs/core/clients/decorators/base.js.map +1 -1
- package/_cjs/core/clients/decorators/decrypt-p.js +13 -0
- package/_cjs/core/clients/decorators/decrypt-p.js.map +1 -0
- package/_cjs/core/clients/decorators/decrypt.js +4 -7
- package/_cjs/core/clients/decorators/decrypt.js.map +1 -1
- package/_cjs/core/clients/decorators/encrypt-p.js +5 -1
- package/_cjs/core/clients/decorators/encrypt-p.js.map +1 -1
- package/_cjs/core/clients/decorators/encrypt.js.map +1 -1
- package/_cjs/core/coprocessor/ZkProof-p.js +4 -2
- package/_cjs/core/coprocessor/ZkProof-p.js.map +1 -1
- package/_cjs/core/coprocessor/ZkProofBuilder-p.js +2 -1
- package/_cjs/core/coprocessor/ZkProofBuilder-p.js.map +1 -1
- package/_cjs/core/coprocessor/encrypt.js +1 -1
- package/_cjs/core/coprocessor/encrypt.js.map +1 -1
- package/_cjs/core/errors/RelayerResponseStatusError.js +3 -2
- package/_cjs/core/errors/RelayerResponseStatusError.js.map +1 -1
- package/_cjs/core/host-contracts/HostContractVersion-p.js +26 -4
- package/_cjs/core/host-contracts/HostContractVersion-p.js.map +1 -1
- package/_cjs/core/host-contracts/KmsSignersContext-p.js +23 -5
- package/_cjs/core/host-contracts/KmsSignersContext-p.js.map +1 -1
- package/_cjs/core/host-contracts/abi-fragments/fragments.js +21 -1
- package/_cjs/core/host-contracts/abi-fragments/fragments.js.map +1 -1
- package/_cjs/core/host-contracts/canDecryptValuesFromPairs.js +1 -1
- package/_cjs/core/host-contracts/canDecryptValuesFromPairs.js.map +1 -1
- package/_cjs/core/host-contracts/checkAllowedForDecryption.js +2 -2
- package/_cjs/core/host-contracts/checkAllowedForDecryption.js.map +1 -1
- package/_cjs/core/host-contracts/checkDelegation.js +8 -8
- package/_cjs/core/host-contracts/checkDelegation.js.map +1 -1
- package/_cjs/core/host-contracts/checkPersistAllowed.js +9 -9
- package/_cjs/core/host-contracts/checkPersistAllowed.js.map +1 -1
- package/_cjs/core/host-contracts/getAclAddress-p.js +1 -2
- package/_cjs/core/host-contracts/getAclAddress-p.js.map +1 -1
- package/_cjs/core/host-contracts/getCurrentKmsContextAndEpoch-p.js +51 -0
- package/_cjs/core/host-contracts/getCurrentKmsContextAndEpoch-p.js.map +1 -0
- package/_cjs/core/host-contracts/getCurrentKmsContextId-p.js +4 -5
- package/_cjs/core/host-contracts/getCurrentKmsContextId-p.js.map +1 -1
- package/_cjs/core/host-contracts/getFhevmExecutorAddress-p.js +1 -1
- package/_cjs/core/host-contracts/getFhevmExecutorAddress-p.js.map +1 -1
- package/_cjs/core/host-contracts/getHandleVersion-p.js +1 -2
- package/_cjs/core/host-contracts/getHandleVersion-p.js.map +1 -1
- package/_cjs/core/host-contracts/getHcuLimitAddress-p.js +1 -2
- package/_cjs/core/host-contracts/getHcuLimitAddress-p.js.map +1 -1
- package/_cjs/core/host-contracts/getInputVerifierAddress-p.js +1 -2
- package/_cjs/core/host-contracts/getInputVerifierAddress-p.js.map +1 -1
- package/_cjs/core/host-contracts/getKmsContextSignersAndThreshold-p.js +5 -7
- package/_cjs/core/host-contracts/getKmsContextSignersAndThreshold-p.js.map +1 -1
- package/_cjs/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.js +4 -5
- package/_cjs/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.js.map +1 -1
- package/_cjs/core/host-contracts/getSignersForKmsContext-p.js +3 -5
- package/_cjs/core/host-contracts/getSignersForKmsContext-p.js.map +1 -1
- package/_cjs/core/host-contracts/isAllowedForDecryption.js +4 -4
- package/_cjs/core/host-contracts/isAllowedForDecryption.js.map +1 -1
- package/_cjs/core/host-contracts/isHandleDelegatedForUserDecryption-p.js +5 -5
- package/_cjs/core/host-contracts/isHandleDelegatedForUserDecryption-p.js.map +1 -1
- package/_cjs/core/host-contracts/isUserDecryptable.js +2 -2
- package/_cjs/core/host-contracts/isUserDecryptable.js.map +1 -1
- package/_cjs/core/host-contracts/persistAllowed.js +4 -4
- package/_cjs/core/host-contracts/persistAllowed.js.map +1 -1
- package/_cjs/core/host-contracts/readKmsSignersContext-p.js +74 -25
- package/_cjs/core/host-contracts/readKmsSignersContext-p.js.map +1 -1
- package/_cjs/core/key/FheEncryptionKeyWasm-p.js +12 -4
- package/_cjs/core/key/FheEncryptionKeyWasm-p.js.map +1 -1
- package/_cjs/core/key/deserializeFheEncryptionKey.js +3 -0
- package/_cjs/core/key/deserializeFheEncryptionKey.js.map +1 -1
- package/_cjs/core/key/fetchFheEncryptionKey.js +1 -1
- package/_cjs/core/key/fetchFheEncryptionKey.js.map +1 -1
- package/_cjs/core/key/fetchFheEncryptionKeyBytes.js.map +1 -1
- package/_cjs/core/key/serializeFheEncryptionKey.js +4 -1
- package/_cjs/core/key/serializeFheEncryptionKey.js.map +1 -1
- package/_cjs/core/kms/KmsSigncryptedShares-p.js +9 -1
- package/_cjs/core/kms/KmsSigncryptedShares-p.js.map +1 -1
- package/_cjs/core/kms/SignedDecryptionPermit-p.js +5 -1
- package/_cjs/core/kms/SignedDecryptionPermit-p.js.map +1 -1
- package/_cjs/core/kms/TransportKeyPair-p.js +31 -7
- package/_cjs/core/kms/TransportKeyPair-p.js.map +1 -1
- package/_cjs/core/kms/createKmsUserDecryptEip712.js +4 -0
- package/_cjs/core/kms/createKmsUserDecryptEip712.js.map +1 -1
- package/_cjs/core/kms/createKmsUserDecryptEip712V2.js +97 -0
- package/_cjs/core/kms/createKmsUserDecryptEip712V2.js.map +1 -0
- package/_cjs/core/kms/{decryptKmsSignedcryptedShares-p.js → decryptKmsSigncryptedShares-p.js} +10 -3
- package/_cjs/core/kms/decryptKmsSigncryptedShares-p.js.map +1 -0
- package/_cjs/core/kms/decryptValuesFromPairs.js +4 -4
- package/_cjs/core/kms/decryptValuesFromPairs.js.map +1 -1
- package/_cjs/core/kms/{fetchKmsSignedcryptedShares-p.js → fetchKmsSigncryptedShares-p.js} +10 -6
- package/_cjs/core/kms/fetchKmsSigncryptedShares-p.js.map +1 -0
- package/_cjs/core/kms/kmsExtraData.js +53 -10
- package/_cjs/core/kms/kmsExtraData.js.map +1 -1
- package/_cjs/core/kms/kmsUserDecryptEip712V2Types.js +25 -0
- package/_cjs/core/kms/kmsUserDecryptEip712V2Types.js.map +1 -0
- package/_cjs/core/kms/publicDecrypt.js +5 -3
- package/_cjs/core/kms/publicDecrypt.js.map +1 -1
- package/_cjs/core/modules/decrypt/mock.js +1 -23
- package/_cjs/core/modules/decrypt/mock.js.map +1 -1
- package/_cjs/core/modules/decrypt/module/api-p.js +51 -23
- package/_cjs/core/modules/decrypt/module/api-p.js.map +1 -1
- package/_cjs/core/modules/decrypt/module/index.js +5 -27
- package/_cjs/core/modules/decrypt/module/index.js.map +1 -1
- package/_cjs/core/modules/decrypt/module/init-p.js +40 -19
- package/_cjs/core/modules/decrypt/module/init-p.js.map +1 -1
- package/_cjs/core/modules/encrypt/mock.js +26 -8
- package/_cjs/core/modules/encrypt/mock.js.map +1 -1
- package/_cjs/core/modules/encrypt/module/api-p.js +50 -21
- package/_cjs/core/modules/encrypt/module/api-p.js.map +1 -1
- package/_cjs/core/modules/encrypt/module/index.js +3 -3
- package/_cjs/core/modules/encrypt/module/index.js.map +1 -1
- package/_cjs/core/modules/encrypt/module/init-p.js +63 -24
- package/_cjs/core/modules/encrypt/module/init-p.js.map +1 -1
- package/_cjs/core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.js +1 -1
- package/_cjs/core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.js.map +1 -1
- package/_cjs/core/modules/relayer/cleartext/fetchUserDecrypt.js +1 -1
- package/_cjs/core/modules/relayer/cleartext/fetchUserDecrypt.js.map +1 -1
- package/_cjs/core/modules/relayer/module/RelayerAsyncRequest.js +28 -4
- package/_cjs/core/modules/relayer/module/RelayerAsyncRequest.js.map +1 -1
- package/_cjs/core/modules/relayer/module/fetchFheEncryptionKeySource.js +5 -1
- package/_cjs/core/modules/relayer/module/fetchFheEncryptionKeySource.js.map +1 -1
- package/_cjs/core/modules/relayer/module/readErrorMessage.js +29 -0
- package/_cjs/core/modules/relayer/module/readErrorMessage.js.map +1 -0
- package/_cjs/core/runtime/CoreFhevm-p.js +171 -5
- package/_cjs/core/runtime/CoreFhevm-p.js.map +1 -1
- package/_cjs/core/runtime/HyperWasmSolver-p.js +187 -0
- package/_cjs/core/runtime/HyperWasmSolver-p.js.map +1 -0
- package/_cjs/core/runtime/ProtocolVersionResolver-p.js +270 -0
- package/_cjs/core/runtime/ProtocolVersionResolver-p.js.map +1 -0
- package/_cjs/core/runtime/initFhevmDecryptRuntime-p.js +1 -1
- package/_cjs/core/runtime/initFhevmDecryptRuntime-p.js.map +1 -1
- package/_cjs/core/runtime/initFhevmEncryptRuntime-p.js +1 -1
- package/_cjs/core/runtime/initFhevmEncryptRuntime-p.js.map +1 -1
- package/_cjs/core/runtime/initFhevmRuntime-p.js +4 -1
- package/_cjs/core/runtime/initFhevmRuntime-p.js.map +1 -1
- package/_cjs/core/runtime/resolveFhevmVersions-p.js +48 -0
- package/_cjs/core/runtime/resolveFhevmVersions-p.js.map +1 -0
- package/_cjs/core/runtimeConfig-p.js +10 -0
- package/_cjs/core/runtimeConfig-p.js.map +1 -1
- package/_cjs/core/types/{zkProofBuilder.js → moduleVersions.js} +1 -1
- package/_cjs/core/types/moduleVersions.js.map +1 -0
- package/_cjs/core/types/{fhevmUser.js → wasmAssets.js} +1 -1
- package/_cjs/core/types/wasmAssets.js.map +1 -0
- package/_cjs/core/types/{fhevmDecryptionKey.js → zkProofBuilder-p.js} +1 -1
- package/_cjs/core/types/zkProofBuilder-p.js.map +1 -0
- package/_cjs/core/utils-p/decrypt/verifyTkmsPublicKey.js +1 -0
- package/_cjs/core/utils-p/decrypt/verifyTkmsPublicKey.js.map +1 -1
- package/_cjs/ethers/internal/config.js +1 -18
- package/_cjs/ethers/internal/config.js.map +1 -1
- package/_cjs/viem/internal/config.js +1 -18
- package/_cjs/viem/internal/config.js.map +1 -1
- package/_cjs/wasm/tfhe/loadTfheLib.js.map +1 -1
- package/_cjs/wasm/tfhe/v1.5.3/tfhe.d.ts +4 -0
- package/_cjs/wasm/tfhe/v1.5.3/tfhe.js +6 -1
- package/_cjs/wasm/tfhe/v1.5.3/tfhe.js.map +2 -2
- package/_cjs/wasm/tfhe/v1.6.1/tfhe.d.ts +4 -0
- package/_cjs/wasm/tfhe/v1.6.1/tfhe.js +6 -1
- package/_cjs/wasm/tfhe/v1.6.1/tfhe.js.map +2 -2
- package/_cjs/wasm/tkms/loadKmsLib.js.map +1 -1
- package/_cjs/wasm/tkms/v0.13.10/kms_lib.d.ts +4 -0
- package/_cjs/wasm/tkms/v0.13.10/kms_lib.js +6 -1
- package/_cjs/wasm/tkms/v0.13.10/kms_lib.js.map +2 -2
- package/_cjs/wasm/tkms/v0.13.20-0/kms_lib.d.ts +4 -0
- package/_cjs/wasm/tkms/v0.13.20-0/kms_lib.js +6 -1
- package/_cjs/wasm/tkms/v0.13.20-0/kms_lib.js.map +2 -2
- package/_cjs/wasm/wasmBaseUrl.js +23 -7
- package/_cjs/wasm/wasmBaseUrl.js.map +2 -2
- package/_esm/core/_version.js +1 -1
- package/_esm/core/actions/base/canDecryptPublicValue.js +1 -1
- package/_esm/core/actions/base/canDecryptPublicValue.js.map +1 -1
- package/_esm/core/actions/base/canDecryptPublicValues.js +1 -1
- package/_esm/core/actions/base/canDecryptPublicValues.js.map +1 -1
- package/_esm/core/actions/base/{fetchKmsSignedcryptedShares.js → fetchKmsSigncryptedShares.js} +4 -4
- package/_esm/core/actions/base/fetchKmsSigncryptedShares.js.map +1 -0
- package/_esm/core/actions/base/index.js +1 -1
- package/_esm/core/actions/base/index.js.map +1 -1
- package/_esm/core/actions/base/readKmsSignersContext.js +2 -1
- package/_esm/core/actions/base/readKmsSignersContext.js.map +1 -1
- package/_esm/core/actions/chain/parseTransportKeyPair.js.map +1 -1
- package/_esm/core/actions/decrypt/decryptKmsSigncryptedShares.js +11 -0
- package/_esm/core/actions/decrypt/decryptKmsSigncryptedShares.js.map +1 -0
- package/_esm/core/actions/decrypt/decryptValue.js +3 -1
- package/_esm/core/actions/decrypt/decryptValue.js.map +1 -1
- package/_esm/core/actions/decrypt/decryptValues.js +3 -1
- package/_esm/core/actions/decrypt/decryptValues.js.map +1 -1
- package/_esm/core/actions/decrypt/decryptValuesFromPairs.js +3 -1
- package/_esm/core/actions/decrypt/decryptValuesFromPairs.js.map +1 -1
- package/_esm/core/actions/decrypt/generateTransportKeyPair.js +3 -1
- package/_esm/core/actions/decrypt/generateTransportKeyPair.js.map +1 -1
- package/_esm/core/actions/decrypt/index.js +1 -1
- package/_esm/core/actions/decrypt/index.js.map +1 -1
- package/_esm/core/actions/encrypt/encryptValue.js +3 -1
- package/_esm/core/actions/encrypt/encryptValue.js.map +1 -1
- package/_esm/core/actions/encrypt/encryptValues.js +3 -1
- package/_esm/core/actions/encrypt/encryptValues.js.map +1 -1
- package/_esm/core/actions/encrypt/generateZkProof.js +5 -1
- package/_esm/core/actions/encrypt/generateZkProof.js.map +1 -1
- package/_esm/core/actions/host/readFhevmExecutorContractData.js +8 -8
- package/_esm/core/actions/host/readFhevmExecutorContractData.js.map +1 -1
- package/_esm/core/actions/host/readInputVerifierContractData.js +2 -2
- package/_esm/core/actions/host/readInputVerifierContractData.js.map +1 -1
- package/_esm/core/actions/host/readKmsVerifierContractData.js +7 -6
- package/_esm/core/actions/host/readKmsVerifierContractData.js.map +1 -1
- package/_esm/core/actions/host/resolveFhevmConfig.js +7 -1
- package/_esm/core/actions/host/resolveFhevmConfig.js.map +1 -1
- package/_esm/core/base/object.js +28 -0
- package/_esm/core/base/object.js.map +1 -1
- package/_esm/core/base/semver.js +164 -0
- package/_esm/core/base/semver.js.map +1 -0
- package/_esm/core/base/uint.js +23 -2
- package/_esm/core/base/uint.js.map +1 -1
- package/_esm/core/chains/definitions/localTestnet.js +3 -0
- package/_esm/core/chains/definitions/localTestnet.js.map +1 -1
- package/_esm/core/chains/definitions/mainnet.js +1 -0
- package/_esm/core/chains/definitions/mainnet.js.map +1 -1
- package/_esm/core/chains/definitions/sepolia.js +1 -0
- package/_esm/core/chains/definitions/sepolia.js.map +1 -1
- package/_esm/core/clients/decorators/base.js +6 -1
- package/_esm/core/clients/decorators/base.js.map +1 -1
- package/_esm/core/clients/decorators/decrypt-p.js +11 -0
- package/_esm/core/clients/decorators/decrypt-p.js.map +1 -0
- package/_esm/core/clients/decorators/decrypt.js +3 -7
- package/_esm/core/clients/decorators/decrypt.js.map +1 -1
- package/_esm/core/clients/decorators/encrypt-p.js +6 -2
- package/_esm/core/clients/decorators/encrypt-p.js.map +1 -1
- package/_esm/core/clients/decorators/encrypt.js.map +1 -1
- package/_esm/core/coprocessor/ZkProof-p.js +4 -2
- package/_esm/core/coprocessor/ZkProof-p.js.map +1 -1
- package/_esm/core/coprocessor/ZkProofBuilder-p.js +2 -1
- package/_esm/core/coprocessor/ZkProofBuilder-p.js.map +1 -1
- package/_esm/core/coprocessor/encrypt.js +1 -1
- package/_esm/core/coprocessor/encrypt.js.map +1 -1
- package/_esm/core/errors/RelayerResponseStatusError.js +7 -2
- package/_esm/core/errors/RelayerResponseStatusError.js.map +1 -1
- package/_esm/core/host-contracts/HostContractVersion-p.js +34 -3
- package/_esm/core/host-contracts/HostContractVersion-p.js.map +1 -1
- package/_esm/core/host-contracts/KmsSignersContext-p.js +24 -6
- package/_esm/core/host-contracts/KmsSignersContext-p.js.map +1 -1
- package/_esm/core/host-contracts/abi-fragments/fragments.js +24 -0
- package/_esm/core/host-contracts/abi-fragments/fragments.js.map +1 -1
- package/_esm/core/host-contracts/canDecryptValuesFromPairs.js +1 -1
- package/_esm/core/host-contracts/canDecryptValuesFromPairs.js.map +1 -1
- package/_esm/core/host-contracts/checkAllowedForDecryption.js +2 -2
- package/_esm/core/host-contracts/checkAllowedForDecryption.js.map +1 -1
- package/_esm/core/host-contracts/checkDelegation.js +8 -8
- package/_esm/core/host-contracts/checkDelegation.js.map +1 -1
- package/_esm/core/host-contracts/checkPersistAllowed.js +9 -9
- package/_esm/core/host-contracts/checkPersistAllowed.js.map +1 -1
- package/_esm/core/host-contracts/getAclAddress-p.js +1 -2
- package/_esm/core/host-contracts/getAclAddress-p.js.map +1 -1
- package/_esm/core/host-contracts/getCurrentKmsContextAndEpoch-p.js +63 -0
- package/_esm/core/host-contracts/getCurrentKmsContextAndEpoch-p.js.map +1 -0
- package/_esm/core/host-contracts/getCurrentKmsContextId-p.js +6 -7
- package/_esm/core/host-contracts/getCurrentKmsContextId-p.js.map +1 -1
- package/_esm/core/host-contracts/getFhevmExecutorAddress-p.js +1 -1
- package/_esm/core/host-contracts/getFhevmExecutorAddress-p.js.map +1 -1
- package/_esm/core/host-contracts/getHandleVersion-p.js +1 -2
- package/_esm/core/host-contracts/getHandleVersion-p.js.map +1 -1
- package/_esm/core/host-contracts/getHcuLimitAddress-p.js +1 -2
- package/_esm/core/host-contracts/getHcuLimitAddress-p.js.map +1 -1
- package/_esm/core/host-contracts/getInputVerifierAddress-p.js +1 -2
- package/_esm/core/host-contracts/getInputVerifierAddress-p.js.map +1 -1
- package/_esm/core/host-contracts/getKmsContextSignersAndThreshold-p.js +6 -8
- package/_esm/core/host-contracts/getKmsContextSignersAndThreshold-p.js.map +1 -1
- package/_esm/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.js +5 -6
- package/_esm/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.js.map +1 -1
- package/_esm/core/host-contracts/getSignersForKmsContext-p.js +5 -7
- package/_esm/core/host-contracts/getSignersForKmsContext-p.js.map +1 -1
- package/_esm/core/host-contracts/isAllowedForDecryption.js +4 -4
- package/_esm/core/host-contracts/isAllowedForDecryption.js.map +1 -1
- package/_esm/core/host-contracts/isHandleDelegatedForUserDecryption-p.js +5 -5
- package/_esm/core/host-contracts/isHandleDelegatedForUserDecryption-p.js.map +1 -1
- package/_esm/core/host-contracts/isUserDecryptable.js +2 -2
- package/_esm/core/host-contracts/isUserDecryptable.js.map +1 -1
- package/_esm/core/host-contracts/persistAllowed.js +4 -4
- package/_esm/core/host-contracts/persistAllowed.js.map +1 -1
- package/_esm/core/host-contracts/readKmsSignersContext-p.js +89 -29
- package/_esm/core/host-contracts/readKmsSignersContext-p.js.map +1 -1
- package/_esm/core/key/FheEncryptionKeyWasm-p.js +12 -4
- package/_esm/core/key/FheEncryptionKeyWasm-p.js.map +1 -1
- package/_esm/core/key/deserializeFheEncryptionKey.js +3 -0
- package/_esm/core/key/deserializeFheEncryptionKey.js.map +1 -1
- package/_esm/core/key/fetchFheEncryptionKey.js +1 -1
- package/_esm/core/key/fetchFheEncryptionKey.js.map +1 -1
- package/_esm/core/key/fetchFheEncryptionKeyBytes.js.map +1 -1
- package/_esm/core/key/serializeFheEncryptionKey.js +4 -1
- package/_esm/core/key/serializeFheEncryptionKey.js.map +1 -1
- package/_esm/core/kms/KmsSigncryptedShares-p.js +9 -1
- package/_esm/core/kms/KmsSigncryptedShares-p.js.map +1 -1
- package/_esm/core/kms/SignedDecryptionPermit-p.js +5 -1
- package/_esm/core/kms/SignedDecryptionPermit-p.js.map +1 -1
- package/_esm/core/kms/TransportKeyPair-p.js +32 -7
- package/_esm/core/kms/TransportKeyPair-p.js.map +1 -1
- package/_esm/core/kms/createKmsUserDecryptEip712.js +4 -0
- package/_esm/core/kms/createKmsUserDecryptEip712.js.map +1 -1
- package/_esm/core/kms/createKmsUserDecryptEip712V2.js +98 -0
- package/_esm/core/kms/createKmsUserDecryptEip712V2.js.map +1 -0
- package/_esm/core/kms/{decryptKmsSignedcryptedShares-p.js → decryptKmsSigncryptedShares-p.js} +9 -2
- package/_esm/core/kms/decryptKmsSigncryptedShares-p.js.map +1 -0
- package/_esm/core/kms/decryptValuesFromPairs.js +4 -4
- package/_esm/core/kms/decryptValuesFromPairs.js.map +1 -1
- package/_esm/core/kms/{fetchKmsSignedcryptedShares-p.js → fetchKmsSigncryptedShares-p.js} +12 -6
- package/_esm/core/kms/fetchKmsSigncryptedShares-p.js.map +1 -0
- package/_esm/core/kms/kmsExtraData.js +70 -12
- package/_esm/core/kms/kmsExtraData.js.map +1 -1
- package/_esm/core/kms/kmsUserDecryptEip712V2Types.js +28 -0
- package/_esm/core/kms/kmsUserDecryptEip712V2Types.js.map +1 -0
- package/_esm/core/kms/publicDecrypt.js +5 -3
- package/_esm/core/kms/publicDecrypt.js.map +1 -1
- package/_esm/core/modules/decrypt/mock.js +0 -24
- package/_esm/core/modules/decrypt/mock.js.map +1 -1
- package/_esm/core/modules/decrypt/module/api-p.js +51 -23
- package/_esm/core/modules/decrypt/module/api-p.js.map +1 -1
- package/_esm/core/modules/decrypt/module/index.js +31 -25
- package/_esm/core/modules/decrypt/module/index.js.map +1 -1
- package/_esm/core/modules/decrypt/module/init-p.js +41 -19
- package/_esm/core/modules/decrypt/module/init-p.js.map +1 -1
- package/_esm/core/modules/encrypt/mock.js +26 -9
- package/_esm/core/modules/encrypt/mock.js.map +1 -1
- package/_esm/core/modules/encrypt/module/api-p.js +50 -21
- package/_esm/core/modules/encrypt/module/api-p.js.map +1 -1
- package/_esm/core/modules/encrypt/module/index.js +3 -3
- package/_esm/core/modules/encrypt/module/index.js.map +1 -1
- package/_esm/core/modules/encrypt/module/init-p.js +69 -29
- package/_esm/core/modules/encrypt/module/init-p.js.map +1 -1
- package/_esm/core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.js +2 -2
- package/_esm/core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.js.map +1 -1
- package/_esm/core/modules/relayer/cleartext/fetchUserDecrypt.js +2 -2
- package/_esm/core/modules/relayer/cleartext/fetchUserDecrypt.js.map +1 -1
- package/_esm/core/modules/relayer/module/RelayerAsyncRequest.js +57 -4
- package/_esm/core/modules/relayer/module/RelayerAsyncRequest.js.map +1 -1
- package/_esm/core/modules/relayer/module/fetchFheEncryptionKeySource.js +8 -1
- package/_esm/core/modules/relayer/module/fetchFheEncryptionKeySource.js.map +1 -1
- package/_esm/core/modules/relayer/module/readErrorMessage.js +52 -0
- package/_esm/core/modules/relayer/module/readErrorMessage.js.map +1 -0
- package/_esm/core/runtime/CoreFhevm-p.js +167 -5
- package/_esm/core/runtime/CoreFhevm-p.js.map +1 -1
- package/_esm/core/runtime/HyperWasmSolver-p.js +268 -0
- package/_esm/core/runtime/HyperWasmSolver-p.js.map +1 -0
- package/_esm/core/runtime/ProtocolVersionResolver-p.js +326 -0
- package/_esm/core/runtime/ProtocolVersionResolver-p.js.map +1 -0
- package/_esm/core/runtime/initFhevmDecryptRuntime-p.js +1 -1
- package/_esm/core/runtime/initFhevmDecryptRuntime-p.js.map +1 -1
- package/_esm/core/runtime/initFhevmEncryptRuntime-p.js +1 -1
- package/_esm/core/runtime/initFhevmEncryptRuntime-p.js.map +1 -1
- package/_esm/core/runtime/initFhevmRuntime-p.js +4 -1
- package/_esm/core/runtime/initFhevmRuntime-p.js.map +1 -1
- package/_esm/core/runtime/resolveFhevmVersions-p.js +62 -0
- package/_esm/core/runtime/resolveFhevmVersions-p.js.map +1 -0
- package/_esm/core/runtimeConfig-p.js +9 -0
- package/_esm/core/runtimeConfig-p.js.map +1 -1
- package/_esm/core/types/moduleVersions.js +2 -0
- package/_esm/core/types/moduleVersions.js.map +1 -0
- package/_esm/core/types/wasmAssets.js +2 -0
- package/_esm/core/types/wasmAssets.js.map +1 -0
- package/_esm/core/types/zkProofBuilder-p.js +2 -0
- package/_esm/core/types/zkProofBuilder-p.js.map +1 -0
- package/_esm/core/utils-p/decrypt/verifyTkmsPublicKey.js +1 -0
- package/_esm/core/utils-p/decrypt/verifyTkmsPublicKey.js.map +1 -1
- package/_esm/ethers/internal/config.js +1 -18
- package/_esm/ethers/internal/config.js.map +1 -1
- package/_esm/viem/internal/config.js +1 -18
- package/_esm/viem/internal/config.js.map +1 -1
- package/_esm/wasm/tfhe/v1.5.3/tfhe.d.ts +4 -0
- package/_esm/wasm/tfhe/v1.5.3/tfhe.js +8 -0
- package/_esm/wasm/tfhe/v1.6.1/tfhe.d.ts +4 -0
- package/_esm/wasm/tfhe/v1.6.1/tfhe.js +8 -0
- package/_esm/wasm/tkms/v0.13.10/kms_lib.d.ts +4 -0
- package/_esm/wasm/tkms/v0.13.10/kms_lib.js +8 -0
- package/_esm/wasm/tkms/v0.13.20-0/kms_lib.d.ts +4 -0
- package/_esm/wasm/tkms/v0.13.20-0/kms_lib.js +8 -0
- package/_esm/wasm/wasmBaseUrl.js +69 -4
- package/_types/core/actions/base/{fetchKmsSignedcryptedShares.d.ts → fetchKmsSigncryptedShares.d.ts} +7 -7
- package/_types/core/actions/base/fetchKmsSigncryptedShares.d.ts.map +1 -0
- package/_types/core/actions/base/index.d.ts +1 -1
- package/_types/core/actions/base/index.d.ts.map +1 -1
- package/_types/core/actions/base/readKmsSignersContext.d.ts.map +1 -1
- package/_types/core/actions/chain/parseSignedDecryptionPermit.d.ts +2 -2
- package/_types/core/actions/chain/parseSignedDecryptionPermit.d.ts.map +1 -1
- package/_types/core/actions/chain/parseTransportKeyPair.d.ts +1 -1
- package/_types/core/actions/chain/parseTransportKeyPair.d.ts.map +1 -1
- package/_types/core/actions/decrypt/{decryptKmsSignedcryptedShares.d.ts → decryptKmsSigncryptedShares.d.ts} +4 -4
- package/_types/core/actions/decrypt/decryptKmsSigncryptedShares.d.ts.map +1 -0
- package/_types/core/actions/decrypt/decryptValue.d.ts.map +1 -1
- package/_types/core/actions/decrypt/decryptValues.d.ts.map +1 -1
- package/_types/core/actions/decrypt/decryptValuesFromPairs.d.ts.map +1 -1
- package/_types/core/actions/decrypt/generateTransportKeyPair.d.ts +2 -2
- package/_types/core/actions/decrypt/generateTransportKeyPair.d.ts.map +1 -1
- package/_types/core/actions/decrypt/index.d.ts +1 -1
- package/_types/core/actions/decrypt/index.d.ts.map +1 -1
- package/_types/core/actions/encrypt/encryptValue.d.ts.map +1 -1
- package/_types/core/actions/encrypt/encryptValues.d.ts.map +1 -1
- package/_types/core/actions/encrypt/generateZkProof.d.ts.map +1 -1
- package/_types/core/actions/host/readKmsVerifierContractData.d.ts +1 -0
- package/_types/core/actions/host/readKmsVerifierContractData.d.ts.map +1 -1
- package/_types/core/actions/host/resolveFhevmConfig.d.ts +2 -0
- package/_types/core/actions/host/resolveFhevmConfig.d.ts.map +1 -1
- package/_types/core/base/object.d.ts +7 -0
- package/_types/core/base/object.d.ts.map +1 -1
- package/_types/core/base/semver.d.ts +39 -0
- package/_types/core/base/semver.d.ts.map +1 -0
- package/_types/core/base/uint.d.ts +13 -2
- package/_types/core/base/uint.d.ts.map +1 -1
- package/_types/core/chains/definitions/localTestnet.d.ts +3 -0
- package/_types/core/chains/definitions/localTestnet.d.ts.map +1 -1
- package/_types/core/chains/definitions/mainnet.d.ts +1 -0
- package/_types/core/chains/definitions/mainnet.d.ts.map +1 -1
- package/_types/core/chains/definitions/sepolia.d.ts.map +1 -1
- package/_types/core/clients/decorators/base.d.ts.map +1 -1
- package/_types/core/clients/decorators/decrypt-p.d.ts +4 -0
- package/_types/core/clients/decorators/decrypt-p.d.ts.map +1 -0
- package/_types/core/clients/decorators/decrypt.d.ts +4 -2
- package/_types/core/clients/decorators/decrypt.d.ts.map +1 -1
- package/_types/core/clients/decorators/encrypt-p.d.ts +2 -3
- package/_types/core/clients/decorators/encrypt-p.d.ts.map +1 -1
- package/_types/core/clients/decorators/encrypt.d.ts +4 -2
- package/_types/core/clients/decorators/encrypt.d.ts.map +1 -1
- package/_types/core/coprocessor/ZkProof-p.d.ts +9 -2
- package/_types/core/coprocessor/ZkProof-p.d.ts.map +1 -1
- package/_types/core/coprocessor/ZkProofBuilder-p.d.ts +3 -1
- package/_types/core/coprocessor/ZkProofBuilder-p.d.ts.map +1 -1
- package/_types/core/coprocessor/encrypt.d.ts +2 -0
- package/_types/core/coprocessor/encrypt.d.ts.map +1 -1
- package/_types/core/errors/RelayerResponseStatusError.d.ts +7 -1
- package/_types/core/errors/RelayerResponseStatusError.d.ts.map +1 -1
- package/_types/core/host-contracts/HostContractVersion-p.d.ts +18 -1
- package/_types/core/host-contracts/HostContractVersion-p.d.ts.map +1 -1
- package/_types/core/host-contracts/KmsSignersContext-p.d.ts +2 -1
- package/_types/core/host-contracts/KmsSignersContext-p.d.ts.map +1 -1
- package/_types/core/host-contracts/abi-fragments/fragments.d.ts +5 -0
- package/_types/core/host-contracts/abi-fragments/fragments.d.ts.map +1 -1
- package/_types/core/host-contracts/checkAllowedForDecryption.d.ts +1 -1
- package/_types/core/host-contracts/checkAllowedForDecryption.d.ts.map +1 -1
- package/_types/core/host-contracts/checkDelegation.d.ts +1 -1
- package/_types/core/host-contracts/checkDelegation.d.ts.map +1 -1
- package/_types/core/host-contracts/checkPersistAllowed.d.ts +1 -1
- package/_types/core/host-contracts/checkPersistAllowed.d.ts.map +1 -1
- package/_types/core/host-contracts/getAclAddress-p.d.ts +1 -1
- package/_types/core/host-contracts/getAclAddress-p.d.ts.map +1 -1
- package/_types/core/host-contracts/getCurrentKmsContextAndEpoch-p.d.ts +30 -0
- package/_types/core/host-contracts/getCurrentKmsContextAndEpoch-p.d.ts.map +1 -0
- package/_types/core/host-contracts/getCurrentKmsContextId-p.d.ts +1 -1
- package/_types/core/host-contracts/getCurrentKmsContextId-p.d.ts.map +1 -1
- package/_types/core/host-contracts/getFhevmExecutorAddress-p.d.ts +1 -1
- package/_types/core/host-contracts/getFhevmExecutorAddress-p.d.ts.map +1 -1
- package/_types/core/host-contracts/getHandleVersion-p.d.ts +1 -1
- package/_types/core/host-contracts/getHandleVersion-p.d.ts.map +1 -1
- package/_types/core/host-contracts/getHcuLimitAddress-p.d.ts +1 -1
- package/_types/core/host-contracts/getHcuLimitAddress-p.d.ts.map +1 -1
- package/_types/core/host-contracts/getInputVerifierAddress-p.d.ts +1 -1
- package/_types/core/host-contracts/getInputVerifierAddress-p.d.ts.map +1 -1
- package/_types/core/host-contracts/getKmsContextSignersAndThreshold-p.d.ts +1 -1
- package/_types/core/host-contracts/getKmsContextSignersAndThreshold-p.d.ts.map +1 -1
- package/_types/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.d.ts +1 -1
- package/_types/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.d.ts.map +1 -1
- package/_types/core/host-contracts/getSignersForKmsContext-p.d.ts +2 -2
- package/_types/core/host-contracts/getSignersForKmsContext-p.d.ts.map +1 -1
- package/_types/core/host-contracts/isAllowedForDecryption.d.ts +1 -1
- package/_types/core/host-contracts/isAllowedForDecryption.d.ts.map +1 -1
- package/_types/core/host-contracts/isHandleDelegatedForUserDecryption-p.d.ts +1 -1
- package/_types/core/host-contracts/isHandleDelegatedForUserDecryption-p.d.ts.map +1 -1
- package/_types/core/host-contracts/isUserDecryptable.d.ts +1 -1
- package/_types/core/host-contracts/isUserDecryptable.d.ts.map +1 -1
- package/_types/core/host-contracts/persistAllowed.d.ts +1 -1
- package/_types/core/host-contracts/persistAllowed.d.ts.map +1 -1
- package/_types/core/host-contracts/readKmsSignersContext-p.d.ts +25 -7
- package/_types/core/host-contracts/readKmsSignersContext-p.d.ts.map +1 -1
- package/_types/core/key/FheEncryptionKeyWasm-p.d.ts +3 -1
- package/_types/core/key/FheEncryptionKeyWasm-p.d.ts.map +1 -1
- package/_types/core/key/deserializeFheEncryptionKey.d.ts +2 -0
- package/_types/core/key/deserializeFheEncryptionKey.d.ts.map +1 -1
- package/_types/core/key/fetchFheEncryptionKey.d.ts +3 -1
- package/_types/core/key/fetchFheEncryptionKey.d.ts.map +1 -1
- package/_types/core/key/fetchFheEncryptionKeyBytes.d.ts.map +1 -1
- package/_types/core/key/serializeFheEncryptionKey.d.ts.map +1 -1
- package/_types/core/kms/KmsSigncryptedShares-p.d.ts.map +1 -1
- package/_types/core/kms/SignedDecryptionPermit-p.d.ts.map +1 -1
- package/_types/core/kms/TransportKeyPair-p.d.ts +9 -0
- package/_types/core/kms/TransportKeyPair-p.d.ts.map +1 -1
- package/_types/core/kms/createKmsUserDecryptEip712.d.ts.map +1 -1
- package/_types/core/kms/createKmsUserDecryptEip712V2.d.ts +15 -0
- package/_types/core/kms/createKmsUserDecryptEip712V2.d.ts.map +1 -0
- package/_types/core/kms/{decryptKmsSignedcryptedShares-p.d.ts → decryptKmsSigncryptedShares-p.d.ts} +4 -2
- package/_types/core/kms/decryptKmsSigncryptedShares-p.d.ts.map +1 -0
- package/_types/core/kms/decryptValuesFromPairs.d.ts +2 -0
- package/_types/core/kms/decryptValuesFromPairs.d.ts.map +1 -1
- package/_types/core/kms/{fetchKmsSignedcryptedShares-p.d.ts → fetchKmsSigncryptedShares-p.d.ts} +2 -2
- package/_types/core/kms/fetchKmsSigncryptedShares-p.d.ts.map +1 -0
- package/_types/core/kms/kmsExtraData.d.ts +9 -2
- package/_types/core/kms/kmsExtraData.d.ts.map +1 -1
- package/_types/core/kms/kmsUserDecryptEip712V2Types.d.ts +3 -0
- package/_types/core/kms/kmsUserDecryptEip712V2Types.d.ts.map +1 -0
- package/_types/core/kms/publicDecrypt.d.ts.map +1 -1
- package/_types/core/modules/decrypt/mock.d.ts +1 -2
- package/_types/core/modules/decrypt/mock.d.ts.map +1 -1
- package/_types/core/modules/decrypt/module/api-p.d.ts +2 -2
- package/_types/core/modules/decrypt/module/api-p.d.ts.map +1 -1
- package/_types/core/modules/decrypt/module/index.d.ts +1 -2
- package/_types/core/modules/decrypt/module/index.d.ts.map +1 -1
- package/_types/core/modules/decrypt/module/init-p.d.ts +3 -3
- package/_types/core/modules/decrypt/module/init-p.d.ts.map +1 -1
- package/_types/core/modules/decrypt/types.d.ts +33 -34
- package/_types/core/modules/decrypt/types.d.ts.map +1 -1
- package/_types/core/modules/encrypt/mock.d.ts.map +1 -1
- package/_types/core/modules/encrypt/module/api-p.d.ts.map +1 -1
- package/_types/core/modules/encrypt/module/index.d.ts.map +1 -1
- package/_types/core/modules/encrypt/module/init-p.d.ts +11 -4
- package/_types/core/modules/encrypt/module/init-p.d.ts.map +1 -1
- package/_types/core/modules/encrypt/types.d.ts +31 -2
- package/_types/core/modules/encrypt/types.d.ts.map +1 -1
- package/_types/core/modules/relayer/module/RelayerAsyncRequest.d.ts +18 -0
- package/_types/core/modules/relayer/module/RelayerAsyncRequest.d.ts.map +1 -1
- package/_types/core/modules/relayer/module/fetchFheEncryptionKeySource.d.ts.map +1 -1
- package/_types/core/modules/relayer/module/readErrorMessage.d.ts +26 -0
- package/_types/core/modules/relayer/module/readErrorMessage.d.ts.map +1 -0
- package/_types/core/runtime/CoreFhevm-p.d.ts +15 -4
- package/_types/core/runtime/CoreFhevm-p.d.ts.map +1 -1
- package/_types/core/runtime/HyperWasmSolver-p.d.ts +71 -0
- package/_types/core/runtime/HyperWasmSolver-p.d.ts.map +1 -0
- package/_types/core/runtime/ProtocolVersionResolver-p.d.ts +29 -0
- package/_types/core/runtime/ProtocolVersionResolver-p.d.ts.map +1 -0
- package/_types/core/runtime/initFhevmRuntime-p.d.ts.map +1 -1
- package/_types/core/runtime/resolveFhevmVersions-p.d.ts +21 -0
- package/_types/core/runtime/resolveFhevmVersions-p.d.ts.map +1 -0
- package/_types/core/runtimeConfig-p.d.ts +3 -2
- package/_types/core/runtimeConfig-p.d.ts.map +1 -1
- package/_types/core/types/auth.d.ts +12 -1
- package/_types/core/types/auth.d.ts.map +1 -1
- package/_types/core/types/coreFhevmClient.d.ts +72 -2
- package/_types/core/types/coreFhevmClient.d.ts.map +1 -1
- package/_types/core/types/coreFhevmRuntime.d.ts +3 -9
- package/_types/core/types/coreFhevmRuntime.d.ts.map +1 -1
- package/_types/core/types/fheEncryptionKey.d.ts +2 -0
- package/_types/core/types/fheEncryptionKey.d.ts.map +1 -1
- package/_types/core/types/fhevmChain.d.ts +3 -0
- package/_types/core/types/fhevmChain.d.ts.map +1 -1
- package/_types/core/types/hostContract.d.ts +1 -0
- package/_types/core/types/hostContract.d.ts.map +1 -1
- package/_types/core/types/index.d.ts +1 -1
- package/_types/core/types/index.d.ts.map +1 -1
- package/_types/core/types/kms-p.d.ts +2 -0
- package/_types/core/types/kms-p.d.ts.map +1 -1
- package/_types/core/types/kms.d.ts +71 -21
- package/_types/core/types/kms.d.ts.map +1 -1
- package/_types/core/types/kmsSignersContext.d.ts +8 -0
- package/_types/core/types/kmsSignersContext.d.ts.map +1 -1
- package/_types/core/types/logger.d.ts +1 -0
- package/_types/core/types/logger.d.ts.map +1 -1
- package/_types/core/types/moduleVersions.d.ts +25 -0
- package/_types/core/types/moduleVersions.d.ts.map +1 -0
- package/_types/core/types/tkms-p.d.ts +2 -0
- package/_types/core/types/tkms-p.d.ts.map +1 -1
- package/_types/core/types/wasmAssets.d.ts +2 -0
- package/_types/core/types/wasmAssets.d.ts.map +1 -0
- package/_types/core/types/{zkProofBuilder.d.ts → zkProofBuilder-p.d.ts} +8 -3
- package/_types/core/types/zkProofBuilder-p.d.ts.map +1 -0
- package/_types/core/utils-p/decrypt/verifyTkmsPublicKey.d.ts +2 -0
- package/_types/core/utils-p/decrypt/verifyTkmsPublicKey.d.ts.map +1 -1
- package/_types/ethers/cleartext/createFhevmCleartextDecryptClient.d.ts +2 -2
- package/_types/ethers/cleartext/createFhevmCleartextDecryptClient.d.ts.map +1 -1
- package/_types/ethers/cleartext/createFhevmCleartextEncryptClient.d.ts +2 -2
- package/_types/ethers/cleartext/createFhevmCleartextEncryptClient.d.ts.map +1 -1
- package/_types/ethers/clients/createFhevmDecryptClient.d.ts +2 -2
- package/_types/ethers/clients/createFhevmDecryptClient.d.ts.map +1 -1
- package/_types/ethers/clients/createFhevmEncryptClient.d.ts +2 -2
- package/_types/ethers/clients/createFhevmEncryptClient.d.ts.map +1 -1
- package/_types/viem/cleartext/createFhevmCleartextDecryptClient.d.ts +2 -2
- package/_types/viem/cleartext/createFhevmCleartextDecryptClient.d.ts.map +1 -1
- package/_types/viem/cleartext/createFhevmCleartextEncryptClient.d.ts +2 -2
- package/_types/viem/cleartext/createFhevmCleartextEncryptClient.d.ts.map +1 -1
- package/_types/viem/clients/createFhevmDecryptClient.d.ts +2 -2
- package/_types/viem/clients/createFhevmDecryptClient.d.ts.map +1 -1
- package/_types/viem/clients/createFhevmEncryptClient.d.ts +2 -2
- package/_types/viem/clients/createFhevmEncryptClient.d.ts.map +1 -1
- package/_types/wasm/tfhe/v1.5.3/tfhe.d.ts +4 -0
- package/_types/wasm/tfhe/v1.6.1/tfhe.d.ts +4 -0
- package/_types/wasm/tfheModuleVersion-p.d.ts +1 -1
- package/_types/wasm/tfheModuleVersion-p.d.ts.map +1 -1
- package/_types/wasm/tkms/v0.13.10/kms_lib.d.ts +4 -0
- package/_types/wasm/tkms/v0.13.20-0/kms_lib.d.ts +4 -0
- package/_types/wasm/tkmsModuleVersion-p.d.ts +1 -1
- package/_types/wasm/tkmsModuleVersion-p.d.ts.map +1 -1
- package/core/_version.ts +1 -1
- package/core/actions/base/canDecryptPublicValue.ts +1 -1
- package/core/actions/base/canDecryptPublicValues.ts +1 -1
- package/core/actions/base/{fetchKmsSignedcryptedShares.ts → fetchKmsSigncryptedShares.ts} +16 -16
- package/core/actions/base/index.ts +5 -5
- package/core/actions/base/readKmsSignersContext.ts +2 -1
- package/core/actions/chain/parseSignedDecryptionPermit.ts +2 -2
- package/core/actions/chain/parseTransportKeyPair.ts +2 -1
- package/core/actions/decrypt/{decryptKmsSignedcryptedShares.ts → decryptKmsSigncryptedShares.ts} +12 -9
- package/core/actions/decrypt/decryptValue.ts +4 -1
- package/core/actions/decrypt/decryptValues.ts +4 -1
- package/core/actions/decrypt/decryptValuesFromPairs.ts +4 -1
- package/core/actions/decrypt/generateTransportKeyPair.ts +5 -3
- package/core/actions/decrypt/index.ts +4 -4
- package/core/actions/encrypt/encryptValue.ts +4 -1
- package/core/actions/encrypt/encryptValues.ts +4 -1
- package/core/actions/encrypt/generateZkProof.ts +9 -1
- package/core/actions/host/readFhevmExecutorContractData.ts +8 -8
- package/core/actions/host/readInputVerifierContractData.ts +2 -2
- package/core/actions/host/readKmsVerifierContractData.ts +8 -6
- package/core/actions/host/resolveFhevmConfig.ts +10 -1
- package/core/base/object.ts +38 -0
- package/core/base/semver.ts +231 -0
- package/core/base/uint.ts +33 -4
- package/core/chains/definitions/localTestnet.ts +3 -0
- package/core/chains/definitions/mainnet.ts +1 -0
- package/core/chains/definitions/sepolia.ts +6 -6
- package/core/clients/decorators/base.ts +8 -1
- package/core/clients/decorators/decrypt-p.ts +18 -0
- package/core/clients/decorators/decrypt.ts +10 -15
- package/core/clients/decorators/encrypt-p.ts +12 -7
- package/core/clients/decorators/encrypt.ts +6 -4
- package/core/coprocessor/ZkProof-p.ts +17 -5
- package/core/coprocessor/ZkProofBuilder-p.ts +5 -2
- package/core/coprocessor/encrypt.ts +6 -1
- package/core/errors/RelayerResponseStatusError.ts +14 -2
- package/core/host-contracts/HostContractVersion-p.ts +60 -3
- package/core/host-contracts/KmsSignersContext-p.ts +36 -5
- package/core/host-contracts/abi-fragments/fragments.ts +28 -0
- package/core/host-contracts/canDecryptValuesFromPairs.ts +1 -1
- package/core/host-contracts/checkAllowedForDecryption.ts +3 -3
- package/core/host-contracts/checkDelegation.ts +9 -9
- package/core/host-contracts/checkPersistAllowed.ts +10 -10
- package/core/host-contracts/getAclAddress-p.ts +2 -3
- package/core/host-contracts/getCurrentKmsContextAndEpoch-p.ts +92 -0
- package/core/host-contracts/getCurrentKmsContextId-p.ts +8 -8
- package/core/host-contracts/getFhevmExecutorAddress-p.ts +2 -2
- package/core/host-contracts/getHandleVersion-p.ts +2 -3
- package/core/host-contracts/getHcuLimitAddress-p.ts +2 -3
- package/core/host-contracts/getInputVerifierAddress-p.ts +2 -3
- package/core/host-contracts/getKmsContextSignersAndThreshold-p.ts +7 -9
- package/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.ts +6 -7
- package/core/host-contracts/getSignersForKmsContext-p.ts +6 -8
- package/core/host-contracts/isAllowedForDecryption.ts +6 -6
- package/core/host-contracts/isHandleDelegatedForUserDecryption-p.ts +7 -7
- package/core/host-contracts/isUserDecryptable.ts +3 -3
- package/core/host-contracts/persistAllowed.ts +6 -6
- package/core/host-contracts/readKmsSignersContext-p.ts +131 -41
- package/core/key/FheEncryptionKeyWasm-p.ts +24 -3
- package/core/key/deserializeFheEncryptionKey.ts +8 -1
- package/core/key/fetchFheEncryptionKey.ts +8 -4
- package/core/key/fetchFheEncryptionKeyBytes.ts +4 -2
- package/core/key/serializeFheEncryptionKey.ts +8 -2
- package/core/kms/KmsSigncryptedShares-p.ts +11 -1
- package/core/kms/SignedDecryptionPermit-p.ts +6 -1
- package/core/kms/TransportKeyPair-p.ts +56 -10
- package/core/kms/createKmsUserDecryptEip712.ts +4 -0
- package/core/kms/createKmsUserDecryptEip712V2.ts +159 -0
- package/core/kms/{decryptKmsSignedcryptedShares-p.ts → decryptKmsSigncryptedShares-p.ts} +12 -2
- package/core/kms/decryptValuesFromPairs.ts +6 -4
- package/core/kms/{fetchKmsSignedcryptedShares-p.ts → fetchKmsSigncryptedShares-p.ts} +12 -5
- package/core/kms/kmsExtraData.ts +82 -13
- package/core/kms/kmsUserDecryptEip712V2Types.ts +31 -0
- package/core/kms/publicDecrypt.ts +5 -3
- package/core/modules/decrypt/mock.ts +0 -35
- package/core/modules/decrypt/module/api-p.ts +88 -17
- package/core/modules/decrypt/module/index.ts +37 -34
- package/core/modules/decrypt/module/init-p.ts +60 -28
- package/core/modules/decrypt/types.ts +37 -65
- package/core/modules/encrypt/mock.ts +34 -4
- package/core/modules/encrypt/module/api-p.ts +66 -15
- package/core/modules/encrypt/module/index.ts +5 -3
- package/core/modules/encrypt/module/init-p.ts +99 -40
- package/core/modules/encrypt/types.ts +34 -2
- package/core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.ts +2 -2
- package/core/modules/relayer/cleartext/fetchUserDecrypt.ts +2 -2
- package/core/modules/relayer/module/RelayerAsyncRequest.ts +60 -4
- package/core/modules/relayer/module/fetchFheEncryptionKeySource.ts +9 -1
- package/core/modules/relayer/module/readErrorMessage.ts +56 -0
- package/core/runtime/CoreFhevm-p.ts +247 -22
- package/core/runtime/HyperWasmSolver-p.ts +417 -0
- package/core/runtime/ProtocolVersionResolver-p.ts +463 -0
- package/core/runtime/initFhevmDecryptRuntime-p.ts +1 -1
- package/core/runtime/initFhevmEncryptRuntime-p.ts +1 -1
- package/core/runtime/initFhevmRuntime-p.ts +4 -1
- package/core/runtime/resolveFhevmVersions-p.ts +85 -0
- package/core/runtimeConfig-p.ts +17 -2
- package/core/types/auth.ts +12 -1
- package/core/types/coreFhevmClient.ts +89 -4
- package/core/types/coreFhevmRuntime.ts +3 -18
- package/core/types/fheEncryptionKey.ts +2 -0
- package/core/types/fhevmChain.ts +3 -0
- package/core/types/hostContract.ts +1 -0
- package/core/types/index.ts +1 -1
- package/core/types/kms-p.ts +2 -0
- package/core/types/kms.ts +48 -18
- package/core/types/kmsSignersContext.ts +8 -0
- package/core/types/logger.ts +1 -0
- package/core/types/moduleVersions.ts +35 -0
- package/core/types/tkms-p.ts +3 -0
- package/core/types/wasmAssets.ts +6 -0
- package/core/types/{zkProofBuilder.ts → zkProofBuilder-p.ts} +3 -2
- package/core/utils-p/decrypt/verifyTkmsPublicKey.ts +3 -1
- package/ethers/cleartext/createFhevmCleartextDecryptClient.ts +2 -2
- package/ethers/cleartext/createFhevmCleartextEncryptClient.ts +2 -2
- package/ethers/clients/createFhevmDecryptClient.ts +2 -2
- package/ethers/clients/createFhevmEncryptClient.ts +2 -2
- package/ethers/internal/config.ts +2 -30
- package/package.json +1 -1
- package/viem/cleartext/createFhevmCleartextDecryptClient.ts +2 -2
- package/viem/cleartext/createFhevmCleartextEncryptClient.ts +2 -2
- package/viem/clients/createFhevmDecryptClient.ts +2 -2
- package/viem/clients/createFhevmEncryptClient.ts +2 -2
- package/viem/internal/config.ts +2 -30
- package/wasm/tfhe/v1.5.3/tfhe.d.ts +4 -0
- package/wasm/tfhe/v1.5.3/tfhe.js +8 -0
- package/wasm/tfhe/v1.6.0-dev/tfhe.d.ts +4 -0
- package/wasm/tfhe/v1.6.0-dev/tfhe.js +8 -0
- package/wasm/tfhe/v1.6.1/tfhe.d.ts +4 -0
- package/wasm/tfhe/v1.6.1/tfhe.js +8 -0
- package/wasm/tfheModuleVersion-p.ts +1 -1
- package/wasm/tkms/v0.13.10/kms_lib.d.ts +4 -0
- package/wasm/tkms/v0.13.10/kms_lib.js +8 -0
- package/wasm/tkms/v0.13.20-0/kms_lib.d.ts +4 -0
- package/wasm/tkms/v0.13.20-0/kms_lib.js +8 -0
- package/wasm/tkmsModuleVersion-p.ts +1 -1
- package/wasm/wasmBaseUrl.js +69 -4
- package/_cjs/core/actions/base/fetchKmsSignedcryptedShares.js.map +0 -1
- package/_cjs/core/actions/decrypt/decryptKmsSignedcryptedShares.js +0 -11
- package/_cjs/core/actions/decrypt/decryptKmsSignedcryptedShares.js.map +0 -1
- package/_cjs/core/kms/decryptKmsSignedcryptedShares-p.js.map +0 -1
- package/_cjs/core/kms/fetchKmsSignedcryptedShares-p.js.map +0 -1
- package/_cjs/core/types/fhevmDecryptionKey.js.map +0 -1
- package/_cjs/core/types/fhevmUser.js.map +0 -1
- package/_cjs/core/types/zkProofBuilder.js.map +0 -1
- package/_esm/core/actions/base/fetchKmsSignedcryptedShares.js.map +0 -1
- package/_esm/core/actions/decrypt/decryptKmsSignedcryptedShares.js +0 -9
- package/_esm/core/actions/decrypt/decryptKmsSignedcryptedShares.js.map +0 -1
- package/_esm/core/kms/decryptKmsSignedcryptedShares-p.js.map +0 -1
- package/_esm/core/kms/fetchKmsSignedcryptedShares-p.js.map +0 -1
- package/_esm/core/types/fhevmDecryptionKey.js +0 -2
- package/_esm/core/types/fhevmDecryptionKey.js.map +0 -1
- package/_esm/core/types/fhevmUser.js +0 -2
- package/_esm/core/types/fhevmUser.js.map +0 -1
- package/_esm/core/types/zkProofBuilder.js +0 -2
- package/_esm/core/types/zkProofBuilder.js.map +0 -1
- package/_types/core/actions/base/fetchKmsSignedcryptedShares.d.ts.map +0 -1
- package/_types/core/actions/decrypt/decryptKmsSignedcryptedShares.d.ts.map +0 -1
- package/_types/core/kms/decryptKmsSignedcryptedShares-p.d.ts.map +0 -1
- package/_types/core/kms/fetchKmsSignedcryptedShares-p.d.ts.map +0 -1
- package/_types/core/types/fhevmDecryptionKey.d.ts +0 -4
- package/_types/core/types/fhevmDecryptionKey.d.ts.map +0 -1
- package/_types/core/types/fhevmUser.d.ts +0 -7
- package/_types/core/types/fhevmUser.d.ts.map +0 -1
- package/_types/core/types/zkProofBuilder.d.ts.map +0 -1
- package/core/types/fhevmDecryptionKey.ts +0 -8
- package/core/types/fhevmUser.ts +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.js","sourceRoot":"","sources":["../../../../core/modules/encrypt/mock.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"mock.js","sour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C,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _TfheCompactPublicKeyImpl_id, _TfheCompactPublicKeyImpl_tfheCompactPublicKeyWasmType, _TfheCompactPkeCrsImpl_id, _TfheCompactPkeCrsImpl_capacity, _TfheCompactPkeCrsImpl_compactPublicKeyWasmType;
|
|
12
|
+
var _TfheCompactPublicKeyImpl_id, _TfheCompactPublicKeyImpl_tfheCompactPublicKeyWasmType, _TfheCompactPublicKeyImpl_tfheVersion, _TfheCompactPkeCrsImpl_id, _TfheCompactPkeCrsImpl_capacity, _TfheCompactPkeCrsImpl_compactPublicKeyWasmType, _TfheCompactPkeCrsImpl_tfheVersion;
|
|
13
13
|
import { isNonEmptyString } from '../../../base/string.js';
|
|
14
14
|
import { hexToBytesFaster } from '../../../base/bytes.js';
|
|
15
15
|
import { encryptionBitsFromFheTypeId, isFheTypeId } from '../../../handle/FheType.js';
|
|
@@ -32,25 +32,33 @@ export const SERIALIZED_SIZE_LIMIT_CRS = BigInt(1024 * 1024 * 512);
|
|
|
32
32
|
// TfheCompactPublicKeyImpl
|
|
33
33
|
////////////////////////////////////////////////////////////////////////////////
|
|
34
34
|
class TfheCompactPublicKeyImpl {
|
|
35
|
-
constructor(token, id, publicEncKeyMlKem512Wasm) {
|
|
35
|
+
constructor(token, id, tfheVersion, publicEncKeyMlKem512Wasm) {
|
|
36
36
|
_TfheCompactPublicKeyImpl_id.set(this, void 0);
|
|
37
37
|
_TfheCompactPublicKeyImpl_tfheCompactPublicKeyWasmType.set(this, void 0);
|
|
38
|
+
_TfheCompactPublicKeyImpl_tfheVersion.set(this, void 0);
|
|
38
39
|
if (token !== PRIVATE_TFHE_LIB_TOKEN) {
|
|
39
40
|
throw new Error('Unauthorized');
|
|
40
41
|
}
|
|
41
42
|
__classPrivateFieldSet(this, _TfheCompactPublicKeyImpl_id, id, "f");
|
|
43
|
+
__classPrivateFieldSet(this, _TfheCompactPublicKeyImpl_tfheVersion, tfheVersion, "f");
|
|
42
44
|
__classPrivateFieldSet(this, _TfheCompactPublicKeyImpl_tfheCompactPublicKeyWasmType, publicEncKeyMlKem512Wasm, "f");
|
|
43
45
|
}
|
|
44
46
|
get id() {
|
|
45
47
|
return __classPrivateFieldGet(this, _TfheCompactPublicKeyImpl_id, "f");
|
|
46
48
|
}
|
|
47
|
-
|
|
49
|
+
get tfheVersion() {
|
|
50
|
+
return __classPrivateFieldGet(this, _TfheCompactPublicKeyImpl_tfheVersion, "f");
|
|
51
|
+
}
|
|
52
|
+
static [(_TfheCompactPublicKeyImpl_id = new WeakMap(), _TfheCompactPublicKeyImpl_tfheCompactPublicKeyWasmType = new WeakMap(), _TfheCompactPublicKeyImpl_tfheVersion = new WeakMap(), GET_NATIVE_FUNC)](key, token, tfheVersion) {
|
|
48
53
|
if (token !== PRIVATE_TFHE_LIB_TOKEN) {
|
|
49
54
|
throw new Error('Unauthorized');
|
|
50
55
|
}
|
|
51
56
|
if (!(key instanceof TfheCompactPublicKeyImpl)) {
|
|
52
57
|
throw new Error('Unauthorized');
|
|
53
58
|
}
|
|
59
|
+
if (tfheVersion !== __classPrivateFieldGet(key, _TfheCompactPublicKeyImpl_tfheVersion, "f")) {
|
|
60
|
+
throw new Error('TfheVersion mismatch');
|
|
61
|
+
}
|
|
54
62
|
return __classPrivateFieldGet(key, _TfheCompactPublicKeyImpl_tfheCompactPublicKeyWasmType, "f");
|
|
55
63
|
}
|
|
56
64
|
}
|
|
@@ -58,30 +66,38 @@ class TfheCompactPublicKeyImpl {
|
|
|
58
66
|
// TfheCompactPkeCrsImpl
|
|
59
67
|
////////////////////////////////////////////////////////////////////////////////
|
|
60
68
|
class TfheCompactPkeCrsImpl {
|
|
61
|
-
constructor(token, id, capacity, compactPublicKeyWasmType) {
|
|
69
|
+
constructor(token, id, tfheVersion, capacity, compactPublicKeyWasmType) {
|
|
62
70
|
_TfheCompactPkeCrsImpl_id.set(this, void 0);
|
|
63
71
|
_TfheCompactPkeCrsImpl_capacity.set(this, void 0);
|
|
64
72
|
_TfheCompactPkeCrsImpl_compactPublicKeyWasmType.set(this, void 0);
|
|
73
|
+
_TfheCompactPkeCrsImpl_tfheVersion.set(this, void 0);
|
|
65
74
|
if (token !== PRIVATE_TFHE_LIB_TOKEN) {
|
|
66
75
|
throw new Error('Unauthorized');
|
|
67
76
|
}
|
|
68
77
|
__classPrivateFieldSet(this, _TfheCompactPkeCrsImpl_id, id, "f");
|
|
78
|
+
__classPrivateFieldSet(this, _TfheCompactPkeCrsImpl_tfheVersion, tfheVersion, "f");
|
|
69
79
|
__classPrivateFieldSet(this, _TfheCompactPkeCrsImpl_capacity, capacity, "f");
|
|
70
80
|
__classPrivateFieldSet(this, _TfheCompactPkeCrsImpl_compactPublicKeyWasmType, compactPublicKeyWasmType, "f");
|
|
71
81
|
}
|
|
72
82
|
get id() {
|
|
73
83
|
return __classPrivateFieldGet(this, _TfheCompactPkeCrsImpl_id, "f");
|
|
74
84
|
}
|
|
85
|
+
get tfheVersion() {
|
|
86
|
+
return __classPrivateFieldGet(this, _TfheCompactPkeCrsImpl_tfheVersion, "f");
|
|
87
|
+
}
|
|
75
88
|
get capacity() {
|
|
76
89
|
return __classPrivateFieldGet(this, _TfheCompactPkeCrsImpl_capacity, "f");
|
|
77
90
|
}
|
|
78
|
-
static [(_TfheCompactPkeCrsImpl_id = new WeakMap(), _TfheCompactPkeCrsImpl_capacity = new WeakMap(), _TfheCompactPkeCrsImpl_compactPublicKeyWasmType = new WeakMap(), GET_NATIVE_FUNC)](key, token) {
|
|
91
|
+
static [(_TfheCompactPkeCrsImpl_id = new WeakMap(), _TfheCompactPkeCrsImpl_capacity = new WeakMap(), _TfheCompactPkeCrsImpl_compactPublicKeyWasmType = new WeakMap(), _TfheCompactPkeCrsImpl_tfheVersion = new WeakMap(), GET_NATIVE_FUNC)](key, token, tfheVersion) {
|
|
79
92
|
if (token !== PRIVATE_TFHE_LIB_TOKEN) {
|
|
80
93
|
throw new Error('Unauthorized');
|
|
81
94
|
}
|
|
82
95
|
if (!(key instanceof TfheCompactPkeCrsImpl)) {
|
|
83
96
|
throw new Error('Unauthorized');
|
|
84
97
|
}
|
|
98
|
+
if (tfheVersion !== __classPrivateFieldGet(key, _TfheCompactPkeCrsImpl_tfheVersion, "f")) {
|
|
99
|
+
throw new Error('TfheVersion mismatch');
|
|
100
|
+
}
|
|
85
101
|
return __classPrivateFieldGet(key, _TfheCompactPkeCrsImpl_compactPublicKeyWasmType, "f");
|
|
86
102
|
}
|
|
87
103
|
}
|
|
@@ -89,7 +105,7 @@ class TfheCompactPkeCrsImpl {
|
|
|
89
105
|
// parseTFHEProvenCompactCiphertextList
|
|
90
106
|
////////////////////////////////////////////////////////////////////////////////
|
|
91
107
|
export async function parseTFHEProvenCompactCiphertextList(runtime, parameters) {
|
|
92
|
-
const tfheLib = await initTfheModule(runtime);
|
|
108
|
+
const tfheLib = await initTfheModule(runtime, { tfheVersion: parameters.tfheVersion });
|
|
93
109
|
const { ciphertextWithZkProof: ciphertextWithZKProof } = parameters;
|
|
94
110
|
if (ciphertextWithZKProof == null) {
|
|
95
111
|
throw new EncryptionError({
|
|
@@ -138,7 +154,7 @@ export async function parseTFHEProvenCompactCiphertextList(runtime, parameters)
|
|
|
138
154
|
// buildWithProofPacked
|
|
139
155
|
////////////////////////////////////////////////////////////////////////////////
|
|
140
156
|
export async function buildWithProofPacked(runtime, parameters) {
|
|
141
|
-
const tfheLib = await initTfheModule(runtime);
|
|
157
|
+
const tfheLib = await initTfheModule(runtime, { tfheVersion: parameters.tfheVersion });
|
|
142
158
|
const { fheEncryptionKey: publicEncryptionParams, metaData, typedValues, extraData } = parameters;
|
|
143
159
|
const tfheCompactPublicKeyImpl = publicEncryptionParams.publicKey;
|
|
144
160
|
const tfheCompactPkeCrsImpl = publicEncryptionParams.crs;
|
|
@@ -152,8 +168,8 @@ export async function buildWithProofPacked(runtime, parameters) {
|
|
|
152
168
|
let ciphertextWithZKProofBytes;
|
|
153
169
|
let fheCompactCiphertextListBuilderWasm;
|
|
154
170
|
try {
|
|
155
|
-
const tfheCompactPublicKeyWasm = TfheCompactPublicKeyImpl[GET_NATIVE_FUNC](tfheCompactPublicKeyImpl, PRIVATE_TFHE_LIB_TOKEN);
|
|
156
|
-
const compactPkeCrsWasm = TfheCompactPkeCrsImpl[GET_NATIVE_FUNC](tfheCompactPkeCrsImpl, PRIVATE_TFHE_LIB_TOKEN);
|
|
171
|
+
const tfheCompactPublicKeyWasm = TfheCompactPublicKeyImpl[GET_NATIVE_FUNC](tfheCompactPublicKeyImpl, PRIVATE_TFHE_LIB_TOKEN, parameters.tfheVersion);
|
|
172
|
+
const compactPkeCrsWasm = TfheCompactPkeCrsImpl[GET_NATIVE_FUNC](tfheCompactPkeCrsImpl, PRIVATE_TFHE_LIB_TOKEN, parameters.tfheVersion);
|
|
157
173
|
fheCompactCiphertextListBuilderWasm = tfheLib.CompactCiphertextList.builder(tfheCompactPublicKeyWasm);
|
|
158
174
|
for (const typedValue of typedValues) {
|
|
159
175
|
assertIsTypedValue(typedValue, {});
|
|
@@ -189,6 +205,7 @@ export async function buildWithProofPacked(runtime, parameters) {
|
|
|
189
205
|
return Object.freeze({
|
|
190
206
|
ciphertextWithZKProofBytes,
|
|
191
207
|
extraData,
|
|
208
|
+
tfheVersion: parameters.tfheVersion,
|
|
192
209
|
});
|
|
193
210
|
}
|
|
194
211
|
finally {
|
|
@@ -214,7 +231,8 @@ export async function buildWithProofPacked(runtime, parameters) {
|
|
|
214
231
|
// serializeFheEncryptionKey
|
|
215
232
|
////////////////////////////////////////////////////////////////////////////////
|
|
216
233
|
export async function serializeFheEncryptionKey(runtime, parameters) {
|
|
217
|
-
|
|
234
|
+
const tfheVersion = parameters.tfheVersion;
|
|
235
|
+
await initTfheModule(runtime, { tfheVersion });
|
|
218
236
|
const { fheEncryptionKey: publicEncryptionParams } = parameters;
|
|
219
237
|
const tfheCompactPublicKeyImpl = publicEncryptionParams.publicKey;
|
|
220
238
|
const tfheCompactPkeCrsImpl = publicEncryptionParams.crs;
|
|
@@ -224,9 +242,9 @@ export async function serializeFheEncryptionKey(runtime, parameters) {
|
|
|
224
242
|
if (!(tfheCompactPkeCrsImpl instanceof TfheCompactPkeCrsImpl)) {
|
|
225
243
|
throw new Error('Invalid tfheCrs');
|
|
226
244
|
}
|
|
227
|
-
const tfhePublicKeyBytes = TfheCompactPublicKeyImpl[GET_NATIVE_FUNC](tfheCompactPublicKeyImpl, PRIVATE_TFHE_LIB_TOKEN).safe_serialize(SERIALIZED_SIZE_LIMIT_PK);
|
|
228
|
-
const tfheCrsBytes = TfheCompactPkeCrsImpl[GET_NATIVE_FUNC](tfheCompactPkeCrsImpl, PRIVATE_TFHE_LIB_TOKEN).safe_serialize(SERIALIZED_SIZE_LIMIT_CRS);
|
|
229
|
-
|
|
245
|
+
const tfhePublicKeyBytes = TfheCompactPublicKeyImpl[GET_NATIVE_FUNC](tfheCompactPublicKeyImpl, PRIVATE_TFHE_LIB_TOKEN, tfheVersion).safe_serialize(SERIALIZED_SIZE_LIMIT_PK);
|
|
246
|
+
const tfheCrsBytes = TfheCompactPkeCrsImpl[GET_NATIVE_FUNC](tfheCompactPkeCrsImpl, PRIVATE_TFHE_LIB_TOKEN, tfheVersion).safe_serialize(SERIALIZED_SIZE_LIMIT_CRS);
|
|
247
|
+
const keyBytes = Object.freeze({
|
|
230
248
|
publicKeyBytes: Object.freeze({
|
|
231
249
|
id: publicEncryptionParams.publicKey.id,
|
|
232
250
|
bytes: tfhePublicKeyBytes,
|
|
@@ -236,57 +254,68 @@ export async function serializeFheEncryptionKey(runtime, parameters) {
|
|
|
236
254
|
capacity: publicEncryptionParams.crs.capacity,
|
|
237
255
|
bytes: tfheCrsBytes,
|
|
238
256
|
}),
|
|
257
|
+
metadata: Object.freeze({
|
|
258
|
+
relayerUrl: publicEncryptionParams.metadata.relayerUrl,
|
|
259
|
+
chainId: publicEncryptionParams.metadata.chainId,
|
|
260
|
+
}),
|
|
239
261
|
});
|
|
262
|
+
return keyBytes;
|
|
240
263
|
}
|
|
241
264
|
////////////////////////////////////////////////////////////////////////////////
|
|
242
265
|
// serializeTfhePublicKey
|
|
243
266
|
////////////////////////////////////////////////////////////////////////////////
|
|
244
267
|
export async function serializeFheEncryptionPublicKey(runtime, parameters) {
|
|
245
|
-
|
|
268
|
+
const tfheVersion = parameters.tfheVersion;
|
|
269
|
+
await initTfheModule(runtime, { tfheVersion });
|
|
246
270
|
const { publicKey: tfhePublicKey } = parameters;
|
|
247
271
|
const tfheCompactPublicKeyImpl = tfhePublicKey;
|
|
248
272
|
if (!(tfheCompactPublicKeyImpl instanceof TfheCompactPublicKeyImpl)) {
|
|
249
273
|
throw new Error('Invalid tfhePublicKey');
|
|
250
274
|
}
|
|
251
|
-
const tfhePublicKeyBytes = TfheCompactPublicKeyImpl[GET_NATIVE_FUNC](tfheCompactPublicKeyImpl, PRIVATE_TFHE_LIB_TOKEN).safe_serialize(SERIALIZED_SIZE_LIMIT_PK);
|
|
275
|
+
const tfhePublicKeyBytes = TfheCompactPublicKeyImpl[GET_NATIVE_FUNC](tfheCompactPublicKeyImpl, PRIVATE_TFHE_LIB_TOKEN, tfheVersion).safe_serialize(SERIALIZED_SIZE_LIMIT_PK);
|
|
252
276
|
return Object.freeze({
|
|
253
277
|
id: tfhePublicKey.id,
|
|
254
278
|
bytes: tfhePublicKeyBytes,
|
|
279
|
+
tfheVersion,
|
|
255
280
|
});
|
|
256
281
|
}
|
|
257
282
|
////////////////////////////////////////////////////////////////////////////////
|
|
258
283
|
// serializeGlobalFheCrs
|
|
259
284
|
////////////////////////////////////////////////////////////////////////////////
|
|
260
285
|
export async function serializeFheEncryptionCrs(runtime, parameters) {
|
|
261
|
-
|
|
286
|
+
const tfheVersion = parameters.tfheVersion;
|
|
287
|
+
await initTfheModule(runtime, { tfheVersion });
|
|
262
288
|
const { crs: tfheCrs } = parameters;
|
|
263
289
|
const tfheCompactPkeCrsImpl = tfheCrs;
|
|
264
290
|
if (!(tfheCompactPkeCrsImpl instanceof TfheCompactPkeCrsImpl)) {
|
|
265
291
|
throw new Error('Invalid tfheCrs');
|
|
266
292
|
}
|
|
267
|
-
const tfheCrsBytes = TfheCompactPkeCrsImpl[GET_NATIVE_FUNC](tfheCompactPkeCrsImpl, PRIVATE_TFHE_LIB_TOKEN).safe_serialize(SERIALIZED_SIZE_LIMIT_CRS);
|
|
293
|
+
const tfheCrsBytes = TfheCompactPkeCrsImpl[GET_NATIVE_FUNC](tfheCompactPkeCrsImpl, PRIVATE_TFHE_LIB_TOKEN, tfheVersion).safe_serialize(SERIALIZED_SIZE_LIMIT_CRS);
|
|
268
294
|
return Object.freeze({
|
|
269
295
|
id: tfheCrs.id,
|
|
270
296
|
capacity: tfheCrs.capacity,
|
|
271
297
|
bytes: tfheCrsBytes,
|
|
298
|
+
tfheVersion,
|
|
272
299
|
});
|
|
273
300
|
}
|
|
274
301
|
////////////////////////////////////////////////////////////////////////////////
|
|
275
302
|
// deserializeFheEncryptionCrs
|
|
276
303
|
////////////////////////////////////////////////////////////////////////////////
|
|
277
304
|
export async function deserializeFheEncryptionCrs(runtime, parameters) {
|
|
278
|
-
const
|
|
305
|
+
const tfheVersion = parameters.tfheVersion;
|
|
306
|
+
const tfheLib = await initTfheModule(runtime, { tfheVersion });
|
|
279
307
|
const { crsBytes: globalFheCrsBytes } = parameters;
|
|
280
308
|
const compactPkeCrsWasm = tfheLib.CompactPkeCrs.safe_deserialize(globalFheCrsBytes.bytes, SERIALIZED_SIZE_LIMIT_CRS);
|
|
281
|
-
return new TfheCompactPkeCrsImpl(PRIVATE_TFHE_LIB_TOKEN, globalFheCrsBytes.id, globalFheCrsBytes.capacity, compactPkeCrsWasm);
|
|
309
|
+
return new TfheCompactPkeCrsImpl(PRIVATE_TFHE_LIB_TOKEN, globalFheCrsBytes.id, tfheVersion, globalFheCrsBytes.capacity, compactPkeCrsWasm);
|
|
282
310
|
}
|
|
283
311
|
////////////////////////////////////////////////////////////////////////////////
|
|
284
312
|
// deserializeFheEncryptionPublicKey
|
|
285
313
|
////////////////////////////////////////////////////////////////////////////////
|
|
286
314
|
export async function deserializeFheEncryptionPublicKey(runtime, parameters) {
|
|
287
|
-
const
|
|
315
|
+
const tfheVersion = parameters.tfheVersion;
|
|
316
|
+
const tfheLib = await initTfheModule(runtime, { tfheVersion });
|
|
288
317
|
const { publicKeyBytes: globalFhePublicKeyBytes } = parameters;
|
|
289
318
|
const tfheCompactPublicKeyWasm = tfheLib.TfheCompactPublicKey.safe_deserialize(globalFhePublicKeyBytes.bytes, SERIALIZED_SIZE_LIMIT_PK);
|
|
290
|
-
return new TfheCompactPublicKeyImpl(PRIVATE_TFHE_LIB_TOKEN, globalFhePublicKeyBytes.id, tfheCompactPublicKeyWasm);
|
|
319
|
+
return new TfheCompactPublicKeyImpl(PRIVATE_TFHE_LIB_TOKEN, globalFhePublicKeyBytes.id, tfheVersion, tfheCompactPublicKeyWasm);
|
|
291
320
|
}
|
|
292
321
|
//# sourceMappingURL=api-p.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-p.js","sourceRoot":"","sources":["../../../../../core/modules/encrypt/module/api-p.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,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,aAAa,CAAC,gBAAgB,CAC7E,iBAAiB,CAAC,KAAK,EACvB,yBAAyB,CAC1B,CAAC;IAEF,OAAO,IAAI,qBAAqB,CAC9B,sBAAsB,EACtB,iBAAiB,CAAC,EAAE,EACpB,WAAW,EACX,iBAAiB,CAAC,QAAQ,EAC1B,iBAAiB,CAClB,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,oCAAoC;AACpC,gFAAgF;AAEhF,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACrD,OAAqB,EACrB,UAAuD;IAEvD,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;IAC3C,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;IAE/D,MAAM,EAAE,cAAc,EAAE,uBAAuB,EAAE,GAAG,UAAU,CAAC;IAE/D,MAAM,wBAAwB,GAAyB,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAClG,uBAAuB,CAAC,KAAK,EAC7B,wBAAwB,CACzB,CAAC;IAEF,OAAO,IAAI,wBAAwB,CACjC,sBAAsB,EACtB,uBAAuB,CAAC,EAAE,EAC1B,WAAW,EACX,wBAAwB,CACzB,CAAC;AACJ,CAAC"}
|
|
@@ -6,10 +6,10 @@ import { getTfheModuleInfo, initTfheModule } from './init-p.js';
|
|
|
6
6
|
export const encryptModule = (runtime) => {
|
|
7
7
|
return Object.freeze({
|
|
8
8
|
encrypt: Object.freeze({
|
|
9
|
-
initTfheModule: async () => {
|
|
10
|
-
await initTfheModule(runtime);
|
|
9
|
+
initTfheModule: async (args) => {
|
|
10
|
+
await initTfheModule(runtime, args);
|
|
11
11
|
},
|
|
12
|
-
getTfheModuleInfo: () => getTfheModuleInfo(),
|
|
12
|
+
getTfheModuleInfo: (args) => getTfheModuleInfo(args),
|
|
13
13
|
parseTFHEProvenCompactCiphertextList: (args) => parseTFHEProvenCompactCiphertextList(runtime, args),
|
|
14
14
|
buildWithProofPacked: (args) => buildWithProofPacked(runtime, args),
|
|
15
15
|
serializeFheEncryptionKey: (args) => serializeFheEncryptionKey(runtime, args),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../core/modules/encrypt/module/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../core/modules/encrypt/module/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,iCAAiC,EACjC,oCAAoC,EACpC,yBAAyB,EACzB,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEhE,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,aAAa,GAAyB,CAAC,OAAqB,EAAE,EAAE;IAC3E,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;YACrB,cAAc,EAAE,KAAK,EAAE,IAA8B,EAAE,EAAE;gBACvD,MAAM,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACtC,CAAC;YACD,iBAAiB,EAAE,CAAC,IAAiC,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC;YACjF,oCAAoC,EAAE,CAAC,IAAoD,EAAE,EAAE,CAC7F,oCAAoC,CAAC,OAAO,EAAE,IAAI,CAAC;YACrD,oBAAoB,EAAE,CAAC,IAAoC,EAAE,EAAE,CAAC,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC;YACnG,yBAAyB,EAAE,CAAC,IAAyC,EAAE,EAAE,CACvE,yBAAyB,CAAC,OAAO,EAAE,IAAI,CAAC;YAC1C,+BAA+B,EAAE,CAAC,IAA+C,EAAE,EAAE,CACnF,+BAA+B,CAAC,OAAO,EAAE,IAAI,CAAC;YAChD,yBAAyB,EAAE,CAAC,IAAyC,EAAE,EAAE,CACvE,yBAAyB,CAAC,OAAO,EAAE,IAAI,CAAC;YAC1C,iCAAiC,EAAE,CAAC,IAAiD,EAAE,EAAE,CACvF,iCAAiC,CAAC,OAAO,EAAE,IAAI,CAAC;YAClD,2BAA2B,EAAE,CAAC,IAA2C,EAAE,EAAE,CAC3E,2BAA2B,CAAC,OAAO,EAAE,IAAI,CAAC;SAC7C,CAAC;KACH,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -2,7 +2,6 @@ import { isomorphicCompileVerifiedWasm, isomorphicCompileWasmFromBase64 } from '
|
|
|
2
2
|
import { isBlobWorkerSupported, isBrowserLike } from '../../../base/isomorphicWorker.js';
|
|
3
3
|
import { threads } from 'wasm-feature-detect';
|
|
4
4
|
import { assertIsFhevmRuntime } from '../../../runtime/CoreFhevmRuntime-p.js';
|
|
5
|
-
import { resolveTfheModuleVersion } from '../../../../wasm/tfheModuleVersion-p.js';
|
|
6
5
|
// Pure JS file (not compiled by tsc) — provides cross-platform base URL
|
|
7
6
|
// for resolving WASM paths. Uses import.meta.url in ESM, __filename in CJS.
|
|
8
7
|
import { wasmBaseUrl } from '../../../../wasm/wasmBaseUrl.js';
|
|
@@ -22,26 +21,31 @@ function _resolveTfheAsset(asset, locateFile) {
|
|
|
22
21
|
}
|
|
23
22
|
return Object.freeze({ ...asset, url });
|
|
24
23
|
}
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const resolvedTfheModuleConfigByVersion = new Map();
|
|
25
|
+
const resolvingTfheModuleConfigPromiseByVersion = new Map();
|
|
27
26
|
/**
|
|
28
27
|
* @internal
|
|
29
|
-
* Returns the existing resolved config, or resolves it from
|
|
28
|
+
* Returns the existing resolved config for a TFHE version, or resolves it from
|
|
29
|
+
* the runtime config.
|
|
30
30
|
*/
|
|
31
|
-
async function _getOrResolveTfheModuleConfig(runtime) {
|
|
31
|
+
async function _getOrResolveTfheModuleConfig(runtime, tfheVersion) {
|
|
32
|
+
const resolvedTfheModuleConfig = resolvedTfheModuleConfigByVersion.get(tfheVersion);
|
|
32
33
|
if (resolvedTfheModuleConfig !== undefined) {
|
|
33
34
|
return resolvedTfheModuleConfig;
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
-
resolvingTfheModuleConfigPromise
|
|
37
|
-
.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
let resolvingTfheModuleConfigPromise = resolvingTfheModuleConfigPromiseByVersion.get(tfheVersion);
|
|
37
|
+
if (resolvingTfheModuleConfigPromise === undefined) {
|
|
38
|
+
resolvingTfheModuleConfigPromise = _resolveTfheModuleConfig(runtime.config, tfheVersion)
|
|
39
|
+
.then((cfg) => {
|
|
40
|
+
resolvedTfheModuleConfigByVersion.set(tfheVersion, cfg);
|
|
41
|
+
return cfg;
|
|
42
|
+
})
|
|
43
|
+
.catch((error) => {
|
|
44
|
+
resolvingTfheModuleConfigPromiseByVersion.delete(tfheVersion);
|
|
45
|
+
throw error;
|
|
46
|
+
});
|
|
47
|
+
resolvingTfheModuleConfigPromiseByVersion.set(tfheVersion, resolvingTfheModuleConfigPromise);
|
|
48
|
+
}
|
|
45
49
|
return resolvingTfheModuleConfigPromise;
|
|
46
50
|
}
|
|
47
51
|
/**
|
|
@@ -121,24 +125,40 @@ async function _resolveTfheModuleConfig(parameters, version) {
|
|
|
121
125
|
////////////////////////////////////////////////////////////////////////////////
|
|
122
126
|
// initTfheModule
|
|
123
127
|
////////////////////////////////////////////////////////////////////////////////
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
const ownerUidByVersion = new Map();
|
|
129
|
+
const cachedTfheModulePromiseByVersion = new Map();
|
|
130
|
+
const moduleInfoByVersion = new Map();
|
|
131
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
132
|
+
// Version-tagged native wrappers
|
|
133
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
134
|
+
export const TFHE_VERSION_TAG = Symbol('TFHE.version');
|
|
135
|
+
export function getTaggedTfheVersion(value) {
|
|
136
|
+
return value[TFHE_VERSION_TAG];
|
|
137
|
+
}
|
|
138
|
+
export function assertTaggedTfheVersion(value, expectedVersion) {
|
|
139
|
+
const actualVersion = getTaggedTfheVersion(value);
|
|
140
|
+
if (actualVersion !== expectedVersion) {
|
|
141
|
+
throw new Error(`Unexpected TFHE native wrapper version '${actualVersion}', expected '${expectedVersion}'.`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
126
144
|
/**
|
|
127
145
|
* Initializes the TFHE module and returns the loaded lib bindings.
|
|
128
|
-
* Idempotent: subsequent calls return the same cached lib instance.
|
|
146
|
+
* Idempotent per TFHE version: subsequent calls return the same cached lib instance.
|
|
129
147
|
*/
|
|
130
|
-
export async function initTfheModule(runtime) {
|
|
148
|
+
export async function initTfheModule(runtime, parameters) {
|
|
131
149
|
assertIsFhevmRuntime(runtime, {});
|
|
150
|
+
const ownerUid = ownerUidByVersion.get(parameters.tfheVersion);
|
|
132
151
|
if (ownerUid !== undefined && runtime.uid !== ownerUid) {
|
|
133
152
|
throw new Error(`Encrypt WASM module is already owned by runtime '${ownerUid}' and cannot be shared with runtime '${runtime.uid}'`);
|
|
134
153
|
}
|
|
135
|
-
|
|
154
|
+
ownerUidByVersion.set(parameters.tfheVersion, runtime.uid);
|
|
136
155
|
// Cache the whole initialization promise before the first await. Several
|
|
137
156
|
// clients may call initTfheModule concurrently during startup; if the promise
|
|
138
157
|
// were assigned after resolving the config, each caller could enter
|
|
139
158
|
// _initTfheModule and try to start the global TFHE worker pool independently.
|
|
140
|
-
//
|
|
141
|
-
// one-shot, so
|
|
159
|
+
// Each TFHE version has its own JS glue module and worker pool, and each
|
|
160
|
+
// version's startWorkers() is intentionally one-shot, so concurrent callers
|
|
161
|
+
// for the same version must await the same promise.
|
|
142
162
|
//
|
|
143
163
|
// Retry is not supported:
|
|
144
164
|
// -----------------------
|
|
@@ -147,17 +167,17 @@ export async function initTfheModule(runtime) {
|
|
|
147
167
|
// failure. Keep even a rejected promise cached so later callers observe the
|
|
148
168
|
// original initialization error instead of retrying against half-initialized
|
|
149
169
|
// state and producing secondary errors such as "Already started".
|
|
150
|
-
|
|
170
|
+
let cachedTfheModulePromise = cachedTfheModulePromiseByVersion.get(parameters.tfheVersion);
|
|
151
171
|
if (cachedTfheModulePromise === undefined) {
|
|
152
172
|
cachedTfheModulePromise = (async () => {
|
|
153
173
|
// resolve is async
|
|
154
|
-
const cfg = await _getOrResolveTfheModuleConfig(runtime);
|
|
174
|
+
const cfg = await _getOrResolveTfheModuleConfig(runtime, parameters.tfheVersion);
|
|
155
175
|
return await _initTfheModule(cfg);
|
|
156
176
|
})();
|
|
177
|
+
cachedTfheModulePromiseByVersion.set(parameters.tfheVersion, cachedTfheModulePromise);
|
|
157
178
|
}
|
|
158
179
|
return cachedTfheModulePromise;
|
|
159
180
|
}
|
|
160
|
-
let moduleInfo = undefined;
|
|
161
181
|
async function _initTfheModule(cfg) {
|
|
162
182
|
const tfheLib = await loadTfheLib(cfg.version);
|
|
163
183
|
// Compile WASM module (see matrix in types.ts)
|
|
@@ -182,20 +202,40 @@ async function _initTfheModule(cfg) {
|
|
|
182
202
|
await tfheLib.initThreadPool(cfg.numberOfThreads);
|
|
183
203
|
}
|
|
184
204
|
const wasmInfo = tfheLib.getWasmInfo();
|
|
185
|
-
|
|
205
|
+
const memory = { byteLength: 0, pages: 0 };
|
|
206
|
+
if (wasmInfo.memory !== undefined) {
|
|
207
|
+
memory.byteLength = wasmInfo.memory.byteLength;
|
|
208
|
+
memory.pages = wasmInfo.memory.pages;
|
|
209
|
+
}
|
|
210
|
+
moduleInfoByVersion.set(cfg.version, Object.freeze({
|
|
186
211
|
wasmUrl: cfg.wasm.url ? new URL(cfg.wasm.url) : undefined,
|
|
187
212
|
version: wasmInfo.version,
|
|
188
213
|
name: wasmInfo.name,
|
|
189
214
|
workerUrl: cfg.worker.url ? new URL(cfg.worker.url) : undefined,
|
|
190
215
|
numberOfThreads: cfg.singleThread ? 0 : cfg.numberOfThreads,
|
|
191
216
|
threadsAvailable: cfg.supportsThreads,
|
|
192
|
-
|
|
217
|
+
memory,
|
|
218
|
+
}));
|
|
193
219
|
return tfheLib;
|
|
194
220
|
}
|
|
195
221
|
////////////////////////////////////////////////////////////////////////////////
|
|
196
222
|
// getTfheModuleInfo
|
|
197
223
|
////////////////////////////////////////////////////////////////////////////////
|
|
198
|
-
export function getTfheModuleInfo() {
|
|
199
|
-
|
|
224
|
+
export async function getTfheModuleInfo(parameters) {
|
|
225
|
+
const tfheLib = await loadTfheLib(parameters.tfheVersion);
|
|
226
|
+
const stored = moduleInfoByVersion.get(parameters.tfheVersion);
|
|
227
|
+
if (stored === undefined) {
|
|
228
|
+
throw new Error(`getTfheModuleInfo: no module info recorded for version "${parameters.tfheVersion}"`);
|
|
229
|
+
}
|
|
230
|
+
const memory = {
|
|
231
|
+
byteLength: stored.memory.byteLength,
|
|
232
|
+
pages: stored.memory.pages,
|
|
233
|
+
};
|
|
234
|
+
const wasmInfo = tfheLib.getWasmInfo();
|
|
235
|
+
if (wasmInfo.memory !== undefined) {
|
|
236
|
+
memory.byteLength = wasmInfo.memory.byteLength;
|
|
237
|
+
memory.pages = wasmInfo.memory.pages;
|
|
238
|
+
}
|
|
239
|
+
return { ...stored, memory };
|
|
200
240
|
}
|
|
201
241
|
//# sourceMappingURL=init-p.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-p.js","sourceRoot":"","sources":["../../../../../core/modules/encrypt/module/init-p.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init-p.js","sourceRoot":"","sources":["../../../../../core/modules/encrypt/module/init-p.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AACvG,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,EAAE,OAAO,E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KAAK;KAC3B,CAAC;IACF,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IACvC,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAClC,MAAM,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC;QAC/C,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { remove0x } from '../../../base/string.js';
|
|
2
|
-
import { asUint32BigInt,
|
|
2
|
+
import { asUint32BigInt, tryParseUintBigIntString, randomUniqueUints } from '../../../base/uint.js';
|
|
3
3
|
import { getTrustedClient } from '../../../runtime/CoreFhevm-p.js';
|
|
4
4
|
import { userDecryptResultToKmsSigncryptedShares } from '../utils.js';
|
|
5
5
|
import { getKmsSignersPrivateKeyMap } from './signers.js';
|
|
@@ -112,7 +112,7 @@ export async function fetchDelegatedUserDecrypt(relayerClient, parameters) {
|
|
|
112
112
|
}
|
|
113
113
|
////////////////////////////////////////////////////////////////////////////////
|
|
114
114
|
function _parseUintBigIntString(label, value) {
|
|
115
|
-
const bn =
|
|
115
|
+
const bn = tryParseUintBigIntString(value);
|
|
116
116
|
if (bn === undefined) {
|
|
117
117
|
throw new Error(`${label} is not a valid uint string, got ${JSON.stringify(value)}`);
|
|
118
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchDelegatedUserDecrypt.js","sourceRoot":"","sources":["../../../../../core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"fetchDelegatedUserDecrypt.js","sourceRoot":"","sources":["../../../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
1
|
import { remove0x } from '../../../base/string.js';
|
|
2
|
-
import { asUint32BigInt,
|
|
2
|
+
import { asUint32BigInt, tryParseUintBigIntString, randomUniqueUints } from '../../../base/uint.js';
|
|
3
3
|
import { getTrustedClient } from '../../../runtime/CoreFhevm-p.js';
|
|
4
4
|
import { userDecryptResultToKmsSigncryptedShares } from '../utils.js';
|
|
5
5
|
import { getKmsSignersPrivateKeyMap } from './signers.js';
|
|
@@ -110,7 +110,7 @@ export async function fetchUserDecrypt(relayerClient, parameters) {
|
|
|
110
110
|
}
|
|
111
111
|
////////////////////////////////////////////////////////////////////////////////
|
|
112
112
|
function _parseUintBigIntString(label, value) {
|
|
113
|
-
const bn =
|
|
113
|
+
const bn = tryParseUintBigIntString(value);
|
|
114
114
|
if (bn === undefined) {
|
|
115
115
|
throw new Error(`${label} is not a valid uint string, got ${JSON.stringify(value)}`);
|
|
116
116
|
}
|