tkms 0.9.1-rc3 → 0.11.0-22

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 CHANGED
@@ -1,117 +1,67 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * @param {PublicSigKey} pk
5
- * @returns {Uint8Array}
6
- */
3
+ export function ml_kem_pke_pk_len(): number;
4
+ export function ml_kem_pke_sk_len(): number;
7
5
  export function public_sig_key_to_u8vec(pk: PublicSigKey): Uint8Array;
8
- /**
9
- * @param {Uint8Array} v
10
- * @returns {PublicSigKey}
11
- */
12
6
  export function u8vec_to_public_sig_key(v: Uint8Array): PublicSigKey;
13
- /**
14
- * @param {PrivateSigKey} sk
15
- * @returns {Uint8Array}
16
- */
17
7
  export function private_sig_key_to_u8vec(sk: PrivateSigKey): Uint8Array;
8
+ export function u8vec_to_private_sig_key(v: Uint8Array): PrivateSigKey;
18
9
  /**
19
- * @param {Uint8Array} v
20
- * @returns {PrivateSigKey}
10
+ * Create a new [ServerIdAddr] structure that holds an ID and an address
11
+ * which must be a valid EIP-55 address, notably prefixed with "0x".
21
12
  */
22
- export function u8vec_to_private_sig_key(v: Uint8Array): PrivateSigKey;
13
+ export function new_server_id_addr(id: number, addr: string): ServerIdAddr;
23
14
  /**
24
15
  * Instantiate a new client.
25
16
  *
26
- * * `server_addrs` - a list of KMS server EIP-55 addresses,
27
- * must be prefixed with "0x".
17
+ * * `server_addrs` - a list of KMS server ID with EIP-55 addresses,
18
+ * the elements in the list can be created using [new_server_id_addr].
28
19
  *
29
20
  * * `client_address_hex` - the client (wallet) address in hex,
30
21
  * must be prefixed with "0x".
31
22
  *
32
- * * `param_choice` - the parameter choice, which can be either `"test"` or `"default"`.
23
+ * * `fhe_parameter` - the parameter choice, which can be either `"test"` or `"default"`.
33
24
  * The "default" parameter choice is selected if no matching string is found.
34
- * @param {(string)[]} server_addrs
35
- * @param {string} client_address_hex
36
- * @param {string} param_choice
37
- * @returns {Client}
38
- */
39
- export function new_client(server_addrs: (string)[], client_address_hex: string, param_choice: string): Client;
40
- /**
41
- * @param {Client} client
42
- * @returns {(string)[]}
43
- */
44
- export function get_server_addrs(client: Client): (string)[];
45
- /**
46
- * @param {Client} client
47
- * @returns {PrivateSigKey | undefined}
48
25
  */
26
+ export function new_client(server_addrs: ServerIdAddr[], client_address_hex: string, fhe_parameter: string): Client;
27
+ export function get_server_addrs(client: Client): ServerIdAddr[];
49
28
  export function get_client_secret_key(client: Client): PrivateSigKey | undefined;
50
- /**
51
- * @param {Client} client
52
- * @returns {string}
53
- */
54
29
  export function get_client_address(client: Client): string;
30
+ export function ml_kem_pke_keygen(): PrivateEncKeyMlKem512;
31
+ export function ml_kem_pke_get_pk(sk: PrivateEncKeyMlKem512): PublicEncKeyMlKem512;
32
+ export function ml_kem_pke_pk_to_u8vec(pk: PublicEncKeyMlKem512): Uint8Array;
33
+ export function ml_kem_pke_sk_to_u8vec(sk: PrivateEncKeyMlKem512): Uint8Array;
34
+ export function u8vec_to_ml_kem_pke_pk(v: Uint8Array): PublicEncKeyMlKem512;
35
+ export function u8vec_to_ml_kem_pke_sk(v: Uint8Array): PrivateEncKeyMlKem512;
55
36
  /**
56
- * @returns {PrivateEncKey}
57
- */
58
- export function cryptobox_keygen(): PrivateEncKey;
59
- /**
60
- * @param {PrivateEncKey} sk
61
- * @returns {PublicEncKey}
62
- */
63
- export function cryptobox_get_pk(sk: PrivateEncKey): PublicEncKey;
64
- /**
65
- * @param {PublicEncKey} pk
66
- * @returns {Uint8Array}
67
- */
68
- export function cryptobox_pk_to_u8vec(pk: PublicEncKey): Uint8Array;
69
- /**
70
- * @param {PrivateEncKey} sk
71
- * @returns {Uint8Array}
72
- */
73
- export function cryptobox_sk_to_u8vec(sk: PrivateEncKey): Uint8Array;
74
- /**
75
- * @param {Uint8Array} v
76
- * @returns {PublicEncKey}
77
- */
78
- export function u8vec_to_cryptobox_pk(v: Uint8Array): PublicEncKey;
79
- /**
80
- * @param {Uint8Array} v
81
- * @returns {PrivateEncKey}
82
- */
83
- export function u8vec_to_cryptobox_sk(v: Uint8Array): PrivateEncKey;
84
- /**
85
- * @param {Uint8Array} msg
86
- * @param {PublicEncKey} their_pk
87
- * @param {PrivateEncKey} my_sk
88
- * @returns {CryptoBoxCt}
37
+ * This function is *not* used by relayer-sdk because the encryption
38
+ * happens on the KMS side. It's just here for completeness and tests.
89
39
  */
