tkms 0.13.0-rc.3 → 0.13.1
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/kms_lib.d.ts +407 -461
- package/kms_lib.js +1772 -1724
- package/kms_lib_bg.wasm +0 -0
- package/package.json +1 -1
package/kms_lib.d.ts
CHANGED
|
@@ -1,324 +1,5 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
|
|
4
|
-
export class CiphertextHandle {
|
|
5
|
-
private constructor();
|
|
6
|
-
free(): void;
|
|
7
|
-
[Symbol.dispose](): void;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Core Client
|
|
12
|
-
*
|
|
13
|
-
* Simple client to interact with the KMS servers. This can be seen as a proof-of-concept
|
|
14
|
-
* and reference code for validating the KMS. The logic supplied by the client will be
|
|
15
|
-
* distributed across the aggregator/proxy and smart contracts.
|
|
16
|
-
*/
|
|
17
|
-
export class Client {
|
|
18
|
-
private constructor();
|
|
19
|
-
free(): void;
|
|
20
|
-
[Symbol.dispose](): void;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Eip712 domain information.
|
|
25
|
-
* Any constraints specified in the [standard](<https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>) _must_ be fulfilled.
|
|
26
|
-
* Furthermore, be aware that all parameters will eventually be parsed into Solidity types.
|
|
27
|
-
*/
|
|
28
|
-
export class Eip712DomainMsg {
|
|
29
|
-
private constructor();
|
|
30
|
-
free(): void;
|
|
31
|
-
[Symbol.dispose](): void;
|
|
32
|
-
chain_id: Uint8Array;
|
|
33
|
-
name: string;
|
|
34
|
-
get salt(): Uint8Array | undefined;
|
|
35
|
-
set salt(value: Uint8Array | null | undefined);
|
|
36
|
-
verifying_contract: string;
|
|
37
|
-
version: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Validity of this struct is not checked.
|
|
42
|
-
*/
|
|
43
|
-
export class ParsedUserDecryptionRequest {
|
|
44
|
-
private constructor();
|
|
45
|
-
free(): void;
|
|
46
|
-
[Symbol.dispose](): void;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export class PrivateEncKeyMlKem512 {
|
|
50
|
-
private constructor();
|
|
51
|
-
free(): void;
|
|
52
|
-
[Symbol.dispose](): void;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export class PrivateSigKey {
|
|
56
|
-
private constructor();
|
|
57
|
-
free(): void;
|
|
58
|
-
[Symbol.dispose](): void;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export class PublicEncKeyMlKem512 {
|
|
62
|
-
private constructor();
|
|
63
|
-
free(): void;
|
|
64
|
-
[Symbol.dispose](): void;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export class PublicSigKey {
|
|
68
|
-
private constructor();
|
|
69
|
-
free(): void;
|
|
70
|
-
[Symbol.dispose](): void;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* / A unique 32 Byte / 256 Bit ID, to be used to identify a request and
|
|
75
|
-
* / for retrieving the computed result later on.
|
|
76
|
-
* / Must be encoded in lower-case hex. The string must NOT contain a `0x` prefix.
|
|
77
|
-
*/
|
|
78
|
-
export class RequestId {
|
|
79
|
-
private constructor();
|
|
80
|
-
free(): void;
|
|
81
|
-
[Symbol.dispose](): void;
|
|
82
|
-
request_id: string;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export class ServerIdAddr {
|
|
86
|
-
private constructor();
|
|
87
|
-
free(): void;
|
|
88
|
-
[Symbol.dispose](): void;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export class TypedCiphertext {
|
|
92
|
-
private constructor();
|
|
93
|
-
free(): void;
|
|
94
|
-
[Symbol.dispose](): void;
|
|
95
|
-
/**
|
|
96
|
-
* The ciphertext format, see CiphertextFormat documentation for details.
|
|
97
|
-
* CiphertextFormat::default() is used if unspecified.
|
|
98
|
-
*/
|
|
99
|
-
ciphertext_format: number;
|
|
100
|
-
/**
|
|
101
|
-
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
102
|
-
*/
|
|
103
|
-
ciphertext: Uint8Array;
|
|
104
|
-
/**
|
|
105
|
-
* The external handle of the ciphertext (the handle used in the copro).
|
|
106
|
-
*/
|
|
107
|
-
external_handle: Uint8Array;
|
|
108
|
-
/**
|
|
109
|
-
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
110
|
-
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
111
|
-
*/
|
|
112
|
-
fhe_type: number;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export class TypedPlaintext {
|
|
116
|
-
private constructor();
|
|
117
|
-
free(): void;
|
|
118
|
-
[Symbol.dispose](): void;
|
|
119
|
-
/**
|
|
120
|
-
* The actual plaintext in bytes.
|
|
121
|
-
*/
|
|
122
|
-
bytes: Uint8Array;
|
|
123
|
-
/**
|
|
124
|
-
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
125
|
-
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
126
|
-
*/
|
|
127
|
-
fhe_type: number;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export class TypedSigncryptedCiphertext {
|
|
131
|
-
private constructor();
|
|
132
|
-
free(): void;
|
|
133
|
-
[Symbol.dispose](): void;
|
|
134
|
-
/**
|
|
135
|
-
* The external handles that were originally in the request.
|
|
136
|
-
*/
|
|
137
|
-
external_handle: Uint8Array;
|
|
138
|
-
/**
|
|
139
|
-
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
140
|
-
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
141
|
-
*/
|
|
142
|
-
fhe_type: number;
|
|
143
|
-
/**
|
|
144
|
-
* The packing factor determines whether the decrypted plaintext
|
|
145
|
-
* has a different way of packing compared to what is specified in the plaintext modulus.
|
|
146
|
-
*/
|
|
147
|
-
packing_factor: number;
|
|
148
|
-
/**
|
|
149
|
-
* The signcrypted payload, using a hybrid encryption approach in
|
|
150
|
-
* sign-then-encrypt.
|
|
151
|
-
*/
|
|
152
|
-
signcrypted_ciphertext: Uint8Array;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export class UserDecryptionRequest {
|
|
156
|
-
private constructor();
|
|
157
|
-
free(): void;
|
|
158
|
-
[Symbol.dispose](): void;
|
|
159
|
-
/**
|
|
160
|
-
* The client's (blockchain wallet) address, encoded using EIP-55. I.e. including `0x`.
|
|
161
|
-
*/
|
|
162
|
-
client_address: string;
|
|
163
|
-
/**
|
|
164
|
-
* MPC context ID which is used to identify the context to use for this request.
|
|
165
|
-
*
|
|
166
|
-
* NOTE: at the moment this can be None since we do not fully support multiple contexts.
|
|
167
|
-
* See <https://github.com/zama-ai/kms-internal/issues/2530>
|
|
168
|
-
*/
|
|
169
|
-
get context_id(): RequestId | undefined;
|
|
170
|
-
/**
|
|
171
|
-
* MPC context ID which is used to identify the context to use for this request.
|
|
172
|
-
*
|
|
173
|
-
* NOTE: at the moment this can be None since we do not fully support multiple contexts.
|
|
174
|
-
* See <https://github.com/zama-ai/kms-internal/issues/2530>
|
|
175
|
-
*/
|
|
176
|
-
set context_id(value: RequestId | null | undefined);
|
|
177
|
-
/**
|
|
178
|
-
* The user's EIP712 domain. This MUST be present. Furthermore, the `verifying_contract` MUST be set and be distinct from `client_address`.
|
|
179
|
-
*/
|
|
180
|
-
get domain(): Eip712DomainMsg | undefined;
|
|
181
|
-
/**
|
|
182
|
-
* The user's EIP712 domain. This MUST be present. Furthermore, the `verifying_contract` MUST be set and be distinct from `client_address`.
|
|
183
|
-
*/
|
|
184
|
-
set domain(value: Eip712DomainMsg | null | undefined);
|
|
185
|
-
/**
|
|
186
|
-
* Encoding of the user's public encryption key for this request.
|
|
187
|
-
* This must be a bincode (v.1) encoded ML-KEM 512 key.
|
|
188
|
-
*/
|
|
189
|
-
enc_key: Uint8Array;
|
|
190
|
-
/**
|
|
191
|
-
* The epoch number placeholder (zama-ai/kms-internal#2743).
|
|
192
|
-
*/
|
|
193
|
-
get epoch_id(): RequestId | undefined;
|
|
194
|
-
/**
|
|
195
|
-
* The epoch number placeholder (zama-ai/kms-internal#2743).
|
|
196
|
-
*/
|
|
197
|
-
set epoch_id(value: RequestId | null | undefined);
|
|
198
|
-
/**
|
|
199
|
-
* Extra data from the gateway.
|
|
200
|
-
*/
|
|
201
|
-
extra_data: Uint8Array;
|
|
202
|
-
/**
|
|
203
|
-
* The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
|
|
204
|
-
* used for key generation
|
|
205
|
-
*/
|
|
206
|
-
get key_id(): RequestId | undefined;
|
|
207
|
-
/**
|
|
208
|
-
* The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
|
|
209
|
-
* used for key generation
|
|
210
|
-
*/
|
|
211
|
-
set key_id(value: RequestId | null | undefined);
|
|
212
|
-
/**
|
|
213
|
-
* The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
|
|
214
|
-
* prefix. Future queries for the result must use this request ID.
|
|
215
|
-
*/
|
|
216
|
-
get request_id(): RequestId | undefined;
|
|
217
|
-
/**
|
|
218
|
-
* The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
|
|
219
|
-
* prefix. Future queries for the result must use this request ID.
|
|
220
|
-
*/
|
|
221
|
-
set request_id(value: RequestId | null | undefined);
|
|
222
|
-
/**
|
|
223
|
-
* The list of ciphertexts to decrypt for the user.
|
|
224
|
-
*/
|
|
225
|
-
typed_ciphertexts: TypedCiphertext[];
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
export class UserDecryptionResponse {
|
|
229
|
-
private constructor();
|
|
230
|
-
free(): void;
|
|
231
|
-
[Symbol.dispose](): void;
|
|
232
|
-
/**
|
|
233
|
-
* This is the external signature created from the Eip712 domain
|
|
234
|
-
* on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
|
|
235
|
-
* struct UserDecryptResponseVerification {
|
|
236
|
-
* bytes publicKey;
|
|
237
|
-
* uint256\[\] ctHandles;
|
|
238
|
-
* bytes userDecryptedShare; // serialization of payload
|
|
239
|
-
* bytes extraData;
|
|
240
|
-
* }
|
|
241
|
-
*/
|
|
242
|
-
external_signature: Uint8Array;
|
|
243
|
-
/**
|
|
244
|
-
* Extra data used in the EIP712 signature - external_signature.
|
|
245
|
-
*/
|
|
246
|
-
extra_data: Uint8Array;
|
|
247
|
-
/**
|
|
248
|
-
* The actual \[UserDecryptionResponsePayload\].
|
|
249
|
-
*/
|
|
250
|
-
get payload(): UserDecryptionResponsePayload | undefined;
|
|
251
|
-
/**
|
|
252
|
-
* The actual \[UserDecryptionResponsePayload\].
|
|
253
|
-
*/
|
|
254
|
-
set payload(value: UserDecryptionResponsePayload | null | undefined);
|
|
255
|
-
signature: Uint8Array;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
export class UserDecryptionResponsePayload {
|
|
259
|
-
private constructor();
|
|
260
|
-
free(): void;
|
|
261
|
-
[Symbol.dispose](): void;
|
|
262
|
-
/**
|
|
263
|
-
* The degree of the sharing scheme used.
|
|
264
|
-
*/
|
|
265
|
-
degree: number;
|
|
266
|
-
/**
|
|
267
|
-
* This is needed to ensure the response corresponds to the request.
|
|
268
|
-
* It is the digest of UserDecryptionLinker hashed using EIP712
|
|
269
|
-
* under the given domain in the request.
|
|
270
|
-
*/
|
|
271
|
-
digest: Uint8Array;
|
|
272
|
-
/**
|
|
273
|
-
* The ID of the MPC party doing the user decryption. Used for polynomial
|
|
274
|
-
* reconstruction.
|
|
275
|
-
*/
|
|
276
|
-
party_id: number;
|
|
277
|
-
/**
|
|
278
|
-
* The resulting signcrypted ciphertexts, each ciphertext
|
|
279
|
-
* must be decrypted and then reconstructed with the other shares
|
|
280
|
-
* to produce the final plaintext.
|
|
281
|
-
*/
|
|
282
|
-
signcrypted_ciphertexts: TypedSigncryptedCiphertext[];
|
|
283
|
-
/**
|
|
284
|
-
* The server's signature verification key, Encoded using SEC1.
|
|
285
|
-
* Needed to validate the response, but MUST also be linked to a list of
|
|
286
|
-
* trusted keys.
|
|
287
|
-
*/
|
|
288
|
-
verification_key: Uint8Array;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
export function get_client_address(client: Client): string;
|
|
292
|
-
|
|
293
|
-
export function get_client_secret_key(client: Client): PrivateSigKey | undefined;
|
|
294
|
-
|
|
295
|
-
export function get_server_addrs(client: Client): ServerIdAddr[];
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* This function is *not* used by relayer-sdk because the decryption
|
|
299
|
-
* is handled by [process_user_decryption_resp].
|
|
300
|
-
* It's just here for completeness and tests.
|
|
301
|
-
*/
|
|
302
|
-
export function ml_kem_pke_decrypt(ct: Uint8Array, my_sk: PrivateEncKeyMlKem512): Uint8Array;
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* This function is *not* used by relayer-sdk because the encryption
|
|
306
|
-
* happens on the KMS side. It's just here for completeness and tests.
|
|
307
|
-
*/
|
|
308
|
-
export function ml_kem_pke_encrypt(msg: Uint8Array, their_pk: PublicEncKeyMlKem512): Uint8Array;
|
|
309
|
-
|
|
310
|
-
export function ml_kem_pke_get_pk(sk: PrivateEncKeyMlKem512): PublicEncKeyMlKem512;
|
|
311
|
-
|
|
312
|
-
export function ml_kem_pke_keygen(): PrivateEncKeyMlKem512;
|
|
313
|
-
|
|
314
|
-
export function ml_kem_pke_pk_len(): number;
|
|
315
|
-
|
|
316
|
-
export function ml_kem_pke_pk_to_u8vec(pk: PublicEncKeyMlKem512): Uint8Array;
|
|
317
|
-
|
|
318
|
-
export function ml_kem_pke_sk_len(): number;
|
|
319
|
-
|
|
320
|
-
export function ml_kem_pke_sk_to_u8vec(sk: PrivateEncKeyMlKem512): Uint8Array;
|
|
321
|
-
|
|
322
3
|
/**
|
|
323
4
|
* Instantiate a new client.
|
|
324
5
|
*
|
|
@@ -332,15 +13,11 @@ export function ml_kem_pke_sk_to_u8vec(sk: PrivateEncKeyMlKem512): Uint8Array;
|
|
|
332
13
|
* The "default" parameter choice is selected if no matching string is found.
|
|
333
14
|
*/
|
|
334
15
|
export function new_client(server_addrs: ServerIdAddr[], client_address_hex: string, fhe_parameter: string): Client;
|
|
335
|
-
|
|
336
16
|
/**
|
|
337
17
|
* Create a new [ServerIdAddr] structure that holds an ID and an address
|
|
338
18
|
* which must be a valid EIP-55 address, notably prefixed with "0x".
|
|
339
19
|
*/
|
|
340
20
|
export function new_server_id_addr(id: number, addr: string): ServerIdAddr;
|
|
341
|
-
|
|
342
|
-
export function private_sig_key_to_u8vec(sk: PrivateSigKey): Uint8Array;
|
|
343
|
-
|
|
344
21
|
/**
|
|
345
22
|
* Process the user_decryption response from Rust objects.
|
|
346
23
|
* Consider using [process_user_decryption_resp_from_js]
|
|
@@ -365,7 +42,9 @@ export function private_sig_key_to_u8vec(sk: PrivateSigKey): Uint8Array;
|
|
|
365
42
|
* It is insecure if `verify = false`!
|
|
366
43
|
*/
|
|
367
44
|
export function process_user_decryption_resp(client: Client, request: ParsedUserDecryptionRequest | null | undefined, eip712_domain: Eip712DomainMsg | null | undefined, agg_resp: UserDecryptionResponse[], enc_pk: PublicEncKeyMlKem512, enc_sk: PrivateEncKeyMlKem512, verify: boolean): TypedPlaintext[];
|
|
368
|
-
|
|
45
|
+
export function ml_kem_pke_keygen(): PrivateEncKeyMlKem512;
|
|
46
|
+
export function ml_kem_pke_sk_len(): number;
|
|
47
|
+
export function ml_kem_pke_pk_to_u8vec(pk: PublicEncKeyMlKem512): Uint8Array;
|
|
369
48
|
/**
|
|
370
49
|
* Process the user_decryption response from JavaScript objects.
|
|
371
50
|
* The returned result is a byte array representing a plaintext of any length,
|
|
@@ -428,155 +107,422 @@ export function process_user_decryption_resp(client: Client, request: ParsedUser
|
|
|
428
107
|
* It is insecure if `verify = false`!
|
|
429
108
|
*/
|
|
430
109
|
export function process_user_decryption_resp_from_js(client: Client, request: any, eip712_domain: any, agg_resp: any, enc_pk: PublicEncKeyMlKem512, enc_sk: PrivateEncKeyMlKem512, verify: boolean): TypedPlaintext[];
|
|
431
|
-
|
|
110
|
+
/**
|
|
111
|
+
* This function is *not* used by relayer-sdk because the decryption
|
|
112
|
+
* is handled by [process_user_decryption_resp].
|
|
113
|
+
* It's just here for completeness and tests.
|
|
114
|
+
*/
|
|
115
|
+
export function ml_kem_pke_decrypt(ct: Uint8Array, my_sk: PrivateEncKeyMlKem512): Uint8Array;
|
|
116
|
+
export function get_client_secret_key(client: Client): PrivateSigKey | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* This function is *not* used by relayer-sdk because the encryption
|
|
119
|
+
* happens on the KMS side. It's just here for completeness and tests.
|
|
120
|
+
*/
|
|
121
|
+
export function ml_kem_pke_encrypt(msg: Uint8Array, their_pk: PublicEncKeyMlKem512): Uint8Array;
|
|
122
|
+
export function u8vec_to_private_sig_key(v: Uint8Array): PrivateSigKey;
|
|
432
123
|
export function public_sig_key_to_u8vec(pk: PublicSigKey): Uint8Array;
|
|
433
|
-
|
|
434
|
-
export function u8vec_to_ml_kem_pke_pk(v: Uint8Array): PublicEncKeyMlKem512;
|
|
435
|
-
|
|
436
124
|
export function u8vec_to_ml_kem_pke_sk(v: Uint8Array): PrivateEncKeyMlKem512;
|
|
437
|
-
|
|
438
|
-
export function
|
|
439
|
-
|
|
125
|
+
export function ml_kem_pke_get_pk(sk: PrivateEncKeyMlKem512): PublicEncKeyMlKem512;
|
|
126
|
+
export function ml_kem_pke_sk_to_u8vec(sk: PrivateEncKeyMlKem512): Uint8Array;
|
|
127
|
+
export function ml_kem_pke_pk_len(): number;
|
|
128
|
+
export function get_client_address(client: Client): string;
|
|
440
129
|
export function u8vec_to_public_sig_key(v: Uint8Array): PublicSigKey;
|
|
130
|
+
export function u8vec_to_ml_kem_pke_pk(v: Uint8Array): PublicEncKeyMlKem512;
|
|
131
|
+
export function get_server_addrs(client: Client): ServerIdAddr[];
|
|
132
|
+
export function private_sig_key_to_u8vec(sk: PrivateSigKey): Uint8Array;
|
|
133
|
+
export class CiphertextHandle {
|
|
134
|
+
private constructor();
|
|
135
|
+
free(): void;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Core Client
|
|
139
|
+
*
|
|
140
|
+
* Simple client to interact with the KMS servers. This can be seen as a proof-of-concept
|
|
141
|
+
* and reference code for validating the KMS. The logic supplied by the client will be
|
|
142
|
+
* distributed across the aggregator/proxy and smart contracts.
|
|
143
|
+
*/
|
|
144
|
+
export class Client {
|
|
145
|
+
private constructor();
|
|
146
|
+
free(): void;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Eip712 domain information.
|
|
150
|
+
* Any constraints specified in the [standard](<https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>) _must_ be fulfilled.
|
|
151
|
+
* Furthermore, be aware that all parameters will eventually be parsed into Solidity types.
|
|
152
|
+
*/
|
|
153
|
+
export class Eip712DomainMsg {
|
|
154
|
+
private constructor();
|
|
155
|
+
free(): void;
|
|
156
|
+
name: string;
|
|
157
|
+
version: string;
|
|
158
|
+
chain_id: Uint8Array;
|
|
159
|
+
verifying_contract: string;
|
|
160
|
+
get salt(): Uint8Array | undefined;
|
|
161
|
+
set salt(value: Uint8Array | null | undefined);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Validity of this struct is not checked.
|
|
165
|
+
*/
|
|
166
|
+
export class ParsedUserDecryptionRequest {
|
|
167
|
+
private constructor();
|
|
168
|
+
free(): void;
|
|
169
|
+
}
|
|
170
|
+
export class PrivateEncKeyMlKem512 {
|
|
171
|
+
private constructor();
|
|
172
|
+
free(): void;
|
|
173
|
+
}
|
|
174
|
+
export class PrivateSigKey {
|
|
175
|
+
private constructor();
|
|
176
|
+
free(): void;
|
|
177
|
+
}
|
|
178
|
+
export class PublicEncKeyMlKem512 {
|
|
179
|
+
private constructor();
|
|
180
|
+
free(): void;
|
|
181
|
+
}
|
|
182
|
+
export class PublicSigKey {
|
|
183
|
+
private constructor();
|
|
184
|
+
free(): void;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* / A unique 32 Byte / 256 Bit ID, to be used to identify a request and
|
|
188
|
+
* / for retrieving the computed result later on.
|
|
189
|
+
* / Must be encoded in lower-case hex. The string must NOT contain a `0x` prefix.
|
|
190
|
+
*/
|
|
191
|
+
export class RequestId {
|
|
192
|
+
private constructor();
|
|
193
|
+
free(): void;
|
|
194
|
+
request_id: string;
|
|
195
|
+
}
|
|
196
|
+
export class ServerIdAddr {
|
|
197
|
+
private constructor();
|
|
198
|
+
free(): void;
|
|
199
|
+
}
|
|
200
|
+
export class TypedCiphertext {
|
|
201
|
+
private constructor();
|
|
202
|
+
free(): void;
|
|
203
|
+
/**
|
|
204
|
+
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
205
|
+
*/
|
|
206
|
+
ciphertext: Uint8Array;
|
|
207
|
+
/**
|
|
208
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
209
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
210
|
+
*/
|
|
211
|
+
fhe_type: number;
|
|
212
|
+
/**
|
|
213
|
+
* The external handle of the ciphertext (the handle used in the copro).
|
|
214
|
+
*/
|
|
215
|
+
external_handle: Uint8Array;
|
|
216
|
+
/**
|
|
217
|
+
* The ciphertext format, see CiphertextFormat documentation for details.
|
|
218
|
+
* CiphertextFormat::default() is used if unspecified.
|
|
219
|
+
*/
|
|
220
|
+
ciphertext_format: number;
|
|
221
|
+
}
|
|
222
|
+
export class TypedPlaintext {
|
|
223
|
+
private constructor();
|
|
224
|
+
free(): void;
|
|
225
|
+
/**
|
|
226
|
+
* The actual plaintext in bytes.
|
|
227
|
+
*/
|
|
228
|
+
bytes: Uint8Array;
|
|
229
|
+
/**
|
|
230
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
231
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
232
|
+
*/
|
|
233
|
+
fhe_type: number;
|
|
234
|
+
}
|
|
235
|
+
export class TypedSigncryptedCiphertext {
|
|
236
|
+
private constructor();
|
|
237
|
+
free(): void;
|
|
238
|
+
/**
|
|
239
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
240
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
241
|
+
*/
|
|
242
|
+
fhe_type: number;
|
|
243
|
+
/**
|
|
244
|
+
* The signcrypted payload, using a hybrid encryption approach in
|
|
245
|
+
* sign-then-encrypt.
|
|
246
|
+
*/
|
|
247
|
+
signcrypted_ciphertext: Uint8Array;
|
|
248
|
+
/**
|
|
249
|
+
* The external handles that were originally in the request.
|
|
250
|
+
*/
|
|
251
|
+
external_handle: Uint8Array;
|
|
252
|
+
/**
|
|
253
|
+
* The packing factor determines whether the decrypted plaintext
|
|
254
|
+
* has a different way of packing compared to what is specified in the plaintext modulus.
|
|
255
|
+
*/
|
|
256
|
+
packing_factor: number;
|
|
257
|
+
}
|
|
258
|
+
export class UserDecryptionRequest {
|
|
259
|
+
private constructor();
|
|
260
|
+
free(): void;
|
|
261
|
+
/**
|
|
262
|
+
* The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
|
|
263
|
+
* prefix. Future queries for the result must use this request ID.
|
|
264
|
+
*/
|
|
265
|
+
get request_id(): RequestId | undefined;
|
|
266
|
+
/**
|
|
267
|
+
* The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
|
|
268
|
+
* prefix. Future queries for the result must use this request ID.
|
|
269
|
+
*/
|
|
270
|
+
set request_id(value: RequestId | null | undefined);
|
|
271
|
+
/**
|
|
272
|
+
* The list of ciphertexts to decrypt for the user.
|
|
273
|
+
*/
|
|
274
|
+
typed_ciphertexts: TypedCiphertext[];
|
|
275
|
+
/**
|
|
276
|
+
* The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
|
|
277
|
+
* used for key generation
|
|
278
|
+
*/
|
|
279
|
+
get key_id(): RequestId | undefined;
|
|
280
|
+
/**
|
|
281
|
+
* The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
|
|
282
|
+
* used for key generation
|
|
283
|
+
*/
|
|
284
|
+
set key_id(value: RequestId | null | undefined);
|
|
285
|
+
/**
|
|
286
|
+
* The client's (blockchain wallet) address, encoded using EIP-55. I.e. including `0x`.
|
|
287
|
+
*/
|
|
288
|
+
client_address: string;
|
|
289
|
+
/**
|
|
290
|
+
* Encoding of the user's public encryption key for this request.
|
|
291
|
+
* This must be a bincode (v.1) encoded ML-KEM 512 key.
|
|
292
|
+
*/
|
|
293
|
+
enc_key: Uint8Array;
|
|
294
|
+
/**
|
|
295
|
+
* The user's EIP712 domain. This MUST be present. Furthermore, the `verifying_contract` MUST be set and be distinct from `client_address`.
|
|
296
|
+
*/
|
|
297
|
+
get domain(): Eip712DomainMsg | undefined;
|
|
298
|
+
/**
|
|
299
|
+
* The user's EIP712 domain. This MUST be present. Furthermore, the `verifying_contract` MUST be set and be distinct from `client_address`.
|
|
300
|
+
*/
|
|
301
|
+
set domain(value: Eip712DomainMsg | null | undefined);
|
|
302
|
+
/**
|
|
303
|
+
* Extra data from the gateway.
|
|
304
|
+
*/
|
|
305
|
+
extra_data: Uint8Array;
|
|
306
|
+
/**
|
|
307
|
+
* MPC context ID which is used to identify the context to use for this request.
|
|
308
|
+
*
|
|
309
|
+
* NOTE: at the moment this can be None since we do not fully support multiple contexts.
|
|
310
|
+
* See <https://github.com/zama-ai/kms-internal/issues/2530>
|
|
311
|
+
*/
|
|
312
|
+
get context_id(): RequestId | undefined;
|
|
313
|
+
/**
|
|
314
|
+
* MPC context ID which is used to identify the context to use for this request.
|
|
315
|
+
*
|
|
316
|
+
* NOTE: at the moment this can be None since we do not fully support multiple contexts.
|
|
317
|
+
* See <https://github.com/zama-ai/kms-internal/issues/2530>
|
|
318
|
+
*/
|
|
319
|
+
set context_id(value: RequestId | null | undefined);
|
|
320
|
+
/**
|
|
321
|
+
* The epoch number placeholder (zama-ai/kms-internal#2743).
|
|
322
|
+
*/
|
|
323
|
+
get epoch_id(): RequestId | undefined;
|
|
324
|
+
/**
|
|
325
|
+
* The epoch number placeholder (zama-ai/kms-internal#2743).
|
|
326
|
+
*/
|
|
327
|
+
set epoch_id(value: RequestId | null | undefined);
|
|
328
|
+
}
|
|
329
|
+
export class UserDecryptionResponse {
|
|
330
|
+
private constructor();
|
|
331
|
+
free(): void;
|
|
332
|
+
signature: Uint8Array;
|
|
333
|
+
/**
|
|
334
|
+
* This is the external signature created from the Eip712 domain
|
|
335
|
+
* on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
|
|
336
|
+
* struct UserDecryptResponseVerification {
|
|
337
|
+
* bytes publicKey;
|
|
338
|
+
* uint256\[\] ctHandles;
|
|
339
|
+
* bytes userDecryptedShare; // serialization of payload
|
|
340
|
+
* bytes extraData;
|
|
341
|
+
* }
|
|
342
|
+
*/
|
|
343
|
+
external_signature: Uint8Array;
|
|
344
|
+
/**
|
|
345
|
+
* The actual \[UserDecryptionResponsePayload\].
|
|
346
|
+
*/
|
|
347
|
+
get payload(): UserDecryptionResponsePayload | undefined;
|
|
348
|
+
/**
|
|
349
|
+
* The actual \[UserDecryptionResponsePayload\].
|
|
350
|
+
*/
|
|
351
|
+
set payload(value: UserDecryptionResponsePayload | null | undefined);
|
|
352
|
+
/**
|
|
353
|
+
* Extra data used in the EIP712 signature - external_signature.
|
|
354
|
+
*/
|
|
355
|
+
extra_data: Uint8Array;
|
|
356
|
+
}
|
|
357
|
+
export class UserDecryptionResponsePayload {
|
|
358
|
+
private constructor();
|
|
359
|
+
free(): void;
|
|
360
|
+
/**
|
|
361
|
+
* The server's signature verification key, Encoded using SEC1.
|
|
362
|
+
* Needed to validate the response, but MUST also be linked to a list of
|
|
363
|
+
* trusted keys.
|
|
364
|
+
*/
|
|
365
|
+
verification_key: Uint8Array;
|
|
366
|
+
/**
|
|
367
|
+
* This is needed to ensure the response corresponds to the request.
|
|
368
|
+
* It is the digest of UserDecryptionLinker hashed using EIP712
|
|
369
|
+
* under the given domain in the request.
|
|
370
|
+
*/
|
|
371
|
+
digest: Uint8Array;
|
|
372
|
+
/**
|
|
373
|
+
* The resulting signcrypted ciphertexts, each ciphertext
|
|
374
|
+
* must be decrypted and then reconstructed with the other shares
|
|
375
|
+
* to produce the final plaintext.
|
|
376
|
+
*/
|
|
377
|
+
signcrypted_ciphertexts: TypedSigncryptedCiphertext[];
|
|
378
|
+
/**
|
|
379
|
+
* The ID of the MPC party doing the user decryption. Used for polynomial
|
|
380
|
+
* reconstruction.
|
|
381
|
+
*/
|
|
382
|
+
party_id: number;
|
|
383
|
+
/**
|
|
384
|
+
* The degree of the sharing scheme used.
|
|
385
|
+
*/
|
|
386
|
+
degree: number;
|
|
387
|
+
}
|
|
441
388
|
|
|
442
389
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
443
390
|
|
|
444
391
|
export interface InitOutput {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
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
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
392
|
+
readonly memory: WebAssembly.Memory;
|
|
393
|
+
readonly __wbg_client_free: (a: number, b: number) => void;
|
|
394
|
+
readonly __wbg_privateenckeymlkem512_free: (a: number, b: number) => void;
|
|
395
|
+
readonly __wbg_publicenckeymlkem512_free: (a: number, b: number) => void;
|
|
396
|
+
readonly __wbg_serveridaddr_free: (a: number, b: number) => void;
|
|
397
|
+
readonly get_client_address: (a: number) => [number, number];
|
|
398
|
+
readonly get_client_secret_key: (a: number) => number;
|
|
399
|
+
readonly get_server_addrs: (a: number) => [number, number];
|
|
400
|
+
readonly ml_kem_pke_decrypt: (a: number, b: number, c: number) => [number, number];
|
|
401
|
+
readonly ml_kem_pke_encrypt: (a: number, b: number, c: number) => [number, number];
|
|
402
|
+
readonly ml_kem_pke_get_pk: (a: number) => number;
|
|
403
|
+
readonly ml_kem_pke_keygen: () => number;
|
|
404
|
+
readonly ml_kem_pke_pk_len: () => number;
|
|
405
|
+
readonly ml_kem_pke_pk_to_u8vec: (a: number) => [number, number, number, number];
|
|
406
|
+
readonly ml_kem_pke_sk_len: () => number;
|
|
407
|
+
readonly ml_kem_pke_sk_to_u8vec: (a: number) => [number, number, number, number];
|
|
408
|
+
readonly new_client: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
409
|
+
readonly new_server_id_addr: (a: number, b: number, c: number) => [number, number, number];
|
|
410
|
+
readonly private_sig_key_to_u8vec: (a: number) => [number, number, number, number];
|
|
411
|
+
readonly process_user_decryption_resp: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
412
|
+
readonly process_user_decryption_resp_from_js: (a: number, b: any, c: any, d: any, e: number, f: number, g: number) => [number, number, number, number];
|
|
413
|
+
readonly public_sig_key_to_u8vec: (a: number) => [number, number];
|
|
414
|
+
readonly u8vec_to_ml_kem_pke_pk: (a: number, b: number) => [number, number, number];
|
|
415
|
+
readonly u8vec_to_ml_kem_pke_sk: (a: number, b: number) => [number, number, number];
|
|
416
|
+
readonly u8vec_to_private_sig_key: (a: number, b: number) => [number, number, number];
|
|
417
|
+
readonly u8vec_to_public_sig_key: (a: number, b: number) => [number, number, number];
|
|
418
|
+
readonly __wbg_ciphertexthandle_free: (a: number, b: number) => void;
|
|
419
|
+
readonly __wbg_parseduserdecryptionrequest_free: (a: number, b: number) => void;
|
|
420
|
+
readonly __wbg_privatesigkey_free: (a: number, b: number) => void;
|
|
421
|
+
readonly __wbg_publicsigkey_free: (a: number, b: number) => void;
|
|
422
|
+
readonly __wbg_eip712domainmsg_free: (a: number, b: number) => void;
|
|
423
|
+
readonly __wbg_get_eip712domainmsg_chain_id: (a: number) => [number, number];
|
|
424
|
+
readonly __wbg_get_eip712domainmsg_name: (a: number) => [number, number];
|
|
425
|
+
readonly __wbg_get_eip712domainmsg_salt: (a: number) => [number, number];
|
|
426
|
+
readonly __wbg_get_eip712domainmsg_verifying_contract: (a: number) => [number, number];
|
|
427
|
+
readonly __wbg_get_eip712domainmsg_version: (a: number) => [number, number];
|
|
428
|
+
readonly __wbg_get_typedciphertext_ciphertext: (a: number) => [number, number];
|
|
429
|
+
readonly __wbg_get_typedciphertext_ciphertext_format: (a: number) => number;
|
|
430
|
+
readonly __wbg_get_typedciphertext_external_handle: (a: number) => [number, number];
|
|
431
|
+
readonly __wbg_get_typedciphertext_fhe_type: (a: number) => number;
|
|
432
|
+
readonly __wbg_get_typedplaintext_fhe_type: (a: number) => number;
|
|
433
|
+
readonly __wbg_get_userdecryptionrequest_context_id: (a: number) => number;
|
|
434
|
+
readonly __wbg_get_userdecryptionrequest_domain: (a: number) => number;
|
|
435
|
+
readonly __wbg_get_userdecryptionrequest_epoch_id: (a: number) => number;
|
|
436
|
+
readonly __wbg_get_userdecryptionrequest_extra_data: (a: number) => [number, number];
|
|
437
|
+
readonly __wbg_get_userdecryptionrequest_key_id: (a: number) => number;
|
|
438
|
+
readonly __wbg_get_userdecryptionrequest_request_id: (a: number) => number;
|
|
439
|
+
readonly __wbg_get_userdecryptionrequest_typed_ciphertexts: (a: number) => [number, number];
|
|
440
|
+
readonly __wbg_get_userdecryptionresponse_payload: (a: number) => number;
|
|
441
|
+
readonly __wbg_get_userdecryptionresponsepayload_degree: (a: number) => number;
|
|
442
|
+
readonly __wbg_get_userdecryptionresponsepayload_party_id: (a: number) => number;
|
|
443
|
+
readonly __wbg_get_userdecryptionresponsepayload_signcrypted_ciphertexts: (a: number) => [number, number];
|
|
444
|
+
readonly __wbg_requestid_free: (a: number, b: number) => void;
|
|
445
|
+
readonly __wbg_set_eip712domainmsg_chain_id: (a: number, b: number, c: number) => void;
|
|
446
|
+
readonly __wbg_set_eip712domainmsg_name: (a: number, b: number, c: number) => void;
|
|
447
|
+
readonly __wbg_set_eip712domainmsg_salt: (a: number, b: number, c: number) => void;
|
|
448
|
+
readonly __wbg_set_eip712domainmsg_verifying_contract: (a: number, b: number, c: number) => void;
|
|
449
|
+
readonly __wbg_set_eip712domainmsg_version: (a: number, b: number, c: number) => void;
|
|
450
|
+
readonly __wbg_set_typedciphertext_ciphertext_format: (a: number, b: number) => void;
|
|
451
|
+
readonly __wbg_set_typedciphertext_fhe_type: (a: number, b: number) => void;
|
|
452
|
+
readonly __wbg_set_typedplaintext_fhe_type: (a: number, b: number) => void;
|
|
453
|
+
readonly __wbg_set_userdecryptionrequest_context_id: (a: number, b: number) => void;
|
|
454
|
+
readonly __wbg_set_userdecryptionrequest_domain: (a: number, b: number) => void;
|
|
455
|
+
readonly __wbg_set_userdecryptionrequest_epoch_id: (a: number, b: number) => void;
|
|
456
|
+
readonly __wbg_set_userdecryptionrequest_key_id: (a: number, b: number) => void;
|
|
457
|
+
readonly __wbg_set_userdecryptionrequest_request_id: (a: number, b: number) => void;
|
|
458
|
+
readonly __wbg_set_userdecryptionrequest_typed_ciphertexts: (a: number, b: number, c: number) => void;
|
|
459
|
+
readonly __wbg_set_userdecryptionresponse_payload: (a: number, b: number) => void;
|
|
460
|
+
readonly __wbg_set_userdecryptionresponsepayload_degree: (a: number, b: number) => void;
|
|
461
|
+
readonly __wbg_set_userdecryptionresponsepayload_party_id: (a: number, b: number) => void;
|
|
462
|
+
readonly __wbg_set_userdecryptionresponsepayload_signcrypted_ciphertexts: (a: number, b: number, c: number) => void;
|
|
463
|
+
readonly __wbg_typedciphertext_free: (a: number, b: number) => void;
|
|
464
|
+
readonly __wbg_typedplaintext_free: (a: number, b: number) => void;
|
|
465
|
+
readonly __wbg_typedsigncryptedciphertext_free: (a: number, b: number) => void;
|
|
466
|
+
readonly __wbg_userdecryptionrequest_free: (a: number, b: number) => void;
|
|
467
|
+
readonly __wbg_userdecryptionresponse_free: (a: number, b: number) => void;
|
|
468
|
+
readonly __wbg_userdecryptionresponsepayload_free: (a: number, b: number) => void;
|
|
469
|
+
readonly __wbg_set_typedsigncryptedciphertext_fhe_type: (a: number, b: number) => void;
|
|
470
|
+
readonly __wbg_set_typedsigncryptedciphertext_packing_factor: (a: number, b: number) => void;
|
|
471
|
+
readonly __wbg_get_requestid_request_id: (a: number) => [number, number];
|
|
472
|
+
readonly __wbg_get_userdecryptionrequest_client_address: (a: number) => [number, number];
|
|
473
|
+
readonly __wbg_set_requestid_request_id: (a: number, b: number, c: number) => void;
|
|
474
|
+
readonly __wbg_set_typedciphertext_ciphertext: (a: number, b: number, c: number) => void;
|
|
475
|
+
readonly __wbg_set_typedciphertext_external_handle: (a: number, b: number, c: number) => void;
|
|
476
|
+
readonly __wbg_set_typedplaintext_bytes: (a: number, b: number, c: number) => void;
|
|
477
|
+
readonly __wbg_set_typedsigncryptedciphertext_external_handle: (a: number, b: number, c: number) => void;
|
|
478
|
+
readonly __wbg_set_typedsigncryptedciphertext_signcrypted_ciphertext: (a: number, b: number, c: number) => void;
|
|
479
|
+
readonly __wbg_set_userdecryptionrequest_client_address: (a: number, b: number, c: number) => void;
|
|
480
|
+
readonly __wbg_set_userdecryptionrequest_enc_key: (a: number, b: number, c: number) => void;
|
|
481
|
+
readonly __wbg_set_userdecryptionrequest_extra_data: (a: number, b: number, c: number) => void;
|
|
482
|
+
readonly __wbg_set_userdecryptionresponse_external_signature: (a: number, b: number, c: number) => void;
|
|
483
|
+
readonly __wbg_set_userdecryptionresponse_extra_data: (a: number, b: number, c: number) => void;
|
|
484
|
+
readonly __wbg_set_userdecryptionresponse_signature: (a: number, b: number, c: number) => void;
|
|
485
|
+
readonly __wbg_set_userdecryptionresponsepayload_digest: (a: number, b: number, c: number) => void;
|
|
486
|
+
readonly __wbg_set_userdecryptionresponsepayload_verification_key: (a: number, b: number, c: number) => void;
|
|
487
|
+
readonly __wbg_get_typedplaintext_bytes: (a: number) => [number, number];
|
|
488
|
+
readonly __wbg_get_typedsigncryptedciphertext_external_handle: (a: number) => [number, number];
|
|
489
|
+
readonly __wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext: (a: number) => [number, number];
|
|
490
|
+
readonly __wbg_get_userdecryptionrequest_enc_key: (a: number) => [number, number];
|
|
491
|
+
readonly __wbg_get_userdecryptionresponse_external_signature: (a: number) => [number, number];
|
|
492
|
+
readonly __wbg_get_userdecryptionresponse_extra_data: (a: number) => [number, number];
|
|
493
|
+
readonly __wbg_get_userdecryptionresponse_signature: (a: number) => [number, number];
|
|
494
|
+
readonly __wbg_get_userdecryptionresponsepayload_digest: (a: number) => [number, number];
|
|
495
|
+
readonly __wbg_get_userdecryptionresponsepayload_verification_key: (a: number) => [number, number];
|
|
496
|
+
readonly __wbg_get_typedsigncryptedciphertext_fhe_type: (a: number) => number;
|
|
497
|
+
readonly __wbg_get_typedsigncryptedciphertext_packing_factor: (a: number) => number;
|
|
498
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
499
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
500
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
501
|
+
readonly __externref_table_alloc: () => number;
|
|
502
|
+
readonly __wbindgen_export_4: WebAssembly.Table;
|
|
503
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
504
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
505
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
506
|
+
readonly __wbindgen_start: () => void;
|
|
560
507
|
}
|
|
561
508
|
|
|
562
509
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
563
|
-
|
|
564
510
|
/**
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
511
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
512
|
+
* a precompiled `WebAssembly.Module`.
|
|
513
|
+
*
|
|
514
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
515
|
+
*
|
|
516
|
+
* @returns {InitOutput}
|
|
517
|
+
*/
|
|
572
518
|
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
573
519
|
|
|
574
520
|
/**
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
521
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
522
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
523
|
+
*
|
|
524
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
525
|
+
*
|
|
526
|
+
* @returns {Promise<InitOutput>}
|
|
527
|
+
*/
|
|
582
528
|
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|