@fhevm/sdk 1.0.0-alpha.1 → 1.0.0-alpha.2
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/fetchVerifiedInputProof.js +1 -1
- package/_cjs/core/actions/base/fetchVerifiedInputProof.js.map +1 -1
- package/_cjs/core/actions/base/signDecryptionPermit.js.map +1 -1
- package/_cjs/core/actions/chain/index.js +5 -5
- package/_cjs/core/actions/chain/index.js.map +1 -1
- package/_cjs/core/actions/chain/parseSignedDecryptionPermit.js +2 -3
- package/_cjs/core/actions/chain/parseSignedDecryptionPermit.js.map +1 -1
- package/_cjs/core/actions/chain/parseTransportKeypair.js +1 -2
- package/_cjs/core/actions/chain/parseTransportKeypair.js.map +1 -1
- package/_cjs/core/actions/decrypt/decryptValue.js +4 -1
- package/_cjs/core/actions/decrypt/decryptValue.js.map +1 -1
- package/_cjs/core/actions/decrypt/decryptValues.js +4 -1
- package/_cjs/core/actions/decrypt/decryptValues.js.map +1 -1
- package/_cjs/core/actions/decrypt/decryptValuesFromPairs.js +4 -1
- package/_cjs/core/actions/decrypt/decryptValuesFromPairs.js.map +1 -1
- package/_cjs/core/actions/decrypt/index.js.map +1 -1
- package/_cjs/core/base/bytes.js +8 -0
- package/_cjs/core/base/bytes.js.map +1 -1
- package/_cjs/core/base/sign.js +50 -0
- package/_cjs/core/base/sign.js.map +1 -0
- package/_cjs/core/base/typedValue.js +17 -0
- package/_cjs/core/base/typedValue.js.map +1 -1
- package/_cjs/core/base/uint.js +29 -0
- package/_cjs/core/base/uint.js.map +1 -1
- package/_cjs/core/clients/decorators/decrypt.js +3 -3
- package/_cjs/core/clients/decorators/decrypt.js.map +1 -1
- package/_cjs/core/coprocessor/ZkProof-p.js +17 -11
- package/_cjs/core/coprocessor/ZkProof-p.js.map +1 -1
- package/_cjs/core/coprocessor/ZkProofBuilder-p.js +6 -4
- package/_cjs/core/coprocessor/ZkProofBuilder-p.js.map +1 -1
- package/_cjs/core/coprocessor/encrypt.js +1 -3
- package/_cjs/core/coprocessor/encrypt.js.map +1 -1
- package/_cjs/core/coprocessor/fetchVerifiedInputProof.js +3 -4
- package/_cjs/core/coprocessor/fetchVerifiedInputProof.js.map +1 -1
- package/_cjs/core/handle/FheType.js +5 -2
- package/_cjs/core/handle/FheType.js.map +1 -1
- package/_cjs/core/host-contracts/KmsSignersContext-p.js +1 -1
- package/_cjs/core/host-contracts/KmsSignersContext-p.js.map +1 -1
- package/_cjs/core/kms/fetchKmsSignedcryptedShares-p.js +2 -3
- package/_cjs/core/kms/fetchKmsSignedcryptedShares-p.js.map +1 -1
- package/_cjs/core/kms/publicDecrypt.js +1 -4
- package/_cjs/core/kms/publicDecrypt.js.map +1 -1
- package/_cjs/core/modules/decrypt/mock.js +93 -10
- package/_cjs/core/modules/decrypt/mock.js.map +1 -1
- package/_cjs/core/modules/encrypt/mock.js +142 -12
- package/_cjs/core/modules/encrypt/mock.js.map +1 -1
- package/_cjs/core/modules/encrypt/module/api-p.js +7 -2
- package/_cjs/core/modules/encrypt/module/api-p.js.map +1 -1
- package/_cjs/core/modules/ethereum/types-ct.js +3 -0
- package/_cjs/core/modules/ethereum/types-ct.js.map +1 -0
- package/_cjs/core/modules/relayer/cleartext/fetchCoprocessorSignatures.js +68 -0
- package/_cjs/core/modules/relayer/cleartext/fetchCoprocessorSignatures.js.map +1 -0
- package/_cjs/core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.js +119 -0
- package/_cjs/core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.js.map +1 -0
- package/_cjs/core/modules/relayer/cleartext/fetchPublicDecrypt.js +52 -0
- package/_cjs/core/modules/relayer/cleartext/fetchPublicDecrypt.js.map +1 -0
- package/_cjs/core/modules/relayer/cleartext/fetchUserDecrypt.js +117 -0
- package/_cjs/core/modules/relayer/cleartext/fetchUserDecrypt.js.map +1 -0
- package/_cjs/core/modules/relayer/cleartext/mock.js +40 -0
- package/_cjs/core/modules/relayer/cleartext/mock.js.map +1 -0
- package/_cjs/core/modules/relayer/cleartext/signers.js +34 -0
- package/_cjs/core/modules/relayer/cleartext/signers.js.map +1 -0
- package/_cjs/core/modules/relayer/module/fetchCoprocessorSignatures.js +2 -2
- package/_cjs/core/modules/relayer/module/fetchCoprocessorSignatures.js.map +1 -1
- package/_cjs/core/modules/relayer/module/fetchDelegatedUserDecrypt.js +1 -1
- package/_cjs/core/modules/relayer/module/fetchDelegatedUserDecrypt.js.map +1 -1
- package/_cjs/core/modules/relayer/module/fetchPublicDecrypt.js +1 -1
- package/_cjs/core/modules/relayer/module/fetchPublicDecrypt.js.map +1 -1
- package/_cjs/core/modules/relayer/module/fetchUserDecrypt.js +1 -1
- package/_cjs/core/modules/relayer/module/fetchUserDecrypt.js.map +1 -1
- package/_cjs/core/modules/relayer/utils.js +16 -0
- package/_cjs/core/modules/relayer/utils.js.map +1 -0
- package/_cjs/ethers/cleartext/createFhevmCleartextBaseClient.js +17 -0
- package/_cjs/ethers/cleartext/createFhevmCleartextBaseClient.js.map +1 -0
- package/_cjs/ethers/cleartext/createFhevmCleartextClient.js +11 -0
- package/_cjs/ethers/cleartext/createFhevmCleartextClient.js.map +1 -0
- package/_cjs/ethers/cleartext/createFhevmCleartextDecryptClient.js +10 -0
- package/_cjs/ethers/cleartext/createFhevmCleartextDecryptClient.js.map +1 -0
- package/_cjs/ethers/cleartext/createFhevmCleartextEncryptClient.js +10 -0
- package/_cjs/ethers/cleartext/createFhevmCleartextEncryptClient.js.map +1 -0
- package/_cjs/ethers/cleartext/decorators/decrypt.js +9 -0
- package/_cjs/ethers/cleartext/decorators/decrypt.js.map +1 -0
- package/_cjs/ethers/cleartext/decorators/encrypt.js +9 -0
- package/_cjs/ethers/cleartext/decorators/encrypt.js.map +1 -0
- package/_cjs/ethers/cleartext/index.js +12 -0
- package/_cjs/ethers/cleartext/index.js.map +1 -0
- package/_cjs/ethers/clients/createFhevmBaseClient.js +2 -1
- package/_cjs/ethers/clients/createFhevmBaseClient.js.map +1 -1
- package/_cjs/ethers/clients/createFhevmClient.js +2 -2
- package/_cjs/ethers/clients/createFhevmClient.js.map +1 -1
- package/_cjs/ethers/clients/createFhevmDecryptClient.js +1 -1
- package/_cjs/ethers/clients/createFhevmDecryptClient.js.map +1 -1
- package/_cjs/ethers/clients/createFhevmEncryptClient.js +1 -1
- package/_cjs/ethers/clients/createFhevmEncryptClient.js.map +1 -1
- package/_cjs/{viem → ethers/clients}/decorators/decrypt.js +2 -2
- package/_cjs/ethers/clients/decorators/decrypt.js.map +1 -0
- package/_cjs/ethers/{decorators → clients/decorators}/encrypt.js +2 -2
- package/_cjs/ethers/clients/decorators/encrypt.js.map +1 -0
- package/_cjs/ethers/index.js +4 -3
- package/_cjs/ethers/index.js.map +1 -1
- package/_cjs/ethers/internal/config.js +32 -0
- package/_cjs/ethers/internal/config.js.map +1 -0
- package/_cjs/ethers/internal/ethereum-ct.js +42 -0
- package/_cjs/ethers/internal/ethereum-ct.js.map +1 -0
- package/_cjs/ethers/internal/ethers-p.js +0 -32
- package/_cjs/ethers/internal/ethers-p.js.map +1 -1
- package/_cjs/ethers/internal/runtime-ct.js +22 -0
- package/_cjs/ethers/internal/runtime-ct.js.map +1 -0
- package/_cjs/ethers/internal/runtime.js +22 -0
- package/_cjs/ethers/internal/runtime.js.map +1 -0
- package/_cjs/ethers/runtime/initFhevmDecryptRuntime.js +3 -2
- package/_cjs/ethers/runtime/initFhevmDecryptRuntime.js.map +1 -1
- package/_cjs/ethers/runtime/initFhevmEncryptRuntime.js +3 -2
- package/_cjs/ethers/runtime/initFhevmEncryptRuntime.js.map +1 -1
- package/_cjs/ethers/runtime/initFhevmRuntime.js +3 -2
- package/_cjs/ethers/runtime/initFhevmRuntime.js.map +1 -1
- package/_cjs/index.js +2 -0
- package/_cjs/index.js.map +1 -0
- package/_cjs/viem/cleartext/createFhevmCleartextBaseClient.js +17 -0
- package/_cjs/viem/cleartext/createFhevmCleartextBaseClient.js.map +1 -0
- package/_cjs/viem/cleartext/createFhevmCleartextClient.js +11 -0
- package/_cjs/viem/cleartext/createFhevmCleartextClient.js.map +1 -0
- package/_cjs/viem/cleartext/createFhevmCleartextDecryptClient.js +10 -0
- package/_cjs/viem/cleartext/createFhevmCleartextDecryptClient.js.map +1 -0
- package/_cjs/viem/cleartext/createFhevmCleartextEncryptClient.js +10 -0
- package/_cjs/viem/cleartext/createFhevmCleartextEncryptClient.js.map +1 -0
- package/_cjs/viem/cleartext/decorators/decrypt.js +9 -0
- package/_cjs/viem/cleartext/decorators/decrypt.js.map +1 -0
- package/_cjs/viem/cleartext/decorators/encrypt.js +9 -0
- package/_cjs/viem/cleartext/decorators/encrypt.js.map +1 -0
- package/_cjs/viem/cleartext/index.js +12 -0
- package/_cjs/viem/cleartext/index.js.map +1 -0
- package/_cjs/viem/clients/createFhevmBaseClient.js +2 -1
- package/_cjs/viem/clients/createFhevmBaseClient.js.map +1 -1
- package/_cjs/viem/clients/createFhevmClient.js +2 -2
- package/_cjs/viem/clients/createFhevmClient.js.map +1 -1
- package/_cjs/viem/clients/createFhevmDecryptClient.js +1 -1
- package/_cjs/viem/clients/createFhevmDecryptClient.js.map +1 -1
- package/_cjs/viem/clients/createFhevmEncryptClient.js +1 -1
- package/_cjs/viem/clients/createFhevmEncryptClient.js.map +1 -1
- package/_cjs/{ethers → viem/clients}/decorators/decrypt.js +2 -2
- package/_cjs/viem/clients/decorators/decrypt.js.map +1 -0
- package/_cjs/viem/{decorators → clients/decorators}/encrypt.js +2 -2
- package/_cjs/viem/clients/decorators/encrypt.js.map +1 -0
- package/_cjs/viem/index.js +6 -5
- package/_cjs/viem/index.js.map +1 -1
- package/_cjs/viem/internal/config.js +32 -0
- package/_cjs/viem/internal/config.js.map +1 -0
- package/_cjs/viem/internal/ethereum-ct.js +42 -0
- package/_cjs/viem/internal/ethereum-ct.js.map +1 -0
- package/_cjs/viem/internal/runtime-ct.js +22 -0
- package/_cjs/viem/internal/runtime-ct.js.map +1 -0
- package/_cjs/viem/internal/runtime.js +22 -0
- package/_cjs/viem/internal/runtime.js.map +1 -0
- package/_cjs/viem/internal/viem-p.js +0 -32
- package/_cjs/viem/internal/viem-p.js.map +1 -1
- package/_cjs/viem/runtime/initFhevmDecryptRuntime.js +2 -1
- package/_cjs/viem/runtime/initFhevmDecryptRuntime.js.map +1 -1
- package/_cjs/viem/runtime/initFhevmEncryptRuntime.js +2 -1
- package/_cjs/viem/runtime/initFhevmEncryptRuntime.js.map +1 -1
- package/_cjs/viem/runtime/initFhevmRuntime.js +2 -1
- package/_cjs/viem/runtime/initFhevmRuntime.js.map +1 -1
- package/_cjs/wasm/tfhe/startWorkers.v1.5.3.js +279 -426
- package/_cjs/wasm/tfhe/startWorkers.v1.5.3.js.map +7 -0
- package/_cjs/wasm/tfhe/tfhe.v1.5.3.js +2779 -3032
- package/_cjs/wasm/tfhe/tfhe.v1.5.3.js.map +7 -0
- package/_cjs/wasm/tfhe/tfhe_bg.v1.5.3.wasm.base64.js +29 -1
- package/_cjs/wasm/tfhe/tfhe_bg.v1.5.3.wasm.base64.js.map +7 -0
- package/_cjs/wasm/tkms/kms_lib.v0.13.10.js +1793 -1985
- package/_cjs/wasm/tkms/kms_lib.v0.13.10.js.map +7 -0
- package/_cjs/wasm/tkms/kms_lib_bg.v0.13.10.wasm.base64.js +29 -3
- package/_cjs/wasm/tkms/kms_lib_bg.v0.13.10.wasm.base64.js.map +7 -0
- package/_cjs/wasm/wasmBaseUrl.js +36 -14
- package/_cjs/wasm/wasmBaseUrl.js.map +7 -0
- package/_esm/core/_version.js +1 -1
- package/_esm/core/actions/base/fetchVerifiedInputProof.js +1 -1
- package/_esm/core/actions/base/fetchVerifiedInputProof.js.map +1 -1
- package/_esm/core/actions/base/signDecryptionPermit.js.map +1 -1
- package/_esm/core/actions/chain/index.js +4 -4
- package/_esm/core/actions/chain/index.js.map +1 -1
- package/_esm/core/actions/chain/parseSignedDecryptionPermit.js +2 -3
- package/_esm/core/actions/chain/parseSignedDecryptionPermit.js.map +1 -1
- package/_esm/core/actions/chain/parseTransportKeypair.js +1 -3
- package/_esm/core/actions/chain/parseTransportKeypair.js.map +1 -1
- package/_esm/core/actions/chain/serializeTransportKeypair.js +0 -1
- package/_esm/core/actions/chain/serializeTransportKeypair.js.map +1 -1
- package/_esm/core/actions/decrypt/decryptValue.js +5 -1
- package/_esm/core/actions/decrypt/decryptValue.js.map +1 -1
- package/_esm/core/actions/decrypt/decryptValues.js +5 -1
- package/_esm/core/actions/decrypt/decryptValues.js.map +1 -1
- package/_esm/core/actions/decrypt/decryptValuesFromPairs.js +5 -1
- package/_esm/core/actions/decrypt/decryptValuesFromPairs.js.map +1 -1
- package/_esm/core/actions/decrypt/index.js +2 -2
- package/_esm/core/actions/decrypt/index.js.map +1 -1
- package/_esm/core/base/bytes.js +7 -0
- package/_esm/core/base/bytes.js.map +1 -1
- package/_esm/core/base/sign.js +58 -0
- package/_esm/core/base/sign.js.map +1 -0
- package/_esm/core/base/typedValue.js +16 -0
- package/_esm/core/base/typedValue.js.map +1 -1
- package/_esm/core/base/uint.js +30 -0
- package/_esm/core/base/uint.js.map +1 -1
- package/_esm/core/clients/decorators/decrypt.js +3 -3
- package/_esm/core/clients/decorators/decrypt.js.map +1 -1
- package/_esm/core/coprocessor/InputProof-p.js +2 -2
- package/_esm/core/coprocessor/InputProof-p.js.map +1 -1
- package/_esm/core/coprocessor/ZkProof-p.js +19 -12
- package/_esm/core/coprocessor/ZkProof-p.js.map +1 -1
- package/_esm/core/coprocessor/ZkProofBuilder-p.js +7 -5
- package/_esm/core/coprocessor/ZkProofBuilder-p.js.map +1 -1
- package/_esm/core/coprocessor/encrypt.js +1 -3
- package/_esm/core/coprocessor/encrypt.js.map +1 -1
- package/_esm/core/coprocessor/fetchVerifiedInputProof.js +3 -4
- package/_esm/core/coprocessor/fetchVerifiedInputProof.js.map +1 -1
- package/_esm/core/handle/FheType.js +4 -2
- package/_esm/core/handle/FheType.js.map +1 -1
- package/_esm/core/host-contracts/KmsSignersContext-p.js +1 -1
- package/_esm/core/host-contracts/KmsSignersContext-p.js.map +1 -1
- package/_esm/core/kms/fetchKmsSignedcryptedShares-p.js +2 -3
- package/_esm/core/kms/fetchKmsSignedcryptedShares-p.js.map +1 -1
- package/_esm/core/kms/publicDecrypt.js +1 -4
- package/_esm/core/kms/publicDecrypt.js.map +1 -1
- package/_esm/core/modules/decrypt/mock.js +96 -10
- package/_esm/core/modules/decrypt/mock.js.map +1 -1
- package/_esm/core/modules/encrypt/mock.js +151 -12
- package/_esm/core/modules/encrypt/mock.js.map +1 -1
- package/_esm/core/modules/encrypt/module/api-p.js +7 -2
- package/_esm/core/modules/encrypt/module/api-p.js.map +1 -1
- package/_esm/core/modules/ethereum/types-ct.js +2 -0
- package/_esm/core/modules/ethereum/types-ct.js.map +1 -0
- package/_esm/core/modules/relayer/cleartext/fetchCoprocessorSignatures.js +75 -0
- package/_esm/core/modules/relayer/cleartext/fetchCoprocessorSignatures.js.map +1 -0
- package/_esm/core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.js +121 -0
- package/_esm/core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.js.map +1 -0
- package/_esm/core/modules/relayer/cleartext/fetchPublicDecrypt.js +52 -0
- package/_esm/core/modules/relayer/cleartext/fetchPublicDecrypt.js.map +1 -0
- package/_esm/core/modules/relayer/cleartext/fetchUserDecrypt.js +119 -0
- package/_esm/core/modules/relayer/cleartext/fetchUserDecrypt.js.map +1 -0
- package/_esm/core/modules/relayer/cleartext/mock.js +39 -0
- package/_esm/core/modules/relayer/cleartext/mock.js.map +1 -0
- package/_esm/core/modules/relayer/cleartext/signers.js +34 -0
- package/_esm/core/modules/relayer/cleartext/signers.js.map +1 -0
- package/_esm/core/modules/relayer/module/fetchCoprocessorSignatures.js +2 -2
- package/_esm/core/modules/relayer/module/fetchCoprocessorSignatures.js.map +1 -1
- package/_esm/core/modules/relayer/module/fetchDelegatedUserDecrypt.js +1 -1
- package/_esm/core/modules/relayer/module/fetchDelegatedUserDecrypt.js.map +1 -1
- package/_esm/core/modules/relayer/module/fetchPublicDecrypt.js +1 -1
- package/_esm/core/modules/relayer/module/fetchPublicDecrypt.js.map +1 -1
- package/_esm/core/modules/relayer/module/fetchUserDecrypt.js +1 -1
- package/_esm/core/modules/relayer/module/fetchUserDecrypt.js.map +1 -1
- package/_esm/core/modules/relayer/utils.js +13 -0
- package/_esm/core/modules/relayer/utils.js.map +1 -0
- package/_esm/ethers/cleartext/createFhevmCleartextBaseClient.js +15 -0
- package/_esm/ethers/cleartext/createFhevmCleartextBaseClient.js.map +1 -0
- package/_esm/ethers/cleartext/createFhevmCleartextClient.js +9 -0
- package/_esm/ethers/cleartext/createFhevmCleartextClient.js.map +1 -0
- package/_esm/ethers/cleartext/createFhevmCleartextDecryptClient.js +8 -0
- package/_esm/ethers/cleartext/createFhevmCleartextDecryptClient.js.map +1 -0
- package/_esm/ethers/cleartext/createFhevmCleartextEncryptClient.js +8 -0
- package/_esm/ethers/cleartext/createFhevmCleartextEncryptClient.js.map +1 -0
- package/_esm/ethers/cleartext/decorators/decrypt.js +7 -0
- package/_esm/ethers/cleartext/decorators/decrypt.js.map +1 -0
- package/_esm/ethers/cleartext/decorators/encrypt.js +7 -0
- package/_esm/ethers/cleartext/decorators/encrypt.js.map +1 -0
- package/_esm/ethers/cleartext/index.js +5 -0
- package/_esm/ethers/cleartext/index.js.map +1 -0
- package/_esm/ethers/clients/createFhevmBaseClient.js +2 -1
- package/_esm/ethers/clients/createFhevmBaseClient.js.map +1 -1
- package/_esm/ethers/clients/createFhevmClient.js +2 -2
- package/_esm/ethers/clients/createFhevmClient.js.map +1 -1
- package/_esm/ethers/clients/createFhevmDecryptClient.js +1 -1
- package/_esm/ethers/clients/createFhevmDecryptClient.js.map +1 -1
- package/_esm/ethers/clients/createFhevmEncryptClient.js +1 -1
- package/_esm/ethers/clients/createFhevmEncryptClient.js.map +1 -1
- package/_esm/ethers/clients/decorators/decrypt.js +7 -0
- package/_esm/ethers/clients/decorators/decrypt.js.map +1 -0
- package/_esm/ethers/clients/decorators/encrypt.js +7 -0
- package/_esm/ethers/clients/decorators/encrypt.js.map +1 -0
- package/_esm/ethers/index.js +1 -1
- package/_esm/ethers/index.js.map +1 -1
- package/_esm/ethers/internal/config.js +38 -0
- package/_esm/ethers/internal/config.js.map +1 -0
- package/_esm/ethers/internal/ethereum-ct.js +39 -0
- package/_esm/ethers/internal/ethereum-ct.js.map +1 -0
- package/_esm/ethers/internal/ethers-p.js +0 -43
- package/_esm/ethers/internal/ethers-p.js.map +1 -1
- package/_esm/ethers/internal/runtime-ct.js +21 -0
- package/_esm/ethers/internal/runtime-ct.js.map +1 -0
- package/_esm/ethers/internal/runtime.js +21 -0
- package/_esm/ethers/internal/runtime.js.map +1 -0
- package/_esm/ethers/runtime/initFhevmDecryptRuntime.js +2 -1
- package/_esm/ethers/runtime/initFhevmDecryptRuntime.js.map +1 -1
- package/_esm/ethers/runtime/initFhevmEncryptRuntime.js +2 -1
- package/_esm/ethers/runtime/initFhevmEncryptRuntime.js.map +1 -1
- package/_esm/ethers/runtime/initFhevmRuntime.js +2 -1
- package/_esm/ethers/runtime/initFhevmRuntime.js.map +1 -1
- package/_esm/index.js +2 -0
- package/_esm/index.js.map +1 -0
- package/_esm/viem/cleartext/createFhevmCleartextBaseClient.js +15 -0
- package/_esm/viem/cleartext/createFhevmCleartextBaseClient.js.map +1 -0
- package/_esm/viem/cleartext/createFhevmCleartextClient.js +9 -0
- package/_esm/viem/cleartext/createFhevmCleartextClient.js.map +1 -0
- package/_esm/viem/cleartext/createFhevmCleartextDecryptClient.js +8 -0
- package/_esm/viem/cleartext/createFhevmCleartextDecryptClient.js.map +1 -0
- package/_esm/viem/cleartext/createFhevmCleartextEncryptClient.js +8 -0
- package/_esm/viem/cleartext/createFhevmCleartextEncryptClient.js.map +1 -0
- package/_esm/viem/cleartext/decorators/decrypt.js +7 -0
- package/_esm/viem/cleartext/decorators/decrypt.js.map +1 -0
- package/_esm/viem/cleartext/decorators/encrypt.js +7 -0
- package/_esm/viem/cleartext/decorators/encrypt.js.map +1 -0
- package/_esm/viem/cleartext/index.js +5 -0
- package/_esm/viem/cleartext/index.js.map +1 -0
- package/_esm/viem/clients/createFhevmBaseClient.js +2 -1
- package/_esm/viem/clients/createFhevmBaseClient.js.map +1 -1
- package/_esm/viem/clients/createFhevmClient.js +2 -2
- package/_esm/viem/clients/createFhevmClient.js.map +1 -1
- package/_esm/viem/clients/createFhevmDecryptClient.js +1 -1
- package/_esm/viem/clients/createFhevmDecryptClient.js.map +1 -1
- package/_esm/viem/clients/createFhevmEncryptClient.js +1 -2
- package/_esm/viem/clients/createFhevmEncryptClient.js.map +1 -1
- package/_esm/viem/clients/decorators/decrypt.js +7 -0
- package/_esm/viem/clients/decorators/decrypt.js.map +1 -0
- package/_esm/viem/clients/decorators/encrypt.js +7 -0
- package/_esm/viem/clients/decorators/encrypt.js.map +1 -0
- package/_esm/viem/index.js +2 -2
- package/_esm/viem/index.js.map +1 -1
- package/_esm/viem/internal/config.js +38 -0
- package/_esm/viem/internal/config.js.map +1 -0
- package/_esm/viem/internal/ethereum-ct.js +39 -0
- package/_esm/viem/internal/ethereum-ct.js.map +1 -0
- package/_esm/viem/internal/runtime-ct.js +21 -0
- package/_esm/viem/internal/runtime-ct.js.map +1 -0
- package/_esm/viem/internal/runtime.js +21 -0
- package/_esm/viem/internal/runtime.js.map +1 -0
- package/_esm/viem/internal/viem-p.js +0 -43
- package/_esm/viem/internal/viem-p.js.map +1 -1
- package/_esm/viem/runtime/initFhevmDecryptRuntime.js +2 -1
- package/_esm/viem/runtime/initFhevmDecryptRuntime.js.map +1 -1
- package/_esm/viem/runtime/initFhevmEncryptRuntime.js +2 -1
- package/_esm/viem/runtime/initFhevmEncryptRuntime.js.map +1 -1
- package/_esm/viem/runtime/initFhevmRuntime.js +2 -1
- package/_esm/viem/runtime/initFhevmRuntime.js.map +1 -1
- package/_types/core/actions/base/signDecryptionPermit.d.ts.map +1 -1
- package/_types/core/actions/chain/index.d.ts +4 -4
- package/_types/core/actions/chain/index.d.ts.map +1 -1
- package/_types/core/actions/chain/parseSignedDecryptionPermit.d.ts +3 -2
- package/_types/core/actions/chain/parseSignedDecryptionPermit.d.ts.map +1 -1
- package/_types/core/actions/chain/parseTransportKeypair.d.ts +2 -2
- package/_types/core/actions/chain/parseTransportKeypair.d.ts.map +1 -1
- package/_types/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.d.ts +1 -1
- package/_types/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.d.ts.map +1 -1
- package/_types/core/actions/decrypt/decryptValue.d.ts +5 -13
- package/_types/core/actions/decrypt/decryptValue.d.ts.map +1 -1
- package/_types/core/actions/decrypt/decryptValues.d.ts +5 -13
- package/_types/core/actions/decrypt/decryptValues.d.ts.map +1 -1
- package/_types/core/actions/decrypt/decryptValuesFromPairs.d.ts +5 -13
- package/_types/core/actions/decrypt/decryptValuesFromPairs.d.ts.map +1 -1
- package/_types/core/actions/decrypt/index.d.ts +3 -3
- package/_types/core/actions/decrypt/index.d.ts.map +1 -1
- package/_types/core/base/bytes.d.ts +1 -0
- package/_types/core/base/bytes.d.ts.map +1 -1
- package/_types/core/base/sign.d.ts +10 -0
- package/_types/core/base/sign.d.ts.map +1 -0
- package/_types/core/base/typedValue.d.ts +2 -1
- package/_types/core/base/typedValue.d.ts.map +1 -1
- package/_types/core/base/uint.d.ts +3 -0
- package/_types/core/base/uint.d.ts.map +1 -1
- package/_types/core/clients/decorators/decrypt.d.ts +6 -15
- package/_types/core/clients/decorators/decrypt.d.ts.map +1 -1
- package/_types/core/coprocessor/ZkProof-p.d.ts +2 -2
- package/_types/core/coprocessor/ZkProof-p.d.ts.map +1 -1
- package/_types/core/coprocessor/ZkProofBuilder-p.d.ts +2 -1
- package/_types/core/coprocessor/ZkProofBuilder-p.d.ts.map +1 -1
- package/_types/core/coprocessor/encrypt.d.ts.map +1 -1
- package/_types/core/coprocessor/fetchVerifiedInputProof.d.ts +0 -2
- package/_types/core/coprocessor/fetchVerifiedInputProof.d.ts.map +1 -1
- package/_types/core/handle/FheType.d.ts +1 -0
- package/_types/core/handle/FheType.d.ts.map +1 -1
- package/_types/core/kms/fetchKmsSignedcryptedShares-p.d.ts.map +1 -1
- package/_types/core/kms/publicDecrypt.d.ts.map +1 -1
- package/_types/core/modules/decrypt/mock.d.ts +5 -5
- package/_types/core/modules/decrypt/mock.d.ts.map +1 -1
- package/_types/core/modules/encrypt/mock.d.ts +6 -6
- 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/types.d.ts +6 -2
- package/_types/core/modules/encrypt/types.d.ts.map +1 -1
- package/_types/core/modules/ethereum/types-ct.d.ts +46 -0
- package/_types/core/modules/ethereum/types-ct.d.ts.map +1 -0
- package/_types/core/modules/relayer/cleartext/fetchCoprocessorSignatures.d.ts +3 -0
- package/_types/core/modules/relayer/cleartext/fetchCoprocessorSignatures.d.ts.map +1 -0
- package/_types/core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.d.ts +3 -0
- package/_types/core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.d.ts.map +1 -0
- package/_types/core/modules/relayer/cleartext/fetchPublicDecrypt.d.ts +3 -0
- package/_types/core/modules/relayer/cleartext/fetchPublicDecrypt.d.ts.map +1 -0
- package/_types/core/modules/relayer/cleartext/fetchUserDecrypt.d.ts +3 -0
- package/_types/core/modules/relayer/cleartext/fetchUserDecrypt.d.ts.map +1 -0
- package/_types/core/modules/relayer/cleartext/mock.d.ts +3 -0
- package/_types/core/modules/relayer/cleartext/mock.d.ts.map +1 -0
- package/_types/core/modules/relayer/cleartext/signers.d.ts +7 -0
- package/_types/core/modules/relayer/cleartext/signers.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/fetchCoprocessorSignatures.d.ts +2 -2
- package/_types/core/modules/relayer/module/fetchCoprocessorSignatures.d.ts.map +1 -1
- package/_types/core/modules/relayer/module/fetchDelegatedUserDecrypt.d.ts +2 -2
- package/_types/core/modules/relayer/module/fetchDelegatedUserDecrypt.d.ts.map +1 -1
- package/_types/core/modules/relayer/module/fetchPublicDecrypt.d.ts +2 -2
- package/_types/core/modules/relayer/module/fetchPublicDecrypt.d.ts.map +1 -1
- package/_types/core/modules/relayer/module/fetchUserDecrypt.d.ts +2 -2
- package/_types/core/modules/relayer/module/fetchUserDecrypt.d.ts.map +1 -1
- package/_types/core/modules/relayer/types.d.ts +14 -5
- package/_types/core/modules/relayer/types.d.ts.map +1 -1
- package/_types/core/modules/relayer/utils.d.ts +4 -0
- package/_types/core/modules/relayer/utils.d.ts.map +1 -0
- package/_types/core/types/zkProof-p.d.ts +2 -1
- package/_types/core/types/zkProof-p.d.ts.map +1 -1
- package/_types/ethers/cleartext/createFhevmCleartextBaseClient.d.ts +11 -0
- package/_types/ethers/cleartext/createFhevmCleartextBaseClient.d.ts.map +1 -0
- package/_types/ethers/cleartext/createFhevmCleartextClient.d.ts +11 -0
- package/_types/ethers/cleartext/createFhevmCleartextClient.d.ts.map +1 -0
- package/_types/ethers/cleartext/createFhevmCleartextDecryptClient.d.ts +11 -0
- package/_types/ethers/cleartext/createFhevmCleartextDecryptClient.d.ts.map +1 -0
- package/_types/ethers/cleartext/createFhevmCleartextEncryptClient.d.ts +11 -0
- package/_types/ethers/cleartext/createFhevmCleartextEncryptClient.d.ts.map +1 -0
- package/_types/ethers/cleartext/decorators/decrypt.d.ts +6 -0
- package/_types/ethers/cleartext/decorators/decrypt.d.ts.map +1 -0
- package/_types/ethers/cleartext/decorators/encrypt.d.ts +6 -0
- package/_types/ethers/cleartext/decorators/encrypt.d.ts.map +1 -0
- package/_types/ethers/cleartext/index.d.ts +5 -0
- package/_types/ethers/cleartext/index.d.ts.map +1 -0
- package/_types/ethers/clients/createFhevmBaseClient.d.ts.map +1 -1
- package/_types/ethers/clients/decorators/decrypt.d.ts +6 -0
- package/_types/ethers/clients/decorators/decrypt.d.ts.map +1 -0
- package/_types/ethers/clients/decorators/encrypt.d.ts +6 -0
- package/_types/ethers/clients/decorators/encrypt.d.ts.map +1 -0
- package/_types/ethers/index.d.ts +1 -1
- package/_types/ethers/index.d.ts.map +1 -1
- package/_types/ethers/internal/config.d.ts +15 -0
- package/_types/ethers/internal/config.d.ts.map +1 -0
- package/_types/ethers/internal/ethereum-ct.d.ts +3 -0
- package/_types/ethers/internal/ethereum-ct.d.ts.map +1 -0
- package/_types/ethers/internal/ethers-p.d.ts +1 -13
- package/_types/ethers/internal/ethers-p.d.ts.map +1 -1
- package/_types/ethers/internal/runtime-ct.d.ts +3 -0
- package/_types/ethers/internal/runtime-ct.d.ts.map +1 -0
- package/_types/ethers/internal/runtime.d.ts +3 -0
- package/_types/ethers/internal/runtime.d.ts.map +1 -0
- package/_types/ethers/runtime/initFhevmDecryptRuntime.d.ts.map +1 -1
- package/_types/ethers/runtime/initFhevmEncryptRuntime.d.ts.map +1 -1
- package/_types/ethers/runtime/initFhevmRuntime.d.ts.map +1 -1
- package/_types/index.d.ts +2 -0
- package/_types/index.d.ts.map +1 -0
- package/_types/viem/cleartext/createFhevmCleartextBaseClient.d.ts +11 -0
- package/_types/viem/cleartext/createFhevmCleartextBaseClient.d.ts.map +1 -0
- package/_types/viem/cleartext/createFhevmCleartextClient.d.ts +11 -0
- package/_types/viem/cleartext/createFhevmCleartextClient.d.ts.map +1 -0
- package/_types/viem/cleartext/createFhevmCleartextDecryptClient.d.ts +11 -0
- package/_types/viem/cleartext/createFhevmCleartextDecryptClient.d.ts.map +1 -0
- package/_types/viem/cleartext/createFhevmCleartextEncryptClient.d.ts +11 -0
- package/_types/viem/cleartext/createFhevmCleartextEncryptClient.d.ts.map +1 -0
- package/_types/viem/cleartext/decorators/decrypt.d.ts +6 -0
- package/_types/viem/cleartext/decorators/decrypt.d.ts.map +1 -0
- package/_types/viem/cleartext/decorators/encrypt.d.ts +6 -0
- package/_types/viem/cleartext/decorators/encrypt.d.ts.map +1 -0
- package/_types/viem/cleartext/index.d.ts +5 -0
- package/_types/viem/cleartext/index.d.ts.map +1 -0
- package/_types/viem/clients/createFhevmBaseClient.d.ts.map +1 -1
- package/_types/viem/clients/decorators/decrypt.d.ts +6 -0
- package/_types/viem/clients/decorators/decrypt.d.ts.map +1 -0
- package/_types/viem/clients/decorators/encrypt.d.ts +6 -0
- package/_types/viem/clients/decorators/encrypt.d.ts.map +1 -0
- package/_types/viem/index.d.ts +2 -2
- package/_types/viem/index.d.ts.map +1 -1
- package/_types/viem/internal/config.d.ts +15 -0
- package/_types/viem/internal/config.d.ts.map +1 -0
- package/_types/viem/internal/ethereum-ct.d.ts +3 -0
- package/_types/viem/internal/ethereum-ct.d.ts.map +1 -0
- package/_types/viem/internal/runtime-ct.d.ts +3 -0
- package/_types/viem/internal/runtime-ct.d.ts.map +1 -0
- package/_types/viem/internal/runtime.d.ts +3 -0
- package/_types/viem/internal/runtime.d.ts.map +1 -0
- package/_types/viem/internal/viem-p.d.ts +1 -13
- package/_types/viem/internal/viem-p.d.ts.map +1 -1
- package/_types/viem/runtime/initFhevmDecryptRuntime.d.ts.map +1 -1
- package/_types/viem/runtime/initFhevmEncryptRuntime.d.ts.map +1 -1
- package/_types/viem/runtime/initFhevmRuntime.d.ts.map +1 -1
- package/core/_version.ts +1 -1
- package/core/actions/base/fetchVerifiedInputProof.ts +1 -1
- package/core/actions/base/signDecryptionPermit.ts +2 -0
- package/core/actions/chain/index.ts +11 -11
- package/core/actions/chain/parseSignedDecryptionPermit.ts +5 -6
- package/core/actions/chain/parseTransportKeypair.ts +3 -7
- package/core/actions/chain/serializeTransportKeypair.ts +0 -2
- package/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.ts +1 -1
- package/core/actions/decrypt/decryptValue.ts +9 -28
- package/core/actions/decrypt/decryptValues.ts +9 -28
- package/core/actions/decrypt/decryptValuesFromPairs.ts +9 -28
- package/core/actions/decrypt/index.ts +3 -14
- package/core/base/bytes.ts +8 -0
- package/core/base/sign.ts +75 -0
- package/core/base/typedValue.ts +18 -0
- package/core/base/uint.ts +32 -0
- package/core/clients/decorators/decrypt.ts +12 -28
- package/core/coprocessor/InputProof-p.ts +2 -2
- package/core/coprocessor/ZkProof-p.ts +21 -9
- package/core/coprocessor/ZkProofBuilder-p.ts +15 -8
- package/core/coprocessor/encrypt.ts +1 -3
- package/core/coprocessor/fetchVerifiedInputProof.ts +7 -13
- package/core/handle/FheType.ts +5 -2
- package/core/host-contracts/KmsSignersContext-p.ts +1 -1
- package/core/kms/fetchKmsSignedcryptedShares-p.ts +16 -24
- package/core/kms/publicDecrypt.ts +6 -12
- package/core/modules/decrypt/mock.ts +126 -13
- package/core/modules/encrypt/mock.ts +206 -12
- package/core/modules/encrypt/module/api-p.ts +7 -2
- package/core/modules/encrypt/types.ts +6 -2
- package/core/modules/ethereum/types-ct.ts +89 -0
- package/core/modules/relayer/cleartext/fetchCoprocessorSignatures.ts +94 -0
- package/core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.ts +147 -0
- package/core/modules/relayer/cleartext/fetchPublicDecrypt.ts +67 -0
- package/core/modules/relayer/cleartext/fetchUserDecrypt.ts +141 -0
- package/core/modules/relayer/cleartext/mock.ts +54 -0
- package/core/modules/relayer/cleartext/signers.ts +52 -0
- package/core/modules/relayer/module/fetchCoprocessorSignatures.ts +4 -4
- package/core/modules/relayer/module/fetchDelegatedUserDecrypt.ts +3 -3
- package/core/modules/relayer/module/fetchPublicDecrypt.ts +3 -3
- package/core/modules/relayer/module/fetchUserDecrypt.ts +3 -3
- package/core/modules/relayer/types.ts +13 -5
- package/core/modules/relayer/utils.ts +17 -0
- package/core/types/zkProof-p.ts +3 -1
- package/ethers/cleartext/createFhevmCleartextBaseClient.ts +25 -0
- package/ethers/cleartext/createFhevmCleartextClient.ts +20 -0
- package/ethers/cleartext/createFhevmCleartextDecryptClient.ts +18 -0
- package/ethers/cleartext/createFhevmCleartextEncryptClient.ts +19 -0
- package/ethers/cleartext/decorators/decrypt.ts +12 -0
- package/ethers/cleartext/decorators/encrypt.ts +12 -0
- package/ethers/cleartext/index.ts +4 -0
- package/ethers/cleartext/package.json +6 -0
- package/ethers/clients/createFhevmBaseClient.ts +2 -1
- package/ethers/clients/createFhevmClient.ts +2 -2
- package/ethers/clients/createFhevmDecryptClient.ts +1 -1
- package/ethers/clients/createFhevmEncryptClient.ts +1 -1
- package/ethers/clients/decorators/decrypt.ts +12 -0
- package/ethers/clients/decorators/encrypt.ts +12 -0
- package/ethers/index.ts +1 -1
- package/ethers/internal/config.ts +50 -0
- package/ethers/internal/ethereum-ct.ts +61 -0
- package/ethers/internal/ethers-p.ts +1 -56
- package/ethers/internal/runtime-ct.ts +28 -0
- package/ethers/internal/runtime.ts +28 -0
- package/ethers/runtime/initFhevmDecryptRuntime.ts +2 -1
- package/ethers/runtime/initFhevmEncryptRuntime.ts +2 -1
- package/ethers/runtime/initFhevmRuntime.ts +2 -1
- package/index.ts +0 -0
- package/package.json +14 -2
- package/viem/cleartext/createFhevmCleartextBaseClient.ts +28 -0
- package/viem/cleartext/createFhevmCleartextClient.ts +20 -0
- package/viem/cleartext/createFhevmCleartextDecryptClient.ts +21 -0
- package/viem/cleartext/createFhevmCleartextEncryptClient.ts +22 -0
- package/viem/cleartext/decorators/decrypt.ts +12 -0
- package/viem/cleartext/decorators/encrypt.ts +12 -0
- package/viem/cleartext/index.ts +4 -0
- package/viem/cleartext/package.json +6 -0
- package/viem/clients/createFhevmBaseClient.ts +2 -1
- package/viem/clients/createFhevmClient.ts +2 -2
- package/viem/clients/createFhevmDecryptClient.ts +1 -1
- package/viem/clients/createFhevmEncryptClient.ts +1 -3
- package/viem/clients/decorators/decrypt.ts +12 -0
- package/viem/clients/decorators/encrypt.ts +12 -0
- package/viem/index.ts +2 -2
- package/viem/internal/config.ts +50 -0
- package/viem/internal/ethereum-ct.ts +61 -0
- package/viem/internal/runtime-ct.ts +28 -0
- package/viem/internal/runtime.ts +28 -0
- package/viem/internal/viem-p.ts +1 -56
- package/viem/runtime/initFhevmDecryptRuntime.ts +2 -1
- package/viem/runtime/initFhevmEncryptRuntime.ts +2 -1
- package/viem/runtime/initFhevmRuntime.ts +2 -1
- package/_cjs/core/modules/relayer/mock.js +0 -29
- package/_cjs/core/modules/relayer/mock.js.map +0 -1
- package/_cjs/ethers/decorators/decrypt.js.map +0 -1
- package/_cjs/ethers/decorators/encrypt.js.map +0 -1
- package/_cjs/viem/decorators/decrypt.js.map +0 -1
- package/_cjs/viem/decorators/encrypt.js.map +0 -1
- package/_esm/core/modules/relayer/mock.js +0 -28
- package/_esm/core/modules/relayer/mock.js.map +0 -1
- package/_esm/ethers/decorators/decrypt.js +0 -7
- package/_esm/ethers/decorators/decrypt.js.map +0 -1
- package/_esm/ethers/decorators/encrypt.js +0 -7
- package/_esm/ethers/decorators/encrypt.js.map +0 -1
- package/_esm/viem/decorators/decrypt.js +0 -7
- package/_esm/viem/decorators/decrypt.js.map +0 -1
- package/_esm/viem/decorators/encrypt.js +0 -7
- package/_esm/viem/decorators/encrypt.js.map +0 -1
- package/_types/core/modules/relayer/mock.d.ts +0 -3
- package/_types/core/modules/relayer/mock.d.ts.map +0 -1
- package/_types/ethers/decorators/decrypt.d.ts +0 -6
- package/_types/ethers/decorators/decrypt.d.ts.map +0 -1
- package/_types/ethers/decorators/encrypt.d.ts +0 -6
- package/_types/ethers/decorators/encrypt.d.ts.map +0 -1
- package/_types/viem/decorators/decrypt.d.ts +0 -6
- package/_types/viem/decorators/decrypt.d.ts.map +0 -1
- package/_types/viem/decorators/encrypt.d.ts +0 -6
- package/_types/viem/decorators/encrypt.d.ts.map +0 -1
- package/core/modules/relayer/mock.ts +0 -47
- package/ethers/decorators/decrypt.ts +0 -12
- package/ethers/decorators/encrypt.ts +0 -12
- package/viem/decorators/decrypt.ts +0 -12
- package/viem/decorators/encrypt.ts +0 -12
|
@@ -1,2117 +1,1925 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var kms_lib_v0_13_10_exports = {};
|
|
20
|
+
__export(kms_lib_v0_13_10_exports, {
|
|
21
|
+
CiphertextHandle: () => CiphertextHandle,
|
|
22
|
+
Client: () => Client,
|
|
23
|
+
Eip712DomainMsg: () => Eip712DomainMsg,
|
|
24
|
+
ParsedUserDecryptionRequest: () => ParsedUserDecryptionRequest,
|
|
25
|
+
PrivateEncKeyMlKem512: () => PrivateEncKeyMlKem512,
|
|
26
|
+
PrivateSigKey: () => PrivateSigKey,
|
|
27
|
+
PublicEncKeyMlKem512: () => PublicEncKeyMlKem512,
|
|
28
|
+
PublicSigKey: () => PublicSigKey,
|
|
29
|
+
RequestId: () => RequestId,
|
|
30
|
+
ServerIdAddr: () => ServerIdAddr,
|
|
31
|
+
TypedCiphertext: () => TypedCiphertext,
|
|
32
|
+
TypedPlaintext: () => TypedPlaintext,
|
|
33
|
+
TypedSigncryptedCiphertext: () => TypedSigncryptedCiphertext,
|
|
34
|
+
UserDecryptionRequest: () => UserDecryptionRequest,
|
|
35
|
+
UserDecryptionResponse: () => UserDecryptionResponse,
|
|
36
|
+
UserDecryptionResponsePayload: () => UserDecryptionResponsePayload,
|
|
37
|
+
default: () => __wbg_init,
|
|
38
|
+
getWasmInfo: () => getWasmInfo,
|
|
39
|
+
get_client_address: () => get_client_address,
|
|
40
|
+
get_client_secret_key: () => get_client_secret_key,
|
|
41
|
+
get_server_addrs: () => get_server_addrs,
|
|
42
|
+
initSync: () => initSync,
|
|
43
|
+
ml_kem_pke_decrypt: () => ml_kem_pke_decrypt,
|
|
44
|
+
ml_kem_pke_encrypt: () => ml_kem_pke_encrypt,
|
|
45
|
+
ml_kem_pke_get_pk: () => ml_kem_pke_get_pk,
|
|
46
|
+
ml_kem_pke_keygen: () => ml_kem_pke_keygen,
|
|
47
|
+
ml_kem_pke_pk_len: () => ml_kem_pke_pk_len,
|
|
48
|
+
ml_kem_pke_pk_to_u8vec: () => ml_kem_pke_pk_to_u8vec,
|
|
49
|
+
ml_kem_pke_sk_len: () => ml_kem_pke_sk_len,
|
|
50
|
+
ml_kem_pke_sk_to_u8vec: () => ml_kem_pke_sk_to_u8vec,
|
|
51
|
+
new_client: () => new_client,
|
|
52
|
+
new_server_id_addr: () => new_server_id_addr,
|
|
53
|
+
private_sig_key_to_u8vec: () => private_sig_key_to_u8vec,
|
|
54
|
+
process_user_decryption_resp: () => process_user_decryption_resp,
|
|
55
|
+
process_user_decryption_resp_from_js: () => process_user_decryption_resp_from_js,
|
|
56
|
+
public_sig_key_to_u8vec: () => public_sig_key_to_u8vec,
|
|
57
|
+
u8vec_to_ml_kem_pke_pk: () => u8vec_to_ml_kem_pke_pk,
|
|
58
|
+
u8vec_to_ml_kem_pke_sk: () => u8vec_to_ml_kem_pke_sk,
|
|
59
|
+
u8vec_to_private_sig_key: () => u8vec_to_private_sig_key,
|
|
60
|
+
u8vec_to_public_sig_key: () => u8vec_to_public_sig_key
|
|
61
|
+
});
|
|
62
|
+
module.exports = __toCommonJS(kms_lib_v0_13_10_exports);
|
|
63
|
+
class CiphertextHandle {
|
|
64
|
+
__destroy_into_raw() {
|
|
65
|
+
const ptr = this.__wbg_ptr;
|
|
66
|
+
this.__wbg_ptr = 0;
|
|
67
|
+
CiphertextHandleFinalization.unregister(this);
|
|
68
|
+
return ptr;
|
|
69
|
+
}
|
|
70
|
+
free() {
|
|
71
|
+
const ptr = this.__destroy_into_raw();
|
|
72
|
+
wasm.__wbg_ciphertexthandle_free(ptr, 0);
|
|
73
|
+
}
|
|
14
74
|
}
|
|
15
75
|
if (Symbol.dispose) CiphertextHandle.prototype[Symbol.dispose] = CiphertextHandle.prototype.free;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
this.__wbg_ptr = 0;
|
|
35
|
-
ClientFinalization.unregister(this);
|
|
36
|
-
return ptr;
|
|
37
|
-
}
|
|
38
|
-
free() {
|
|
39
|
-
const ptr = this.__destroy_into_raw();
|
|
40
|
-
wasm.__wbg_client_free(ptr, 0);
|
|
41
|
-
}
|
|
76
|
+
class Client {
|
|
77
|
+
static __wrap(ptr) {
|
|
78
|
+
ptr = ptr >>> 0;
|
|
79
|
+
const obj = Object.create(Client.prototype);
|
|
80
|
+
obj.__wbg_ptr = ptr;
|
|
81
|
+
ClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
82
|
+
return obj;
|
|
83
|
+
}
|
|
84
|
+
__destroy_into_raw() {
|
|
85
|
+
const ptr = this.__wbg_ptr;
|
|
86
|
+
this.__wbg_ptr = 0;
|
|
87
|
+
ClientFinalization.unregister(this);
|
|
88
|
+
return ptr;
|
|
89
|
+
}
|
|
90
|
+
free() {
|
|
91
|
+
const ptr = this.__destroy_into_raw();
|
|
92
|
+
wasm.__wbg_client_free(ptr, 0);
|
|
93
|
+
}
|
|
42
94
|
}
|
|
43
95
|
if (Symbol.dispose) Client.prototype[Symbol.dispose] = Client.prototype.free;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const ret = wasm.__wbg_get_eip712domainmsg_name(this.__wbg_ptr);
|
|
85
|
-
deferred1_0 = ret[0];
|
|
86
|
-
deferred1_1 = ret[1];
|
|
87
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
88
|
-
} finally {
|
|
89
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* @returns {Uint8Array | undefined}
|
|
94
|
-
*/
|
|
95
|
-
get salt() {
|
|
96
|
-
const ret = wasm.__wbg_get_eip712domainmsg_salt(this.__wbg_ptr);
|
|
97
|
-
let v1;
|
|
98
|
-
if (ret[0] !== 0) {
|
|
99
|
-
v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
100
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
101
|
-
}
|
|
102
|
-
return v1;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* @returns {string}
|
|
106
|
-
*/
|
|
107
|
-
get verifying_contract() {
|
|
108
|
-
let deferred1_0;
|
|
109
|
-
let deferred1_1;
|
|
110
|
-
try {
|
|
111
|
-
const ret = wasm.__wbg_get_eip712domainmsg_verifying_contract(this.__wbg_ptr);
|
|
112
|
-
deferred1_0 = ret[0];
|
|
113
|
-
deferred1_1 = ret[1];
|
|
114
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
115
|
-
} finally {
|
|
116
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* @returns {string}
|
|
121
|
-
*/
|
|
122
|
-
get version() {
|
|
123
|
-
let deferred1_0;
|
|
124
|
-
let deferred1_1;
|
|
125
|
-
try {
|
|
126
|
-
const ret = wasm.__wbg_get_eip712domainmsg_version(this.__wbg_ptr);
|
|
127
|
-
deferred1_0 = ret[0];
|
|
128
|
-
deferred1_1 = ret[1];
|
|
129
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
130
|
-
} finally {
|
|
131
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* @param {Uint8Array} arg0
|
|
136
|
-
*/
|
|
137
|
-
set chain_id(arg0) {
|
|
138
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
139
|
-
const len0 = WASM_VECTOR_LEN;
|
|
140
|
-
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* @param {string} arg0
|
|
144
|
-
*/
|
|
145
|
-
set name(arg0) {
|
|
146
|
-
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
147
|
-
const len0 = WASM_VECTOR_LEN;
|
|
148
|
-
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
96
|
+
class Eip712DomainMsg {
|
|
97
|
+
static __wrap(ptr) {
|
|
98
|
+
ptr = ptr >>> 0;
|
|
99
|
+
const obj = Object.create(Eip712DomainMsg.prototype);
|
|
100
|
+
obj.__wbg_ptr = ptr;
|
|
101
|
+
Eip712DomainMsgFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
102
|
+
return obj;
|
|
103
|
+
}
|
|
104
|
+
__destroy_into_raw() {
|
|
105
|
+
const ptr = this.__wbg_ptr;
|
|
106
|
+
this.__wbg_ptr = 0;
|
|
107
|
+
Eip712DomainMsgFinalization.unregister(this);
|
|
108
|
+
return ptr;
|
|
109
|
+
}
|
|
110
|
+
free() {
|
|
111
|
+
const ptr = this.__destroy_into_raw();
|
|
112
|
+
wasm.__wbg_eip712domainmsg_free(ptr, 0);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* @returns {Uint8Array}
|
|
116
|
+
*/
|
|
117
|
+
get chain_id() {
|
|
118
|
+
const ret = wasm.__wbg_get_eip712domainmsg_chain_id(this.__wbg_ptr);
|
|
119
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
120
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
121
|
+
return v1;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* @returns {string}
|
|
125
|
+
*/
|
|
126
|
+
get name() {
|
|
127
|
+
let deferred1_0;
|
|
128
|
+
let deferred1_1;
|
|
129
|
+
try {
|
|
130
|
+
const ret = wasm.__wbg_get_eip712domainmsg_name(this.__wbg_ptr);
|
|
131
|
+
deferred1_0 = ret[0];
|
|
132
|
+
deferred1_1 = ret[1];
|
|
133
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
134
|
+
} finally {
|
|
135
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
149
136
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* @returns {Uint8Array | undefined}
|
|
140
|
+
*/
|
|
141
|
+
get salt() {
|
|
142
|
+
const ret = wasm.__wbg_get_eip712domainmsg_salt(this.__wbg_ptr);
|
|
143
|
+
let v1;
|
|
144
|
+
if (ret[0] !== 0) {
|
|
145
|
+
v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
146
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
157
147
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
148
|
+
return v1;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* @returns {string}
|
|
152
|
+
*/
|
|
153
|
+
get verifying_contract() {
|
|
154
|
+
let deferred1_0;
|
|
155
|
+
let deferred1_1;
|
|
156
|
+
try {
|
|
157
|
+
const ret = wasm.__wbg_get_eip712domainmsg_verifying_contract(this.__wbg_ptr);
|
|
158
|
+
deferred1_0 = ret[0];
|
|
159
|
+
deferred1_1 = ret[1];
|
|
160
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
161
|
+
} finally {
|
|
162
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
165
163
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* @returns {string}
|
|
167
|
+
*/
|
|
168
|
+
get version() {
|
|
169
|
+
let deferred1_0;
|
|
170
|
+
let deferred1_1;
|
|
171
|
+
try {
|
|
172
|
+
const ret = wasm.__wbg_get_eip712domainmsg_version(this.__wbg_ptr);
|
|
173
|
+
deferred1_0 = ret[0];
|
|
174
|
+
deferred1_1 = ret[1];
|
|
175
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
176
|
+
} finally {
|
|
177
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
173
178
|
}
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* @param {Uint8Array} arg0
|
|
182
|
+
*/
|
|
183
|
+
set chain_id(arg0) {
|
|
184
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
185
|
+
const len0 = WASM_VECTOR_LEN;
|
|
186
|
+
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* @param {string} arg0
|
|
190
|
+
*/
|
|
191
|
+
set name(arg0) {
|
|
192
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
193
|
+
const len0 = WASM_VECTOR_LEN;
|
|
194
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* @param {Uint8Array | null} [arg0]
|
|
198
|
+
*/
|
|
199
|
+
set salt(arg0) {
|
|
200
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
201
|
+
var len0 = WASM_VECTOR_LEN;
|
|
202
|
+
wasm.__wbg_set_eip712domainmsg_salt(this.__wbg_ptr, ptr0, len0);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* @param {string} arg0
|
|
206
|
+
*/
|
|
207
|
+
set verifying_contract(arg0) {
|
|
208
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
209
|
+
const len0 = WASM_VECTOR_LEN;
|
|
210
|
+
wasm.__wbg_set_eip712domainmsg_verifying_contract(this.__wbg_ptr, ptr0, len0);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* @param {string} arg0
|
|
214
|
+
*/
|
|
215
|
+
set version(arg0) {
|
|
216
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
217
|
+
const len0 = WASM_VECTOR_LEN;
|
|
218
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
219
|
+
}
|
|
174
220
|
}
|
|
175
221
|
if (Symbol.dispose) Eip712DomainMsg.prototype[Symbol.dispose] = Eip712DomainMsg.prototype.free;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
free() {
|
|
188
|
-
const ptr = this.__destroy_into_raw();
|
|
189
|
-
wasm.__wbg_parseduserdecryptionrequest_free(ptr, 0);
|
|
190
|
-
}
|
|
222
|
+
class ParsedUserDecryptionRequest {
|
|
223
|
+
__destroy_into_raw() {
|
|
224
|
+
const ptr = this.__wbg_ptr;
|
|
225
|
+
this.__wbg_ptr = 0;
|
|
226
|
+
ParsedUserDecryptionRequestFinalization.unregister(this);
|
|
227
|
+
return ptr;
|
|
228
|
+
}
|
|
229
|
+
free() {
|
|
230
|
+
const ptr = this.__destroy_into_raw();
|
|
231
|
+
wasm.__wbg_parseduserdecryptionrequest_free(ptr, 0);
|
|
232
|
+
}
|
|
191
233
|
}
|
|
192
234
|
if (Symbol.dispose) ParsedUserDecryptionRequest.prototype[Symbol.dispose] = ParsedUserDecryptionRequest.prototype.free;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
235
|
+
class PrivateEncKeyMlKem512 {
|
|
236
|
+
static __wrap(ptr) {
|
|
237
|
+
ptr = ptr >>> 0;
|
|
238
|
+
const obj = Object.create(PrivateEncKeyMlKem512.prototype);
|
|
239
|
+
obj.__wbg_ptr = ptr;
|
|
240
|
+
PrivateEncKeyMlKem512Finalization.register(obj, obj.__wbg_ptr, obj);
|
|
241
|
+
return obj;
|
|
242
|
+
}
|
|
243
|
+
__destroy_into_raw() {
|
|
244
|
+
const ptr = this.__wbg_ptr;
|
|
245
|
+
this.__wbg_ptr = 0;
|
|
246
|
+
PrivateEncKeyMlKem512Finalization.unregister(this);
|
|
247
|
+
return ptr;
|
|
248
|
+
}
|
|
249
|
+
free() {
|
|
250
|
+
const ptr = this.__destroy_into_raw();
|
|
251
|
+
wasm.__wbg_privateenckeymlkem512_free(ptr, 0);
|
|
252
|
+
}
|
|
212
253
|
}
|
|
213
254
|
if (Symbol.dispose) PrivateEncKeyMlKem512.prototype[Symbol.dispose] = PrivateEncKeyMlKem512.prototype.free;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
255
|
+
class PrivateSigKey {
|
|
256
|
+
static __wrap(ptr) {
|
|
257
|
+
ptr = ptr >>> 0;
|
|
258
|
+
const obj = Object.create(PrivateSigKey.prototype);
|
|
259
|
+
obj.__wbg_ptr = ptr;
|
|
260
|
+
PrivateSigKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
261
|
+
return obj;
|
|
262
|
+
}
|
|
263
|
+
__destroy_into_raw() {
|
|
264
|
+
const ptr = this.__wbg_ptr;
|
|
265
|
+
this.__wbg_ptr = 0;
|
|
266
|
+
PrivateSigKeyFinalization.unregister(this);
|
|
267
|
+
return ptr;
|
|
268
|
+
}
|
|
269
|
+
free() {
|
|
270
|
+
const ptr = this.__destroy_into_raw();
|
|
271
|
+
wasm.__wbg_privatesigkey_free(ptr, 0);
|
|
272
|
+
}
|
|
233
273
|
}
|
|
234
274
|
if (Symbol.dispose) PrivateSigKey.prototype[Symbol.dispose] = PrivateSigKey.prototype.free;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
275
|
+
class PublicEncKeyMlKem512 {
|
|
276
|
+
static __wrap(ptr) {
|
|
277
|
+
ptr = ptr >>> 0;
|
|
278
|
+
const obj = Object.create(PublicEncKeyMlKem512.prototype);
|
|
279
|
+
obj.__wbg_ptr = ptr;
|
|
280
|
+
PublicEncKeyMlKem512Finalization.register(obj, obj.__wbg_ptr, obj);
|
|
281
|
+
return obj;
|
|
282
|
+
}
|
|
283
|
+
__destroy_into_raw() {
|
|
284
|
+
const ptr = this.__wbg_ptr;
|
|
285
|
+
this.__wbg_ptr = 0;
|
|
286
|
+
PublicEncKeyMlKem512Finalization.unregister(this);
|
|
287
|
+
return ptr;
|
|
288
|
+
}
|
|
289
|
+
free() {
|
|
290
|
+
const ptr = this.__destroy_into_raw();
|
|
291
|
+
wasm.__wbg_publicenckeymlkem512_free(ptr, 0);
|
|
292
|
+
}
|
|
254
293
|
}
|
|
255
294
|
if (Symbol.dispose) PublicEncKeyMlKem512.prototype[Symbol.dispose] = PublicEncKeyMlKem512.prototype.free;
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
295
|
+
class PublicSigKey {
|
|
296
|
+
static __wrap(ptr) {
|
|
297
|
+
ptr = ptr >>> 0;
|
|
298
|
+
const obj = Object.create(PublicSigKey.prototype);
|
|
299
|
+
obj.__wbg_ptr = ptr;
|
|
300
|
+
PublicSigKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
301
|
+
return obj;
|
|
302
|
+
}
|
|
303
|
+
__destroy_into_raw() {
|
|
304
|
+
const ptr = this.__wbg_ptr;
|
|
305
|
+
this.__wbg_ptr = 0;
|
|
306
|
+
PublicSigKeyFinalization.unregister(this);
|
|
307
|
+
return ptr;
|
|
308
|
+
}
|
|
309
|
+
free() {
|
|
310
|
+
const ptr = this.__destroy_into_raw();
|
|
311
|
+
wasm.__wbg_publicsigkey_free(ptr, 0);
|
|
312
|
+
}
|
|
275
313
|
}
|
|
276
314
|
if (Symbol.dispose) PublicSigKey.prototype[Symbol.dispose] = PublicSigKey.prototype.free;
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
const ret = wasm.__wbg_get_requestid_request_id(this.__wbg_ptr);
|
|
309
|
-
deferred1_0 = ret[0];
|
|
310
|
-
deferred1_1 = ret[1];
|
|
311
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
312
|
-
} finally {
|
|
313
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* @param {string} arg0
|
|
318
|
-
*/
|
|
319
|
-
set request_id(arg0) {
|
|
320
|
-
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
321
|
-
const len0 = WASM_VECTOR_LEN;
|
|
322
|
-
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
315
|
+
class RequestId {
|
|
316
|
+
static __wrap(ptr) {
|
|
317
|
+
ptr = ptr >>> 0;
|
|
318
|
+
const obj = Object.create(RequestId.prototype);
|
|
319
|
+
obj.__wbg_ptr = ptr;
|
|
320
|
+
RequestIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
321
|
+
return obj;
|
|
322
|
+
}
|
|
323
|
+
__destroy_into_raw() {
|
|
324
|
+
const ptr = this.__wbg_ptr;
|
|
325
|
+
this.__wbg_ptr = 0;
|
|
326
|
+
RequestIdFinalization.unregister(this);
|
|
327
|
+
return ptr;
|
|
328
|
+
}
|
|
329
|
+
free() {
|
|
330
|
+
const ptr = this.__destroy_into_raw();
|
|
331
|
+
wasm.__wbg_requestid_free(ptr, 0);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* @returns {string}
|
|
335
|
+
*/
|
|
336
|
+
get request_id() {
|
|
337
|
+
let deferred1_0;
|
|
338
|
+
let deferred1_1;
|
|
339
|
+
try {
|
|
340
|
+
const ret = wasm.__wbg_get_requestid_request_id(this.__wbg_ptr);
|
|
341
|
+
deferred1_0 = ret[0];
|
|
342
|
+
deferred1_1 = ret[1];
|
|
343
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
344
|
+
} finally {
|
|
345
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
323
346
|
}
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* @param {string} arg0
|
|
350
|
+
*/
|
|
351
|
+
set request_id(arg0) {
|
|
352
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
353
|
+
const len0 = WASM_VECTOR_LEN;
|
|
354
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
355
|
+
}
|
|
324
356
|
}
|
|
325
357
|
if (Symbol.dispose) RequestId.prototype[Symbol.dispose] = RequestId.prototype.free;
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
return 0;
|
|
338
|
-
}
|
|
339
|
-
return jsValue.__destroy_into_raw();
|
|
340
|
-
}
|
|
341
|
-
__destroy_into_raw() {
|
|
342
|
-
const ptr = this.__wbg_ptr;
|
|
343
|
-
this.__wbg_ptr = 0;
|
|
344
|
-
ServerIdAddrFinalization.unregister(this);
|
|
345
|
-
return ptr;
|
|
346
|
-
}
|
|
347
|
-
free() {
|
|
348
|
-
const ptr = this.__destroy_into_raw();
|
|
349
|
-
wasm.__wbg_serveridaddr_free(ptr, 0);
|
|
358
|
+
class ServerIdAddr {
|
|
359
|
+
static __wrap(ptr) {
|
|
360
|
+
ptr = ptr >>> 0;
|
|
361
|
+
const obj = Object.create(ServerIdAddr.prototype);
|
|
362
|
+
obj.__wbg_ptr = ptr;
|
|
363
|
+
ServerIdAddrFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
364
|
+
return obj;
|
|
365
|
+
}
|
|
366
|
+
static __unwrap(jsValue) {
|
|
367
|
+
if (!(jsValue instanceof ServerIdAddr)) {
|
|
368
|
+
return 0;
|
|
350
369
|
}
|
|
370
|
+
return jsValue.__destroy_into_raw();
|
|
371
|
+
}
|
|
372
|
+
__destroy_into_raw() {
|
|
373
|
+
const ptr = this.__wbg_ptr;
|
|
374
|
+
this.__wbg_ptr = 0;
|
|
375
|
+
ServerIdAddrFinalization.unregister(this);
|
|
376
|
+
return ptr;
|
|
377
|
+
}
|
|
378
|
+
free() {
|
|
379
|
+
const ptr = this.__destroy_into_raw();
|
|
380
|
+
wasm.__wbg_serveridaddr_free(ptr, 0);
|
|
381
|
+
}
|
|
351
382
|
}
|
|
352
383
|
if (Symbol.dispose) ServerIdAddr.prototype[Symbol.dispose] = ServerIdAddr.prototype.free;
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
return 0;
|
|
365
|
-
}
|
|
366
|
-
return jsValue.__destroy_into_raw();
|
|
367
|
-
}
|
|
368
|
-
__destroy_into_raw() {
|
|
369
|
-
const ptr = this.__wbg_ptr;
|
|
370
|
-
this.__wbg_ptr = 0;
|
|
371
|
-
TypedCiphertextFinalization.unregister(this);
|
|
372
|
-
return ptr;
|
|
373
|
-
}
|
|
374
|
-
free() {
|
|
375
|
-
const ptr = this.__destroy_into_raw();
|
|
376
|
-
wasm.__wbg_typedciphertext_free(ptr, 0);
|
|
377
|
-
}
|
|
378
|
-
/**
|
|
379
|
-
* The ciphertext format, see CiphertextFormat documentation for details.
|
|
380
|
-
* CiphertextFormat::default() is used if unspecified.
|
|
381
|
-
* @returns {number}
|
|
382
|
-
*/
|
|
383
|
-
get ciphertext_format() {
|
|
384
|
-
const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
|
|
385
|
-
return ret;
|
|
386
|
-
}
|
|
387
|
-
/**
|
|
388
|
-
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
389
|
-
* @returns {Uint8Array}
|
|
390
|
-
*/
|
|
391
|
-
get ciphertext() {
|
|
392
|
-
const ret = wasm.__wbg_get_typedciphertext_ciphertext(this.__wbg_ptr);
|
|
393
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
394
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
395
|
-
return v1;
|
|
396
|
-
}
|
|
397
|
-
/**
|
|
398
|
-
* The external handle of the ciphertext (the handle used in the copro).
|
|
399
|
-
* @returns {Uint8Array}
|
|
400
|
-
*/
|
|
401
|
-
get external_handle() {
|
|
402
|
-
const ret = wasm.__wbg_get_typedciphertext_external_handle(this.__wbg_ptr);
|
|
403
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
404
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
405
|
-
return v1;
|
|
406
|
-
}
|
|
407
|
-
/**
|
|
408
|
-
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
409
|
-
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
410
|
-
* @returns {number}
|
|
411
|
-
*/
|
|
412
|
-
get fhe_type() {
|
|
413
|
-
const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
|
|
414
|
-
return ret;
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* The ciphertext format, see CiphertextFormat documentation for details.
|
|
418
|
-
* CiphertextFormat::default() is used if unspecified.
|
|
419
|
-
* @param {number} arg0
|
|
420
|
-
*/
|
|
421
|
-
set ciphertext_format(arg0) {
|
|
422
|
-
wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
|
|
423
|
-
}
|
|
424
|
-
/**
|
|
425
|
-
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
426
|
-
* @param {Uint8Array} arg0
|
|
427
|
-
*/
|
|
428
|
-
set ciphertext(arg0) {
|
|
429
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
430
|
-
const len0 = WASM_VECTOR_LEN;
|
|
431
|
-
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* The external handle of the ciphertext (the handle used in the copro).
|
|
435
|
-
* @param {Uint8Array} arg0
|
|
436
|
-
*/
|
|
437
|
-
set external_handle(arg0) {
|
|
438
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
439
|
-
const len0 = WASM_VECTOR_LEN;
|
|
440
|
-
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
441
|
-
}
|
|
442
|
-
/**
|
|
443
|
-
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
444
|
-
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
445
|
-
* @param {number} arg0
|
|
446
|
-
*/
|
|
447
|
-
set fhe_type(arg0) {
|
|
448
|
-
wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
|
|
384
|
+
class TypedCiphertext {
|
|
385
|
+
static __wrap(ptr) {
|
|
386
|
+
ptr = ptr >>> 0;
|
|
387
|
+
const obj = Object.create(TypedCiphertext.prototype);
|
|
388
|
+
obj.__wbg_ptr = ptr;
|
|
389
|
+
TypedCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
390
|
+
return obj;
|
|
391
|
+
}
|
|
392
|
+
static __unwrap(jsValue) {
|
|
393
|
+
if (!(jsValue instanceof TypedCiphertext)) {
|
|
394
|
+
return 0;
|
|
449
395
|
}
|
|
396
|
+
return jsValue.__destroy_into_raw();
|
|
397
|
+
}
|
|
398
|
+
__destroy_into_raw() {
|
|
399
|
+
const ptr = this.__wbg_ptr;
|
|
400
|
+
this.__wbg_ptr = 0;
|
|
401
|
+
TypedCiphertextFinalization.unregister(this);
|
|
402
|
+
return ptr;
|
|
403
|
+
}
|
|
404
|
+
free() {
|
|
405
|
+
const ptr = this.__destroy_into_raw();
|
|
406
|
+
wasm.__wbg_typedciphertext_free(ptr, 0);
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* The ciphertext format, see CiphertextFormat documentation for details.
|
|
410
|
+
* CiphertextFormat::default() is used if unspecified.
|
|
411
|
+
* @returns {number}
|
|
412
|
+
*/
|
|
413
|
+
get ciphertext_format() {
|
|
414
|
+
const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
|
|
415
|
+
return ret;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
419
|
+
* @returns {Uint8Array}
|
|
420
|
+
*/
|
|
421
|
+
get ciphertext() {
|
|
422
|
+
const ret = wasm.__wbg_get_typedciphertext_ciphertext(this.__wbg_ptr);
|
|
423
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
424
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
425
|
+
return v1;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* The external handle of the ciphertext (the handle used in the copro).
|
|
429
|
+
* @returns {Uint8Array}
|
|
430
|
+
*/
|
|
431
|
+
get external_handle() {
|
|
432
|
+
const ret = wasm.__wbg_get_typedciphertext_external_handle(this.__wbg_ptr);
|
|
433
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
434
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
435
|
+
return v1;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
439
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
440
|
+
* @returns {number}
|
|
441
|
+
*/
|
|
442
|
+
get fhe_type() {
|
|
443
|
+
const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
|
|
444
|
+
return ret;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* The ciphertext format, see CiphertextFormat documentation for details.
|
|
448
|
+
* CiphertextFormat::default() is used if unspecified.
|
|
449
|
+
* @param {number} arg0
|
|
450
|
+
*/
|
|
451
|
+
set ciphertext_format(arg0) {
|
|
452
|
+
wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
456
|
+
* @param {Uint8Array} arg0
|
|
457
|
+
*/
|
|
458
|
+
set ciphertext(arg0) {
|
|
459
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
460
|
+
const len0 = WASM_VECTOR_LEN;
|
|
461
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* The external handle of the ciphertext (the handle used in the copro).
|
|
465
|
+
* @param {Uint8Array} arg0
|
|
466
|
+
*/
|
|
467
|
+
set external_handle(arg0) {
|
|
468
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
469
|
+
const len0 = WASM_VECTOR_LEN;
|
|
470
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
474
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
475
|
+
* @param {number} arg0
|
|
476
|
+
*/
|
|
477
|
+
set fhe_type(arg0) {
|
|
478
|
+
wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
|
|
479
|
+
}
|
|
450
480
|
}
|
|
451
481
|
if (Symbol.dispose) TypedCiphertext.prototype[Symbol.dispose] = TypedCiphertext.prototype.free;
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
}
|
|
482
|
+
class TypedPlaintext {
|
|
483
|
+
static __wrap(ptr) {
|
|
484
|
+
ptr = ptr >>> 0;
|
|
485
|
+
const obj = Object.create(TypedPlaintext.prototype);
|
|
486
|
+
obj.__wbg_ptr = ptr;
|
|
487
|
+
TypedPlaintextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
488
|
+
return obj;
|
|
489
|
+
}
|
|
490
|
+
__destroy_into_raw() {
|
|
491
|
+
const ptr = this.__wbg_ptr;
|
|
492
|
+
this.__wbg_ptr = 0;
|
|
493
|
+
TypedPlaintextFinalization.unregister(this);
|
|
494
|
+
return ptr;
|
|
495
|
+
}
|
|
496
|
+
free() {
|
|
497
|
+
const ptr = this.__destroy_into_raw();
|
|
498
|
+
wasm.__wbg_typedplaintext_free(ptr, 0);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* The actual plaintext in bytes.
|
|
502
|
+
* @returns {Uint8Array}
|
|
503
|
+
*/
|
|
504
|
+
get bytes() {
|
|
505
|
+
const ret = wasm.__wbg_get_typedplaintext_bytes(this.__wbg_ptr);
|
|
506
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
507
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
508
|
+
return v1;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
512
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
513
|
+
* @returns {number}
|
|
514
|
+
*/
|
|
515
|
+
get fhe_type() {
|
|
516
|
+
const ret = wasm.__wbg_get_typedplaintext_fhe_type(this.__wbg_ptr);
|
|
517
|
+
return ret;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* The actual plaintext in bytes.
|
|
521
|
+
* @param {Uint8Array} arg0
|
|
522
|
+
*/
|
|
523
|
+
set bytes(arg0) {
|
|
524
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
525
|
+
const len0 = WASM_VECTOR_LEN;
|
|
526
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
530
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
531
|
+
* @param {number} arg0
|
|
532
|
+
*/
|
|
533
|
+
set fhe_type(arg0) {
|
|
534
|
+
wasm.__wbg_set_typedplaintext_fhe_type(this.__wbg_ptr, arg0);
|
|
535
|
+
}
|
|
507
536
|
}
|
|
508
537
|
if (Symbol.dispose) TypedPlaintext.prototype[Symbol.dispose] = TypedPlaintext.prototype.free;
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
return 0;
|
|
521
|
-
}
|
|
522
|
-
return jsValue.__destroy_into_raw();
|
|
523
|
-
}
|
|
524
|
-
__destroy_into_raw() {
|
|
525
|
-
const ptr = this.__wbg_ptr;
|
|
526
|
-
this.__wbg_ptr = 0;
|
|
527
|
-
TypedSigncryptedCiphertextFinalization.unregister(this);
|
|
528
|
-
return ptr;
|
|
529
|
-
}
|
|
530
|
-
free() {
|
|
531
|
-
const ptr = this.__destroy_into_raw();
|
|
532
|
-
wasm.__wbg_typedsigncryptedciphertext_free(ptr, 0);
|
|
533
|
-
}
|
|
534
|
-
/**
|
|
535
|
-
* The external handles that were originally in the request.
|
|
536
|
-
* @returns {Uint8Array}
|
|
537
|
-
*/
|
|
538
|
-
get external_handle() {
|
|
539
|
-
const ret = wasm.__wbg_get_typedsigncryptedciphertext_external_handle(this.__wbg_ptr);
|
|
540
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
541
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
542
|
-
return v1;
|
|
543
|
-
}
|
|
544
|
-
/**
|
|
545
|
-
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
546
|
-
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
547
|
-
* @returns {number}
|
|
548
|
-
*/
|
|
549
|
-
get fhe_type() {
|
|
550
|
-
const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
|
|
551
|
-
return ret;
|
|
552
|
-
}
|
|
553
|
-
/**
|
|
554
|
-
* The packing factor determines whether the decrypted plaintext
|
|
555
|
-
* has a different way of packing compared to what is specified in the plaintext modulus.
|
|
556
|
-
* @returns {number}
|
|
557
|
-
*/
|
|
558
|
-
get packing_factor() {
|
|
559
|
-
const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
|
|
560
|
-
return ret >>> 0;
|
|
561
|
-
}
|
|
562
|
-
/**
|
|
563
|
-
* The signcrypted payload, using a hybrid encryption approach in
|
|
564
|
-
* sign-then-encrypt.
|
|
565
|
-
* @returns {Uint8Array}
|
|
566
|
-
*/
|
|
567
|
-
get signcrypted_ciphertext() {
|
|
568
|
-
const ret = wasm.__wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext(this.__wbg_ptr);
|
|
569
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
570
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
571
|
-
return v1;
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* The external handles that were originally in the request.
|
|
575
|
-
* @param {Uint8Array} arg0
|
|
576
|
-
*/
|
|
577
|
-
set external_handle(arg0) {
|
|
578
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
579
|
-
const len0 = WASM_VECTOR_LEN;
|
|
580
|
-
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
581
|
-
}
|
|
582
|
-
/**
|
|
583
|
-
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
584
|
-
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
585
|
-
* @param {number} arg0
|
|
586
|
-
*/
|
|
587
|
-
set fhe_type(arg0) {
|
|
588
|
-
wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
|
|
589
|
-
}
|
|
590
|
-
/**
|
|
591
|
-
* The packing factor determines whether the decrypted plaintext
|
|
592
|
-
* has a different way of packing compared to what is specified in the plaintext modulus.
|
|
593
|
-
* @param {number} arg0
|
|
594
|
-
*/
|
|
595
|
-
set packing_factor(arg0) {
|
|
596
|
-
wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
|
|
597
|
-
}
|
|
598
|
-
/**
|
|
599
|
-
* The signcrypted payload, using a hybrid encryption approach in
|
|
600
|
-
* sign-then-encrypt.
|
|
601
|
-
* @param {Uint8Array} arg0
|
|
602
|
-
*/
|
|
603
|
-
set signcrypted_ciphertext(arg0) {
|
|
604
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
605
|
-
const len0 = WASM_VECTOR_LEN;
|
|
606
|
-
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
538
|
+
class TypedSigncryptedCiphertext {
|
|
539
|
+
static __wrap(ptr) {
|
|
540
|
+
ptr = ptr >>> 0;
|
|
541
|
+
const obj = Object.create(TypedSigncryptedCiphertext.prototype);
|
|
542
|
+
obj.__wbg_ptr = ptr;
|
|
543
|
+
TypedSigncryptedCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
544
|
+
return obj;
|
|
545
|
+
}
|
|
546
|
+
static __unwrap(jsValue) {
|
|
547
|
+
if (!(jsValue instanceof TypedSigncryptedCiphertext)) {
|
|
548
|
+
return 0;
|
|
607
549
|
}
|
|
550
|
+
return jsValue.__destroy_into_raw();
|
|
551
|
+
}
|
|
552
|
+
__destroy_into_raw() {
|
|
553
|
+
const ptr = this.__wbg_ptr;
|
|
554
|
+
this.__wbg_ptr = 0;
|
|
555
|
+
TypedSigncryptedCiphertextFinalization.unregister(this);
|
|
556
|
+
return ptr;
|
|
557
|
+
}
|
|
558
|
+
free() {
|
|
559
|
+
const ptr = this.__destroy_into_raw();
|
|
560
|
+
wasm.__wbg_typedsigncryptedciphertext_free(ptr, 0);
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* The external handles that were originally in the request.
|
|
564
|
+
* @returns {Uint8Array}
|
|
565
|
+
*/
|
|
566
|
+
get external_handle() {
|
|
567
|
+
const ret = wasm.__wbg_get_typedsigncryptedciphertext_external_handle(this.__wbg_ptr);
|
|
568
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
569
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
570
|
+
return v1;
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
574
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
575
|
+
* @returns {number}
|
|
576
|
+
*/
|
|
577
|
+
get fhe_type() {
|
|
578
|
+
const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
|
|
579
|
+
return ret;
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* The packing factor determines whether the decrypted plaintext
|
|
583
|
+
* has a different way of packing compared to what is specified in the plaintext modulus.
|
|
584
|
+
* @returns {number}
|
|
585
|
+
*/
|
|
586
|
+
get packing_factor() {
|
|
587
|
+
const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
|
|
588
|
+
return ret >>> 0;
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* The signcrypted payload, using a hybrid encryption approach in
|
|
592
|
+
* sign-then-encrypt.
|
|
593
|
+
* @returns {Uint8Array}
|
|
594
|
+
*/
|
|
595
|
+
get signcrypted_ciphertext() {
|
|
596
|
+
const ret = wasm.__wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext(this.__wbg_ptr);
|
|
597
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
598
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
599
|
+
return v1;
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* The external handles that were originally in the request.
|
|
603
|
+
* @param {Uint8Array} arg0
|
|
604
|
+
*/
|
|
605
|
+
set external_handle(arg0) {
|
|
606
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
607
|
+
const len0 = WASM_VECTOR_LEN;
|
|
608
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
612
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
613
|
+
* @param {number} arg0
|
|
614
|
+
*/
|
|
615
|
+
set fhe_type(arg0) {
|
|
616
|
+
wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* The packing factor determines whether the decrypted plaintext
|
|
620
|
+
* has a different way of packing compared to what is specified in the plaintext modulus.
|
|
621
|
+
* @param {number} arg0
|
|
622
|
+
*/
|
|
623
|
+
set packing_factor(arg0) {
|
|
624
|
+
wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* The signcrypted payload, using a hybrid encryption approach in
|
|
628
|
+
* sign-then-encrypt.
|
|
629
|
+
* @param {Uint8Array} arg0
|
|
630
|
+
*/
|
|
631
|
+
set signcrypted_ciphertext(arg0) {
|
|
632
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
633
|
+
const len0 = WASM_VECTOR_LEN;
|
|
634
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
635
|
+
}
|
|
608
636
|
}
|
|
609
637
|
if (Symbol.dispose) TypedSigncryptedCiphertext.prototype[Symbol.dispose] = TypedSigncryptedCiphertext.prototype.free;
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
get client_address() {
|
|
627
|
-
let deferred1_0;
|
|
628
|
-
let deferred1_1;
|
|
629
|
-
try {
|
|
630
|
-
const ret = wasm.__wbg_get_userdecryptionrequest_client_address(this.__wbg_ptr);
|
|
631
|
-
deferred1_0 = ret[0];
|
|
632
|
-
deferred1_1 = ret[1];
|
|
633
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
634
|
-
} finally {
|
|
635
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
/**
|
|
639
|
-
* MPC context ID which is used to identify the context to use for this request.
|
|
640
|
-
*
|
|
641
|
-
* NOTE: at the moment this can be None since we do not fully support multiple contexts.
|
|
642
|
-
* See <https://github.com/zama-ai/kms-internal/issues/2530>
|
|
643
|
-
* @returns {RequestId | undefined}
|
|
644
|
-
*/
|
|
645
|
-
get context_id() {
|
|
646
|
-
const ret = wasm.__wbg_get_userdecryptionrequest_context_id(this.__wbg_ptr);
|
|
647
|
-
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
648
|
-
}
|
|
649
|
-
/**
|
|
650
|
-
* The user's EIP712 domain. This MUST be present. Furthermore, the `verifying_contract` MUST be set and be distinct from `client_address`.
|
|
651
|
-
* @returns {Eip712DomainMsg | undefined}
|
|
652
|
-
*/
|
|
653
|
-
get domain() {
|
|
654
|
-
const ret = wasm.__wbg_get_userdecryptionrequest_domain(this.__wbg_ptr);
|
|
655
|
-
return ret === 0 ? undefined : Eip712DomainMsg.__wrap(ret);
|
|
656
|
-
}
|
|
657
|
-
/**
|
|
658
|
-
* Encoding of the user's public encryption key for this request.
|
|
659
|
-
* This must be a bincode (v.1) encoded ML-KEM 512 key.
|
|
660
|
-
* @returns {Uint8Array}
|
|
661
|
-
*/
|
|
662
|
-
get enc_key() {
|
|
663
|
-
const ret = wasm.__wbg_get_userdecryptionrequest_enc_key(this.__wbg_ptr);
|
|
664
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
665
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
666
|
-
return v1;
|
|
667
|
-
}
|
|
668
|
-
/**
|
|
669
|
-
* The epoch number placeholder (zama-ai/kms-internal#2743).
|
|
670
|
-
* @returns {RequestId | undefined}
|
|
671
|
-
*/
|
|
672
|
-
get epoch_id() {
|
|
673
|
-
const ret = wasm.__wbg_get_userdecryptionrequest_epoch_id(this.__wbg_ptr);
|
|
674
|
-
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
675
|
-
}
|
|
676
|
-
/**
|
|
677
|
-
* Extra data from the gateway.
|
|
678
|
-
* @returns {Uint8Array}
|
|
679
|
-
*/
|
|
680
|
-
get extra_data() {
|
|
681
|
-
const ret = wasm.__wbg_get_userdecryptionrequest_extra_data(this.__wbg_ptr);
|
|
682
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
683
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
684
|
-
return v1;
|
|
685
|
-
}
|
|
686
|
-
/**
|
|
687
|
-
* The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
|
|
688
|
-
* used for key generation
|
|
689
|
-
* @returns {RequestId | undefined}
|
|
690
|
-
*/
|
|
691
|
-
get key_id() {
|
|
692
|
-
const ret = wasm.__wbg_get_userdecryptionrequest_key_id(this.__wbg_ptr);
|
|
693
|
-
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
694
|
-
}
|
|
695
|
-
/**
|
|
696
|
-
* The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
|
|
697
|
-
* prefix. Future queries for the result must use this request ID.
|
|
698
|
-
* @returns {RequestId | undefined}
|
|
699
|
-
*/
|
|
700
|
-
get request_id() {
|
|
701
|
-
const ret = wasm.__wbg_get_userdecryptionrequest_request_id(this.__wbg_ptr);
|
|
702
|
-
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
703
|
-
}
|
|
704
|
-
/**
|
|
705
|
-
* The list of ciphertexts to decrypt for the user.
|
|
706
|
-
* @returns {TypedCiphertext[]}
|
|
707
|
-
*/
|
|
708
|
-
get typed_ciphertexts() {
|
|
709
|
-
const ret = wasm.__wbg_get_userdecryptionrequest_typed_ciphertexts(this.__wbg_ptr);
|
|
710
|
-
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
711
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
712
|
-
return v1;
|
|
713
|
-
}
|
|
714
|
-
/**
|
|
715
|
-
* The client's (blockchain wallet) address, encoded using EIP-55. I.e. including `0x`.
|
|
716
|
-
* @param {string} arg0
|
|
717
|
-
*/
|
|
718
|
-
set client_address(arg0) {
|
|
719
|
-
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
720
|
-
const len0 = WASM_VECTOR_LEN;
|
|
721
|
-
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
722
|
-
}
|
|
723
|
-
/**
|
|
724
|
-
* MPC context ID which is used to identify the context to use for this request.
|
|
725
|
-
*
|
|
726
|
-
* NOTE: at the moment this can be None since we do not fully support multiple contexts.
|
|
727
|
-
* See <https://github.com/zama-ai/kms-internal/issues/2530>
|
|
728
|
-
* @param {RequestId | null} [arg0]
|
|
729
|
-
*/
|
|
730
|
-
set context_id(arg0) {
|
|
731
|
-
let ptr0 = 0;
|
|
732
|
-
if (!isLikeNone(arg0)) {
|
|
733
|
-
_assertClass(arg0, RequestId);
|
|
734
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
735
|
-
}
|
|
736
|
-
wasm.__wbg_set_userdecryptionrequest_context_id(this.__wbg_ptr, ptr0);
|
|
737
|
-
}
|
|
738
|
-
/**
|
|
739
|
-
* The user's EIP712 domain. This MUST be present. Furthermore, the `verifying_contract` MUST be set and be distinct from `client_address`.
|
|
740
|
-
* @param {Eip712DomainMsg | null} [arg0]
|
|
741
|
-
*/
|
|
742
|
-
set domain(arg0) {
|
|
743
|
-
let ptr0 = 0;
|
|
744
|
-
if (!isLikeNone(arg0)) {
|
|
745
|
-
_assertClass(arg0, Eip712DomainMsg);
|
|
746
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
747
|
-
}
|
|
748
|
-
wasm.__wbg_set_userdecryptionrequest_domain(this.__wbg_ptr, ptr0);
|
|
749
|
-
}
|
|
750
|
-
/**
|
|
751
|
-
* Encoding of the user's public encryption key for this request.
|
|
752
|
-
* This must be a bincode (v.1) encoded ML-KEM 512 key.
|
|
753
|
-
* @param {Uint8Array} arg0
|
|
754
|
-
*/
|
|
755
|
-
set enc_key(arg0) {
|
|
756
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
757
|
-
const len0 = WASM_VECTOR_LEN;
|
|
758
|
-
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
759
|
-
}
|
|
760
|
-
/**
|
|
761
|
-
* The epoch number placeholder (zama-ai/kms-internal#2743).
|
|
762
|
-
* @param {RequestId | null} [arg0]
|
|
763
|
-
*/
|
|
764
|
-
set epoch_id(arg0) {
|
|
765
|
-
let ptr0 = 0;
|
|
766
|
-
if (!isLikeNone(arg0)) {
|
|
767
|
-
_assertClass(arg0, RequestId);
|
|
768
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
769
|
-
}
|
|
770
|
-
wasm.__wbg_set_userdecryptionrequest_epoch_id(this.__wbg_ptr, ptr0);
|
|
771
|
-
}
|
|
772
|
-
/**
|
|
773
|
-
* Extra data from the gateway.
|
|
774
|
-
* @param {Uint8Array} arg0
|
|
775
|
-
*/
|
|
776
|
-
set extra_data(arg0) {
|
|
777
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
778
|
-
const len0 = WASM_VECTOR_LEN;
|
|
779
|
-
wasm.__wbg_set_eip712domainmsg_verifying_contract(this.__wbg_ptr, ptr0, len0);
|
|
780
|
-
}
|
|
781
|
-
/**
|
|
782
|
-
* The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
|
|
783
|
-
* used for key generation
|
|
784
|
-
* @param {RequestId | null} [arg0]
|
|
785
|
-
*/
|
|
786
|
-
set key_id(arg0) {
|
|
787
|
-
let ptr0 = 0;
|
|
788
|
-
if (!isLikeNone(arg0)) {
|
|
789
|
-
_assertClass(arg0, RequestId);
|
|
790
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
791
|
-
}
|
|
792
|
-
wasm.__wbg_set_userdecryptionrequest_key_id(this.__wbg_ptr, ptr0);
|
|
793
|
-
}
|
|
794
|
-
/**
|
|
795
|
-
* The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
|
|
796
|
-
* prefix. Future queries for the result must use this request ID.
|
|
797
|
-
* @param {RequestId | null} [arg0]
|
|
798
|
-
*/
|
|
799
|
-
set request_id(arg0) {
|
|
800
|
-
let ptr0 = 0;
|
|
801
|
-
if (!isLikeNone(arg0)) {
|
|
802
|
-
_assertClass(arg0, RequestId);
|
|
803
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
804
|
-
}
|
|
805
|
-
wasm.__wbg_set_userdecryptionrequest_request_id(this.__wbg_ptr, ptr0);
|
|
806
|
-
}
|
|
807
|
-
/**
|
|
808
|
-
* The list of ciphertexts to decrypt for the user.
|
|
809
|
-
* @param {TypedCiphertext[]} arg0
|
|
810
|
-
*/
|
|
811
|
-
set typed_ciphertexts(arg0) {
|
|
812
|
-
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
813
|
-
const len0 = WASM_VECTOR_LEN;
|
|
814
|
-
wasm.__wbg_set_userdecryptionrequest_typed_ciphertexts(this.__wbg_ptr, ptr0, len0);
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
if (Symbol.dispose) UserDecryptionRequest.prototype[Symbol.dispose] = UserDecryptionRequest.prototype.free;
|
|
818
|
-
|
|
819
|
-
export class UserDecryptionResponse {
|
|
820
|
-
static __unwrap(jsValue) {
|
|
821
|
-
if (!(jsValue instanceof UserDecryptionResponse)) {
|
|
822
|
-
return 0;
|
|
823
|
-
}
|
|
824
|
-
return jsValue.__destroy_into_raw();
|
|
825
|
-
}
|
|
826
|
-
__destroy_into_raw() {
|
|
827
|
-
const ptr = this.__wbg_ptr;
|
|
828
|
-
this.__wbg_ptr = 0;
|
|
829
|
-
UserDecryptionResponseFinalization.unregister(this);
|
|
830
|
-
return ptr;
|
|
831
|
-
}
|
|
832
|
-
free() {
|
|
833
|
-
const ptr = this.__destroy_into_raw();
|
|
834
|
-
wasm.__wbg_userdecryptionresponse_free(ptr, 0);
|
|
835
|
-
}
|
|
836
|
-
/**
|
|
837
|
-
* This is the external signature created from the Eip712 domain
|
|
838
|
-
* on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
|
|
839
|
-
* struct UserDecryptResponseVerification {
|
|
840
|
-
* bytes publicKey;
|
|
841
|
-
* uint256\[\] ctHandles;
|
|
842
|
-
* bytes userDecryptedShare; // serialization of payload
|
|
843
|
-
* bytes extraData;
|
|
844
|
-
* }
|
|
845
|
-
* @returns {Uint8Array}
|
|
846
|
-
*/
|
|
847
|
-
get external_signature() {
|
|
848
|
-
const ret = wasm.__wbg_get_userdecryptionresponse_external_signature(this.__wbg_ptr);
|
|
849
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
850
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
851
|
-
return v1;
|
|
852
|
-
}
|
|
853
|
-
/**
|
|
854
|
-
* Extra data used in the EIP712 signature - external_signature.
|
|
855
|
-
* @returns {Uint8Array}
|
|
856
|
-
*/
|
|
857
|
-
get extra_data() {
|
|
858
|
-
const ret = wasm.__wbg_get_userdecryptionresponse_extra_data(this.__wbg_ptr);
|
|
859
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
860
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
861
|
-
return v1;
|
|
862
|
-
}
|
|
863
|
-
/**
|
|
864
|
-
* The actual \[UserDecryptionResponsePayload\].
|
|
865
|
-
* @returns {UserDecryptionResponsePayload | undefined}
|
|
866
|
-
*/
|
|
867
|
-
get payload() {
|
|
868
|
-
const ret = wasm.__wbg_get_userdecryptionresponse_payload(this.__wbg_ptr);
|
|
869
|
-
return ret === 0 ? undefined : UserDecryptionResponsePayload.__wrap(ret);
|
|
870
|
-
}
|
|
871
|
-
/**
|
|
872
|
-
* @returns {Uint8Array}
|
|
873
|
-
*/
|
|
874
|
-
get signature() {
|
|
875
|
-
const ret = wasm.__wbg_get_userdecryptionresponse_signature(this.__wbg_ptr);
|
|
876
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
877
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
878
|
-
return v1;
|
|
879
|
-
}
|
|
880
|
-
/**
|
|
881
|
-
* This is the external signature created from the Eip712 domain
|
|
882
|
-
* on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
|
|
883
|
-
* struct UserDecryptResponseVerification {
|
|
884
|
-
* bytes publicKey;
|
|
885
|
-
* uint256\[\] ctHandles;
|
|
886
|
-
* bytes userDecryptedShare; // serialization of payload
|
|
887
|
-
* bytes extraData;
|
|
888
|
-
* }
|
|
889
|
-
* @param {Uint8Array} arg0
|
|
890
|
-
*/
|
|
891
|
-
set external_signature(arg0) {
|
|
892
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
893
|
-
const len0 = WASM_VECTOR_LEN;
|
|
894
|
-
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
895
|
-
}
|
|
896
|
-
/**
|
|
897
|
-
* Extra data used in the EIP712 signature - external_signature.
|
|
898
|
-
* @param {Uint8Array} arg0
|
|
899
|
-
*/
|
|
900
|
-
set extra_data(arg0) {
|
|
901
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
902
|
-
const len0 = WASM_VECTOR_LEN;
|
|
903
|
-
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
904
|
-
}
|
|
905
|
-
/**
|
|
906
|
-
* The actual \[UserDecryptionResponsePayload\].
|
|
907
|
-
* @param {UserDecryptionResponsePayload | null} [arg0]
|
|
908
|
-
*/
|
|
909
|
-
set payload(arg0) {
|
|
910
|
-
let ptr0 = 0;
|
|
911
|
-
if (!isLikeNone(arg0)) {
|
|
912
|
-
_assertClass(arg0, UserDecryptionResponsePayload);
|
|
913
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
914
|
-
}
|
|
915
|
-
wasm.__wbg_set_userdecryptionresponse_payload(this.__wbg_ptr, ptr0);
|
|
916
|
-
}
|
|
917
|
-
/**
|
|
918
|
-
* @param {Uint8Array} arg0
|
|
919
|
-
*/
|
|
920
|
-
set signature(arg0) {
|
|
921
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
922
|
-
const len0 = WASM_VECTOR_LEN;
|
|
923
|
-
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
if (Symbol.dispose) UserDecryptionResponse.prototype[Symbol.dispose] = UserDecryptionResponse.prototype.free;
|
|
927
|
-
|
|
928
|
-
export class UserDecryptionResponsePayload {
|
|
929
|
-
static __wrap(ptr) {
|
|
930
|
-
ptr = ptr >>> 0;
|
|
931
|
-
const obj = Object.create(UserDecryptionResponsePayload.prototype);
|
|
932
|
-
obj.__wbg_ptr = ptr;
|
|
933
|
-
UserDecryptionResponsePayloadFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
934
|
-
return obj;
|
|
935
|
-
}
|
|
936
|
-
__destroy_into_raw() {
|
|
937
|
-
const ptr = this.__wbg_ptr;
|
|
938
|
-
this.__wbg_ptr = 0;
|
|
939
|
-
UserDecryptionResponsePayloadFinalization.unregister(this);
|
|
940
|
-
return ptr;
|
|
941
|
-
}
|
|
942
|
-
free() {
|
|
943
|
-
const ptr = this.__destroy_into_raw();
|
|
944
|
-
wasm.__wbg_userdecryptionresponsepayload_free(ptr, 0);
|
|
945
|
-
}
|
|
946
|
-
/**
|
|
947
|
-
* The degree of the sharing scheme used.
|
|
948
|
-
* @returns {number}
|
|
949
|
-
*/
|
|
950
|
-
get degree() {
|
|
951
|
-
const ret = wasm.__wbg_get_userdecryptionresponsepayload_degree(this.__wbg_ptr);
|
|
952
|
-
return ret >>> 0;
|
|
953
|
-
}
|
|
954
|
-
/**
|
|
955
|
-
* This is needed to ensure the response corresponds to the request.
|
|
956
|
-
* It is the digest of UserDecryptionLinker hashed using EIP712
|
|
957
|
-
* under the given domain in the request.
|
|
958
|
-
* @returns {Uint8Array}
|
|
959
|
-
*/
|
|
960
|
-
get digest() {
|
|
961
|
-
const ret = wasm.__wbg_get_userdecryptionresponsepayload_digest(this.__wbg_ptr);
|
|
962
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
963
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
964
|
-
return v1;
|
|
965
|
-
}
|
|
966
|
-
/**
|
|
967
|
-
* The ID of the MPC party doing the user decryption. Used for polynomial
|
|
968
|
-
* reconstruction.
|
|
969
|
-
* @returns {number}
|
|
970
|
-
*/
|
|
971
|
-
get party_id() {
|
|
972
|
-
const ret = wasm.__wbg_get_userdecryptionresponsepayload_party_id(this.__wbg_ptr);
|
|
973
|
-
return ret >>> 0;
|
|
974
|
-
}
|
|
975
|
-
/**
|
|
976
|
-
* The resulting signcrypted ciphertexts, each ciphertext
|
|
977
|
-
* must be decrypted and then reconstructed with the other shares
|
|
978
|
-
* to produce the final plaintext.
|
|
979
|
-
* @returns {TypedSigncryptedCiphertext[]}
|
|
980
|
-
*/
|
|
981
|
-
get signcrypted_ciphertexts() {
|
|
982
|
-
const ret = wasm.__wbg_get_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr);
|
|
983
|
-
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
984
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
985
|
-
return v1;
|
|
986
|
-
}
|
|
987
|
-
/**
|
|
988
|
-
* The server's signature verification key, Encoded using SEC1.
|
|
989
|
-
* Needed to validate the response, but MUST also be linked to a list of
|
|
990
|
-
* trusted keys.
|
|
991
|
-
* @returns {Uint8Array}
|
|
992
|
-
*/
|
|
993
|
-
get verification_key() {
|
|
994
|
-
const ret = wasm.__wbg_get_userdecryptionresponsepayload_verification_key(this.__wbg_ptr);
|
|
995
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
996
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
997
|
-
return v1;
|
|
998
|
-
}
|
|
999
|
-
/**
|
|
1000
|
-
* The degree of the sharing scheme used.
|
|
1001
|
-
* @param {number} arg0
|
|
1002
|
-
*/
|
|
1003
|
-
set degree(arg0) {
|
|
1004
|
-
wasm.__wbg_set_userdecryptionresponsepayload_degree(this.__wbg_ptr, arg0);
|
|
1005
|
-
}
|
|
1006
|
-
/**
|
|
1007
|
-
* This is needed to ensure the response corresponds to the request.
|
|
1008
|
-
* It is the digest of UserDecryptionLinker hashed using EIP712
|
|
1009
|
-
* under the given domain in the request.
|
|
1010
|
-
* @param {Uint8Array} arg0
|
|
1011
|
-
*/
|
|
1012
|
-
set digest(arg0) {
|
|
1013
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1014
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1015
|
-
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1016
|
-
}
|
|
1017
|
-
/**
|
|
1018
|
-
* The ID of the MPC party doing the user decryption. Used for polynomial
|
|
1019
|
-
* reconstruction.
|
|
1020
|
-
* @param {number} arg0
|
|
1021
|
-
*/
|
|
1022
|
-
set party_id(arg0) {
|
|
1023
|
-
wasm.__wbg_set_userdecryptionresponsepayload_party_id(this.__wbg_ptr, arg0);
|
|
1024
|
-
}
|
|
1025
|
-
/**
|
|
1026
|
-
* The resulting signcrypted ciphertexts, each ciphertext
|
|
1027
|
-
* must be decrypted and then reconstructed with the other shares
|
|
1028
|
-
* to produce the final plaintext.
|
|
1029
|
-
* @param {TypedSigncryptedCiphertext[]} arg0
|
|
1030
|
-
*/
|
|
1031
|
-
set signcrypted_ciphertexts(arg0) {
|
|
1032
|
-
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1033
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1034
|
-
wasm.__wbg_set_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr, ptr0, len0);
|
|
1035
|
-
}
|
|
1036
|
-
/**
|
|
1037
|
-
* The server's signature verification key, Encoded using SEC1.
|
|
1038
|
-
* Needed to validate the response, but MUST also be linked to a list of
|
|
1039
|
-
* trusted keys.
|
|
1040
|
-
* @param {Uint8Array} arg0
|
|
1041
|
-
*/
|
|
1042
|
-
set verification_key(arg0) {
|
|
1043
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1044
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1045
|
-
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
if (Symbol.dispose) UserDecryptionResponsePayload.prototype[Symbol.dispose] = UserDecryptionResponsePayload.prototype.free;
|
|
1049
|
-
|
|
1050
|
-
/**
|
|
1051
|
-
* @param {Client} client
|
|
1052
|
-
* @returns {string}
|
|
1053
|
-
*/
|
|
1054
|
-
export function get_client_address(client) {
|
|
638
|
+
class UserDecryptionRequest {
|
|
639
|
+
__destroy_into_raw() {
|
|
640
|
+
const ptr = this.__wbg_ptr;
|
|
641
|
+
this.__wbg_ptr = 0;
|
|
642
|
+
UserDecryptionRequestFinalization.unregister(this);
|
|
643
|
+
return ptr;
|
|
644
|
+
}
|
|
645
|
+
free() {
|
|
646
|
+
const ptr = this.__destroy_into_raw();
|
|
647
|
+
wasm.__wbg_userdecryptionrequest_free(ptr, 0);
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* The client's (blockchain wallet) address, encoded using EIP-55. I.e. including `0x`.
|
|
651
|
+
* @returns {string}
|
|
652
|
+
*/
|
|
653
|
+
get client_address() {
|
|
1055
654
|
let deferred1_0;
|
|
1056
655
|
let deferred1_1;
|
|
1057
656
|
try {
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
657
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_client_address(this.__wbg_ptr);
|
|
658
|
+
deferred1_0 = ret[0];
|
|
659
|
+
deferred1_1 = ret[1];
|
|
660
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1063
661
|
} finally {
|
|
1064
|
-
|
|
662
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1065
663
|
}
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
/**
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* MPC context ID which is used to identify the context to use for this request.
|
|
667
|
+
*
|
|
668
|
+
* NOTE: at the moment this can be None since we do not fully support multiple contexts.
|
|
669
|
+
* See <https://github.com/zama-ai/kms-internal/issues/2530>
|
|
670
|
+
* @returns {RequestId | undefined}
|
|
671
|
+
*/
|
|
672
|
+
get context_id() {
|
|
673
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_context_id(this.__wbg_ptr);
|
|
674
|
+
return ret === 0 ? void 0 : RequestId.__wrap(ret);
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* The user's EIP712 domain. This MUST be present. Furthermore, the `verifying_contract` MUST be set and be distinct from `client_address`.
|
|
678
|
+
* @returns {Eip712DomainMsg | undefined}
|
|
679
|
+
*/
|
|
680
|
+
get domain() {
|
|
681
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_domain(this.__wbg_ptr);
|
|
682
|
+
return ret === 0 ? void 0 : Eip712DomainMsg.__wrap(ret);
|
|
683
|
+
}
|
|
684
|
+
/**
|
|
685
|
+
* Encoding of the user's public encryption key for this request.
|
|
686
|
+
* This must be a bincode (v.1) encoded ML-KEM 512 key.
|
|
687
|
+
* @returns {Uint8Array}
|
|
688
|
+
*/
|
|
689
|
+
get enc_key() {
|
|
690
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_enc_key(this.__wbg_ptr);
|
|
691
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
692
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
693
|
+
return v1;
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* The epoch number placeholder (zama-ai/kms-internal#2743).
|
|
697
|
+
* @returns {RequestId | undefined}
|
|
698
|
+
*/
|
|
699
|
+
get epoch_id() {
|
|
700
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_epoch_id(this.__wbg_ptr);
|
|
701
|
+
return ret === 0 ? void 0 : RequestId.__wrap(ret);
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Extra data from the gateway.
|
|
705
|
+
* @returns {Uint8Array}
|
|
706
|
+
*/
|
|
707
|
+
get extra_data() {
|
|
708
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_extra_data(this.__wbg_ptr);
|
|
709
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
710
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
711
|
+
return v1;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
|
|
715
|
+
* used for key generation
|
|
716
|
+
* @returns {RequestId | undefined}
|
|
717
|
+
*/
|
|
718
|
+
get key_id() {
|
|
719
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_key_id(this.__wbg_ptr);
|
|
720
|
+
return ret === 0 ? void 0 : RequestId.__wrap(ret);
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
|
|
724
|
+
* prefix. Future queries for the result must use this request ID.
|
|
725
|
+
* @returns {RequestId | undefined}
|
|
726
|
+
*/
|
|
727
|
+
get request_id() {
|
|
728
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_request_id(this.__wbg_ptr);
|
|
729
|
+
return ret === 0 ? void 0 : RequestId.__wrap(ret);
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* The list of ciphertexts to decrypt for the user.
|
|
733
|
+
* @returns {TypedCiphertext[]}
|
|
734
|
+
*/
|
|
735
|
+
get typed_ciphertexts() {
|
|
736
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_typed_ciphertexts(this.__wbg_ptr);
|
|
1085
737
|
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1086
738
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1087
739
|
return v1;
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
* @param {PrivateEncKeyMlKem512} my_sk
|
|
1096
|
-
* @returns {Uint8Array}
|
|
1097
|
-
*/
|
|
1098
|
-
export function ml_kem_pke_decrypt(ct, my_sk) {
|
|
1099
|
-
const ptr0 = passArray8ToWasm0(ct, wasm.__wbindgen_malloc);
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* The client's (blockchain wallet) address, encoded using EIP-55. I.e. including `0x`.
|
|
743
|
+
* @param {string} arg0
|
|
744
|
+
*/
|
|
745
|
+
set client_address(arg0) {
|
|
746
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1100
747
|
const len0 = WASM_VECTOR_LEN;
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
748
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* MPC context ID which is used to identify the context to use for this request.
|
|
752
|
+
*
|
|
753
|
+
* NOTE: at the moment this can be None since we do not fully support multiple contexts.
|
|
754
|
+
* See <https://github.com/zama-ai/kms-internal/issues/2530>
|
|
755
|
+
* @param {RequestId | null} [arg0]
|
|
756
|
+
*/
|
|
757
|
+
set context_id(arg0) {
|
|
758
|
+
let ptr0 = 0;
|
|
759
|
+
if (!isLikeNone(arg0)) {
|
|
760
|
+
_assertClass(arg0, RequestId);
|
|
761
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
762
|
+
}
|
|
763
|
+
wasm.__wbg_set_userdecryptionrequest_context_id(this.__wbg_ptr, ptr0);
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* The user's EIP712 domain. This MUST be present. Furthermore, the `verifying_contract` MUST be set and be distinct from `client_address`.
|
|
767
|
+
* @param {Eip712DomainMsg | null} [arg0]
|
|
768
|
+
*/
|
|
769
|
+
set domain(arg0) {
|
|
770
|
+
let ptr0 = 0;
|
|
771
|
+
if (!isLikeNone(arg0)) {
|
|
772
|
+
_assertClass(arg0, Eip712DomainMsg);
|
|
773
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
774
|
+
}
|
|
775
|
+
wasm.__wbg_set_userdecryptionrequest_domain(this.__wbg_ptr, ptr0);
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* Encoding of the user's public encryption key for this request.
|
|
779
|
+
* This must be a bincode (v.1) encoded ML-KEM 512 key.
|
|
780
|
+
* @param {Uint8Array} arg0
|
|
781
|
+
*/
|
|
782
|
+
set enc_key(arg0) {
|
|
783
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1117
784
|
const len0 = WASM_VECTOR_LEN;
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
785
|
+
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* The epoch number placeholder (zama-ai/kms-internal#2743).
|
|
789
|
+
* @param {RequestId | null} [arg0]
|
|
790
|
+
*/
|
|
791
|
+
set epoch_id(arg0) {
|
|
792
|
+
let ptr0 = 0;
|
|
793
|
+
if (!isLikeNone(arg0)) {
|
|
794
|
+
_assertClass(arg0, RequestId);
|
|
795
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
796
|
+
}
|
|
797
|
+
wasm.__wbg_set_userdecryptionrequest_epoch_id(this.__wbg_ptr, ptr0);
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* Extra data from the gateway.
|
|
801
|
+
* @param {Uint8Array} arg0
|
|
802
|
+
*/
|
|
803
|
+
set extra_data(arg0) {
|
|
804
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
805
|
+
const len0 = WASM_VECTOR_LEN;
|
|
806
|
+
wasm.__wbg_set_eip712domainmsg_verifying_contract(this.__wbg_ptr, ptr0, len0);
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
|
|
810
|
+
* used for key generation
|
|
811
|
+
* @param {RequestId | null} [arg0]
|
|
812
|
+
*/
|
|
813
|
+
set key_id(arg0) {
|
|
814
|
+
let ptr0 = 0;
|
|
815
|
+
if (!isLikeNone(arg0)) {
|
|
816
|
+
_assertClass(arg0, RequestId);
|
|
817
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
818
|
+
}
|
|
819
|
+
wasm.__wbg_set_userdecryptionrequest_key_id(this.__wbg_ptr, ptr0);
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
|
|
823
|
+
* prefix. Future queries for the result must use this request ID.
|
|
824
|
+
* @param {RequestId | null} [arg0]
|
|
825
|
+
*/
|
|
826
|
+
set request_id(arg0) {
|
|
827
|
+
let ptr0 = 0;
|
|
828
|
+
if (!isLikeNone(arg0)) {
|
|
829
|
+
_assertClass(arg0, RequestId);
|
|
830
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
831
|
+
}
|
|
832
|
+
wasm.__wbg_set_userdecryptionrequest_request_id(this.__wbg_ptr, ptr0);
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* The list of ciphertexts to decrypt for the user.
|
|
836
|
+
* @param {TypedCiphertext[]} arg0
|
|
837
|
+
*/
|
|
838
|
+
set typed_ciphertexts(arg0) {
|
|
839
|
+
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
840
|
+
const len0 = WASM_VECTOR_LEN;
|
|
841
|
+
wasm.__wbg_set_userdecryptionrequest_typed_ciphertexts(this.__wbg_ptr, ptr0, len0);
|
|
842
|
+
}
|
|
1149
843
|
}
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
export function ml_kem_pke_pk_to_u8vec(pk) {
|
|
1156
|
-
_assertClass(pk, PublicEncKeyMlKem512);
|
|
1157
|
-
const ret = wasm.ml_kem_pke_pk_to_u8vec(pk.__wbg_ptr);
|
|
1158
|
-
if (ret[3]) {
|
|
1159
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
844
|
+
if (Symbol.dispose) UserDecryptionRequest.prototype[Symbol.dispose] = UserDecryptionRequest.prototype.free;
|
|
845
|
+
class UserDecryptionResponse {
|
|
846
|
+
static __unwrap(jsValue) {
|
|
847
|
+
if (!(jsValue instanceof UserDecryptionResponse)) {
|
|
848
|
+
return 0;
|
|
1160
849
|
}
|
|
850
|
+
return jsValue.__destroy_into_raw();
|
|
851
|
+
}
|
|
852
|
+
__destroy_into_raw() {
|
|
853
|
+
const ptr = this.__wbg_ptr;
|
|
854
|
+
this.__wbg_ptr = 0;
|
|
855
|
+
UserDecryptionResponseFinalization.unregister(this);
|
|
856
|
+
return ptr;
|
|
857
|
+
}
|
|
858
|
+
free() {
|
|
859
|
+
const ptr = this.__destroy_into_raw();
|
|
860
|
+
wasm.__wbg_userdecryptionresponse_free(ptr, 0);
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* This is the external signature created from the Eip712 domain
|
|
864
|
+
* on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
|
|
865
|
+
* struct UserDecryptResponseVerification {
|
|
866
|
+
* bytes publicKey;
|
|
867
|
+
* uint256\[\] ctHandles;
|
|
868
|
+
* bytes userDecryptedShare; // serialization of payload
|
|
869
|
+
* bytes extraData;
|
|
870
|
+
* }
|
|
871
|
+
* @returns {Uint8Array}
|
|
872
|
+
*/
|
|
873
|
+
get external_signature() {
|
|
874
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_external_signature(this.__wbg_ptr);
|
|
1161
875
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1162
876
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1163
877
|
return v1;
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
const ret = wasm.
|
|
1171
|
-
return ret >>> 0;
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
/**
|
|
1175
|
-
* @param {PrivateEncKeyMlKem512} sk
|
|
1176
|
-
* @returns {Uint8Array}
|
|
1177
|
-
*/
|
|
1178
|
-
export function ml_kem_pke_sk_to_u8vec(sk) {
|
|
1179
|
-
_assertClass(sk, PrivateEncKeyMlKem512);
|
|
1180
|
-
const ret = wasm.ml_kem_pke_sk_to_u8vec(sk.__wbg_ptr);
|
|
1181
|
-
if (ret[3]) {
|
|
1182
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
1183
|
-
}
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Extra data used in the EIP712 signature - external_signature.
|
|
881
|
+
* @returns {Uint8Array}
|
|
882
|
+
*/
|
|
883
|
+
get extra_data() {
|
|
884
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_extra_data(this.__wbg_ptr);
|
|
1184
885
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1185
886
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1186
887
|
return v1;
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
*
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* The actual \[UserDecryptionResponsePayload\].
|
|
891
|
+
* @returns {UserDecryptionResponsePayload | undefined}
|
|
892
|
+
*/
|
|
893
|
+
get payload() {
|
|
894
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_payload(this.__wbg_ptr);
|
|
895
|
+
return ret === 0 ? void 0 : UserDecryptionResponsePayload.__wrap(ret);
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* @returns {Uint8Array}
|
|
899
|
+
*/
|
|
900
|
+
get signature() {
|
|
901
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_signature(this.__wbg_ptr);
|
|
902
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
903
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
904
|
+
return v1;
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* This is the external signature created from the Eip712 domain
|
|
908
|
+
* on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
|
|
909
|
+
* struct UserDecryptResponseVerification {
|
|
910
|
+
* bytes publicKey;
|
|
911
|
+
* uint256\[\] ctHandles;
|
|
912
|
+
* bytes userDecryptedShare; // serialization of payload
|
|
913
|
+
* bytes extraData;
|
|
914
|
+
* }
|
|
915
|
+
* @param {Uint8Array} arg0
|
|
916
|
+
*/
|
|
917
|
+
set external_signature(arg0) {
|
|
918
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1207
919
|
const len0 = WASM_VECTOR_LEN;
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
return Client.__wrap(ret[0]);
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
/**
|
|
1220
|
-
* Create a new [ServerIdAddr] structure that holds an ID and an address
|
|
1221
|
-
* which must be a valid EIP-55 address, notably prefixed with "0x".
|
|
1222
|
-
* @param {number} id
|
|
1223
|
-
* @param {string} addr
|
|
1224
|
-
* @returns {ServerIdAddr}
|
|
1225
|
-
*/
|
|
1226
|
-
export function new_server_id_addr(id, addr) {
|
|
1227
|
-
const ptr0 = passStringToWasm0(addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
920
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* Extra data used in the EIP712 signature - external_signature.
|
|
924
|
+
* @param {Uint8Array} arg0
|
|
925
|
+
*/
|
|
926
|
+
set extra_data(arg0) {
|
|
927
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1228
928
|
const len0 = WASM_VECTOR_LEN;
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
929
|
+
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* The actual \[UserDecryptionResponsePayload\].
|
|
933
|
+
* @param {UserDecryptionResponsePayload | null} [arg0]
|
|
934
|
+
*/
|
|
935
|
+
set payload(arg0) {
|
|
936
|
+
let ptr0 = 0;
|
|
937
|
+
if (!isLikeNone(arg0)) {
|
|
938
|
+
_assertClass(arg0, UserDecryptionResponsePayload);
|
|
939
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1232
940
|
}
|
|
1233
|
-
|
|
941
|
+
wasm.__wbg_set_userdecryptionresponse_payload(this.__wbg_ptr, ptr0);
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* @param {Uint8Array} arg0
|
|
945
|
+
*/
|
|
946
|
+
set signature(arg0) {
|
|
947
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
948
|
+
const len0 = WASM_VECTOR_LEN;
|
|
949
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
950
|
+
}
|
|
1234
951
|
}
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
952
|
+
if (Symbol.dispose) UserDecryptionResponse.prototype[Symbol.dispose] = UserDecryptionResponse.prototype.free;
|
|
953
|
+
class UserDecryptionResponsePayload {
|
|
954
|
+
static __wrap(ptr) {
|
|
955
|
+
ptr = ptr >>> 0;
|
|
956
|
+
const obj = Object.create(UserDecryptionResponsePayload.prototype);
|
|
957
|
+
obj.__wbg_ptr = ptr;
|
|
958
|
+
UserDecryptionResponsePayloadFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
959
|
+
return obj;
|
|
960
|
+
}
|
|
961
|
+
__destroy_into_raw() {
|
|
962
|
+
const ptr = this.__wbg_ptr;
|
|
963
|
+
this.__wbg_ptr = 0;
|
|
964
|
+
UserDecryptionResponsePayloadFinalization.unregister(this);
|
|
965
|
+
return ptr;
|
|
966
|
+
}
|
|
967
|
+
free() {
|
|
968
|
+
const ptr = this.__destroy_into_raw();
|
|
969
|
+
wasm.__wbg_userdecryptionresponsepayload_free(ptr, 0);
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* The degree of the sharing scheme used.
|
|
973
|
+
* @returns {number}
|
|
974
|
+
*/
|
|
975
|
+
get degree() {
|
|
976
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_degree(this.__wbg_ptr);
|
|
977
|
+
return ret >>> 0;
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* This is needed to ensure the response corresponds to the request.
|
|
981
|
+
* It is the digest of UserDecryptionLinker hashed using EIP712
|
|
982
|
+
* under the given domain in the request.
|
|
983
|
+
* @returns {Uint8Array}
|
|
984
|
+
*/
|
|
985
|
+
get digest() {
|
|
986
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_digest(this.__wbg_ptr);
|
|
1246
987
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1247
988
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1248
989
|
return v1;
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
* * `enc_pk` - The ephemeral public key.
|
|
1268
|
-
*
|
|
1269
|
-
* * `enc_sk` - The ephemeral secret key.
|
|
1270
|
-
*
|
|
1271
|
-
* * `verify` - Whether to perform signature verification for the response.
|
|
1272
|
-
* It is insecure if `verify = false`!
|
|
1273
|
-
* @param {Client} client
|
|
1274
|
-
* @param {ParsedUserDecryptionRequest | null | undefined} request
|
|
1275
|
-
* @param {Eip712DomainMsg | null | undefined} eip712_domain
|
|
1276
|
-
* @param {UserDecryptionResponse[]} agg_resp
|
|
1277
|
-
* @param {PublicEncKeyMlKem512} enc_pk
|
|
1278
|
-
* @param {PrivateEncKeyMlKem512} enc_sk
|
|
1279
|
-
* @param {boolean} verify
|
|
1280
|
-
* @returns {TypedPlaintext[]}
|
|
1281
|
-
*/
|
|
1282
|
-
export function process_user_decryption_resp(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
|
|
1283
|
-
_assertClass(client, Client);
|
|
1284
|
-
let ptr0 = 0;
|
|
1285
|
-
if (!isLikeNone(request)) {
|
|
1286
|
-
_assertClass(request, ParsedUserDecryptionRequest);
|
|
1287
|
-
ptr0 = request.__destroy_into_raw();
|
|
1288
|
-
}
|
|
1289
|
-
let ptr1 = 0;
|
|
1290
|
-
if (!isLikeNone(eip712_domain)) {
|
|
1291
|
-
_assertClass(eip712_domain, Eip712DomainMsg);
|
|
1292
|
-
ptr1 = eip712_domain.__destroy_into_raw();
|
|
1293
|
-
}
|
|
1294
|
-
const ptr2 = passArrayJsValueToWasm0(agg_resp, wasm.__wbindgen_malloc);
|
|
1295
|
-
const len2 = WASM_VECTOR_LEN;
|
|
1296
|
-
_assertClass(enc_pk, PublicEncKeyMlKem512);
|
|
1297
|
-
_assertClass(enc_sk, PrivateEncKeyMlKem512);
|
|
1298
|
-
const ret = wasm.process_user_decryption_resp(client.__wbg_ptr, ptr0, ptr1, ptr2, len2, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
|
|
1299
|
-
if (ret[3]) {
|
|
1300
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
1301
|
-
}
|
|
1302
|
-
var v4 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1303
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1304
|
-
return v4;
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1307
|
-
/**
|
|
1308
|
-
* Process the user_decryption response from JavaScript objects.
|
|
1309
|
-
* The returned result is a byte array representing a plaintext of any length,
|
|
1310
|
-
* postprocessing is returned to turn it into an integer.
|
|
1311
|
-
*
|
|
1312
|
-
* * `client` - client that wants to perform user_decryption.
|
|
1313
|
-
*
|
|
1314
|
-
* * `request` - the initial user_decryption request JS object.
|
|
1315
|
-
* It can be set to null if `verify` is false.
|
|
1316
|
-
* Otherwise the caller needs to give the following JS object.
|
|
1317
|
-
* Note that `client_address` and `eip712_verifying_contract` follow EIP-55.
|
|
1318
|
-
* The signature field is not needed.
|
|
1319
|
-
* ```
|
|
1320
|
-
* {
|
|
1321
|
-
* signature: undefined,
|
|
1322
|
-
* client_address: '0x17853A630aAe15AED549B2B874de08B73C0F59c5',
|
|
1323
|
-
* enc_key: '2000000000000000df2fcacb774f03187f3802a27259f45c06d33cefa68d9c53426b15ad531aa822',
|
|
1324
|
-
* ciphertext_handles: [ '0748b542afe2353c86cb707e3d21044b0be1fd18efc7cbaa6a415af055bfb358' ]
|
|
1325
|
-
* eip712_verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657'
|
|
1326
|
-
* }
|
|
1327
|
-
* ```
|
|
1328
|
-
*
|
|
1329
|
-
* * `eip712_domain` - the EIP-712 domain JS object.
|
|
1330
|
-
* It can be set to null if `verify` is false.
|
|
1331
|
-
* Otherwise the caller needs to give the following JS object.
|
|
1332
|
-
* Note that `salt` is optional and `verifying_contract` follows EIP-55,
|
|
1333
|
-
* additionally, `chain_id` is an array of u8.
|
|
1334
|
-
* ```
|
|
1335
|
-
* {
|
|
1336
|
-
* name: 'Authorization token',
|
|
1337
|
-
* version: '1',
|
|
1338
|
-
* chain_id: [
|
|
1339
|
-
* 70, 31, 0, 0, 0, 0, 0, 0, 0,
|
|
1340
|
-
* 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
1341
|
-
* 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
1342
|
-
* 0, 0, 0, 0, 0
|
|
1343
|
-
* ],
|
|
1344
|
-
* verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657',
|
|
1345
|
-
* salt: []
|
|
1346
|
-
* }
|
|
1347
|
-
* ```
|
|
1348
|
-
*
|
|
1349
|
-
* * `agg_resp` - the response JS object from the gateway.
|
|
1350
|
-
* It has two fields like so, both are hex encoded byte arrays.
|
|
1351
|
-
* ```
|
|
1352
|
-
* [
|
|
1353
|
-
* {
|
|
1354
|
-
* signature: '69e7e040cab157aa819015b321c012dccb1545ffefd325b359b492653f0347517e28e66c572cdc299e259024329859ff9fcb0096e1ce072af0b6e1ca1fe25ec6',
|
|
1355
|
-
* payload: '0100000029...',
|
|
1356
|
-
* extra_data: '01234...',
|
|
1357
|
-
* }
|
|
1358
|
-
* ]
|
|
1359
|
-
* ```
|
|
1360
|
-
*
|
|
1361
|
-
* * `enc_pk` - The ephemeral public key.
|
|
1362
|
-
*
|
|
1363
|
-
* * `enc_sk` - The ephemeral secret key.
|
|
1364
|
-
*
|
|
1365
|
-
* * `verify` - Whether to perform signature verification for the response.
|
|
1366
|
-
* It is insecure if `verify = false`!
|
|
1367
|
-
* @param {Client} client
|
|
1368
|
-
* @param {any} request
|
|
1369
|
-
* @param {any} eip712_domain
|
|
1370
|
-
* @param {any} agg_resp
|
|
1371
|
-
* @param {PublicEncKeyMlKem512} enc_pk
|
|
1372
|
-
* @param {PrivateEncKeyMlKem512} enc_sk
|
|
1373
|
-
* @param {boolean} verify
|
|
1374
|
-
* @returns {TypedPlaintext[]}
|
|
1375
|
-
*/
|
|
1376
|
-
export function process_user_decryption_resp_from_js(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
|
|
1377
|
-
_assertClass(client, Client);
|
|
1378
|
-
_assertClass(enc_pk, PublicEncKeyMlKem512);
|
|
1379
|
-
_assertClass(enc_sk, PrivateEncKeyMlKem512);
|
|
1380
|
-
const ret = wasm.process_user_decryption_resp_from_js(client.__wbg_ptr, request, eip712_domain, agg_resp, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
|
|
1381
|
-
if (ret[3]) {
|
|
1382
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
1383
|
-
}
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* The ID of the MPC party doing the user decryption. Used for polynomial
|
|
993
|
+
* reconstruction.
|
|
994
|
+
* @returns {number}
|
|
995
|
+
*/
|
|
996
|
+
get party_id() {
|
|
997
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_party_id(this.__wbg_ptr);
|
|
998
|
+
return ret >>> 0;
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* The resulting signcrypted ciphertexts, each ciphertext
|
|
1002
|
+
* must be decrypted and then reconstructed with the other shares
|
|
1003
|
+
* to produce the final plaintext.
|
|
1004
|
+
* @returns {TypedSigncryptedCiphertext[]}
|
|
1005
|
+
*/
|
|
1006
|
+
get signcrypted_ciphertexts() {
|
|
1007
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr);
|
|
1384
1008
|
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1385
1009
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1386
1010
|
return v1;
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
const ret = wasm.
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* The server's signature verification key, Encoded using SEC1.
|
|
1014
|
+
* Needed to validate the response, but MUST also be linked to a list of
|
|
1015
|
+
* trusted keys.
|
|
1016
|
+
* @returns {Uint8Array}
|
|
1017
|
+
*/
|
|
1018
|
+
get verification_key() {
|
|
1019
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_verification_key(this.__wbg_ptr);
|
|
1396
1020
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1397
1021
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1398
1022
|
return v1;
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* The degree of the sharing scheme used.
|
|
1026
|
+
* @param {number} arg0
|
|
1027
|
+
*/
|
|
1028
|
+
set degree(arg0) {
|
|
1029
|
+
wasm.__wbg_set_userdecryptionresponsepayload_degree(this.__wbg_ptr, arg0);
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* This is needed to ensure the response corresponds to the request.
|
|
1033
|
+
* It is the digest of UserDecryptionLinker hashed using EIP712
|
|
1034
|
+
* under the given domain in the request.
|
|
1035
|
+
* @param {Uint8Array} arg0
|
|
1036
|
+
*/
|
|
1037
|
+
set digest(arg0) {
|
|
1038
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1407
1039
|
const len0 = WASM_VECTOR_LEN;
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1040
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* The ID of the MPC party doing the user decryption. Used for polynomial
|
|
1044
|
+
* reconstruction.
|
|
1045
|
+
* @param {number} arg0
|
|
1046
|
+
*/
|
|
1047
|
+
set party_id(arg0) {
|
|
1048
|
+
wasm.__wbg_set_userdecryptionresponsepayload_party_id(this.__wbg_ptr, arg0);
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* The resulting signcrypted ciphertexts, each ciphertext
|
|
1052
|
+
* must be decrypted and then reconstructed with the other shares
|
|
1053
|
+
* to produce the final plaintext.
|
|
1054
|
+
* @param {TypedSigncryptedCiphertext[]} arg0
|
|
1055
|
+
*/
|
|
1056
|
+
set signcrypted_ciphertexts(arg0) {
|
|
1057
|
+
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1421
1058
|
const len0 = WASM_VECTOR_LEN;
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
*/
|
|
1433
|
-
export function u8vec_to_private_sig_key(v) {
|
|
1434
|
-
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
1059
|
+
wasm.__wbg_set_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr, ptr0, len0);
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* The server's signature verification key, Encoded using SEC1.
|
|
1063
|
+
* Needed to validate the response, but MUST also be linked to a list of
|
|
1064
|
+
* trusted keys.
|
|
1065
|
+
* @param {Uint8Array} arg0
|
|
1066
|
+
*/
|
|
1067
|
+
set verification_key(arg0) {
|
|
1068
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1435
1069
|
const len0 = WASM_VECTOR_LEN;
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
1439
|
-
}
|
|
1440
|
-
return PrivateSigKey.__wrap(ret[0]);
|
|
1070
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1071
|
+
}
|
|
1441
1072
|
}
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
const
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1073
|
+
if (Symbol.dispose) UserDecryptionResponsePayload.prototype[Symbol.dispose] = UserDecryptionResponsePayload.prototype.free;
|
|
1074
|
+
function get_client_address(client) {
|
|
1075
|
+
let deferred1_0;
|
|
1076
|
+
let deferred1_1;
|
|
1077
|
+
try {
|
|
1078
|
+
_assertClass(client, Client);
|
|
1079
|
+
const ret = wasm.get_client_address(client.__wbg_ptr);
|
|
1080
|
+
deferred1_0 = ret[0];
|
|
1081
|
+
deferred1_1 = ret[1];
|
|
1082
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1083
|
+
} finally {
|
|
1084
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
function get_client_secret_key(client) {
|
|
1088
|
+
_assertClass(client, Client);
|
|
1089
|
+
const ret = wasm.get_client_secret_key(client.__wbg_ptr);
|
|
1090
|
+
return ret === 0 ? void 0 : PrivateSigKey.__wrap(ret);
|
|
1091
|
+
}
|
|
1092
|
+
function get_server_addrs(client) {
|
|
1093
|
+
_assertClass(client, Client);
|
|
1094
|
+
const ret = wasm.get_server_addrs(client.__wbg_ptr);
|
|
1095
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1096
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1097
|
+
return v1;
|
|
1098
|
+
}
|
|
1099
|
+
function ml_kem_pke_decrypt(ct, my_sk) {
|
|
1100
|
+
const ptr0 = passArray8ToWasm0(ct, wasm.__wbindgen_malloc);
|
|
1101
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1102
|
+
_assertClass(my_sk, PrivateEncKeyMlKem512);
|
|
1103
|
+
const ret = wasm.ml_kem_pke_decrypt(ptr0, len0, my_sk.__wbg_ptr);
|
|
1104
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1105
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1106
|
+
return v2;
|
|
1107
|
+
}
|
|
1108
|
+
function ml_kem_pke_encrypt(msg, their_pk) {
|
|
1109
|
+
const ptr0 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
|
|
1110
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1111
|
+
_assertClass(their_pk, PublicEncKeyMlKem512);
|
|
1112
|
+
const ret = wasm.ml_kem_pke_encrypt(ptr0, len0, their_pk.__wbg_ptr);
|
|
1113
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1114
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1115
|
+
return v2;
|
|
1116
|
+
}
|
|
1117
|
+
function ml_kem_pke_get_pk(sk) {
|
|
1118
|
+
_assertClass(sk, PrivateEncKeyMlKem512);
|
|
1119
|
+
const ret = wasm.ml_kem_pke_get_pk(sk.__wbg_ptr);
|
|
1120
|
+
return PublicEncKeyMlKem512.__wrap(ret);
|
|
1121
|
+
}
|
|
1122
|
+
function ml_kem_pke_keygen() {
|
|
1123
|
+
const ret = wasm.ml_kem_pke_keygen();
|
|
1124
|
+
return PrivateEncKeyMlKem512.__wrap(ret);
|
|
1125
|
+
}
|
|
1126
|
+
function ml_kem_pke_pk_len() {
|
|
1127
|
+
const ret = wasm.ml_kem_pke_pk_len();
|
|
1128
|
+
return ret >>> 0;
|
|
1129
|
+
}
|
|
1130
|
+
function ml_kem_pke_pk_to_u8vec(pk) {
|
|
1131
|
+
_assertClass(pk, PublicEncKeyMlKem512);
|
|
1132
|
+
const ret = wasm.ml_kem_pke_pk_to_u8vec(pk.__wbg_ptr);
|
|
1133
|
+
if (ret[3]) {
|
|
1134
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1135
|
+
}
|
|
1136
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1137
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1138
|
+
return v1;
|
|
1139
|
+
}
|
|
1140
|
+
function ml_kem_pke_sk_len() {
|
|
1141
|
+
const ret = wasm.ml_kem_pke_sk_len();
|
|
1142
|
+
return ret >>> 0;
|
|
1143
|
+
}
|
|
1144
|
+
function ml_kem_pke_sk_to_u8vec(sk) {
|
|
1145
|
+
_assertClass(sk, PrivateEncKeyMlKem512);
|
|
1146
|
+
const ret = wasm.ml_kem_pke_sk_to_u8vec(sk.__wbg_ptr);
|
|
1147
|
+
if (ret[3]) {
|
|
1148
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1149
|
+
}
|
|
1150
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1151
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1152
|
+
return v1;
|
|
1153
|
+
}
|
|
1154
|
+
function new_client(server_addrs, client_address_hex, fhe_parameter) {
|
|
1155
|
+
const ptr0 = passArrayJsValueToWasm0(server_addrs, wasm.__wbindgen_malloc);
|
|
1156
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1157
|
+
const ptr1 = passStringToWasm0(client_address_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1158
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1159
|
+
const ptr2 = passStringToWasm0(fhe_parameter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1160
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1161
|
+
const ret = wasm.new_client(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1162
|
+
if (ret[2]) {
|
|
1163
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1164
|
+
}
|
|
1165
|
+
return Client.__wrap(ret[0]);
|
|
1166
|
+
}
|
|
1167
|
+
function new_server_id_addr(id, addr) {
|
|
1168
|
+
const ptr0 = passStringToWasm0(addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1169
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1170
|
+
const ret = wasm.new_server_id_addr(id, ptr0, len0);
|
|
1171
|
+
if (ret[2]) {
|
|
1172
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1173
|
+
}
|
|
1174
|
+
return ServerIdAddr.__wrap(ret[0]);
|
|
1175
|
+
}
|
|
1176
|
+
function private_sig_key_to_u8vec(sk) {
|
|
1177
|
+
_assertClass(sk, PrivateSigKey);
|
|
1178
|
+
const ret = wasm.private_sig_key_to_u8vec(sk.__wbg_ptr);
|
|
1179
|
+
if (ret[3]) {
|
|
1180
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1181
|
+
}
|
|
1182
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1183
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1184
|
+
return v1;
|
|
1185
|
+
}
|
|
1186
|
+
function process_user_decryption_resp(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
|
|
1187
|
+
_assertClass(client, Client);
|
|
1188
|
+
let ptr0 = 0;
|
|
1189
|
+
if (!isLikeNone(request)) {
|
|
1190
|
+
_assertClass(request, ParsedUserDecryptionRequest);
|
|
1191
|
+
ptr0 = request.__destroy_into_raw();
|
|
1192
|
+
}
|
|
1193
|
+
let ptr1 = 0;
|
|
1194
|
+
if (!isLikeNone(eip712_domain)) {
|
|
1195
|
+
_assertClass(eip712_domain, Eip712DomainMsg);
|
|
1196
|
+
ptr1 = eip712_domain.__destroy_into_raw();
|
|
1197
|
+
}
|
|
1198
|
+
const ptr2 = passArrayJsValueToWasm0(agg_resp, wasm.__wbindgen_malloc);
|
|
1199
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1200
|
+
_assertClass(enc_pk, PublicEncKeyMlKem512);
|
|
1201
|
+
_assertClass(enc_sk, PrivateEncKeyMlKem512);
|
|
1202
|
+
const ret = wasm.process_user_decryption_resp(client.__wbg_ptr, ptr0, ptr1, ptr2, len2, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
|
|
1203
|
+
if (ret[3]) {
|
|
1204
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1205
|
+
}
|
|
1206
|
+
var v4 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1207
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1208
|
+
return v4;
|
|
1209
|
+
}
|
|
1210
|
+
function process_user_decryption_resp_from_js(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
|
|
1211
|
+
_assertClass(client, Client);
|
|
1212
|
+
_assertClass(enc_pk, PublicEncKeyMlKem512);
|
|
1213
|
+
_assertClass(enc_sk, PrivateEncKeyMlKem512);
|
|
1214
|
+
const ret = wasm.process_user_decryption_resp_from_js(client.__wbg_ptr, request, eip712_domain, agg_resp, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
|
|
1215
|
+
if (ret[3]) {
|
|
1216
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1217
|
+
}
|
|
1218
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1219
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1220
|
+
return v1;
|
|
1221
|
+
}
|
|
1222
|
+
function public_sig_key_to_u8vec(pk) {
|
|
1223
|
+
_assertClass(pk, PublicSigKey);
|
|
1224
|
+
const ret = wasm.public_sig_key_to_u8vec(pk.__wbg_ptr);
|
|
1225
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1226
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1227
|
+
return v1;
|
|
1228
|
+
}
|
|
1229
|
+
function u8vec_to_ml_kem_pke_pk(v) {
|
|
1230
|
+
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
1231
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1232
|
+
const ret = wasm.u8vec_to_ml_kem_pke_pk(ptr0, len0);
|
|
1233
|
+
if (ret[2]) {
|
|
1234
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1235
|
+
}
|
|
1236
|
+
return PublicEncKeyMlKem512.__wrap(ret[0]);
|
|
1237
|
+
}
|
|
1238
|
+
function u8vec_to_ml_kem_pke_sk(v) {
|
|
1239
|
+
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
1240
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1241
|
+
const ret = wasm.u8vec_to_ml_kem_pke_sk(ptr0, len0);
|
|
1242
|
+
if (ret[2]) {
|
|
1243
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1244
|
+
}
|
|
1245
|
+
return PrivateEncKeyMlKem512.__wrap(ret[0]);
|
|
1246
|
+
}
|
|
1247
|
+
function u8vec_to_private_sig_key(v) {
|
|
1248
|
+
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
1249
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1250
|
+
const ret = wasm.u8vec_to_private_sig_key(ptr0, len0);
|
|
1251
|
+
if (ret[2]) {
|
|
1252
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1253
|
+
}
|
|
1254
|
+
return PrivateSigKey.__wrap(ret[0]);
|
|
1255
|
+
}
|
|
1256
|
+
function u8vec_to_public_sig_key(v) {
|
|
1257
|
+
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
1258
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1259
|
+
const ret = wasm.u8vec_to_public_sig_key(ptr0, len0);
|
|
1260
|
+
if (ret[2]) {
|
|
1261
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1262
|
+
}
|
|
1263
|
+
return PublicSigKey.__wrap(ret[0]);
|
|
1455
1264
|
}
|
|
1456
|
-
|
|
1457
1265
|
function __wbg_get_imports() {
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1266
|
+
const import0 = {
|
|
1267
|
+
__proto__: null,
|
|
1268
|
+
__wbg_Error_8c4e43fe74559d73: function(arg0, arg1) {
|
|
1269
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
1270
|
+
return ret;
|
|
1271
|
+
},
|
|
1272
|
+
__wbg_Number_04624de7d0e8332d: function(arg0) {
|
|
1273
|
+
const ret = Number(arg0);
|
|
1274
|
+
return ret;
|
|
1275
|
+
},
|
|
1276
|
+
__wbg_String_8f0eb39a4a4c2f66: function(arg0, arg1) {
|
|
1277
|
+
const ret = String(arg1);
|
|
1278
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1279
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1280
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1281
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1282
|
+
},
|
|
1283
|
+
__wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(arg0) {
|
|
1284
|
+
const v = arg0;
|
|
1285
|
+
const ret = typeof v === "boolean" ? v : void 0;
|
|
1286
|
+
return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
|
|
1287
|
+
},
|
|
1288
|
+
__wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(arg0, arg1) {
|
|
1289
|
+
const ret = debugString(arg1);
|
|
1290
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1291
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1292
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1293
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1294
|
+
},
|
|
1295
|
+
__wbg___wbindgen_in_47fa6863be6f2f25: function(arg0, arg1) {
|
|
1296
|
+
const ret = arg0 in arg1;
|
|
1297
|
+
return ret;
|
|
1298
|
+
},
|
|
1299
|
+
__wbg___wbindgen_is_function_0095a73b8b156f76: function(arg0) {
|
|
1300
|
+
const ret = typeof arg0 === "function";
|
|
1301
|
+
return ret;
|
|
1302
|
+
},
|
|
1303
|
+
__wbg___wbindgen_is_null_ac34f5003991759a: function(arg0) {
|
|
1304
|
+
const ret = arg0 === null;
|
|
1305
|
+
return ret;
|
|
1306
|
+
},
|
|
1307
|
+
__wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(arg0) {
|
|
1308
|
+
const val = arg0;
|
|
1309
|
+
const ret = typeof val === "object" && val !== null;
|
|
1310
|
+
return ret;
|
|
1311
|
+
},
|
|
1312
|
+
__wbg___wbindgen_is_string_cd444516edc5b180: function(arg0) {
|
|
1313
|
+
const ret = typeof arg0 === "string";
|
|
1314
|
+
return ret;
|
|
1315
|
+
},
|
|
1316
|
+
__wbg___wbindgen_is_undefined_9e4d92534c42d778: function(arg0) {
|
|
1317
|
+
const ret = arg0 === void 0;
|
|
1318
|
+
return ret;
|
|
1319
|
+
},
|
|
1320
|
+
__wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811: function(arg0, arg1) {
|
|
1321
|
+
const ret = arg0 == arg1;
|
|
1322
|
+
return ret;
|
|
1323
|
+
},
|
|
1324
|
+
__wbg___wbindgen_number_get_8ff4255516ccad3e: function(arg0, arg1) {
|
|
1325
|
+
const obj = arg1;
|
|
1326
|
+
const ret = typeof obj === "number" ? obj : void 0;
|
|
1327
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
1328
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1329
|
+
},
|
|
1330
|
+
__wbg___wbindgen_string_get_72fb696202c56729: function(arg0, arg1) {
|
|
1331
|
+
const obj = arg1;
|
|
1332
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
1333
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1334
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1335
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1336
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1337
|
+
},
|
|
1338
|
+
__wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
|
|
1339
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1340
|
+
},
|
|
1341
|
+
__wbg_call_389efe28435a9388: function() {
|
|
1342
|
+
return handleError(function(arg0, arg1) {
|
|
1343
|
+
const ret = arg0.call(arg1);
|
|
1344
|
+
return ret;
|
|
1345
|
+
}, arguments);
|
|
1346
|
+
},
|
|
1347
|
+
__wbg_call_4708e0c13bdc8e95: function() {
|
|
1348
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
1349
|
+
const ret = arg0.call(arg1, arg2);
|
|
1350
|
+
return ret;
|
|
1351
|
+
}, arguments);
|
|
1352
|
+
},
|
|
1353
|
+
__wbg_crypto_ed58b8e10a292839: function(arg0) {
|
|
1354
|
+
const ret = arg0.crypto;
|
|
1355
|
+
return ret;
|
|
1356
|
+
},
|
|
1357
|
+
__wbg_done_57b39ecd9addfe81: function(arg0) {
|
|
1358
|
+
const ret = arg0.done;
|
|
1359
|
+
return ret;
|
|
1360
|
+
},
|
|
1361
|
+
__wbg_error_7534b8e9a36f1ab4: function(arg0, arg1) {
|
|
1362
|
+
let deferred0_0;
|
|
1363
|
+
let deferred0_1;
|
|
1364
|
+
try {
|
|
1365
|
+
deferred0_0 = arg0;
|
|
1366
|
+
deferred0_1 = arg1;
|
|
1367
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
1368
|
+
} finally {
|
|
1369
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1370
|
+
}
|
|
1371
|
+
},
|
|
1372
|
+
__wbg_getRandomValues_bcb4912f16000dc4: function() {
|
|
1373
|
+
return handleError(function(arg0, arg1) {
|
|
1374
|
+
arg0.getRandomValues(arg1);
|
|
1375
|
+
}, arguments);
|
|
1376
|
+
},
|
|
1377
|
+
__wbg_get_9b94d73e6221f75c: function(arg0, arg1) {
|
|
1378
|
+
const ret = arg0[arg1 >>> 0];
|
|
1379
|
+
return ret;
|
|
1380
|
+
},
|
|
1381
|
+
__wbg_get_b3ed3ad4be2bc8ac: function() {
|
|
1382
|
+
return handleError(function(arg0, arg1) {
|
|
1383
|
+
const ret = Reflect.get(arg0, arg1);
|
|
1384
|
+
return ret;
|
|
1385
|
+
}, arguments);
|
|
1386
|
+
},
|
|
1387
|
+
__wbg_get_with_ref_key_1dc361bd10053bfe: function(arg0, arg1) {
|
|
1388
|
+
const ret = arg0[arg1];
|
|
1389
|
+
return ret;
|
|
1390
|
+
},
|
|
1391
|
+
__wbg_instanceof_ArrayBuffer_c367199e2fa2aa04: function(arg0) {
|
|
1392
|
+
let result;
|
|
1393
|
+
try {
|
|
1394
|
+
result = arg0 instanceof ArrayBuffer;
|
|
1395
|
+
} catch (_) {
|
|
1396
|
+
result = false;
|
|
1397
|
+
}
|
|
1398
|
+
const ret = result;
|
|
1399
|
+
return ret;
|
|
1400
|
+
},
|
|
1401
|
+
__wbg_instanceof_Uint8Array_9b9075935c74707c: function(arg0) {
|
|
1402
|
+
let result;
|
|
1403
|
+
try {
|
|
1404
|
+
result = arg0 instanceof Uint8Array;
|
|
1405
|
+
} catch (_) {
|
|
1406
|
+
result = false;
|
|
1407
|
+
}
|
|
1408
|
+
const ret = result;
|
|
1409
|
+
return ret;
|
|
1410
|
+
},
|
|
1411
|
+
__wbg_isArray_d314bb98fcf08331: function(arg0) {
|
|
1412
|
+
const ret = Array.isArray(arg0);
|
|
1413
|
+
return ret;
|
|
1414
|
+
},
|
|
1415
|
+
__wbg_isSafeInteger_bfbc7332a9768d2a: function(arg0) {
|
|
1416
|
+
const ret = Number.isSafeInteger(arg0);
|
|
1417
|
+
return ret;
|
|
1418
|
+
},
|
|
1419
|
+
__wbg_iterator_6ff6560ca1568e55: function() {
|
|
1420
|
+
const ret = Symbol.iterator;
|
|
1421
|
+
return ret;
|
|
1422
|
+
},
|
|
1423
|
+
__wbg_length_32ed9a279acd054c: function(arg0) {
|
|
1424
|
+
const ret = arg0.length;
|
|
1425
|
+
return ret;
|
|
1426
|
+
},
|
|
1427
|
+
__wbg_length_35a7bace40f36eac: function(arg0) {
|
|
1428
|
+
const ret = arg0.length;
|
|
1429
|
+
return ret;
|
|
1430
|
+
},
|
|
1431
|
+
__wbg_msCrypto_0a36e2ec3a343d26: function(arg0) {
|
|
1432
|
+
const ret = arg0.msCrypto;
|
|
1433
|
+
return ret;
|
|
1434
|
+
},
|
|
1435
|
+
__wbg_new_8a6f238a6ece86ea: function() {
|
|
1436
|
+
const ret = new Error();
|
|
1437
|
+
return ret;
|
|
1438
|
+
},
|
|
1439
|
+
__wbg_new_dd2b680c8bf6ae29: function(arg0) {
|
|
1440
|
+
const ret = new Uint8Array(arg0);
|
|
1441
|
+
return ret;
|
|
1442
|
+
},
|
|
1443
|
+
__wbg_new_no_args_1c7c842f08d00ebb: function(arg0, arg1) {
|
|
1444
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
1445
|
+
return ret;
|
|
1446
|
+
},
|
|
1447
|
+
__wbg_new_with_length_a2c39cbe88fd8ff1: function(arg0) {
|
|
1448
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
1449
|
+
return ret;
|
|
1450
|
+
},
|
|
1451
|
+
__wbg_next_3482f54c49e8af19: function() {
|
|
1452
|
+
return handleError(function(arg0) {
|
|
1453
|
+
const ret = arg0.next();
|
|
1454
|
+
return ret;
|
|
1455
|
+
}, arguments);
|
|
1456
|
+
},
|
|
1457
|
+
__wbg_next_418f80d8f5303233: function(arg0) {
|
|
1458
|
+
const ret = arg0.next;
|
|
1459
|
+
return ret;
|
|
1460
|
+
},
|
|
1461
|
+
__wbg_node_02999533c4ea02e3: function(arg0) {
|
|
1462
|
+
const ret = arg0.node;
|
|
1463
|
+
return ret;
|
|
1464
|
+
},
|
|
1465
|
+
__wbg_process_5c1d670bc53614b8: function(arg0) {
|
|
1466
|
+
const ret = arg0.process;
|
|
1467
|
+
return ret;
|
|
1468
|
+
},
|
|
1469
|
+
__wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
|
|
1470
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1471
|
+
},
|
|
1472
|
+
__wbg_randomFillSync_ab2cfe79ebbf2740: function() {
|
|
1473
|
+
return handleError(function(arg0, arg1) {
|
|
1474
|
+
arg0.randomFillSync(arg1);
|
|
1475
|
+
}, arguments);
|
|
1476
|
+
},
|
|
1477
|
+
__wbg_require_79b1e9274cde3c87: function() {
|
|
1478
|
+
return handleError(function() {
|
|
1479
|
+
const ret = module.require;
|
|
1480
|
+
return ret;
|
|
1481
|
+
}, arguments);
|
|
1482
|
+
},
|
|
1483
|
+
__wbg_serveridaddr_new: function(arg0) {
|
|
1484
|
+
const ret = ServerIdAddr.__wrap(arg0);
|
|
1485
|
+
return ret;
|
|
1486
|
+
},
|
|
1487
|
+
__wbg_serveridaddr_unwrap: function(arg0) {
|
|
1488
|
+
const ret = ServerIdAddr.__unwrap(arg0);
|
|
1489
|
+
return ret;
|
|
1490
|
+
},
|
|
1491
|
+
__wbg_stack_0ed75d68575b0f3c: function(arg0, arg1) {
|
|
1492
|
+
const ret = arg1.stack;
|
|
1493
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1494
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1495
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1496
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1497
|
+
},
|
|
1498
|
+
__wbg_static_accessor_GLOBAL_12837167ad935116: function() {
|
|
1499
|
+
const ret = typeof global === "undefined" ? null : global;
|
|
1500
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1501
|
+
},
|
|
1502
|
+
__wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function() {
|
|
1503
|
+
const ret = typeof globalThis === "undefined" ? null : globalThis;
|
|
1504
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1505
|
+
},
|
|
1506
|
+
__wbg_static_accessor_SELF_a621d3dfbb60d0ce: function() {
|
|
1507
|
+
const ret = typeof self === "undefined" ? null : self;
|
|
1508
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1509
|
+
},
|
|
1510
|
+
__wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function() {
|
|
1511
|
+
const ret = typeof window === "undefined" ? null : window;
|
|
1512
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1513
|
+
},
|
|
1514
|
+
__wbg_subarray_a96e1fef17ed23cb: function(arg0, arg1, arg2) {
|
|
1515
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1516
|
+
return ret;
|
|
1517
|
+
},
|
|
1518
|
+
__wbg_typedciphertext_new: function(arg0) {
|
|
1519
|
+
const ret = TypedCiphertext.__wrap(arg0);
|
|
1520
|
+
return ret;
|
|
1521
|
+
},
|
|
1522
|
+
__wbg_typedciphertext_unwrap: function(arg0) {
|
|
1523
|
+
const ret = TypedCiphertext.__unwrap(arg0);
|
|
1524
|
+
return ret;
|
|
1525
|
+
},
|
|
1526
|
+
__wbg_typedplaintext_new: function(arg0) {
|
|
1527
|
+
const ret = TypedPlaintext.__wrap(arg0);
|
|
1528
|
+
return ret;
|
|
1529
|
+
},
|
|
1530
|
+
__wbg_typedsigncryptedciphertext_new: function(arg0) {
|
|
1531
|
+
const ret = TypedSigncryptedCiphertext.__wrap(arg0);
|
|
1532
|
+
return ret;
|
|
1533
|
+
},
|
|
1534
|
+
__wbg_typedsigncryptedciphertext_unwrap: function(arg0) {
|
|
1535
|
+
const ret = TypedSigncryptedCiphertext.__unwrap(arg0);
|
|
1536
|
+
return ret;
|
|
1537
|
+
},
|
|
1538
|
+
__wbg_userdecryptionresponse_unwrap: function(arg0) {
|
|
1539
|
+
const ret = UserDecryptionResponse.__unwrap(arg0);
|
|
1540
|
+
return ret;
|
|
1541
|
+
},
|
|
1542
|
+
__wbg_value_0546255b415e96c1: function(arg0) {
|
|
1543
|
+
const ret = arg0.value;
|
|
1544
|
+
return ret;
|
|
1545
|
+
},
|
|
1546
|
+
__wbg_versions_c71aa1626a93e0a1: function(arg0) {
|
|
1547
|
+
const ret = arg0.versions;
|
|
1548
|
+
return ret;
|
|
1549
|
+
},
|
|
1550
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1551
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
1552
|
+
return ret;
|
|
1553
|
+
},
|
|
1554
|
+
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1555
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1556
|
+
return ret;
|
|
1557
|
+
},
|
|
1558
|
+
__wbindgen_init_externref_table: function() {
|
|
1559
|
+
const table = wasm.__wbindgen_externrefs;
|
|
1560
|
+
const offset = table.grow(4);
|
|
1561
|
+
table.set(0, void 0);
|
|
1562
|
+
table.set(offset + 0, void 0);
|
|
1563
|
+
table.set(offset + 1, null);
|
|
1564
|
+
table.set(offset + 2, true);
|
|
1565
|
+
table.set(offset + 3, false);
|
|
1566
|
+
}
|
|
1567
|
+
};
|
|
1568
|
+
return {
|
|
1569
|
+
__proto__: null,
|
|
1570
|
+
"./kms_lib_bg.js": import0
|
|
1571
|
+
};
|
|
1752
1572
|
}
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_userdecryptionresponsepayload_free(ptr >>> 0, 1));
|
|
1802
|
-
|
|
1573
|
+
const CiphertextHandleFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1574
|
+
}, unregister: () => {
|
|
1575
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_ciphertexthandle_free(ptr >>> 0, 1));
|
|
1576
|
+
const ClientFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1577
|
+
}, unregister: () => {
|
|
1578
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_client_free(ptr >>> 0, 1));
|
|
1579
|
+
const Eip712DomainMsgFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1580
|
+
}, unregister: () => {
|
|
1581
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_eip712domainmsg_free(ptr >>> 0, 1));
|
|
1582
|
+
const ParsedUserDecryptionRequestFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1583
|
+
}, unregister: () => {
|
|
1584
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_parseduserdecryptionrequest_free(ptr >>> 0, 1));
|
|
1585
|
+
const PrivateEncKeyMlKem512Finalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1586
|
+
}, unregister: () => {
|
|
1587
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_privateenckeymlkem512_free(ptr >>> 0, 1));
|
|
1588
|
+
const PrivateSigKeyFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1589
|
+
}, unregister: () => {
|
|
1590
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_privatesigkey_free(ptr >>> 0, 1));
|
|
1591
|
+
const PublicEncKeyMlKem512Finalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1592
|
+
}, unregister: () => {
|
|
1593
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_publicenckeymlkem512_free(ptr >>> 0, 1));
|
|
1594
|
+
const PublicSigKeyFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1595
|
+
}, unregister: () => {
|
|
1596
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_publicsigkey_free(ptr >>> 0, 1));
|
|
1597
|
+
const RequestIdFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1598
|
+
}, unregister: () => {
|
|
1599
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_requestid_free(ptr >>> 0, 1));
|
|
1600
|
+
const ServerIdAddrFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1601
|
+
}, unregister: () => {
|
|
1602
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_serveridaddr_free(ptr >>> 0, 1));
|
|
1603
|
+
const TypedCiphertextFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1604
|
+
}, unregister: () => {
|
|
1605
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_typedciphertext_free(ptr >>> 0, 1));
|
|
1606
|
+
const TypedPlaintextFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1607
|
+
}, unregister: () => {
|
|
1608
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_typedplaintext_free(ptr >>> 0, 1));
|
|
1609
|
+
const TypedSigncryptedCiphertextFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1610
|
+
}, unregister: () => {
|
|
1611
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_typedsigncryptedciphertext_free(ptr >>> 0, 1));
|
|
1612
|
+
const UserDecryptionRequestFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1613
|
+
}, unregister: () => {
|
|
1614
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_userdecryptionrequest_free(ptr >>> 0, 1));
|
|
1615
|
+
const UserDecryptionResponseFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1616
|
+
}, unregister: () => {
|
|
1617
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_userdecryptionresponse_free(ptr >>> 0, 1));
|
|
1618
|
+
const UserDecryptionResponsePayloadFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
1619
|
+
}, unregister: () => {
|
|
1620
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_userdecryptionresponsepayload_free(ptr >>> 0, 1));
|
|
1803
1621
|
function addToExternrefTable0(obj) {
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1622
|
+
const idx = wasm.__externref_table_alloc();
|
|
1623
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
1624
|
+
return idx;
|
|
1807
1625
|
}
|
|
1808
|
-
|
|
1809
1626
|
function _assertClass(instance, klass) {
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1627
|
+
if (!(instance instanceof klass)) {
|
|
1628
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
1629
|
+
}
|
|
1813
1630
|
}
|
|
1814
|
-
|
|
1815
1631
|
function debugString(val) {
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
return `Symbol(${description})`;
|
|
1830
|
-
}
|
|
1831
|
-
}
|
|
1832
|
-
if (type == 'function') {
|
|
1833
|
-
const name = val.name;
|
|
1834
|
-
if (typeof name == 'string' && name.length > 0) {
|
|
1835
|
-
return `Function(${name})`;
|
|
1836
|
-
} else {
|
|
1837
|
-
return 'Function';
|
|
1838
|
-
}
|
|
1839
|
-
}
|
|
1840
|
-
// objects
|
|
1841
|
-
if (Array.isArray(val)) {
|
|
1842
|
-
const length = val.length;
|
|
1843
|
-
let debug = '[';
|
|
1844
|
-
if (length > 0) {
|
|
1845
|
-
debug += debugString(val[0]);
|
|
1846
|
-
}
|
|
1847
|
-
for(let i = 1; i < length; i++) {
|
|
1848
|
-
debug += ', ' + debugString(val[i]);
|
|
1849
|
-
}
|
|
1850
|
-
debug += ']';
|
|
1851
|
-
return debug;
|
|
1632
|
+
const type = typeof val;
|
|
1633
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
1634
|
+
return `${val}`;
|
|
1635
|
+
}
|
|
1636
|
+
if (type == "string") {
|
|
1637
|
+
return `"${val}"`;
|
|
1638
|
+
}
|
|
1639
|
+
if (type == "symbol") {
|
|
1640
|
+
const description = val.description;
|
|
1641
|
+
if (description == null) {
|
|
1642
|
+
return "Symbol";
|
|
1643
|
+
} else {
|
|
1644
|
+
return `Symbol(${description})`;
|
|
1852
1645
|
}
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
if (
|
|
1857
|
-
|
|
1646
|
+
}
|
|
1647
|
+
if (type == "function") {
|
|
1648
|
+
const name = val.name;
|
|
1649
|
+
if (typeof name == "string" && name.length > 0) {
|
|
1650
|
+
return `Function(${name})`;
|
|
1858
1651
|
} else {
|
|
1859
|
-
|
|
1860
|
-
return toString.call(val);
|
|
1652
|
+
return "Function";
|
|
1861
1653
|
}
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
} catch (_) {
|
|
1869
|
-
return 'Object';
|
|
1870
|
-
}
|
|
1654
|
+
}
|
|
1655
|
+
if (Array.isArray(val)) {
|
|
1656
|
+
const length = val.length;
|
|
1657
|
+
let debug = "[";
|
|
1658
|
+
if (length > 0) {
|
|
1659
|
+
debug += debugString(val[0]);
|
|
1871
1660
|
}
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1661
|
+
for (let i = 1; i < length; i++) {
|
|
1662
|
+
debug += ", " + debugString(val[i]);
|
|
1663
|
+
}
|
|
1664
|
+
debug += "]";
|
|
1665
|
+
return debug;
|
|
1666
|
+
}
|
|
1667
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
1668
|
+
let className;
|
|
1669
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
1670
|
+
className = builtInMatches[1];
|
|
1671
|
+
} else {
|
|
1672
|
+
return toString.call(val);
|
|
1673
|
+
}
|
|
1674
|
+
if (className == "Object") {
|
|
1675
|
+
try {
|
|
1676
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
1677
|
+
} catch (_) {
|
|
1678
|
+
return "Object";
|
|
1875
1679
|
}
|
|
1876
|
-
|
|
1877
|
-
|
|
1680
|
+
}
|
|
1681
|
+
if (val instanceof Error) {
|
|
1682
|
+
return `${val.name}: ${val.message}
|
|
1683
|
+
${val.stack}`;
|
|
1684
|
+
}
|
|
1685
|
+
return className;
|
|
1878
1686
|
}
|
|
1879
|
-
|
|
1880
1687
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1688
|
+
ptr = ptr >>> 0;
|
|
1689
|
+
const mem = getDataViewMemory0();
|
|
1690
|
+
const result = [];
|
|
1691
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
1692
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
1693
|
+
}
|
|
1694
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
1695
|
+
return result;
|
|
1889
1696
|
}
|
|
1890
|
-
|
|
1891
1697
|
function getArrayU8FromWasm0(ptr, len) {
|
|
1892
|
-
|
|
1893
|
-
|
|
1698
|
+
ptr = ptr >>> 0;
|
|
1699
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
1894
1700
|
}
|
|
1895
|
-
|
|
1896
1701
|
let cachedDataViewMemory0 = null;
|
|
1897
1702
|
function getDataViewMemory0() {
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1703
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
1704
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1705
|
+
}
|
|
1706
|
+
return cachedDataViewMemory0;
|
|
1902
1707
|
}
|
|
1903
|
-
|
|
1904
1708
|
function getStringFromWasm0(ptr, len) {
|
|
1905
|
-
|
|
1906
|
-
|
|
1709
|
+
ptr = ptr >>> 0;
|
|
1710
|
+
return decodeText(ptr, len);
|
|
1907
1711
|
}
|
|
1908
|
-
|
|
1909
1712
|
let cachedUint8ArrayMemory0 = null;
|
|
1910
1713
|
function getUint8ArrayMemory0() {
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1714
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
1715
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1716
|
+
}
|
|
1717
|
+
return cachedUint8ArrayMemory0;
|
|
1915
1718
|
}
|
|
1916
|
-
|
|
1917
1719
|
function handleError(f, args) {
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1720
|
+
try {
|
|
1721
|
+
return f.apply(this, args);
|
|
1722
|
+
} catch (e) {
|
|
1723
|
+
const idx = addToExternrefTable0(e);
|
|
1724
|
+
wasm.__wbindgen_exn_store(idx);
|
|
1725
|
+
}
|
|
1924
1726
|
}
|
|
1925
|
-
|
|
1926
1727
|
function isLikeNone(x) {
|
|
1927
|
-
|
|
1728
|
+
return x === void 0 || x === null;
|
|
1928
1729
|
}
|
|
1929
|
-
|
|
1930
1730
|
function passArray8ToWasm0(arg, malloc) {
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1731
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1732
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1733
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1734
|
+
return ptr;
|
|
1935
1735
|
}
|
|
1936
|
-
|
|
1937
1736
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1737
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
1738
|
+
for (let i = 0; i < array.length; i++) {
|
|
1739
|
+
const add = addToExternrefTable0(array[i]);
|
|
1740
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
1741
|
+
}
|
|
1742
|
+
WASM_VECTOR_LEN = array.length;
|
|
1743
|
+
return ptr;
|
|
1945
1744
|
}
|
|
1946
|
-
|
|
1947
1745
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
offset += ret.written;
|
|
1977
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1978
|
-
}
|
|
1979
|
-
|
|
1980
|
-
WASM_VECTOR_LEN = offset;
|
|
1981
|
-
return ptr;
|
|
1746
|
+
if (realloc === void 0) {
|
|
1747
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1748
|
+
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
1749
|
+
getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
1750
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1751
|
+
return ptr2;
|
|
1752
|
+
}
|
|
1753
|
+
let len = arg.length;
|
|
1754
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1755
|
+
const mem = getUint8ArrayMemory0();
|
|
1756
|
+
let offset = 0;
|
|
1757
|
+
for (; offset < len; offset++) {
|
|
1758
|
+
const code = arg.charCodeAt(offset);
|
|
1759
|
+
if (code > 127) break;
|
|
1760
|
+
mem[ptr + offset] = code;
|
|
1761
|
+
}
|
|
1762
|
+
if (offset !== len) {
|
|
1763
|
+
if (offset !== 0) {
|
|
1764
|
+
arg = arg.slice(offset);
|
|
1765
|
+
}
|
|
1766
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1767
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1768
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1769
|
+
offset += ret.written;
|
|
1770
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1771
|
+
}
|
|
1772
|
+
WASM_VECTOR_LEN = offset;
|
|
1773
|
+
return ptr;
|
|
1982
1774
|
}
|
|
1983
|
-
|
|
1984
1775
|
function takeFromExternrefTable0(idx) {
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1776
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1777
|
+
wasm.__externref_table_dealloc(idx);
|
|
1778
|
+
return value;
|
|
1988
1779
|
}
|
|
1989
|
-
|
|
1990
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1780
|
+
let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
1991
1781
|
cachedTextDecoder.decode();
|
|
1992
1782
|
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1993
1783
|
let numBytesDecoded = 0;
|
|
1994
1784
|
function decodeText(ptr, len) {
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
1785
|
+
numBytesDecoded += len;
|
|
1786
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1787
|
+
cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
1788
|
+
cachedTextDecoder.decode();
|
|
1789
|
+
numBytesDecoded = len;
|
|
1790
|
+
}
|
|
1791
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
2002
1792
|
}
|
|
2003
|
-
|
|
2004
1793
|
const cachedTextEncoder = new TextEncoder();
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
written: buf.length
|
|
2013
|
-
};
|
|
1794
|
+
if (!("encodeInto" in cachedTextEncoder)) {
|
|
1795
|
+
cachedTextEncoder.encodeInto = function(arg, view) {
|
|
1796
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1797
|
+
view.set(buf);
|
|
1798
|
+
return {
|
|
1799
|
+
read: arg.length,
|
|
1800
|
+
written: buf.length
|
|
2014
1801
|
};
|
|
1802
|
+
};
|
|
2015
1803
|
}
|
|
2016
|
-
|
|
2017
1804
|
let WASM_VECTOR_LEN = 0;
|
|
2018
|
-
|
|
2019
1805
|
let wasmModule, wasm;
|
|
2020
|
-
function __wbg_finalize_init(instance,
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
1806
|
+
function __wbg_finalize_init(instance, module2) {
|
|
1807
|
+
wasm = instance.exports;
|
|
1808
|
+
wasmModule = module2;
|
|
1809
|
+
cachedDataViewMemory0 = null;
|
|
1810
|
+
cachedUint8ArrayMemory0 = null;
|
|
1811
|
+
wasm.__wbindgen_start();
|
|
1812
|
+
return wasm;
|
|
2027
1813
|
}
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
if (typeof
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
2038
|
-
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
2039
|
-
|
|
2040
|
-
} else { throw e; }
|
|
2041
|
-
}
|
|
2042
|
-
}
|
|
2043
|
-
|
|
2044
|
-
const bytes = await module.arrayBuffer();
|
|
2045
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
2046
|
-
} else {
|
|
2047
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
2048
|
-
|
|
2049
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
2050
|
-
return { instance, module };
|
|
1814
|
+
async function __wbg_load(module2, imports) {
|
|
1815
|
+
if (typeof Response === "function" && module2 instanceof Response) {
|
|
1816
|
+
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
1817
|
+
try {
|
|
1818
|
+
return await WebAssembly.instantiateStreaming(module2, imports);
|
|
1819
|
+
} catch (e) {
|
|
1820
|
+
const validResponse = module2.ok && expectedResponseType(module2.type);
|
|
1821
|
+
if (validResponse && module2.headers.get("Content-Type") !== "application/wasm") {
|
|
1822
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
2051
1823
|
} else {
|
|
2052
|
-
|
|
1824
|
+
throw e;
|
|
2053
1825
|
}
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
const bytes = await module2.arrayBuffer();
|
|
1829
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1830
|
+
} else {
|
|
1831
|
+
const instance = await WebAssembly.instantiate(module2, imports);
|
|
1832
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1833
|
+
return { instance, module: module2 };
|
|
1834
|
+
} else {
|
|
1835
|
+
return instance;
|
|
2054
1836
|
}
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
1837
|
+
}
|
|
1838
|
+
function expectedResponseType(type) {
|
|
1839
|
+
switch (type) {
|
|
1840
|
+
case "basic":
|
|
1841
|
+
case "cors":
|
|
1842
|
+
case "default":
|
|
1843
|
+
return true;
|
|
1844
|
+
}
|
|
1845
|
+
return false;
|
|
1846
|
+
}
|
|
2062
1847
|
}
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
({module} = module)
|
|
2071
|
-
} else {
|
|
2072
|
-
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
2073
|
-
}
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2076
|
-
const imports = __wbg_get_imports();
|
|
2077
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
2078
|
-
module = new WebAssembly.Module(module);
|
|
1848
|
+
function initSync(module2) {
|
|
1849
|
+
if (wasm !== void 0) return wasm;
|
|
1850
|
+
if (module2 !== void 0) {
|
|
1851
|
+
if (Object.getPrototypeOf(module2) === Object.prototype) {
|
|
1852
|
+
({ module: module2 } = module2);
|
|
1853
|
+
} else {
|
|
1854
|
+
console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
|
2079
1855
|
}
|
|
2080
|
-
|
|
2081
|
-
|
|
1856
|
+
}
|
|
1857
|
+
const imports = __wbg_get_imports();
|
|
1858
|
+
if (!(module2 instanceof WebAssembly.Module)) {
|
|
1859
|
+
module2 = new WebAssembly.Module(module2);
|
|
1860
|
+
}
|
|
1861
|
+
const instance = new WebAssembly.Instance(module2, imports);
|
|
1862
|
+
return __wbg_finalize_init(instance, module2);
|
|
2082
1863
|
}
|
|
2083
|
-
|
|
2084
1864
|
async function __wbg_init(module_or_path) {
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
} else {
|
|
2092
|
-
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
2093
|
-
}
|
|
1865
|
+
if (wasm !== void 0) return wasm;
|
|
1866
|
+
if (module_or_path !== void 0) {
|
|
1867
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1868
|
+
({ module_or_path } = module_or_path);
|
|
1869
|
+
} else {
|
|
1870
|
+
console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
|
2094
1871
|
}
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
const imports = __wbg_get_imports();
|
|
2100
|
-
|
|
2101
|
-
// if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
2102
|
-
// module_or_path = fetch(module_or_path);
|
|
2103
|
-
// }
|
|
2104
|
-
|
|
2105
|
-
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
2106
|
-
|
|
2107
|
-
return __wbg_finalize_init(instance, module);
|
|
1872
|
+
}
|
|
1873
|
+
const imports = __wbg_get_imports();
|
|
1874
|
+
const { instance, module: module2 } = await __wbg_load(await module_or_path, imports);
|
|
1875
|
+
return __wbg_finalize_init(instance, module2);
|
|
2108
1876
|
}
|
|
2109
|
-
|
|
2110
1877
|
function getWasmInfo() {
|
|
2111
1878
|
return {
|
|
2112
1879
|
name: "tkms",
|
|
2113
1880
|
version: "0.13.10"
|
|
2114
|
-
}
|
|
1881
|
+
};
|
|
2115
1882
|
}
|
|
2116
|
-
|
|
2117
|
-
|
|
1883
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1884
|
+
0 && (module.exports = {
|
|
1885
|
+
CiphertextHandle,
|
|
1886
|
+
Client,
|
|
1887
|
+
Eip712DomainMsg,
|
|
1888
|
+
ParsedUserDecryptionRequest,
|
|
1889
|
+
PrivateEncKeyMlKem512,
|
|
1890
|
+
PrivateSigKey,
|
|
1891
|
+
PublicEncKeyMlKem512,
|
|
1892
|
+
PublicSigKey,
|
|
1893
|
+
RequestId,
|
|
1894
|
+
ServerIdAddr,
|
|
1895
|
+
TypedCiphertext,
|
|
1896
|
+
TypedPlaintext,
|
|
1897
|
+
TypedSigncryptedCiphertext,
|
|
1898
|
+
UserDecryptionRequest,
|
|
1899
|
+
UserDecryptionResponse,
|
|
1900
|
+
UserDecryptionResponsePayload,
|
|
1901
|
+
getWasmInfo,
|
|
1902
|
+
get_client_address,
|
|
1903
|
+
get_client_secret_key,
|
|
1904
|
+
get_server_addrs,
|
|
1905
|
+
initSync,
|
|
1906
|
+
ml_kem_pke_decrypt,
|
|
1907
|
+
ml_kem_pke_encrypt,
|
|
1908
|
+
ml_kem_pke_get_pk,
|
|
1909
|
+
ml_kem_pke_keygen,
|
|
1910
|
+
ml_kem_pke_pk_len,
|
|
1911
|
+
ml_kem_pke_pk_to_u8vec,
|
|
1912
|
+
ml_kem_pke_sk_len,
|
|
1913
|
+
ml_kem_pke_sk_to_u8vec,
|
|
1914
|
+
new_client,
|
|
1915
|
+
new_server_id_addr,
|
|
1916
|
+
private_sig_key_to_u8vec,
|
|
1917
|
+
process_user_decryption_resp,
|
|
1918
|
+
process_user_decryption_resp_from_js,
|
|
1919
|
+
public_sig_key_to_u8vec,
|
|
1920
|
+
u8vec_to_ml_kem_pke_pk,
|
|
1921
|
+
u8vec_to_ml_kem_pke_sk,
|
|
1922
|
+
u8vec_to_private_sig_key,
|
|
1923
|
+
u8vec_to_public_sig_key
|
|
1924
|
+
});
|
|
1925
|
+
//# sourceMappingURL=kms_lib.v0.13.10.js.map
|