90
- export function cryptobox_encrypt(msg: Uint8Array, their_pk: PublicEncKey, my_sk: PrivateEncKey): CryptoBoxCt;
40
+ export function ml_kem_pke_encrypt(msg: Uint8Array, their_pk: PublicEncKeyMlKem512): Uint8Array;
91
41
  /**
92
- * @param {CryptoBoxCt} ct
93
- * @param {PrivateEncKey} my_sk
94
- * @param {PublicEncKey} their_pk
95
- * @returns {Uint8Array}
42
+ * This function is *not* used by relayer-sdk because the decryption
43
+ * is handled by [process_user_decryption_resp].
44
+ * It's just here for completeness and tests.
96
45
  */
97
- export function cryptobox_decrypt(ct: CryptoBoxCt, my_sk: PrivateEncKey, their_pk: PublicEncKey): Uint8Array;
46
+ export function ml_kem_pke_decrypt(ct: Uint8Array, my_sk: PrivateEncKeyMlKem512): Uint8Array;
98
47
  /**
99
- * Process the reencryption response from JavaScript objects.
48
+ * Process the user_decryption response from JavaScript objects.
100
49
  * The returned result is a byte array representing a plaintext of any length,
101
50
  * postprocessing is returned to turn it into an integer.
102
51
  *
103
- * * `client` - client that wants to perform reencryption.
52
+ * * `client` - client that wants to perform user_decryption.
104
53
  *
105
- * * `request` - the initial reencryption request JS object.
54
+ * * `request` - the initial user_decryption request JS object.
106
55
  * It can be set to null if `verify` is false.
107
56
  * Otherwise the caller needs to give the following JS object.
108
57
  * Note that `client_address` and `eip712_verifying_contract` follow EIP-55.
58
+ * The signature field is not needed.
109
59
  * ```
110
60
  * {
111
- * signature: '15a4f9a8eb61459cfba7d103d8f911fb04ce91ecf841b34c49c0d56a70b896d20cbc31986188f91efc3842b7df215cee8acb40178daedb8b63d0ba5d199bce121c',
61
+ * signature: undefined,
112
62
  * client_address: '0x17853A630aAe15AED549B2B874de08B73C0F59c5',
113
63
  * enc_key: '2000000000000000df2fcacb774f03187f3802a27259f45c06d33cefa68d9c53426b15ad531aa822',
114
- * ciphertext_handle: '0748b542afe2353c86cb707e3d21044b0be1fd18efc7cbaa6a415af055bfb358',
64
+ * ciphertext_handles: [ '0748b542afe2353c86cb707e3d21044b0be1fd18efc7cbaa6a415af055bfb358' ]
115
65
  * eip712_verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657'
116
66
  * }
117
67
  * ```
@@ -153,31 +103,23 @@ export function cryptobox_decrypt(ct: CryptoBoxCt, my_sk: PrivateEncKey, their_p
153
103
  *
154
104
  * * `verify` - Whether to perform signature verification for the response.
155
105
  * It is insecure if `verify = false`!
156
- * @param {Client} client
157
- * @param {any} request
158
- * @param {any} eip712_domain
159
- * @param {any} agg_resp
160
- * @param {PublicEncKey} enc_pk
161
- * @param {PrivateEncKey} enc_sk
162
- * @param {boolean} verify
163
- * @returns {Uint8Array}
164
106
  */
165
- export function process_reencryption_resp_from_js(client: Client, request: any, eip712_domain: any, agg_resp: any, enc_pk: PublicEncKey, enc_sk: PrivateEncKey, verify: boolean): Uint8Array;
107
+ 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[];
166
108
  /**
167
- * Process the reencryption response from Rust objects.
168
- * Consider using [process_reencryption_resp_from_js]
109
+ * Process the user_decryption response from Rust objects.
110
+ * Consider using [process_user_decryption_resp_from_js]
169
111
  * when using the JS API.
170
112
  * The result is a byte array representing a plaintext of any length.
171
113
  *
172
- * * `client` - client that wants to perform reencryption.
114
+ * * `client` - client that wants to perform user_decryption.
173
115
  *
174
- * * `request` - the initial reencryption request.
116
+ * * `request` - the initial user_decryption request.
175
117
  * Must be given if `verify` is true.
176
118
  *
177
119
  * * `eip712_domain` - the EIP-712 domain.
178
120
  * Must be given if `verify` is true.
179
121
  *
180
- * * `agg_resp` - the vector of reencryption responses.
122
+ * * `agg_resp` - the vector of user_decryption responses.
181
123
  *
182
124
  * * `enc_pk` - The ephemeral public key.
183
125
  *
@@ -185,32 +127,11 @@ export function process_reencryption_resp_from_js(client: Client, request: any,
185
127
  *
186
128
  * * `verify` - Whether to perform signature verification for the response.
187
129
  * It is insecure if `verify = false`!
188
- * @param {Client} client
189
- * @param {ParsedReencryptionRequest | undefined} request
190
- * @param {Eip712DomainMsg | undefined} eip712_domain
191
- * @param {(ReencryptionResponse)[]} agg_resp
192
- * @param {PublicEncKey} enc_pk
193
- * @param {PrivateEncKey} enc_sk
194
- * @param {boolean} verify
195
- * @returns {Uint8Array}
196
130
  */
