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