tkms 0.14.2 → 0.15.0-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 +79 -32
- package/kms_lib.js +240 -74
- package/kms_lib_bg.wasm +0 -0
- package/package.json +2 -2
package/kms_lib.d.ts
CHANGED
|
@@ -97,10 +97,6 @@ export class TypedCiphertext {
|
|
|
97
97
|
* CiphertextFormat::default() is used if unspecified.
|
|
98
98
|
*/
|
|
99
99
|
ciphertext_format: number;
|
|
100
|
-
/**
|
|
101
|
-
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
102
|
-
*/
|
|
103
|
-
ciphertext: Uint8Array;
|
|
104
100
|
/**
|
|
105
101
|
* The external handle of the ciphertext (the handle used in the copro).
|
|
106
102
|
*/
|
|
@@ -110,6 +106,10 @@ export class TypedCiphertext {
|
|
|
110
106
|
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
111
107
|
*/
|
|
112
108
|
fhe_type: number;
|
|
109
|
+
/**
|
|
110
|
+
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
111
|
+
*/
|
|
112
|
+
ciphertext: Uint8Array;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
export class TypedPlaintext {
|
|
@@ -127,6 +127,27 @@ export class TypedPlaintext {
|
|
|
127
127
|
fhe_type: number;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
/**
|
|
131
|
+
* A single signature together with the scheme that produced it.
|
|
132
|
+
*
|
|
133
|
+
* Used to carry a chain-native signature for one signing scheme when a response
|
|
134
|
+
* may be signed under several schemes at once (e.g. ECDSA/secp256k1 EIP-712 for
|
|
135
|
+
* an EVM, ed25519 for Solana, ML-DSA for post-quantum).
|
|
136
|
+
*/
|
|
137
|
+
export class TypedSignature {
|
|
138
|
+
private constructor();
|
|
139
|
+
free(): void;
|
|
140
|
+
[Symbol.dispose](): void;
|
|
141
|
+
/**
|
|
142
|
+
* The signature scheme that produced `signature`.
|
|
143
|
+
*/
|
|
144
|
+
scheme: number;
|
|
145
|
+
/**
|
|
146
|
+
* The raw, scheme-specific signature bytes.
|
|
147
|
+
*/
|
|
148
|
+
signature: Uint8Array;
|
|
149
|
+
}
|
|
150
|
+
|
|
130
151
|
export class TypedSigncryptedCiphertext {
|
|
131
152
|
private constructor();
|
|
132
153
|
free(): void;
|
|
@@ -162,16 +183,12 @@ export class UserDecryptionRequest {
|
|
|
162
183
|
client_address: string;
|
|
163
184
|
/**
|
|
164
185
|
* 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>
|
|
186
|
+
* If unset, the server's default context is used.
|
|
168
187
|
*/
|
|
169
188
|
get context_id(): RequestId | undefined;
|
|
170
189
|
/**
|
|
171
190
|
* 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>
|
|
191
|
+
* If unset, the server's default context is used.
|
|
175
192
|
*/
|
|
176
193
|
set context_id(value: RequestId | null | undefined);
|
|
177
194
|
/**
|
|
@@ -188,11 +205,13 @@ export class UserDecryptionRequest {
|
|
|
188
205
|
*/
|
|
189
206
|
enc_key: Uint8Array;
|
|
190
207
|
/**
|
|
191
|
-
* The epoch
|
|
208
|
+
* The MPC epoch ID identifying which epoch's key material and session to
|
|
209
|
+
* use for this request.
|
|
192
210
|
*/
|
|
193
211
|
get epoch_id(): RequestId | undefined;
|
|
194
212
|
/**
|
|
195
|
-
* The epoch
|
|
213
|
+
* The MPC epoch ID identifying which epoch's key material and session to
|
|
214
|
+
* use for this request.
|
|
196
215
|
*/
|
|
197
216
|
set epoch_id(value: RequestId | null | undefined);
|
|
198
217
|
/**
|
|
@@ -219,6 +238,12 @@ export class UserDecryptionRequest {
|
|
|
219
238
|
* prefix. Future queries for the result must use this request ID.
|
|
220
239
|
*/
|
|
221
240
|
set request_id(value: RequestId | null | undefined);
|
|
241
|
+
/**
|
|
242
|
+
* The signature schemes to include in the response `signatures` field.
|
|
243
|
+
* If empty, it defaults to ECDSA256K1, so the response carries a single ECDSA
|
|
244
|
+
* entry.
|
|
245
|
+
*/
|
|
246
|
+
signing_schemes: Int32Array;
|
|
222
247
|
/**
|
|
223
248
|
* The list of ciphertexts to decrypt for the user.
|
|
224
249
|
*/
|
|
@@ -230,7 +255,7 @@ export class UserDecryptionResponse {
|
|
|
230
255
|
free(): void;
|
|
231
256
|
[Symbol.dispose](): void;
|
|
232
257
|
/**
|
|
233
|
-
* This is the external signature created from the Eip712 domain
|
|
258
|
+
* This is the external ECDSA signature created from the Eip712 domain
|
|
234
259
|
* on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
|
|
235
260
|
* struct UserDecryptResponseVerification {
|
|
236
261
|
* bytes publicKey;
|
|
@@ -238,6 +263,7 @@ export class UserDecryptionResponse {
|
|
|
238
263
|
* bytes userDecryptedShare; // serialization of payload
|
|
239
264
|
* bytes extraData;
|
|
240
265
|
* }
|
|
266
|
+
* DEPRECATED: To be removed in 0.16 TODO(0.16)
|
|
241
267
|
*/
|
|
242
268
|
external_signature: Uint8Array;
|
|
243
269
|
/**
|
|
@@ -252,7 +278,19 @@ export class UserDecryptionResponse {
|
|
|
252
278
|
* The actual \[UserDecryptionResponsePayload\].
|
|
253
279
|
*/
|
|
254
280
|
set payload(value: UserDecryptionResponsePayload | null | undefined);
|
|
281
|
+
/**
|
|
282
|
+
* DEPRECATED to be removed in 0.16.0 TODO(0.16)
|
|
283
|
+
* The KMS-internal ECDSA/secp256k1 authenticity signature over
|
|
284
|
+
* the serialization of \[UserDecryptionResponsePayload\]. Kept at field 1 (and
|
|
285
|
+
* kept populated) for wire backward-compatibility with clients that predate
|
|
286
|
+
* the multi-scheme `signatures` list.
|
|
287
|
+
*/
|
|
255
288
|
signature: Uint8Array;
|
|
289
|
+
/**
|
|
290
|
+
* Per-scheme KMS signatures, one per scheme requested in the request's
|
|
291
|
+
* `signing_schemes`.
|
|
292
|
+
*/
|
|
293
|
+
signatures: TypedSignature[];
|
|
256
294
|
}
|
|
257
295
|
|
|
258
296
|
export class UserDecryptionResponsePayload {
|
|
@@ -423,11 +461,6 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
423
461
|
|
|
424
462
|
export interface InitOutput {
|
|
425
463
|
readonly memory: WebAssembly.Memory;
|
|
426
|
-
readonly __wbg_client_free: (a: number, b: number) => void;
|
|
427
|
-
readonly __wbg_ciphertexthandle_free: (a: number, b: number) => void;
|
|
428
|
-
readonly __wbg_parseduserdecryptionrequest_free: (a: number, b: number) => void;
|
|
429
|
-
readonly __wbg_privatesigkey_free: (a: number, b: number) => void;
|
|
430
|
-
readonly __wbg_publicsigkey_free: (a: number, b: number) => void;
|
|
431
464
|
readonly __wbg_privateenckeymlkem512_free: (a: number, b: number) => void;
|
|
432
465
|
readonly __wbg_publicenckeymlkem512_free: (a: number, b: number) => void;
|
|
433
466
|
readonly __wbg_serveridaddr_free: (a: number, b: number) => void;
|
|
@@ -451,25 +484,33 @@ export interface InitOutput {
|
|
|
451
484
|
readonly u8vec_to_ml_kem_pke_sk: (a: number, b: number) => [number, number, number];
|
|
452
485
|
readonly u8vec_to_private_sig_key: (a: number, b: number) => [number, number, number];
|
|
453
486
|
readonly u8vec_to_public_sig_key: (a: number, b: number) => [number, number, number];
|
|
487
|
+
readonly __wbg_privatesigkey_free: (a: number, b: number) => void;
|
|
488
|
+
readonly __wbg_publicsigkey_free: (a: number, b: number) => void;
|
|
489
|
+
readonly __wbg_ciphertexthandle_free: (a: number, b: number) => void;
|
|
490
|
+
readonly __wbg_parseduserdecryptionrequest_free: (a: number, b: number) => void;
|
|
491
|
+
readonly __wbg_client_free: (a: number, b: number) => void;
|
|
454
492
|
readonly __wbg_eip712domainmsg_free: (a: number, b: number) => void;
|
|
455
493
|
readonly __wbg_get_eip712domainmsg_chain_id: (a: number) => [number, number];
|
|
456
494
|
readonly __wbg_get_eip712domainmsg_name: (a: number) => [number, number];
|
|
457
495
|
readonly __wbg_get_eip712domainmsg_salt: (a: number) => [number, number];
|
|
458
496
|
readonly __wbg_get_eip712domainmsg_verifying_contract: (a: number) => [number, number];
|
|
459
497
|
readonly __wbg_get_eip712domainmsg_version: (a: number) => [number, number];
|
|
460
|
-
readonly __wbg_get_typedciphertext_ciphertext: (a: number) => [number, number];
|
|
461
498
|
readonly __wbg_get_typedciphertext_ciphertext_format: (a: number) => number;
|
|
462
499
|
readonly __wbg_get_typedciphertext_external_handle: (a: number) => [number, number];
|
|
463
500
|
readonly __wbg_get_typedciphertext_fhe_type: (a: number) => number;
|
|
464
501
|
readonly __wbg_get_typedplaintext_fhe_type: (a: number) => number;
|
|
502
|
+
readonly __wbg_get_typedsigncryptedciphertext_external_handle: (a: number) => [number, number];
|
|
503
|
+
readonly __wbg_get_typedsigncryptedciphertext_fhe_type: (a: number) => number;
|
|
465
504
|
readonly __wbg_get_userdecryptionrequest_context_id: (a: number) => number;
|
|
466
505
|
readonly __wbg_get_userdecryptionrequest_domain: (a: number) => number;
|
|
467
506
|
readonly __wbg_get_userdecryptionrequest_epoch_id: (a: number) => number;
|
|
468
507
|
readonly __wbg_get_userdecryptionrequest_extra_data: (a: number) => [number, number];
|
|
469
508
|
readonly __wbg_get_userdecryptionrequest_key_id: (a: number) => number;
|
|
470
509
|
readonly __wbg_get_userdecryptionrequest_request_id: (a: number) => number;
|
|
510
|
+
readonly __wbg_get_userdecryptionrequest_signing_schemes: (a: number) => [number, number];
|
|
471
511
|
readonly __wbg_get_userdecryptionrequest_typed_ciphertexts: (a: number) => [number, number];
|
|
472
512
|
readonly __wbg_get_userdecryptionresponse_payload: (a: number) => number;
|
|
513
|
+
readonly __wbg_get_userdecryptionresponse_signatures: (a: number) => [number, number];
|
|
473
514
|
readonly __wbg_get_userdecryptionresponsepayload_degree: (a: number) => number;
|
|
474
515
|
readonly __wbg_get_userdecryptionresponsepayload_party_id: (a: number) => number;
|
|
475
516
|
readonly __wbg_get_userdecryptionresponsepayload_signcrypted_ciphertexts: (a: number) => [number, number];
|
|
@@ -482,41 +523,36 @@ export interface InitOutput {
|
|
|
482
523
|
readonly __wbg_set_typedciphertext_ciphertext_format: (a: number, b: number) => void;
|
|
483
524
|
readonly __wbg_set_typedciphertext_fhe_type: (a: number, b: number) => void;
|
|
484
525
|
readonly __wbg_set_typedplaintext_fhe_type: (a: number, b: number) => void;
|
|
526
|
+
readonly __wbg_set_typedsigncryptedciphertext_fhe_type: (a: number, b: number) => void;
|
|
485
527
|
readonly __wbg_set_userdecryptionrequest_context_id: (a: number, b: number) => void;
|
|
486
528
|
readonly __wbg_set_userdecryptionrequest_domain: (a: number, b: number) => void;
|
|
487
529
|
readonly __wbg_set_userdecryptionrequest_epoch_id: (a: number, b: number) => void;
|
|
488
530
|
readonly __wbg_set_userdecryptionrequest_key_id: (a: number, b: number) => void;
|
|
489
531
|
readonly __wbg_set_userdecryptionrequest_request_id: (a: number, b: number) => void;
|
|
532
|
+
readonly __wbg_set_userdecryptionrequest_signing_schemes: (a: number, b: number, c: number) => void;
|
|
490
533
|
readonly __wbg_set_userdecryptionrequest_typed_ciphertexts: (a: number, b: number, c: number) => void;
|
|
491
534
|
readonly __wbg_set_userdecryptionresponse_payload: (a: number, b: number) => void;
|
|
535
|
+
readonly __wbg_set_userdecryptionresponse_signatures: (a: number, b: number, c: number) => void;
|
|
492
536
|
readonly __wbg_set_userdecryptionresponsepayload_degree: (a: number, b: number) => void;
|
|
493
537
|
readonly __wbg_set_userdecryptionresponsepayload_party_id: (a: number, b: number) => void;
|
|
494
538
|
readonly __wbg_set_userdecryptionresponsepayload_signcrypted_ciphertexts: (a: number, b: number, c: number) => void;
|
|
495
539
|
readonly __wbg_typedciphertext_free: (a: number, b: number) => void;
|
|
496
540
|
readonly __wbg_typedplaintext_free: (a: number, b: number) => void;
|
|
541
|
+
readonly __wbg_typedsignature_free: (a: number, b: number) => void;
|
|
497
542
|
readonly __wbg_typedsigncryptedciphertext_free: (a: number, b: number) => void;
|
|
498
543
|
readonly __wbg_userdecryptionrequest_free: (a: number, b: number) => void;
|
|
499
544
|
readonly __wbg_userdecryptionresponse_free: (a: number, b: number) => void;
|
|
500
545
|
readonly __wbg_userdecryptionresponsepayload_free: (a: number, b: number) => void;
|
|
501
546
|
readonly __wbg_get_requestid_request_id: (a: number) => [number, number];
|
|
502
547
|
readonly __wbg_get_userdecryptionrequest_client_address: (a: number) => [number, number];
|
|
503
|
-
readonly
|
|
504
|
-
readonly __wbg_set_typedsigncryptedciphertext_packing_factor: (a: number, b: number) => void;
|
|
505
|
-
readonly __wbg_get_typedsigncryptedciphertext_fhe_type: (a: number) => number;
|
|
548
|
+
readonly __wbg_get_typedsignature_scheme: (a: number) => number;
|
|
506
549
|
readonly __wbg_get_typedsigncryptedciphertext_packing_factor: (a: number) => number;
|
|
507
|
-
readonly
|
|
508
|
-
readonly
|
|
509
|
-
readonly __wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext: (a: number) => [number, number];
|
|
510
|
-
readonly __wbg_get_userdecryptionrequest_enc_key: (a: number) => [number, number];
|
|
511
|
-
readonly __wbg_get_userdecryptionresponse_external_signature: (a: number) => [number, number];
|
|
512
|
-
readonly __wbg_get_userdecryptionresponse_extra_data: (a: number) => [number, number];
|
|
513
|
-
readonly __wbg_get_userdecryptionresponse_signature: (a: number) => [number, number];
|
|
514
|
-
readonly __wbg_get_userdecryptionresponsepayload_digest: (a: number) => [number, number];
|
|
515
|
-
readonly __wbg_get_userdecryptionresponsepayload_verification_key: (a: number) => [number, number];
|
|
550
|
+
readonly __wbg_set_typedsignature_scheme: (a: number, b: number) => void;
|
|
551
|
+
readonly __wbg_set_typedsigncryptedciphertext_packing_factor: (a: number, b: number) => void;
|
|
516
552
|
readonly __wbg_set_requestid_request_id: (a: number, b: number, c: number) => void;
|
|
517
|
-
readonly __wbg_set_typedciphertext_ciphertext: (a: number, b: number, c: number) => void;
|
|
518
553
|
readonly __wbg_set_typedciphertext_external_handle: (a: number, b: number, c: number) => void;
|
|
519
554
|
readonly __wbg_set_typedplaintext_bytes: (a: number, b: number, c: number) => void;
|
|
555
|
+
readonly __wbg_set_typedsignature_signature: (a: number, b: number, c: number) => void;
|
|
520
556
|
readonly __wbg_set_typedsigncryptedciphertext_external_handle: (a: number, b: number, c: number) => void;
|
|
521
557
|
readonly __wbg_set_typedsigncryptedciphertext_signcrypted_ciphertext: (a: number, b: number, c: number) => void;
|
|
522
558
|
readonly __wbg_set_userdecryptionrequest_client_address: (a: number, b: number, c: number) => void;
|
|
@@ -527,6 +563,17 @@ export interface InitOutput {
|
|
|
527
563
|
readonly __wbg_set_userdecryptionresponse_signature: (a: number, b: number, c: number) => void;
|
|
528
564
|
readonly __wbg_set_userdecryptionresponsepayload_digest: (a: number, b: number, c: number) => void;
|
|
529
565
|
readonly __wbg_set_userdecryptionresponsepayload_verification_key: (a: number, b: number, c: number) => void;
|
|
566
|
+
readonly __wbg_get_typedplaintext_bytes: (a: number) => [number, number];
|
|
567
|
+
readonly __wbg_get_typedsignature_signature: (a: number) => [number, number];
|
|
568
|
+
readonly __wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext: (a: number) => [number, number];
|
|
569
|
+
readonly __wbg_get_userdecryptionrequest_enc_key: (a: number) => [number, number];
|
|
570
|
+
readonly __wbg_get_userdecryptionresponse_external_signature: (a: number) => [number, number];
|
|
571
|
+
readonly __wbg_get_userdecryptionresponse_extra_data: (a: number) => [number, number];
|
|
572
|
+
readonly __wbg_get_userdecryptionresponse_signature: (a: number) => [number, number];
|
|
573
|
+
readonly __wbg_get_userdecryptionresponsepayload_digest: (a: number) => [number, number];
|
|
574
|
+
readonly __wbg_get_userdecryptionresponsepayload_verification_key: (a: number) => [number, number];
|
|
575
|
+
readonly typedciphertext_ciphertext: (a: number) => [number, number];
|
|
576
|
+
readonly typedciphertext_set_ciphertext: (a: number, b: number, c: number) => void;
|
|
530
577
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
531
578
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
532
579
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/kms_lib.js
CHANGED
|
@@ -375,16 +375,6 @@ export class TypedCiphertext {
|
|
|
375
375
|
const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
|
|
376
376
|
return ret;
|
|
377
377
|
}
|
|
378
|
-
/**
|
|
379
|
-
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
380
|
-
* @returns {Uint8Array}
|
|
381
|
-
*/
|
|
382
|
-
get ciphertext() {
|
|
383
|
-
const ret = wasm.__wbg_get_typedciphertext_ciphertext(this.__wbg_ptr);
|
|
384
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
385
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
386
|
-
return v1;
|
|
387
|
-
}
|
|
388
378
|
/**
|
|
389
379
|
* The external handle of the ciphertext (the handle used in the copro).
|
|
390
380
|
* @returns {Uint8Array}
|
|
@@ -412,15 +402,6 @@ export class TypedCiphertext {
|
|
|
412
402
|
set ciphertext_format(arg0) {
|
|
413
403
|
wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
|
|
414
404
|
}
|
|
415
|
-
/**
|
|
416
|
-
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
417
|
-
* @param {Uint8Array} arg0
|
|
418
|
-
*/
|
|
419
|
-
set ciphertext(arg0) {
|
|
420
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
421
|
-
const len0 = WASM_VECTOR_LEN;
|
|
422
|
-
wasm.__wbg_set_typedciphertext_ciphertext(this.__wbg_ptr, ptr0, len0);
|
|
423
|
-
}
|
|
424
405
|
/**
|
|
425
406
|
* The external handle of the ciphertext (the handle used in the copro).
|
|
426
407
|
* @param {Uint8Array} arg0
|
|
@@ -438,6 +419,25 @@ export class TypedCiphertext {
|
|
|
438
419
|
set fhe_type(arg0) {
|
|
439
420
|
wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
|
|
440
421
|
}
|
|
422
|
+
/**
|
|
423
|
+
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
424
|
+
* @returns {Uint8Array}
|
|
425
|
+
*/
|
|
426
|
+
get ciphertext() {
|
|
427
|
+
const ret = wasm.typedciphertext_ciphertext(this.__wbg_ptr);
|
|
428
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
429
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
430
|
+
return v1;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Replaces the ciphertext bytes.
|
|
434
|
+
* @param {Uint8Array} ciphertext
|
|
435
|
+
*/
|
|
436
|
+
set ciphertext(ciphertext) {
|
|
437
|
+
const ptr0 = passArray8ToWasm0(ciphertext, wasm.__wbindgen_malloc);
|
|
438
|
+
const len0 = WASM_VECTOR_LEN;
|
|
439
|
+
wasm.typedciphertext_set_ciphertext(this.__wbg_ptr, ptr0, len0);
|
|
440
|
+
}
|
|
441
441
|
}
|
|
442
442
|
if (Symbol.dispose) TypedCiphertext.prototype[Symbol.dispose] = TypedCiphertext.prototype.free;
|
|
443
443
|
|
|
@@ -497,6 +497,73 @@ export class TypedPlaintext {
|
|
|
497
497
|
}
|
|
498
498
|
if (Symbol.dispose) TypedPlaintext.prototype[Symbol.dispose] = TypedPlaintext.prototype.free;
|
|
499
499
|
|
|
500
|
+
/**
|
|
501
|
+
* A single signature together with the scheme that produced it.
|
|
502
|
+
*
|
|
503
|
+
* Used to carry a chain-native signature for one signing scheme when a response
|
|
504
|
+
* may be signed under several schemes at once (e.g. ECDSA/secp256k1 EIP-712 for
|
|
505
|
+
* an EVM, ed25519 for Solana, ML-DSA for post-quantum).
|
|
506
|
+
*/
|
|
507
|
+
export class TypedSignature {
|
|
508
|
+
static __wrap(ptr) {
|
|
509
|
+
const obj = Object.create(TypedSignature.prototype);
|
|
510
|
+
obj.__wbg_ptr = ptr;
|
|
511
|
+
TypedSignatureFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
512
|
+
return obj;
|
|
513
|
+
}
|
|
514
|
+
static __unwrap(jsValue) {
|
|
515
|
+
if (!(jsValue instanceof TypedSignature)) {
|
|
516
|
+
return 0;
|
|
517
|
+
}
|
|
518
|
+
return jsValue.__destroy_into_raw();
|
|
519
|
+
}
|
|
520
|
+
__destroy_into_raw() {
|
|
521
|
+
const ptr = this.__wbg_ptr;
|
|
522
|
+
this.__wbg_ptr = 0;
|
|
523
|
+
TypedSignatureFinalization.unregister(this);
|
|
524
|
+
return ptr;
|
|
525
|
+
}
|
|
526
|
+
free() {
|
|
527
|
+
const ptr = this.__destroy_into_raw();
|
|
528
|
+
wasm.__wbg_typedsignature_free(ptr, 0);
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* The signature scheme that produced `signature`.
|
|
532
|
+
* @returns {number}
|
|
533
|
+
*/
|
|
534
|
+
get scheme() {
|
|
535
|
+
const ret = wasm.__wbg_get_typedsignature_scheme(this.__wbg_ptr);
|
|
536
|
+
return ret;
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* The raw, scheme-specific signature bytes.
|
|
540
|
+
* @returns {Uint8Array}
|
|
541
|
+
*/
|
|
542
|
+
get signature() {
|
|
543
|
+
const ret = wasm.__wbg_get_typedsignature_signature(this.__wbg_ptr);
|
|
544
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
545
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
546
|
+
return v1;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* The signature scheme that produced `signature`.
|
|
550
|
+
* @param {number} arg0
|
|
551
|
+
*/
|
|
552
|
+
set scheme(arg0) {
|
|
553
|
+
wasm.__wbg_set_typedsignature_scheme(this.__wbg_ptr, arg0);
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* The raw, scheme-specific signature bytes.
|
|
557
|
+
* @param {Uint8Array} arg0
|
|
558
|
+
*/
|
|
559
|
+
set signature(arg0) {
|
|
560
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
561
|
+
const len0 = WASM_VECTOR_LEN;
|
|
562
|
+
wasm.__wbg_set_typedsignature_signature(this.__wbg_ptr, ptr0, len0);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
if (Symbol.dispose) TypedSignature.prototype[Symbol.dispose] = TypedSignature.prototype.free;
|
|
566
|
+
|
|
500
567
|
export class TypedSigncryptedCiphertext {
|
|
501
568
|
static __wrap(ptr) {
|
|
502
569
|
const obj = Object.create(TypedSigncryptedCiphertext.prototype);
|
|
@@ -626,9 +693,7 @@ export class UserDecryptionRequest {
|
|
|
626
693
|
}
|
|
627
694
|
/**
|
|
628
695
|
* MPC context ID which is used to identify the context to use for this request.
|
|
629
|
-
*
|
|
630
|
-
* NOTE: at the moment this can be None since we do not fully support multiple contexts.
|
|
631
|
-
* See <https://github.com/zama-ai/kms-internal/issues/2530>
|
|
696
|
+
* If unset, the server's default context is used.
|
|
632
697
|
* @returns {RequestId | undefined}
|
|
633
698
|
*/
|
|
634
699
|
get context_id() {
|
|
@@ -655,7 +720,8 @@ export class UserDecryptionRequest {
|
|
|
655
720
|
return v1;
|
|
656
721
|
}
|
|
657
722
|
/**
|
|
658
|
-
* The epoch
|
|
723
|
+
* The MPC epoch ID identifying which epoch's key material and session to
|
|
724
|
+
* use for this request.
|
|
659
725
|
* @returns {RequestId | undefined}
|
|
660
726
|
*/
|
|
661
727
|
get epoch_id() {
|
|
@@ -690,13 +756,25 @@ export class UserDecryptionRequest {
|
|
|
690
756
|
const ret = wasm.__wbg_get_userdecryptionrequest_request_id(this.__wbg_ptr);
|
|
691
757
|
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
692
758
|
}
|
|
759
|
+
/**
|
|
760
|
+
* The signature schemes to include in the response `signatures` field.
|
|
761
|
+
* If empty, it defaults to ECDSA256K1, so the response carries a single ECDSA
|
|
762
|
+
* entry.
|
|
763
|
+
* @returns {Int32Array}
|
|
764
|
+
*/
|
|
765
|
+
get signing_schemes() {
|
|
766
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_signing_schemes(this.__wbg_ptr);
|
|
767
|
+
var v1 = getArrayI32FromWasm0(ret[0], ret[1]).slice();
|
|
768
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
769
|
+
return v1;
|
|
770
|
+
}
|
|
693
771
|
/**
|
|
694
772
|
* The list of ciphertexts to decrypt for the user.
|
|
695
773
|
* @returns {TypedCiphertext[]}
|
|
696
774
|
*/
|
|
697
775
|
get typed_ciphertexts() {
|
|
698
776
|
const ret = wasm.__wbg_get_userdecryptionrequest_typed_ciphertexts(this.__wbg_ptr);
|
|
699
|
-
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1])
|
|
777
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]);
|
|
700
778
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
701
779
|
return v1;
|
|
702
780
|
}
|
|
@@ -711,9 +789,7 @@ export class UserDecryptionRequest {
|
|
|
711
789
|
}
|
|
712
790
|
/**
|
|
713
791
|
* MPC context ID which is used to identify the context to use for this request.
|
|
714
|
-
*
|
|
715
|
-
* NOTE: at the moment this can be None since we do not fully support multiple contexts.
|
|
716
|
-
* See <https://github.com/zama-ai/kms-internal/issues/2530>
|
|
792
|
+
* If unset, the server's default context is used.
|
|
717
793
|
* @param {RequestId | null} [arg0]
|
|
718
794
|
*/
|
|
719
795
|
set context_id(arg0) {
|
|
@@ -747,7 +823,8 @@ export class UserDecryptionRequest {
|
|
|
747
823
|
wasm.__wbg_set_userdecryptionrequest_enc_key(this.__wbg_ptr, ptr0, len0);
|
|
748
824
|
}
|
|
749
825
|
/**
|
|
750
|
-
* The epoch
|
|
826
|
+
* The MPC epoch ID identifying which epoch's key material and session to
|
|
827
|
+
* use for this request.
|
|
751
828
|
* @param {RequestId | null} [arg0]
|
|
752
829
|
*/
|
|
753
830
|
set epoch_id(arg0) {
|
|
@@ -793,6 +870,17 @@ export class UserDecryptionRequest {
|
|
|
793
870
|
}
|
|
794
871
|
wasm.__wbg_set_userdecryptionrequest_request_id(this.__wbg_ptr, ptr0);
|
|
795
872
|
}
|
|
873
|
+
/**
|
|
874
|
+
* The signature schemes to include in the response `signatures` field.
|
|
875
|
+
* If empty, it defaults to ECDSA256K1, so the response carries a single ECDSA
|
|
876
|
+
* entry.
|
|
877
|
+
* @param {Int32Array} arg0
|
|
878
|
+
*/
|
|
879
|
+
set signing_schemes(arg0) {
|
|
880
|
+
const ptr0 = passArray32ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
881
|
+
const len0 = WASM_VECTOR_LEN;
|
|
882
|
+
wasm.__wbg_set_userdecryptionrequest_signing_schemes(this.__wbg_ptr, ptr0, len0);
|
|
883
|
+
}
|
|
796
884
|
/**
|
|
797
885
|
* The list of ciphertexts to decrypt for the user.
|
|
798
886
|
* @param {TypedCiphertext[]} arg0
|
|
@@ -817,7 +905,7 @@ export class UserDecryptionResponse {
|
|
|
817
905
|
wasm.__wbg_userdecryptionresponse_free(ptr, 0);
|
|
818
906
|
}
|
|
819
907
|
/**
|
|
820
|
-
* This is the external signature created from the Eip712 domain
|
|
908
|
+
* This is the external ECDSA signature created from the Eip712 domain
|
|
821
909
|
* on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
|
|
822
910
|
* struct UserDecryptResponseVerification {
|
|
823
911
|
* bytes publicKey;
|
|
@@ -825,6 +913,7 @@ export class UserDecryptionResponse {
|
|
|
825
913
|
* bytes userDecryptedShare; // serialization of payload
|
|
826
914
|
* bytes extraData;
|
|
827
915
|
* }
|
|
916
|
+
* DEPRECATED: To be removed in 0.16 TODO(0.16)
|
|
828
917
|
* @returns {Uint8Array}
|
|
829
918
|
*/
|
|
830
919
|
get external_signature() {
|
|
@@ -852,6 +941,11 @@ export class UserDecryptionResponse {
|
|
|
852
941
|
return ret === 0 ? undefined : UserDecryptionResponsePayload.__wrap(ret);
|
|
853
942
|
}
|
|
854
943
|
/**
|
|
944
|
+
* DEPRECATED to be removed in 0.16.0 TODO(0.16)
|
|
945
|
+
* The KMS-internal ECDSA/secp256k1 authenticity signature over
|
|
946
|
+
* the serialization of \[UserDecryptionResponsePayload\]. Kept at field 1 (and
|
|
947
|
+
* kept populated) for wire backward-compatibility with clients that predate
|
|
948
|
+
* the multi-scheme `signatures` list.
|
|
855
949
|
* @returns {Uint8Array}
|
|
856
950
|
*/
|
|
857
951
|
get signature() {
|
|
@@ -861,7 +955,18 @@ export class UserDecryptionResponse {
|
|
|
861
955
|
return v1;
|
|
862
956
|
}
|
|
863
957
|
/**
|
|
864
|
-
*
|
|
958
|
+
* Per-scheme KMS signatures, one per scheme requested in the request's
|
|
959
|
+
* `signing_schemes`.
|
|
960
|
+
* @returns {TypedSignature[]}
|
|
961
|
+
*/
|
|
962
|
+
get signatures() {
|
|
963
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_signatures(this.__wbg_ptr);
|
|
964
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]);
|
|
965
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
966
|
+
return v1;
|
|
967
|
+
}
|
|
968
|
+
/**
|
|
969
|
+
* This is the external ECDSA signature created from the Eip712 domain
|
|
865
970
|
* on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
|
|
866
971
|
* struct UserDecryptResponseVerification {
|
|
867
972
|
* bytes publicKey;
|
|
@@ -869,6 +974,7 @@ export class UserDecryptionResponse {
|
|
|
869
974
|
* bytes userDecryptedShare; // serialization of payload
|
|
870
975
|
* bytes extraData;
|
|
871
976
|
* }
|
|
977
|
+
* DEPRECATED: To be removed in 0.16 TODO(0.16)
|
|
872
978
|
* @param {Uint8Array} arg0
|
|
873
979
|
*/
|
|
874
980
|
set external_signature(arg0) {
|
|
@@ -898,6 +1004,11 @@ export class UserDecryptionResponse {
|
|
|
898
1004
|
wasm.__wbg_set_userdecryptionresponse_payload(this.__wbg_ptr, ptr0);
|
|
899
1005
|
}
|
|
900
1006
|
/**
|
|
1007
|
+
* DEPRECATED to be removed in 0.16.0 TODO(0.16)
|
|
1008
|
+
* The KMS-internal ECDSA/secp256k1 authenticity signature over
|
|
1009
|
+
* the serialization of \[UserDecryptionResponsePayload\]. Kept at field 1 (and
|
|
1010
|
+
* kept populated) for wire backward-compatibility with clients that predate
|
|
1011
|
+
* the multi-scheme `signatures` list.
|
|
901
1012
|
* @param {Uint8Array} arg0
|
|
902
1013
|
*/
|
|
903
1014
|
set signature(arg0) {
|
|
@@ -905,6 +1016,16 @@ export class UserDecryptionResponse {
|
|
|
905
1016
|
const len0 = WASM_VECTOR_LEN;
|
|
906
1017
|
wasm.__wbg_set_userdecryptionresponse_signature(this.__wbg_ptr, ptr0, len0);
|
|
907
1018
|
}
|
|
1019
|
+
/**
|
|
1020
|
+
* Per-scheme KMS signatures, one per scheme requested in the request's
|
|
1021
|
+
* `signing_schemes`.
|
|
1022
|
+
* @param {TypedSignature[]} arg0
|
|
1023
|
+
*/
|
|
1024
|
+
set signatures(arg0) {
|
|
1025
|
+
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1026
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1027
|
+
wasm.__wbg_set_userdecryptionresponse_signatures(this.__wbg_ptr, ptr0, len0);
|
|
1028
|
+
}
|
|
908
1029
|
}
|
|
909
1030
|
if (Symbol.dispose) UserDecryptionResponse.prototype[Symbol.dispose] = UserDecryptionResponse.prototype.free;
|
|
910
1031
|
|
|
@@ -962,7 +1083,7 @@ export class UserDecryptionResponsePayload {
|
|
|
962
1083
|
*/
|
|
963
1084
|
get signcrypted_ciphertexts() {
|
|
964
1085
|
const ret = wasm.__wbg_get_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr);
|
|
965
|
-
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1])
|
|
1086
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]);
|
|
966
1087
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
967
1088
|
return v1;
|
|
968
1089
|
}
|
|
@@ -1064,7 +1185,7 @@ export function get_client_secret_key(client) {
|
|
|
1064
1185
|
export function get_server_addrs(client) {
|
|
1065
1186
|
_assertClass(client, Client);
|
|
1066
1187
|
const ret = wasm.get_server_addrs(client.__wbg_ptr);
|
|
1067
|
-
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1])
|
|
1188
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]);
|
|
1068
1189
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1069
1190
|
return v1;
|
|
1070
1191
|
}
|
|
@@ -1313,7 +1434,7 @@ export function process_user_decryption_resp_from_js(client, request, eip712_dom
|
|
|
1313
1434
|
if (ret[3]) {
|
|
1314
1435
|
throw takeFromExternrefTable0(ret[2]);
|
|
1315
1436
|
}
|
|
1316
|
-
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1])
|
|
1437
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]);
|
|
1317
1438
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1318
1439
|
return v1;
|
|
1319
1440
|
}
|
|
@@ -1388,11 +1509,11 @@ export function u8vec_to_public_sig_key(v) {
|
|
|
1388
1509
|
function __wbg_get_imports() {
|
|
1389
1510
|
const import0 = {
|
|
1390
1511
|
__proto__: null,
|
|
1391
|
-
|
|
1512
|
+
__wbg_Error_408e67f47ca7b58b: function(arg0, arg1) {
|
|
1392
1513
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
1393
1514
|
return ret;
|
|
1394
1515
|
},
|
|
1395
|
-
|
|
1516
|
+
__wbg_Number_3890faa6d3ff057d: function(arg0) {
|
|
1396
1517
|
const ret = Number(arg0);
|
|
1397
1518
|
return ret;
|
|
1398
1519
|
},
|
|
@@ -1403,54 +1524,54 @@ function __wbg_get_imports() {
|
|
|
1403
1524
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1404
1525
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1405
1526
|
},
|
|
1406
|
-
|
|
1527
|
+
__wbg___wbindgen_boolean_get_c9c83ebd41b34df3: function(arg0) {
|
|
1407
1528
|
const v = arg0;
|
|
1408
1529
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
1409
1530
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
1410
1531
|
},
|
|
1411
|
-
|
|
1532
|
+
__wbg___wbindgen_debug_string_a57024b9c6e4a48b: function(arg0, arg1) {
|
|
1412
1533
|
const ret = debugString(arg1);
|
|
1413
1534
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1414
1535
|
const len1 = WASM_VECTOR_LEN;
|
|
1415
1536
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1416
1537
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1417
1538
|
},
|
|
1418
|
-
|
|
1539
|
+
__wbg___wbindgen_in_ac983077f137f2e6: function(arg0, arg1) {
|
|
1419
1540
|
const ret = arg0 in arg1;
|
|
1420
1541
|
return ret;
|
|
1421
1542
|
},
|
|
1422
|
-
|
|
1543
|
+
__wbg___wbindgen_is_function_5e4570eb24ffa122: function(arg0) {
|
|
1423
1544
|
const ret = typeof(arg0) === 'function';
|
|
1424
1545
|
return ret;
|
|
1425
1546
|
},
|
|
1426
|
-
|
|
1547
|
+
__wbg___wbindgen_is_null_7d13f41e1a2d5140: function(arg0) {
|
|
1427
1548
|
const ret = arg0 === null;
|
|
1428
1549
|
return ret;
|
|
1429
1550
|
},
|
|
1430
|
-
|
|
1551
|
+
__wbg___wbindgen_is_object_a2790eb24c211ea0: function(arg0) {
|
|
1431
1552
|
const val = arg0;
|
|
1432
1553
|
const ret = typeof(val) === 'object' && val !== null;
|
|
1433
1554
|
return ret;
|
|
1434
1555
|
},
|
|
1435
|
-
|
|
1556
|
+
__wbg___wbindgen_is_string_e6f02f0ea5f20a32: function(arg0) {
|
|
1436
1557
|
const ret = typeof(arg0) === 'string';
|
|
1437
1558
|
return ret;
|
|
1438
1559
|
},
|
|
1439
|
-
|
|
1560
|
+
__wbg___wbindgen_is_undefined_6cff064c44e0d823: function(arg0) {
|
|
1440
1561
|
const ret = arg0 === undefined;
|
|
1441
1562
|
return ret;
|
|
1442
1563
|
},
|
|
1443
|
-
|
|
1564
|
+
__wbg___wbindgen_jsval_loose_eq_acf2776254a8d832: function(arg0, arg1) {
|
|
1444
1565
|
const ret = arg0 == arg1;
|
|
1445
1566
|
return ret;
|
|
1446
1567
|
},
|
|
1447
|
-
|
|
1568
|
+
__wbg___wbindgen_number_get_136b9679cab35cfb: function(arg0, arg1) {
|
|
1448
1569
|
const obj = arg1;
|
|
1449
1570
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1450
1571
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
1451
1572
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1452
1573
|
},
|
|
1453
|
-
|
|
1574
|
+
__wbg___wbindgen_string_get_d154f1e671052120: function(arg0, arg1) {
|
|
1454
1575
|
const obj = arg1;
|
|
1455
1576
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1456
1577
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -1458,26 +1579,26 @@ function __wbg_get_imports() {
|
|
|
1458
1579
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1459
1580
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1460
1581
|
},
|
|
1461
|
-
|
|
1582
|
+
__wbg___wbindgen_throw_bb96b2010945f0bc: function(arg0, arg1) {
|
|
1462
1583
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1463
1584
|
},
|
|
1464
|
-
|
|
1465
|
-
const ret = arg0.call(arg1
|
|
1585
|
+
__wbg_call_1c5886ab9c57d1c7: function() { return handleError(function (arg0, arg1) {
|
|
1586
|
+
const ret = arg0.call(arg1);
|
|
1466
1587
|
return ret;
|
|
1467
1588
|
}, arguments); },
|
|
1468
|
-
|
|
1469
|
-
const ret = arg0.call(arg1);
|
|
1589
|
+
__wbg_call_35dba3c747ad7521: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1590
|
+
const ret = arg0.call(arg1, arg2);
|
|
1470
1591
|
return ret;
|
|
1471
1592
|
}, arguments); },
|
|
1472
1593
|
__wbg_crypto_38df2bab126b63dc: function(arg0) {
|
|
1473
1594
|
const ret = arg0.crypto;
|
|
1474
1595
|
return ret;
|
|
1475
1596
|
},
|
|
1476
|
-
|
|
1597
|
+
__wbg_done_669171204c3dcae2: function(arg0) {
|
|
1477
1598
|
const ret = arg0.done;
|
|
1478
1599
|
return ret;
|
|
1479
1600
|
},
|
|
1480
|
-
|
|
1601
|
+
__wbg_error_757e9472f8410341: function(arg0, arg1) {
|
|
1481
1602
|
let deferred0_0;
|
|
1482
1603
|
let deferred0_1;
|
|
1483
1604
|
try {
|
|
@@ -1491,11 +1612,11 @@ function __wbg_get_imports() {
|
|
|
1491
1612
|
__wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
|
|
1492
1613
|
arg0.getRandomValues(arg1);
|
|
1493
1614
|
}, arguments); },
|
|
1494
|
-
|
|
1615
|
+
__wbg_get_d173c0308df22d37: function() { return handleError(function (arg0, arg1) {
|
|
1495
1616
|
const ret = Reflect.get(arg0, arg1);
|
|
1496
1617
|
return ret;
|
|
1497
1618
|
}, arguments); },
|
|
1498
|
-
|
|
1619
|
+
__wbg_get_unchecked_e20b893aeafc3fca: function(arg0, arg1) {
|
|
1499
1620
|
const ret = arg0[arg1 >>> 0];
|
|
1500
1621
|
return ret;
|
|
1501
1622
|
},
|
|
@@ -1503,7 +1624,7 @@ function __wbg_get_imports() {
|
|
|
1503
1624
|
const ret = arg0[arg1];
|
|
1504
1625
|
return ret;
|
|
1505
1626
|
},
|
|
1506
|
-
|
|
1627
|
+
__wbg_instanceof_ArrayBuffer_993d02d2d254cad1: function(arg0) {
|
|
1507
1628
|
let result;
|
|
1508
1629
|
try {
|
|
1509
1630
|
result = arg0 instanceof ArrayBuffer;
|
|
@@ -1513,7 +1634,7 @@ function __wbg_get_imports() {
|
|
|
1513
1634
|
const ret = result;
|
|
1514
1635
|
return ret;
|
|
1515
1636
|
},
|
|
1516
|
-
|
|
1637
|
+
__wbg_instanceof_Uint8Array_f935dbb0aa7cdeed: function(arg0) {
|
|
1517
1638
|
let result;
|
|
1518
1639
|
try {
|
|
1519
1640
|
result = arg0 instanceof Uint8Array;
|
|
@@ -1523,23 +1644,23 @@ function __wbg_get_imports() {
|
|
|
1523
1644
|
const ret = result;
|
|
1524
1645
|
return ret;
|
|
1525
1646
|
},
|
|
1526
|
-
|
|
1647
|
+
__wbg_isArray_6339f732981044bf: function(arg0) {
|
|
1527
1648
|
const ret = Array.isArray(arg0);
|
|
1528
1649
|
return ret;
|
|
1529
1650
|
},
|
|
1530
|
-
|
|
1651
|
+
__wbg_isSafeInteger_f3d6cd19ccfe4512: function(arg0) {
|
|
1531
1652
|
const ret = Number.isSafeInteger(arg0);
|
|
1532
1653
|
return ret;
|
|
1533
1654
|
},
|
|
1534
|
-
|
|
1655
|
+
__wbg_iterator_5cebbb86e33c6dd6: function() {
|
|
1535
1656
|
const ret = Symbol.iterator;
|
|
1536
1657
|
return ret;
|
|
1537
1658
|
},
|
|
1538
|
-
|
|
1659
|
+
__wbg_length_36bd29c6848c2144: function(arg0) {
|
|
1539
1660
|
const ret = arg0.length;
|
|
1540
1661
|
return ret;
|
|
1541
1662
|
},
|
|
1542
|
-
|
|
1663
|
+
__wbg_length_ecfa2c63d3d0d82c: function(arg0) {
|
|
1543
1664
|
const ret = arg0.length;
|
|
1544
1665
|
return ret;
|
|
1545
1666
|
},
|
|
@@ -1551,19 +1672,19 @@ function __wbg_get_imports() {
|
|
|
1551
1672
|
const ret = new Error();
|
|
1552
1673
|
return ret;
|
|
1553
1674
|
},
|
|
1554
|
-
|
|
1675
|
+
__wbg_new_77cc4f4f472aeb81: function(arg0) {
|
|
1555
1676
|
const ret = new Uint8Array(arg0);
|
|
1556
1677
|
return ret;
|
|
1557
1678
|
},
|
|
1558
|
-
|
|
1679
|
+
__wbg_new_with_length_3ffc1c56427c525c: function(arg0) {
|
|
1559
1680
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
1560
1681
|
return ret;
|
|
1561
1682
|
},
|
|
1562
|
-
|
|
1683
|
+
__wbg_next_42cf16ee0dafc9e2: function() { return handleError(function (arg0) {
|
|
1563
1684
|
const ret = arg0.next();
|
|
1564
1685
|
return ret;
|
|
1565
1686
|
}, arguments); },
|
|
1566
|
-
|
|
1687
|
+
__wbg_next_8f26b64fa5e9f64b: function(arg0) {
|
|
1567
1688
|
const ret = arg0.next;
|
|
1568
1689
|
return ret;
|
|
1569
1690
|
},
|
|
@@ -1575,7 +1696,7 @@ function __wbg_get_imports() {
|
|
|
1575
1696
|
const ret = arg0.process;
|
|
1576
1697
|
return ret;
|
|
1577
1698
|
},
|
|
1578
|
-
|
|
1699
|
+
__wbg_prototypesetcall_de8e0d9553586985: function(arg0, arg1, arg2) {
|
|
1579
1700
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1580
1701
|
},
|
|
1581
1702
|
__wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
|
|
@@ -1600,23 +1721,23 @@ function __wbg_get_imports() {
|
|
|
1600
1721
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1601
1722
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1602
1723
|
},
|
|
1603
|
-
|
|
1724
|
+
__wbg_static_accessor_GLOBAL_THIS_466428f93b4eaa76: function() {
|
|
1604
1725
|
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1605
1726
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1606
1727
|
},
|
|
1607
|
-
|
|
1728
|
+
__wbg_static_accessor_GLOBAL_c7aea38d4de089bc: function() {
|
|
1608
1729
|
const ret = typeof global === 'undefined' ? null : global;
|
|
1609
1730
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1610
1731
|
},
|
|
1611
|
-
|
|
1732
|
+
__wbg_static_accessor_SELF_42d4fae05e59267a: function() {
|
|
1612
1733
|
const ret = typeof self === 'undefined' ? null : self;
|
|
1613
1734
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1614
1735
|
},
|
|
1615
|
-
|
|
1736
|
+
__wbg_static_accessor_WINDOW_e0db14a0eba6a812: function() {
|
|
1616
1737
|
const ret = typeof window === 'undefined' ? null : window;
|
|
1617
1738
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1618
1739
|
},
|
|
1619
|
-
|
|
1740
|
+
__wbg_subarray_a4cc58201c7359fd: function(arg0, arg1, arg2) {
|
|
1620
1741
|
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1621
1742
|
return ret;
|
|
1622
1743
|
},
|
|
@@ -1632,6 +1753,14 @@ function __wbg_get_imports() {
|
|
|
1632
1753
|
const ret = TypedPlaintext.__wrap(arg0);
|
|
1633
1754
|
return ret;
|
|
1634
1755
|
},
|
|
1756
|
+
__wbg_typedsignature_new: function(arg0) {
|
|
1757
|
+
const ret = TypedSignature.__wrap(arg0);
|
|
1758
|
+
return ret;
|
|
1759
|
+
},
|
|
1760
|
+
__wbg_typedsignature_unwrap: function(arg0) {
|
|
1761
|
+
const ret = TypedSignature.__unwrap(arg0);
|
|
1762
|
+
return ret;
|
|
1763
|
+
},
|
|
1635
1764
|
__wbg_typedsigncryptedciphertext_new: function(arg0) {
|
|
1636
1765
|
const ret = TypedSigncryptedCiphertext.__wrap(arg0);
|
|
1637
1766
|
return ret;
|
|
@@ -1640,7 +1769,7 @@ function __wbg_get_imports() {
|
|
|
1640
1769
|
const ret = TypedSigncryptedCiphertext.__unwrap(arg0);
|
|
1641
1770
|
return ret;
|
|
1642
1771
|
},
|
|
1643
|
-
|
|
1772
|
+
__wbg_value_1e2369fab29b420e: function(arg0) {
|
|
1644
1773
|
const ret = arg0.value;
|
|
1645
1774
|
return ret;
|
|
1646
1775
|
},
|
|
@@ -1710,6 +1839,9 @@ const TypedCiphertextFinalization = (typeof FinalizationRegistry === 'undefined'
|
|
|
1710
1839
|
const TypedPlaintextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1711
1840
|
? { register: () => {}, unregister: () => {} }
|
|
1712
1841
|
: new FinalizationRegistry(ptr => wasm.__wbg_typedplaintext_free(ptr, 1));
|
|
1842
|
+
const TypedSignatureFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1843
|
+
? { register: () => {}, unregister: () => {} }
|
|
1844
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_typedsignature_free(ptr, 1));
|
|
1713
1845
|
const TypedSigncryptedCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1714
1846
|
? { register: () => {}, unregister: () => {} }
|
|
1715
1847
|
: new FinalizationRegistry(ptr => wasm.__wbg_typedsigncryptedciphertext_free(ptr, 1));
|
|
@@ -1800,6 +1932,11 @@ function debugString(val) {
|
|
|
1800
1932
|
return className;
|
|
1801
1933
|
}
|
|
1802
1934
|
|
|
1935
|
+
function getArrayI32FromWasm0(ptr, len) {
|
|
1936
|
+
ptr = ptr >>> 0;
|
|
1937
|
+
return getInt32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1803
1940
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
1804
1941
|
ptr = ptr >>> 0;
|
|
1805
1942
|
const mem = getDataViewMemory0();
|
|
@@ -1824,10 +1961,26 @@ function getDataViewMemory0() {
|
|
|
1824
1961
|
return cachedDataViewMemory0;
|
|
1825
1962
|
}
|
|
1826
1963
|
|
|
1964
|
+
let cachedInt32ArrayMemory0 = null;
|
|
1965
|
+
function getInt32ArrayMemory0() {
|
|
1966
|
+
if (cachedInt32ArrayMemory0 === null || cachedInt32ArrayMemory0.byteLength === 0) {
|
|
1967
|
+
cachedInt32ArrayMemory0 = new Int32Array(wasm.memory.buffer);
|
|
1968
|
+
}
|
|
1969
|
+
return cachedInt32ArrayMemory0;
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1827
1972
|
function getStringFromWasm0(ptr, len) {
|
|
1828
1973
|
return decodeText(ptr >>> 0, len);
|
|
1829
1974
|
}
|
|
1830
1975
|
|
|
1976
|
+
let cachedUint32ArrayMemory0 = null;
|
|
1977
|
+
function getUint32ArrayMemory0() {
|
|
1978
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
1979
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
1980
|
+
}
|
|
1981
|
+
return cachedUint32ArrayMemory0;
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1831
1984
|
let cachedUint8ArrayMemory0 = null;
|
|
1832
1985
|
function getUint8ArrayMemory0() {
|
|
1833
1986
|
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
@@ -1849,6 +2002,13 @@ function isLikeNone(x) {
|
|
|
1849
2002
|
return x === undefined || x === null;
|
|
1850
2003
|
}
|
|
1851
2004
|
|
|
2005
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
2006
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
2007
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
2008
|
+
WASM_VECTOR_LEN = arg.length;
|
|
2009
|
+
return ptr;
|
|
2010
|
+
}
|
|
2011
|
+
|
|
1852
2012
|
function passArray8ToWasm0(arg, malloc) {
|
|
1853
2013
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1854
2014
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -1944,6 +2104,8 @@ function __wbg_finalize_init(instance, module) {
|
|
|
1944
2104
|
wasm = instance.exports;
|
|
1945
2105
|
wasmModule = module;
|
|
1946
2106
|
cachedDataViewMemory0 = null;
|
|
2107
|
+
cachedInt32ArrayMemory0 = null;
|
|
2108
|
+
cachedUint32ArrayMemory0 = null;
|
|
1947
2109
|
cachedUint8ArrayMemory0 = null;
|
|
1948
2110
|
wasm.__wbindgen_start();
|
|
1949
2111
|
return wasm;
|
|
@@ -1951,11 +2113,15 @@ function __wbg_finalize_init(instance, module) {
|
|
|
1951
2113
|
|
|
1952
2114
|
async function __wbg_load(module, imports) {
|
|
1953
2115
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
2116
|
+
if (!module.ok) {
|
|
2117
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
2118
|
+
}
|
|
2119
|
+
|
|
1954
2120
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1955
2121
|
try {
|
|
1956
2122
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1957
2123
|
} catch (e) {
|
|
1958
|
-
const validResponse =
|
|
2124
|
+
const validResponse = expectedResponseType(module.type);
|
|
1959
2125
|
|
|
1960
2126
|
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1961
2127
|
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
package/kms_lib_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"Zama"
|
|
6
6
|
],
|
|
7
7
|
"description": "Key Management System for the Zama Protocol.",
|
|
8
|
-
"version": "v0.
|
|
8
|
+
"version": "v0.15.0-1",
|
|
9
9
|
"license": "BSD-3-Clause-Clear",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
"sideEffects": [
|
|
22
22
|
"./snippets/*"
|
|
23
23
|
]
|
|
24
|
-
}
|
|
24
|
+
}
|