197
- export function process_reencryption_resp(client: Client, request: ParsedReencryptionRequest | undefined, eip712_domain: Eip712DomainMsg | undefined, agg_resp: (ReencryptionResponse)[], enc_pk: PublicEncKey, enc_sk: PrivateEncKey, verify: boolean): Uint8Array;
198
- /**
199
- * The plaintext types that can be encrypted in a fhevm ciphertext.
200
- */
201
- export enum FheType {
202
- Ebool = 0,
203
- Euint4 = 1,
204
- Euint8 = 2,
205
- Euint16 = 3,
206
- Euint32 = 4,
207
- Euint64 = 5,
208
- Euint128 = 6,
209
- Euint160 = 7,
210
- Euint256 = 8,
211
- Euint512 = 9,
212
- Euint1024 = 10,
213
- Euint2048 = 11,
131
+ 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[];
132
+ export class CiphertextHandle {
133
+ private constructor();
134
+ free(): void;
214
135
  }
215
136
  /**
216
137
  * Core Client
@@ -220,147 +141,217 @@ export enum FheType {
220
141
  * distributed across the aggregator/proxy and smart contracts.
221
142
  */
222
143
  export class Client {
223
- free(): void;
224
- }
225
- export class CryptoBoxCt {
144
+ private constructor();
226
145
  free(): void;
227
146
  }
228
147
  /**
229
- * <https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>
230
- * eventually chain_id, verifying_contract and salt will be parsed in to
231
- * solidity types
148
+ * Eip712 domain information.
149
+ * Any constraints specified in the [standard](<https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>) _must_ be fulfilled.
150
+ * Furthermore, be aware that all parameters will eventually be parsed into Solidity types.
232
151
  */
233
152
  export class Eip712DomainMsg {
153
+ private constructor();
234
154
  free(): void;
235
- chain_id: Uint8Array;
236
155
  name: string;
237
- salt?: Uint8Array;
238
- verifying_contract: string;
239
156
  version: string;
157
+ chain_id: Uint8Array;
158
+ verifying_contract: string;
159
+ get salt(): Uint8Array | undefined;
160
+ set salt(value: Uint8Array | null | undefined);
240
161
  }
241
162
  /**
242
163
  * Validity of this struct is not checked.
243
164
  */
244
- export class ParsedReencryptionRequest {
165
+ export class ParsedUserDecryptionRequest {
166
+ private constructor();
245
167
  free(): void;
246
168
  }
247
- export class PrivateEncKey {
169
+ export class PrivateEncKeyMlKem512 {
170
+ private constructor();
248
171
  free(): void;
249
172
  }
250
173
  export class PrivateSigKey {
174
+ private constructor();
251
175
  free(): void;
252
176
  }
253
- export class PublicEncKey {
177
+ export class PublicEncKeyMlKem512 {
178
+ private constructor();
254
179
  free(): void;
255
180
  }
256
181
  export class PublicSigKey {
182
+ private constructor();
257
183
  free(): void;
258
184
  }
259
- export class ReencryptionRequest {
260
- free(): void;
261
- domain?: Eip712DomainMsg;
262
- payload?: ReencryptionRequestPayload;
263
185
  /**
264
- * The ID that identifies this request.
265
- * Future queries for the result must use this request ID.
186
+ * / A unique 32 Byte / 256 Bit ID, to be used to identify a request and
187
+ * / for retrieving the computed result later on.
188
+ * / Must be encoded in lower-case hex. The string must NOT contain a `0x` prefix.
266
189
  */
267
- request_id?: RequestId;
268
- /**
269
- * Signature of the serialization of \[ReencryptionRequestPayload\].
270
- */
271
- signature: Uint8Array;
190
+ export class RequestId {
191
+ private constructor();
192
+ free(): void;
193
+ request_id: string;
272
194
  }
273
- export class ReencryptionRequestPayload {
195
+ export class ServerIdAddr {
196
+ private constructor();
274
197
  free(): void;
275
- /**
276
- * The actual ciphertext to decrypt, taken directly from the fhevm.
277
- * When creating the payload, this field may be empty,
278
- * it is the responsibility of the gateway to fetch the
279
- * ciphertext for the given digest below.
280
- */
281
- ciphertext?: Uint8Array;
282
- /**
283
- * The SHA3 digest of the ciphertext above.
284
- */
285
- ciphertext_digest: Uint8Array;
286
- /**
287
- * The client's (blockchain wallet) address,
288
- * encoded using EIP-55.
289
- */
290
- client_address: string;
291
- /**
292
- * Encoding of the user's public encryption key for this request.
293
- * Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
294
- * Montgomery point.
295
- */
296
- enc_key: Uint8Array;
297
- /**
298
- * The type of plaintext encrypted.
299
- */
198
+ }
199
+ export class TypedCiphertext {
200
+ private constructor();
201
+ free(): void;
202
+ /**
203
+ * The actual ciphertext to decrypt, taken directly from fhevm.
204
+ */
205
+ ciphertext: Uint8Array;
206
+ /**
207
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
208
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
209
+ */
300
210
  fhe_type: number;
301
- /**
302
- * The key id to use for decryption. Will be the request_id used during key
303
- * generation
304
- */
305
- key_id?: RequestId;
306
- /**
307
- * Version of the request format.
308
- */
309
- version: number;
211
+ /**
212
+ * The external handle of the ciphertext (the handle used in the copro).
213
+ */
214
+ external_handle: Uint8Array;
215
+ /**
216
+ * The ciphertext format, see CiphertextFormat documentation for details.
217
+ * CiphertextFormat::default() is used if unspecified.
218
+ */
219
+ ciphertext_format: number;
310
220
  }
311
- export class ReencryptionResponse {
221
+ export class TypedPlaintext {
222
+ private constructor();
312
223
  free(): void;
313
- /**
314
- * Signature of the serialization of \[ReencryptionResponsePayload\].
315
- */
316
- payload?: ReencryptionResponsePayload;
317
- signature: Uint8Array;
224
+ /**
225
+ * The actual plaintext in bytes.
226
+ */
227
+ bytes: Uint8Array;
228
+ /**
229
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
230
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
231
+ */
232
+ fhe_type: number;
318
233
  }
319
- export class ReencryptionResponsePayload {
234
+ export class TypedSigncryptedCiphertext {
235
+ private constructor();
320
236
  free(): void;
321
- /**
322
- * The degree of the sharing scheme used.
323
- */
324
- degree: number;
325
- /**
326
- * The concatenation of two digests:
327
- * (eip712_signing_hash(pk, domain) || ciphertext digest).
328
- * This is needed to ensure the response corresponds to the request.
329
- */
330
- digest: Uint8Array;
331
- /**
332
- * The type of plaintext encrypted.
333
- */
237
+ /**
238
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
239
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
240
+ */
334
241
  fhe_type: number;
335
- /**
336
- * The ID of the MPC party doing the reencryption. Used for polynomial
337
- * reconstruction.
338
- */
339
- party_id: number;
340
- /**
341
- * The signcrypted payload, using a hybrid encryption approach in
342
- * sign-then-encrypt.
343
- */
242
+ /**
243
+ * The signcrypted payload, using a hybrid encryption approach in
244
+ * sign-then-encrypt.
245
+ */
344
246
  signcrypted_ciphertext: Uint8Array;
345
- /**
346
- * The server's signature verification key.
347
- * Encoded using SEC1.
348
- * Needed to validate the response, but MUST also be linked to a list of
349
- * trusted keys.
350
- */
351
- verification_key: Uint8Array;
352
- /**
353
- * Version of the response format.
354
- */
355
- version: number;
247
+ /**
248
+ * The external handles that were originally in the request.
249
+ */
250
+ external_handle: Uint8Array;
251
+ /**
252
+ * The packing factor determines whether the decrypted plaintext
253
+ * has a different way of packing compared to what is specified in the plaintext modulus.
254
+ */
255
+ packing_factor: number;
356
256
  }
357
- /**
358
- * Simple response to return an ID, to be used to retrieve the computed result
359
- * later on.
360
- */
361
- export class RequestId {
257
+ export class UserDecryptionRequest {
258
+ private constructor();
362
259
  free(): void;
363
- request_id: string;
260
+ /**
261
+ * The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
262
+ * prefix. Future queries for the result must use this request ID.
263
+ */
264
+ get request_id(): RequestId | undefined;
265
+ /**
266
+ * The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
267
+ * prefix. Future queries for the result must use this request ID.
268
+ */
269
+ set request_id(value: RequestId | null | undefined);
270
+ /**
271
+ * The list of ciphertexts to decrypt for the user.
272
+ */
273
+ typed_ciphertexts: TypedCiphertext[];
274
+ /**
275
+ * The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
276
+ * used for key generation
277
+ */
278
+ get key_id(): RequestId | undefined;
279
+ /**
280
+ * The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
281
+ * used for key generation
282
+ */
283
+ set key_id(value: RequestId | null | undefined);
284
+ /**
285
+ * The client's (blockchain wallet) address, encoded using EIP-55. I.e. including `0x`.
286
+ */
287
+ client_address: string;
288
+ /**
289
+ * Encoding of the user's public encryption key for this request.
290
+ * This must be a bincode (v.1) encoded ML-KEM 512 key.
291
+ */
292
+ enc_key: Uint8Array;
293
+ /**
294
+ * The user's EIP712 domain. This MUST be present. Furthermore, the `verifying_contract` MUST be set and be distinct from `client_address`.
295
+ */
296
+ get domain(): Eip712DomainMsg | undefined;
297
+ /**
298
+ * The user's EIP712 domain. This MUST be present. Furthermore, the `verifying_contract` MUST be set and be distinct from `client_address`.
299
+ */
300
+ set domain(value: Eip712DomainMsg | null | undefined);
301
+ }
302
+ export class UserDecryptionResponse {
303
+ private constructor();
304
+ free(): void;
305
+ signature: Uint8Array;
306
+ /**
307
+ * This is the external signature created from the Eip712 domain
308
+ * on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
309
+ * struct UserDecryptResponseVerification {
310
+ * bytes publicKey;
311
+ * uint256\[\] ctHandles;
312
+ * bytes userDecryptedShare;
313
+ * }
314
+ */
315
+ external_signature: Uint8Array;
316
+ /**
317
+ * The actual \[UserDecryptionResponsePayload\].
318
+ */
319
+ get payload(): UserDecryptionResponsePayload | undefined;
320
+ /**
321
+ * The actual \[UserDecryptionResponsePayload\].
322
+ */
323
+ set payload(value: UserDecryptionResponsePayload | null | undefined);
324
+ }
325
+ export class UserDecryptionResponsePayload {
326
+ private constructor();
327
+ free(): void;
328
+ /**
329
+ * The server's signature verification key, Encoded using SEC1.
330
+ * Needed to validate the response, but MUST also be linked to a list of
331
+ * trusted keys.
332
+ */
333
+ verification_key: Uint8Array;
334
+ /**
335
+ * This is needed to ensure the response corresponds to the request.
336
+ * It is the digest of UserDecryptionLinker hashed using EIP712
337
+ * under the given domain in the request.
338
+ */
339
+ digest: Uint8Array;
340
+ /**
341
+ * The resulting signcrypted ciphertexts, each ciphertext
342
+ * must be decrypted and then reconstructed with the other shares
343
+ * to produce the final plaintext.
344
+ */
345
+ signcrypted_ciphertexts: TypedSigncryptedCiphertext[];
346
+ /**
347
+ * The ID of the MPC party doing the user decryption. Used for polynomial
348
+ * reconstruction.
349
+ */
350
+ party_id: number;
351
+ /**
352
+ * The degree of the sharing scheme used.
353
+ */
354
+ degree: number;
364
355
  }
365
356
 
366
357
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
@@ -368,96 +359,110 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
368
359
  export interface InitOutput {
369
360
  readonly memory: WebAssembly.Memory;
370
361
  readonly __wbg_client_free: (a: number, b: number) => void;
371
- readonly __wbg_parsedreencryptionrequest_free: (a: number, b: number) => void;
372
- readonly public_sig_key_to_u8vec: (a: number) => Array;
373
- readonly u8vec_to_public_sig_key: (a: number, b: number) => Array;
374
- readonly private_sig_key_to_u8vec: (a: number) => Array;
375
- readonly u8vec_to_private_sig_key: (a: number, b: number) => Array;
376
- readonly new_client: (a: number, b: number, c: number, d: number, e: number, f: number) => Array;
377
- readonly get_server_addrs: (a: number) => Array;
362
+ readonly __wbg_ciphertexthandle_free: (a: number, b: number) => void;
363
+ readonly __wbg_parseduserdecryptionrequest_free: (a: number, b: number) => void;
364
+ readonly __wbg_publicsigkey_free: (a: number, b: number) => void;
365
+ readonly __wbg_privatesigkey_free: (a: number, b: number) => void;
366
+ readonly __wbg_privateenckeymlkem512_free: (a: number, b: number) => void;
367
+ readonly __wbg_publicenckeymlkem512_free: (a: number, b: number) => void;
368
+ readonly ml_kem_pke_pk_len: () => number;
369
+ readonly ml_kem_pke_sk_len: () => number;
370
+ readonly public_sig_key_to_u8vec: (a: number) => [number, number];
371
+ readonly u8vec_to_public_sig_key: (a: number, b: number) => [number, number, number];
372
+ readonly private_sig_key_to_u8vec: (a: number) => [number, number, number, number];
373
+ readonly u8vec_to_private_sig_key: (a: number, b: number) => [number, number, number];
374
+ readonly __wbg_serveridaddr_free: (a: number, b: number) => void;
375
+ readonly new_server_id_addr: (a: number, b: number, c: number) => [number, number, number];
376
+ readonly new_client: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
377
+ readonly get_server_addrs: (a: number) => [number, number];
378
378
  readonly get_client_secret_key: (a: number) => number;
379
- readonly get_client_address: (a: number) => Array;
380
- readonly __wbg_cryptoboxct_free: (a: number, b: number) => void;
381
- readonly cryptobox_keygen: () => number;
382
- readonly cryptobox_get_pk: (a: number) => number;
383
- readonly cryptobox_pk_to_u8vec: (a: number) => Array;
384
- readonly cryptobox_sk_to_u8vec: (a: number) => Array;
385
- readonly u8vec_to_cryptobox_pk: (a: number, b: number) => Array;
386
- readonly u8vec_to_cryptobox_sk: (a: number, b: number) => Array;
387
- readonly cryptobox_encrypt: (a: number, b: number, c: number, d: number) => number;
388
- readonly cryptobox_decrypt: (a: number, b: number, c: number) => Array;
389
- readonly process_reencryption_resp_from_js: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => Array;
390
- readonly process_reencryption_resp: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => Array;
379
+ readonly get_client_address: (a: number) => [number, number];
380
+ readonly ml_kem_pke_keygen: () => number;
381
+ readonly ml_kem_pke_get_pk: (a: number) => number;
382
+ readonly ml_kem_pke_pk_to_u8vec: (a: number) => [number, number, number, number];
383
+ readonly ml_kem_pke_sk_to_u8vec: (a: number) => [number, number, number, number];
384
+ readonly u8vec_to_ml_kem_pke_pk: (a: number, b: number) => [number, number, number];
385
+ readonly u8vec_to_ml_kem_pke_sk: (a: number, b: number) => [number, number, number];
386
+ readonly ml_kem_pke_encrypt: (a: number, b: number, c: number) => [number, number];
387
+ readonly ml_kem_pke_decrypt: (a: number, b: number, c: number) => [number, number];
388
+ 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];
389
+ 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];
391
390
  readonly __wbg_requestid_free: (a: number, b: number) => void;
392
- readonly __wbg_reencryptionrequestpayload_free: (a: number, b: number) => void;
393
- readonly __wbg_get_reencryptionrequestpayload_version: (a: number) => number;
394
- readonly __wbg_set_reencryptionrequestpayload_version: (a: number, b: number) => void;
395
- readonly __wbg_get_reencryptionrequestpayload_enc_key: (a: number) => Array;
396
- readonly __wbg_get_reencryptionrequestpayload_fhe_type: (a: number) => number;
397
- readonly __wbg_set_reencryptionrequestpayload_fhe_type: (a: number, b: number) => void;
398
- readonly __wbg_get_reencryptionrequestpayload_key_id: (a: number) => number;
399
- readonly __wbg_set_reencryptionrequestpayload_key_id: (a: number, b: number) => void;
391
+ readonly __wbg_typedciphertext_free: (a: number, b: number) => void;
392
+ readonly __wbg_get_typedciphertext_ciphertext: (a: number) => [number, number];
393
+ readonly __wbg_get_typedciphertext_fhe_type: (a: number) => number;
394
+ readonly __wbg_set_typedciphertext_fhe_type: (a: number, b: number) => void;
395
+ readonly __wbg_get_typedciphertext_external_handle: (a: number) => [number, number];
396
+ readonly __wbg_get_typedciphertext_ciphertext_format: (a: number) => number;
397
+ readonly __wbg_set_typedciphertext_ciphertext_format: (a: number, b: number) => void;
400
398
  readonly __wbg_eip712domainmsg_free: (a: number, b: number) => void;
401
- readonly __wbg_get_eip712domainmsg_name: (a: number) => Array;
399
+ readonly __wbg_get_eip712domainmsg_name: (a: number) => [number, number];
402
400
  readonly __wbg_set_eip712domainmsg_name: (a: number, b: number, c: number) => void;
403
- readonly __wbg_get_eip712domainmsg_version: (a: number) => Array;
401
+ readonly __wbg_get_eip712domainmsg_version: (a: number) => [number, number];
404
402
  readonly __wbg_set_eip712domainmsg_version: (a: number, b: number, c: number) => void;
405
- readonly __wbg_get_eip712domainmsg_chain_id: (a: number) => Array;
403
+ readonly __wbg_get_eip712domainmsg_chain_id: (a: number) => [number, number];
406
404
  readonly __wbg_set_eip712domainmsg_chain_id: (a: number, b: number, c: number) => void;
407
- readonly __wbg_get_eip712domainmsg_verifying_contract: (a: number) => Array;
405
+ readonly __wbg_get_eip712domainmsg_verifying_contract: (a: number) => [number, number];
408
406
  readonly __wbg_set_eip712domainmsg_verifying_contract: (a: number, b: number, c: number) => void;
409
- readonly __wbg_get_eip712domainmsg_salt: (a: number) => Array;
407
+ readonly __wbg_get_eip712domainmsg_salt: (a: number) => [number, number];
410
408
  readonly __wbg_set_eip712domainmsg_salt: (a: number, b: number, c: number) => void;
411
- readonly __wbg_reencryptionrequest_free: (a: number, b: number) => void;
412
- readonly __wbg_get_reencryptionrequest_signature: (a: number) => Array;
413
- readonly __wbg_get_reencryptionrequest_payload: (a: number) => number;
414
- readonly __wbg_set_reencryptionrequest_payload: (a: number, b: number) => void;
415
- readonly __wbg_get_reencryptionrequest_domain: (a: number) => number;
416
- readonly __wbg_set_reencryptionrequest_domain: (a: number, b: number) => void;
417
- readonly __wbg_get_reencryptionrequest_request_id: (a: number) => number;
418
- readonly __wbg_set_reencryptionrequest_request_id: (a: number, b: number) => void;
419
- readonly __wbg_reencryptionresponse_free: (a: number, b: number) => void;
420
- readonly __wbg_get_reencryptionresponse_payload: (a: number) => number;
421
- readonly __wbg_set_reencryptionresponse_payload: (a: number, b: number) => void;
422
- readonly __wbg_reencryptionresponsepayload_free: (a: number, b: number) => void;
423
- readonly __wbg_get_reencryptionresponsepayload_version: (a: number) => number;
424
- readonly __wbg_set_reencryptionresponsepayload_version: (a: number, b: number) => void;
425
- readonly __wbg_get_reencryptionresponsepayload_fhe_type: (a: number) => number;
426
- readonly __wbg_set_reencryptionresponsepayload_fhe_type: (a: number, b: number) => void;
427
- readonly __wbg_get_reencryptionresponsepayload_party_id: (a: number) => number;
428
- readonly __wbg_set_reencryptionresponsepayload_party_id: (a: number, b: number) => void;
429
- readonly __wbg_get_reencryptionresponsepayload_degree: (a: number) => number;
430
- readonly __wbg_set_reencryptionresponsepayload_degree: (a: number, b: number) => void;
409
+ readonly __wbg_userdecryptionrequest_free: (a: number, b: number) => void;
410
+ readonly __wbg_get_userdecryptionrequest_request_id: (a: number) => number;
411
+ readonly __wbg_set_userdecryptionrequest_request_id: (a: number, b: number) => void;
412
+ readonly __wbg_get_userdecryptionrequest_typed_ciphertexts: (a: number) => [number, number];
413
+ readonly __wbg_set_userdecryptionrequest_typed_ciphertexts: (a: number, b: number, c: number) => void;
414
+ readonly __wbg_get_userdecryptionrequest_key_id: (a: number) => number;
415
+ readonly __wbg_set_userdecryptionrequest_key_id: (a: number, b: number) => void;
416
+ readonly __wbg_get_userdecryptionrequest_domain: (a: number) => number;
417
+ readonly __wbg_set_userdecryptionrequest_domain: (a: number, b: number) => void;
418
+ readonly __wbg_userdecryptionresponse_free: (a: number, b: number) => void;
419
+ readonly __wbg_get_userdecryptionresponse_payload: (a: number) => number;
420
+ readonly __wbg_set_userdecryptionresponse_payload: (a: number, b: number) => void;
421
+ readonly __wbg_userdecryptionresponsepayload_free: (a: number, b: number) => void;
422
+ readonly __wbg_get_userdecryptionresponsepayload_signcrypted_ciphertexts: (a: number) => [number, number];
423
+ readonly __wbg_set_userdecryptionresponsepayload_signcrypted_ciphertexts: (a: number, b: number, c: number) => void;
424
+ readonly __wbg_get_userdecryptionresponsepayload_party_id: (a: number) => number;
425
+ readonly __wbg_set_userdecryptionresponsepayload_party_id: (a: number, b: number) => void;
426
+ readonly __wbg_get_userdecryptionresponsepayload_degree: (a: number) => number;
427
+ readonly __wbg_set_userdecryptionresponsepayload_degree: (a: number, b: number) => void;
428
+ readonly __wbg_typedplaintext_free: (a: number, b: number) => void;
429
+ readonly __wbg_get_typedplaintext_fhe_type: (a: number) => number;
430
+ readonly __wbg_set_typedplaintext_fhe_type: (a: number, b: number) => void;
431
+ readonly __wbg_typedsigncryptedciphertext_free: (a: number, b: number) => void;
432
+ readonly __wbg_set_typedciphertext_ciphertext: (a: number, b: number, c: number) => void;
431
433
  readonly __wbg_set_requestid_request_id: (a: number, b: number, c: number) => void;
432
- readonly __wbg_set_reencryptionrequestpayload_client_address: (a: number, b: number, c: number) => void;
433
- readonly __wbg_set_reencryptionrequestpayload_enc_key: (a: number, b: number, c: number) => void;
434
- readonly __wbg_set_reencryptionrequestpayload_ciphertext_digest: (a: number, b: number, c: number) => void;
435
- readonly __wbg_set_reencryptionrequest_signature: (a: number, b: number, c: number) => void;
436
- readonly __wbg_set_reencryptionresponse_signature: (a: number, b: number, c: number) => void;
437
- readonly __wbg_set_reencryptionresponsepayload_verification_key: (a: number, b: number, c: number) => void;
438
- readonly __wbg_set_reencryptionresponsepayload_digest: (a: number, b: number, c: number) => void;
439
- readonly __wbg_set_reencryptionresponsepayload_signcrypted_ciphertext: (a: number, b: number, c: number) => void;
440
- readonly __wbg_set_reencryptionrequestpayload_ciphertext: (a: number, b: number, c: number) => void;
441
- readonly __wbg_get_reencryptionrequestpayload_ciphertext: (a: number) => Array;
442
- readonly __wbg_get_reencryptionrequestpayload_ciphertext_digest: (a: number) => Array;
443
- readonly __wbg_get_reencryptionresponse_signature: (a: number) => Array;
444
- readonly __wbg_get_reencryptionresponsepayload_verification_key: (a: number) => Array;
445
- readonly __wbg_get_reencryptionresponsepayload_digest: (a: number) => Array;
446
- readonly __wbg_get_reencryptionresponsepayload_signcrypted_ciphertext: (a: number) => Array;
447
- readonly __wbg_get_requestid_request_id: (a: number) => Array;
448
- readonly __wbg_get_reencryptionrequestpayload_client_address: (a: number) => Array;
449
- readonly __wbg_publicenckey_free: (a: number, b: number) => void;
450
- readonly __wbg_privateenckey_free: (a: number, b: number) => void;
451
- readonly __wbg_publicsigkey_free: (a: number, b: number) => void;
452
- readonly __wbg_privatesigkey_free: (a: number, b: number) => void;
434
+ readonly __wbg_set_typedciphertext_external_handle: (a: number, b: number, c: number) => void;
435
+ readonly __wbg_set_userdecryptionrequest_client_address: (a: number, b: number, c: number) => void;
436
+ readonly __wbg_set_userdecryptionrequest_enc_key: (a: number, b: number, c: number) => void;
437
+ readonly __wbg_set_userdecryptionresponse_signature: (a: number, b: number, c: number) => void;
438
+ readonly __wbg_set_userdecryptionresponse_external_signature: (a: number, b: number, c: number) => void;
439
+ readonly __wbg_set_userdecryptionresponsepayload_verification_key: (a: number, b: number, c: number) => void;
440
+ readonly __wbg_set_userdecryptionresponsepayload_digest: (a: number, b: number, c: number) => void;
441
+ readonly __wbg_set_typedplaintext_bytes: (a: number, b: number, c: number) => void;
442
+ readonly __wbg_set_typedsigncryptedciphertext_signcrypted_ciphertext: (a: number, b: number, c: number) => void;
443
+ readonly __wbg_set_typedsigncryptedciphertext_external_handle: (a: number, b: number, c: number) => void;
444
+ readonly __wbg_set_typedsigncryptedciphertext_fhe_type: (a: number, b: number) => void;
445
+ readonly __wbg_set_typedsigncryptedciphertext_packing_factor: (a: number, b: number) => void;
446
+ readonly __wbg_get_typedsigncryptedciphertext_fhe_type: (a: number) => number;
447
+ readonly __wbg_get_typedsigncryptedciphertext_packing_factor: (a: number) => number;
448
+ readonly __wbg_get_requestid_request_id: (a: number) => [number, number];
449
+ readonly __wbg_get_userdecryptionrequest_client_address: (a: number) => [number, number];
450
+ readonly __wbg_get_userdecryptionrequest_enc_key: (a: number) => [number, number];
451
+ readonly __wbg_get_userdecryptionresponse_signature: (a: number) => [number, number];
452
+ readonly __wbg_get_userdecryptionresponse_external_signature: (a: number) => [number, number];
453
+ readonly __wbg_get_userdecryptionresponsepayload_verification_key: (a: number) => [number, number];
454
+ readonly __wbg_get_userdecryptionresponsepayload_digest: (a: number) => [number, number];
455
+ readonly __wbg_get_typedplaintext_bytes: (a: number) => [number, number];
456
+ readonly __wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext: (a: number) => [number, number];
457
+ readonly __wbg_get_typedsigncryptedciphertext_external_handle: (a: number) => [number, number];
453
458
  readonly __wbindgen_malloc: (a: number, b: number) => number;
454
459
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
455
- readonly __wbindgen_export_2: WebAssembly.Table;
460
+ readonly __wbindgen_exn_store: (a: number) => void;
461
+ readonly __externref_table_alloc: () => number;
462
+ readonly __wbindgen_export_4: WebAssembly.Table;
456
463
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
457
464
  readonly __externref_table_dealloc: (a: number) => void;
458
- readonly __externref_table_alloc: () => number;
459
465
  readonly __externref_drop_slice: (a: number, b: number) => void;
460
- readonly __wbindgen_exn_store: (a: number) => void;
461
466
  readonly __wbindgen_start: () => void;
462
467
  }
463
468