tkms 0.14.1 → 0.15.0-0
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 +70 -23
- package/kms_lib.js +172 -10
- package/kms_lib_bg.wasm +0 -0
- package/package.json +2 -2
package/kms_lib.d.ts
CHANGED
|
@@ -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,9 @@ 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_privatesigkey_free: (a: number, b: number) => void;
|
|
428
|
-
readonly __wbg_publicsigkey_free: (a: number, b: number) => void;
|
|
429
464
|
readonly __wbg_ciphertexthandle_free: (a: number, b: number) => void;
|
|
430
465
|
readonly __wbg_parseduserdecryptionrequest_free: (a: number, b: number) => void;
|
|
466
|
+
readonly __wbg_client_free: (a: number, b: number) => void;
|
|
431
467
|
readonly __wbg_privateenckeymlkem512_free: (a: number, b: number) => void;
|
|
432
468
|
readonly __wbg_publicenckeymlkem512_free: (a: number, b: number) => void;
|
|
433
469
|
readonly __wbg_serveridaddr_free: (a: number, b: number) => void;
|
|
@@ -451,6 +487,8 @@ export interface InitOutput {
|
|
|
451
487
|
readonly u8vec_to_ml_kem_pke_sk: (a: number, b: number) => [number, number, number];
|
|
452
488
|
readonly u8vec_to_private_sig_key: (a: number, b: number) => [number, number, number];
|
|
453
489
|
readonly u8vec_to_public_sig_key: (a: number, b: number) => [number, number, number];
|
|
490
|
+
readonly __wbg_privatesigkey_free: (a: number, b: number) => void;
|
|
491
|
+
readonly __wbg_publicsigkey_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];
|
|
@@ -468,8 +506,10 @@ export interface InitOutput {
|
|
|
468
506
|
readonly __wbg_get_userdecryptionrequest_extra_data: (a: number) => [number, number];
|
|
469
507
|
readonly __wbg_get_userdecryptionrequest_key_id: (a: number) => number;
|
|
470
508
|
readonly __wbg_get_userdecryptionrequest_request_id: (a: number) => number;
|
|
509
|
+
readonly __wbg_get_userdecryptionrequest_signing_schemes: (a: number) => [number, number];
|
|
471
510
|
readonly __wbg_get_userdecryptionrequest_typed_ciphertexts: (a: number) => [number, number];
|
|
472
511
|
readonly __wbg_get_userdecryptionresponse_payload: (a: number) => number;
|
|
512
|
+
readonly __wbg_get_userdecryptionresponse_signatures: (a: number) => [number, number];
|
|
473
513
|
readonly __wbg_get_userdecryptionresponsepayload_degree: (a: number) => number;
|
|
474
514
|
readonly __wbg_get_userdecryptionresponsepayload_party_id: (a: number) => number;
|
|
475
515
|
readonly __wbg_get_userdecryptionresponsepayload_signcrypted_ciphertexts: (a: number) => [number, number];
|
|
@@ -487,36 +527,33 @@ export interface InitOutput {
|
|
|
487
527
|
readonly __wbg_set_userdecryptionrequest_epoch_id: (a: number, b: number) => void;
|
|
488
528
|
readonly __wbg_set_userdecryptionrequest_key_id: (a: number, b: number) => void;
|
|
489
529
|
readonly __wbg_set_userdecryptionrequest_request_id: (a: number, b: number) => void;
|
|
530
|
+
readonly __wbg_set_userdecryptionrequest_signing_schemes: (a: number, b: number, c: number) => void;
|
|
490
531
|
readonly __wbg_set_userdecryptionrequest_typed_ciphertexts: (a: number, b: number, c: number) => void;
|
|
491
532
|
readonly __wbg_set_userdecryptionresponse_payload: (a: number, b: number) => void;
|
|
533
|
+
readonly __wbg_set_userdecryptionresponse_signatures: (a: number, b: number, c: number) => void;
|
|
492
534
|
readonly __wbg_set_userdecryptionresponsepayload_degree: (a: number, b: number) => void;
|
|
493
535
|
readonly __wbg_set_userdecryptionresponsepayload_party_id: (a: number, b: number) => void;
|
|
494
536
|
readonly __wbg_set_userdecryptionresponsepayload_signcrypted_ciphertexts: (a: number, b: number, c: number) => void;
|
|
495
537
|
readonly __wbg_typedciphertext_free: (a: number, b: number) => void;
|
|
496
538
|
readonly __wbg_typedplaintext_free: (a: number, b: number) => void;
|
|
539
|
+
readonly __wbg_typedsignature_free: (a: number, b: number) => void;
|
|
497
540
|
readonly __wbg_typedsigncryptedciphertext_free: (a: number, b: number) => void;
|
|
498
541
|
readonly __wbg_userdecryptionrequest_free: (a: number, b: number) => void;
|
|
499
542
|
readonly __wbg_userdecryptionresponse_free: (a: number, b: number) => void;
|
|
500
543
|
readonly __wbg_userdecryptionresponsepayload_free: (a: number, b: number) => void;
|
|
501
544
|
readonly __wbg_get_requestid_request_id: (a: number) => [number, number];
|
|
502
545
|
readonly __wbg_get_userdecryptionrequest_client_address: (a: number) => [number, number];
|
|
503
|
-
readonly
|
|
504
|
-
readonly __wbg_set_typedsigncryptedciphertext_packing_factor: (a: number, b: number) => void;
|
|
546
|
+
readonly __wbg_get_typedsignature_scheme: (a: number) => number;
|
|
505
547
|
readonly __wbg_get_typedsigncryptedciphertext_fhe_type: (a: number) => number;
|
|
506
548
|
readonly __wbg_get_typedsigncryptedciphertext_packing_factor: (a: number) => number;
|
|
507
|
-
readonly
|
|
508
|
-
readonly
|
|
509
|
-
readonly
|
|
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];
|
|
549
|
+
readonly __wbg_set_typedsignature_scheme: (a: number, b: number) => void;
|
|
550
|
+
readonly __wbg_set_typedsigncryptedciphertext_fhe_type: (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
553
|
readonly __wbg_set_typedciphertext_ciphertext: (a: number, b: number, c: number) => void;
|
|
518
554
|
readonly __wbg_set_typedciphertext_external_handle: (a: number, b: number, c: number) => void;
|
|
519
555
|
readonly __wbg_set_typedplaintext_bytes: (a: number, b: number, c: number) => void;
|
|
556
|
+
readonly __wbg_set_typedsignature_signature: (a: number, b: number, c: number) => void;
|
|
520
557
|
readonly __wbg_set_typedsigncryptedciphertext_external_handle: (a: number, b: number, c: number) => void;
|
|
521
558
|
readonly __wbg_set_typedsigncryptedciphertext_signcrypted_ciphertext: (a: number, b: number, c: number) => void;
|
|
522
559
|
readonly __wbg_set_userdecryptionrequest_client_address: (a: number, b: number, c: number) => void;
|
|
@@ -527,6 +564,16 @@ export interface InitOutput {
|
|
|
527
564
|
readonly __wbg_set_userdecryptionresponse_signature: (a: number, b: number, c: number) => void;
|
|
528
565
|
readonly __wbg_set_userdecryptionresponsepayload_digest: (a: number, b: number, c: number) => void;
|
|
529
566
|
readonly __wbg_set_userdecryptionresponsepayload_verification_key: (a: number, b: number, c: number) => void;
|
|
567
|
+
readonly __wbg_get_typedplaintext_bytes: (a: number) => [number, number];
|
|
568
|
+
readonly __wbg_get_typedsignature_signature: (a: number) => [number, number];
|
|
569
|
+
readonly __wbg_get_typedsigncryptedciphertext_external_handle: (a: number) => [number, number];
|
|
570
|
+
readonly __wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext: (a: number) => [number, number];
|
|
571
|
+
readonly __wbg_get_userdecryptionrequest_enc_key: (a: number) => [number, number];
|
|
572
|
+
readonly __wbg_get_userdecryptionresponse_external_signature: (a: number) => [number, number];
|
|
573
|
+
readonly __wbg_get_userdecryptionresponse_extra_data: (a: number) => [number, number];
|
|
574
|
+
readonly __wbg_get_userdecryptionresponse_signature: (a: number) => [number, number];
|
|
575
|
+
readonly __wbg_get_userdecryptionresponsepayload_digest: (a: number) => [number, number];
|
|
576
|
+
readonly __wbg_get_userdecryptionresponsepayload_verification_key: (a: number) => [number, number];
|
|
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
|
@@ -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,6 +756,18 @@ 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[]}
|
|
@@ -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]).slice();
|
|
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
|
|
|
@@ -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;
|
|
@@ -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;
|
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-0",
|
|
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
|
+
}
|