node-tkms 0.13.10 → 0.13.20-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 CHANGED
@@ -22,7 +22,7 @@ export class Client {
22
22
 
23
23
  /**
24
24
  * Eip712 domain information.
25
- * Any constraints specified in the [standard](<https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>) _must_ be fulfilled.
25
+ * Any constraints specified in the [standard](<https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>) *must* be fulfilled.
26
26
  * Furthermore, be aware that all parameters will eventually be parsed into Solidity types.
27
27
  */
28
28
  export class Eip712DomainMsg {
@@ -196,7 +196,7 @@ export class UserDecryptionRequest {
196
196
  */
197
197
  set epoch_id(value: RequestId | null | undefined);
198
198
  /**
199
- * Extra data from the gateway.
199
+ * Extra data used in the EIP712 signature - external_signature.
200
200
  */
201
201
  extra_data: Uint8Array;
202
202
  /**
@@ -233,10 +233,10 @@ export class UserDecryptionResponse {
233
233
  * This is the external signature created from the Eip712 domain
234
234
  * on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
235
235
  * struct UserDecryptResponseVerification {
236
- * bytes publicKey;
237
- * uint256\[\] ctHandles;
238
- * bytes userDecryptedShare; // serialization of payload
239
- * bytes extraData;
236
+ * bytes publicKey;
237
+ * uint256\[\] ctHandles;
238
+ * bytes userDecryptedShare; // serialization of payload
239
+ * bytes extraData;
240
240
  * }
241
241
  */
242
242
  external_signature: Uint8Array;
@@ -361,10 +361,13 @@ export function private_sig_key_to_u8vec(sk: PrivateSigKey): Uint8Array;
361
361
  *
362
362
  * * `enc_sk` - The ephemeral secret key.
363
363
  *
364
+ * * `threshold` - Optional threshold override for reconstruction.
365
+ * If not provided, it is computed from the number of server addresses as `(n - 1) / 3`.
366
+ *
364
367
  * * `verify` - Whether to perform signature verification for the response.
365
368
  * It is insecure if `verify = false`!
366
369
  */
367
- export function process_user_decryption_resp(client: Client, request: ParsedUserDecryptionRequest | null | undefined, eip712_domain: Eip712DomainMsg | null | undefined, agg_resp: UserDecryptionResponse[], enc_pk: PublicEncKeyMlKem512, enc_sk: PrivateEncKeyMlKem512, verify: boolean): TypedPlaintext[];
370
+ export function process_user_decryption_resp(client: Client, request: ParsedUserDecryptionRequest | null | undefined, eip712_domain: Eip712DomainMsg | null | undefined, agg_resp: UserDecryptionResponse[], enc_pk: PublicEncKeyMlKem512, enc_sk: PrivateEncKeyMlKem512, threshold: number | null | undefined, verify: boolean): TypedPlaintext[];
368
371
 
369
372
  /**
370
373
  * Process the user_decryption response from JavaScript objects.
@@ -424,10 +427,15 @@ export function process_user_decryption_resp(client: Client, request: ParsedUser
424
427
  *
425
428
  * * `enc_sk` - The ephemeral secret key.
426
429
  *
430
+ * * `threshold` - Optional expected threshold/degree used during response validation.
431
+ * Validation requires at least `threshold + 1` matching responses, and the selected pivot
432
+ * response must have `degree == threshold`. If not provided, it is computed from the number
433
+ * of server addresses as `(n - 1) / 3`.
434
+ *
427
435
  * * `verify` - Whether to perform signature verification for the response.
428
436
  * It is insecure if `verify = false`!
429
437
  */
430
- export function process_user_decryption_resp_from_js(client: Client, request: any, eip712_domain: any, agg_resp: any, enc_pk: PublicEncKeyMlKem512, enc_sk: PrivateEncKeyMlKem512, verify: boolean): TypedPlaintext[];
438
+ export function process_user_decryption_resp_from_js(client: Client, request: any, eip712_domain: any, agg_resp: any, enc_pk: PublicEncKeyMlKem512, enc_sk: PrivateEncKeyMlKem512, threshold: number | null | undefined, verify: boolean): TypedPlaintext[];
431
439
 
432
440
  export function public_sig_key_to_u8vec(pk: PublicSigKey): Uint8Array;
433
441
 
package/kms_lib.js CHANGED
@@ -46,7 +46,7 @@ exports.Client = Client;
46
46
 
47
47
  /**
48
48
  * Eip712 domain information.
49
- * Any constraints specified in the [standard](<https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>) _must_ be fulfilled.
49
+ * Any constraints specified in the [standard](<https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>) *must* be fulfilled.
50
50
  * Furthermore, be aware that all parameters will eventually be parsed into Solidity types.
51
51
  */
52
52
  class Eip712DomainMsg {
@@ -327,7 +327,7 @@ class RequestId {
327
327
  set request_id(arg0) {
328
328
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
329
329
  const len0 = WASM_VECTOR_LEN;
330
- wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
330
+ wasm.__wbg_set_requestid_request_id(this.__wbg_ptr, ptr0, len0);
331
331
  }
332
332
  }
333
333
  if (Symbol.dispose) RequestId.prototype[Symbol.dispose] = RequestId.prototype.free;
@@ -438,7 +438,7 @@ class TypedCiphertext {
438
438
  set ciphertext(arg0) {
439
439
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
440
440
  const len0 = WASM_VECTOR_LEN;
441
- wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
441
+ wasm.__wbg_set_typedciphertext_ciphertext(this.__wbg_ptr, ptr0, len0);
442
442
  }
443
443
  /**
444
444
  * The external handle of the ciphertext (the handle used in the copro).
@@ -447,7 +447,7 @@ class TypedCiphertext {
447
447
  set external_handle(arg0) {
448
448
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
449
449
  const len0 = WASM_VECTOR_LEN;
450
- wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
450
+ wasm.__wbg_set_typedciphertext_external_handle(this.__wbg_ptr, ptr0, len0);
451
451
  }
452
452
  /**
453
453
  * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
@@ -505,7 +505,7 @@ class TypedPlaintext {
505
505
  set bytes(arg0) {
506
506
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
507
507
  const len0 = WASM_VECTOR_LEN;
508
- wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
508
+ wasm.__wbg_set_typedplaintext_bytes(this.__wbg_ptr, ptr0, len0);
509
509
  }
510
510
  /**
511
511
  * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
@@ -559,7 +559,7 @@ class TypedSigncryptedCiphertext {
559
559
  * @returns {number}
560
560
  */
561
561
  get fhe_type() {
562
- const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
562
+ const ret = wasm.__wbg_get_typedsigncryptedciphertext_fhe_type(this.__wbg_ptr);
563
563
  return ret;
564
564
  }
565
565
  /**
@@ -568,7 +568,7 @@ class TypedSigncryptedCiphertext {
568
568
  * @returns {number}
569
569
  */
570
570
  get packing_factor() {
571
- const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
571
+ const ret = wasm.__wbg_get_typedsigncryptedciphertext_packing_factor(this.__wbg_ptr);
572
572
  return ret >>> 0;
573
573
  }
574
574
  /**
@@ -589,7 +589,7 @@ class TypedSigncryptedCiphertext {
589
589
  set external_handle(arg0) {
590
590
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
591
591
  const len0 = WASM_VECTOR_LEN;
592
- wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
592
+ wasm.__wbg_set_typedsigncryptedciphertext_external_handle(this.__wbg_ptr, ptr0, len0);
593
593
  }
594
594
  /**
595
595
  * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
@@ -597,7 +597,7 @@ class TypedSigncryptedCiphertext {
597
597
  * @param {number} arg0
598
598
  */
599
599
  set fhe_type(arg0) {
600
- wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
600
+ wasm.__wbg_set_typedsigncryptedciphertext_fhe_type(this.__wbg_ptr, arg0);
601
601
  }
602
602
  /**
603
603
  * The packing factor determines whether the decrypted plaintext
@@ -605,7 +605,7 @@ class TypedSigncryptedCiphertext {
605
605
  * @param {number} arg0
606
606
  */
607
607
  set packing_factor(arg0) {
608
- wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
608
+ wasm.__wbg_set_typedsigncryptedciphertext_packing_factor(this.__wbg_ptr, arg0);
609
609
  }
610
610
  /**
611
611
  * The signcrypted payload, using a hybrid encryption approach in
@@ -615,7 +615,7 @@ class TypedSigncryptedCiphertext {
615
615
  set signcrypted_ciphertext(arg0) {
616
616
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
617
617
  const len0 = WASM_VECTOR_LEN;
618
- wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
618
+ wasm.__wbg_set_typedsigncryptedciphertext_signcrypted_ciphertext(this.__wbg_ptr, ptr0, len0);
619
619
  }
620
620
  }
621
621
  if (Symbol.dispose) TypedSigncryptedCiphertext.prototype[Symbol.dispose] = TypedSigncryptedCiphertext.prototype.free;
@@ -687,7 +687,7 @@ class UserDecryptionRequest {
687
687
  return ret === 0 ? undefined : RequestId.__wrap(ret);
688
688
  }
689
689
  /**
690
- * Extra data from the gateway.
690
+ * Extra data used in the EIP712 signature - external_signature.
691
691
  * @returns {Uint8Array}
692
692
  */
693
693
  get extra_data() {
@@ -731,7 +731,7 @@ class UserDecryptionRequest {
731
731
  set client_address(arg0) {
732
732
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
733
733
  const len0 = WASM_VECTOR_LEN;
734
- wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
734
+ wasm.__wbg_set_userdecryptionrequest_client_address(this.__wbg_ptr, ptr0, len0);
735
735
  }
736
736
  /**
737
737
  * MPC context ID which is used to identify the context to use for this request.
@@ -768,7 +768,7 @@ class UserDecryptionRequest {
768
768
  set enc_key(arg0) {
769
769
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
770
770
  const len0 = WASM_VECTOR_LEN;
771
- wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
771
+ wasm.__wbg_set_userdecryptionrequest_enc_key(this.__wbg_ptr, ptr0, len0);
772
772
  }
773
773
  /**
774
774
  * The epoch number placeholder (zama-ai/kms-internal#2743).
@@ -783,13 +783,13 @@ class UserDecryptionRequest {
783
783
  wasm.__wbg_set_userdecryptionrequest_epoch_id(this.__wbg_ptr, ptr0);
784
784
  }
785
785
  /**
786
- * Extra data from the gateway.
786
+ * Extra data used in the EIP712 signature - external_signature.
787
787
  * @param {Uint8Array} arg0
788
788
  */
789
789
  set extra_data(arg0) {
790
790
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
791
791
  const len0 = WASM_VECTOR_LEN;
792
- wasm.__wbg_set_eip712domainmsg_verifying_contract(this.__wbg_ptr, ptr0, len0);
792
+ wasm.__wbg_set_userdecryptionrequest_extra_data(this.__wbg_ptr, ptr0, len0);
793
793
  }
794
794
  /**
795
795
  * The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
@@ -851,10 +851,10 @@ class UserDecryptionResponse {
851
851
  * This is the external signature created from the Eip712 domain
852
852
  * on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
853
853
  * struct UserDecryptResponseVerification {
854
- * bytes publicKey;
855
- * uint256\[\] ctHandles;
856
- * bytes userDecryptedShare; // serialization of payload
857
- * bytes extraData;
854
+ * bytes publicKey;
855
+ * uint256\[\] ctHandles;
856
+ * bytes userDecryptedShare; // serialization of payload
857
+ * bytes extraData;
858
858
  * }
859
859
  * @returns {Uint8Array}
860
860
  */
@@ -895,17 +895,17 @@ class UserDecryptionResponse {
895
895
  * This is the external signature created from the Eip712 domain
896
896
  * on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
897
897
  * struct UserDecryptResponseVerification {
898
- * bytes publicKey;
899
- * uint256\[\] ctHandles;
900
- * bytes userDecryptedShare; // serialization of payload
901
- * bytes extraData;
898
+ * bytes publicKey;
899
+ * uint256\[\] ctHandles;
900
+ * bytes userDecryptedShare; // serialization of payload
901
+ * bytes extraData;
902
902
  * }
903
903
  * @param {Uint8Array} arg0
904
904
  */
905
905
  set external_signature(arg0) {
906
906
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
907
907
  const len0 = WASM_VECTOR_LEN;
908
- wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
908
+ wasm.__wbg_set_userdecryptionresponse_external_signature(this.__wbg_ptr, ptr0, len0);
909
909
  }
910
910
  /**
911
911
  * Extra data used in the EIP712 signature - external_signature.
@@ -914,7 +914,7 @@ class UserDecryptionResponse {
914
914
  set extra_data(arg0) {
915
915
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
916
916
  const len0 = WASM_VECTOR_LEN;
917
- wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
917
+ wasm.__wbg_set_userdecryptionresponse_extra_data(this.__wbg_ptr, ptr0, len0);
918
918
  }
919
919
  /**
920
920
  * The actual \[UserDecryptionResponsePayload\].
@@ -934,7 +934,7 @@ class UserDecryptionResponse {
934
934
  set signature(arg0) {
935
935
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
936
936
  const len0 = WASM_VECTOR_LEN;
937
- wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
937
+ wasm.__wbg_set_userdecryptionresponse_signature(this.__wbg_ptr, ptr0, len0);
938
938
  }
939
939
  }
940
940
  if (Symbol.dispose) UserDecryptionResponse.prototype[Symbol.dispose] = UserDecryptionResponse.prototype.free;
@@ -1027,7 +1027,7 @@ class UserDecryptionResponsePayload {
1027
1027
  set digest(arg0) {
1028
1028
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1029
1029
  const len0 = WASM_VECTOR_LEN;
1030
- wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1030
+ wasm.__wbg_set_userdecryptionresponsepayload_digest(this.__wbg_ptr, ptr0, len0);
1031
1031
  }
1032
1032
  /**
1033
1033
  * The ID of the MPC party doing the user decryption. Used for polynomial
@@ -1057,7 +1057,7 @@ class UserDecryptionResponsePayload {
1057
1057
  set verification_key(arg0) {
1058
1058
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1059
1059
  const len0 = WASM_VECTOR_LEN;
1060
- wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1060
+ wasm.__wbg_set_userdecryptionresponsepayload_verification_key(this.__wbg_ptr, ptr0, len0);
1061
1061
  }
1062
1062
  }
1063
1063
  if (Symbol.dispose) UserDecryptionResponsePayload.prototype[Symbol.dispose] = UserDecryptionResponsePayload.prototype.free;
@@ -1298,6 +1298,9 @@ exports.private_sig_key_to_u8vec = private_sig_key_to_u8vec;
1298
1298
  *
1299
1299
  * * `enc_sk` - The ephemeral secret key.
1300
1300
  *
1301
+ * * `threshold` - Optional threshold override for reconstruction.
1302
+ * If not provided, it is computed from the number of server addresses as `(n - 1) / 3`.
1303
+ *
1301
1304
  * * `verify` - Whether to perform signature verification for the response.
1302
1305
  * It is insecure if `verify = false`!
1303
1306
  * @param {Client} client
@@ -1306,10 +1309,11 @@ exports.private_sig_key_to_u8vec = private_sig_key_to_u8vec;
1306
1309
  * @param {UserDecryptionResponse[]} agg_resp
1307
1310
  * @param {PublicEncKeyMlKem512} enc_pk
1308
1311
  * @param {PrivateEncKeyMlKem512} enc_sk
1312
+ * @param {number | null | undefined} threshold
1309
1313
  * @param {boolean} verify
1310
1314
  * @returns {TypedPlaintext[]}
1311
1315
  */
1312
- function process_user_decryption_resp(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
1316
+ function process_user_decryption_resp(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, threshold, verify) {
1313
1317
  _assertClass(client, Client);
1314
1318
  let ptr0 = 0;
1315
1319
  if (!isLikeNone(request)) {
@@ -1325,7 +1329,7 @@ function process_user_decryption_resp(client, request, eip712_domain, agg_resp,
1325
1329
  const len2 = WASM_VECTOR_LEN;
1326
1330
  _assertClass(enc_pk, PublicEncKeyMlKem512);
1327
1331
  _assertClass(enc_sk, PrivateEncKeyMlKem512);
1328
- const ret = wasm.process_user_decryption_resp(client.__wbg_ptr, ptr0, ptr1, ptr2, len2, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
1332
+ const ret = wasm.process_user_decryption_resp(client.__wbg_ptr, ptr0, ptr1, ptr2, len2, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, isLikeNone(threshold) ? 0x100000001 : (threshold) >>> 0, verify);
1329
1333
  if (ret[3]) {
1330
1334
  throw takeFromExternrefTable0(ret[2]);
1331
1335
  }
@@ -1393,6 +1397,11 @@ exports.process_user_decryption_resp = process_user_decryption_resp;
1393
1397
  *
1394
1398
  * * `enc_sk` - The ephemeral secret key.
1395
1399
  *
1400
+ * * `threshold` - Optional expected threshold/degree used during response validation.
1401
+ * Validation requires at least `threshold + 1` matching responses, and the selected pivot
1402
+ * response must have `degree == threshold`. If not provided, it is computed from the number
1403
+ * of server addresses as `(n - 1) / 3`.
1404
+ *
1396
1405
  * * `verify` - Whether to perform signature verification for the response.
1397
1406
  * It is insecure if `verify = false`!
1398
1407
  * @param {Client} client
@@ -1401,14 +1410,15 @@ exports.process_user_decryption_resp = process_user_decryption_resp;
1401
1410
  * @param {any} agg_resp
1402
1411
  * @param {PublicEncKeyMlKem512} enc_pk
1403
1412
  * @param {PrivateEncKeyMlKem512} enc_sk
1413
+ * @param {number | null | undefined} threshold
1404
1414
  * @param {boolean} verify
1405
1415
  * @returns {TypedPlaintext[]}
1406
1416
  */
1407
- function process_user_decryption_resp_from_js(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
1417
+ function process_user_decryption_resp_from_js(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, threshold, verify) {
1408
1418
  _assertClass(client, Client);
1409
1419
  _assertClass(enc_pk, PublicEncKeyMlKem512);
1410
1420
  _assertClass(enc_sk, PrivateEncKeyMlKem512);
1411
- const ret = wasm.process_user_decryption_resp_from_js(client.__wbg_ptr, request, eip712_domain, agg_resp, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
1421
+ const ret = wasm.process_user_decryption_resp_from_js(client.__wbg_ptr, request, eip712_domain, agg_resp, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, isLikeNone(threshold) ? 0x100000001 : (threshold) >>> 0, verify);
1412
1422
  if (ret[3]) {
1413
1423
  throw takeFromExternrefTable0(ret[2]);
1414
1424
  }
@@ -1494,69 +1504,69 @@ exports.u8vec_to_public_sig_key = u8vec_to_public_sig_key;
1494
1504
  function __wbg_get_imports() {
1495
1505
  const import0 = {
1496
1506
  __proto__: null,
1497
- __wbg_Error_8c4e43fe74559d73: function(arg0, arg1) {
1507
+ __wbg_Error_83742b46f01ce22d: function(arg0, arg1) {
1498
1508
  const ret = Error(getStringFromWasm0(arg0, arg1));
1499
1509
  return ret;
1500
1510
  },
1501
- __wbg_Number_04624de7d0e8332d: function(arg0) {
1511
+ __wbg_Number_a5a435bd7bbec835: function(arg0) {
1502
1512
  const ret = Number(arg0);
1503
1513
  return ret;
1504
1514
  },
1505
- __wbg_String_8f0eb39a4a4c2f66: function(arg0, arg1) {
1515
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
1506
1516
  const ret = String(arg1);
1507
1517
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1508
1518
  const len1 = WASM_VECTOR_LEN;
1509
1519
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1510
1520
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1511
1521
  },
1512
- __wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(arg0) {
1522
+ __wbg___wbindgen_boolean_get_c0f3f60bac5a78d1: function(arg0) {
1513
1523
  const v = arg0;
1514
1524
  const ret = typeof(v) === 'boolean' ? v : undefined;
1515
1525
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1516
1526
  },
1517
- __wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(arg0, arg1) {
1527
+ __wbg___wbindgen_debug_string_5398f5bb970e0daa: function(arg0, arg1) {
1518
1528
  const ret = debugString(arg1);
1519
1529
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1520
1530
  const len1 = WASM_VECTOR_LEN;
1521
1531
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1522
1532
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1523
1533
  },
1524
- __wbg___wbindgen_in_47fa6863be6f2f25: function(arg0, arg1) {
1534
+ __wbg___wbindgen_in_41dbb8413020e076: function(arg0, arg1) {
1525
1535
  const ret = arg0 in arg1;
1526
1536
  return ret;
1527
1537
  },
1528
- __wbg___wbindgen_is_function_0095a73b8b156f76: function(arg0) {
1538
+ __wbg___wbindgen_is_function_3c846841762788c1: function(arg0) {
1529
1539
  const ret = typeof(arg0) === 'function';
1530
1540
  return ret;
1531
1541
  },
1532
- __wbg___wbindgen_is_null_ac34f5003991759a: function(arg0) {
1542
+ __wbg___wbindgen_is_null_0b605fc6b167c56f: function(arg0) {
1533
1543
  const ret = arg0 === null;
1534
1544
  return ret;
1535
1545
  },
1536
- __wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(arg0) {
1546
+ __wbg___wbindgen_is_object_781bc9f159099513: function(arg0) {
1537
1547
  const val = arg0;
1538
1548
  const ret = typeof(val) === 'object' && val !== null;
1539
1549
  return ret;
1540
1550
  },
1541
- __wbg___wbindgen_is_string_cd444516edc5b180: function(arg0) {
1551
+ __wbg___wbindgen_is_string_7ef6b97b02428fae: function(arg0) {
1542
1552
  const ret = typeof(arg0) === 'string';
1543
1553
  return ret;
1544
1554
  },
1545
- __wbg___wbindgen_is_undefined_9e4d92534c42d778: function(arg0) {
1555
+ __wbg___wbindgen_is_undefined_52709e72fb9f179c: function(arg0) {
1546
1556
  const ret = arg0 === undefined;
1547
1557
  return ret;
1548
1558
  },
1549
- __wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811: function(arg0, arg1) {
1559
+ __wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b: function(arg0, arg1) {
1550
1560
  const ret = arg0 == arg1;
1551
1561
  return ret;
1552
1562
  },
1553
- __wbg___wbindgen_number_get_8ff4255516ccad3e: function(arg0, arg1) {
1563
+ __wbg___wbindgen_number_get_34bb9d9dcfa21373: function(arg0, arg1) {
1554
1564
  const obj = arg1;
1555
1565
  const ret = typeof(obj) === 'number' ? obj : undefined;
1556
1566
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1557
1567
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1558
1568
  },
1559
- __wbg___wbindgen_string_get_72fb696202c56729: function(arg0, arg1) {
1569
+ __wbg___wbindgen_string_get_395e606bd0ee4427: function(arg0, arg1) {
1560
1570
  const obj = arg1;
1561
1571
  const ret = typeof(obj) === 'string' ? obj : undefined;
1562
1572
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -1564,26 +1574,26 @@ function __wbg_get_imports() {
1564
1574
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1565
1575
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1566
1576
  },
1567
- __wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
1577
+ __wbg___wbindgen_throw_6ddd609b62940d55: function(arg0, arg1) {
1568
1578
  throw new Error(getStringFromWasm0(arg0, arg1));
1569
1579
  },
1570
- __wbg_call_389efe28435a9388: function() { return handleError(function (arg0, arg1) {
1571
- const ret = arg0.call(arg1);
1580
+ __wbg_call_2d781c1f4d5c0ef8: function() { return handleError(function (arg0, arg1, arg2) {
1581
+ const ret = arg0.call(arg1, arg2);
1572
1582
  return ret;
1573
1583
  }, arguments); },
1574
- __wbg_call_4708e0c13bdc8e95: function() { return handleError(function (arg0, arg1, arg2) {
1575
- const ret = arg0.call(arg1, arg2);
1584
+ __wbg_call_e133b57c9155d22c: function() { return handleError(function (arg0, arg1) {
1585
+ const ret = arg0.call(arg1);
1576
1586
  return ret;
1577
1587
  }, arguments); },
1578
- __wbg_crypto_ed58b8e10a292839: function(arg0) {
1588
+ __wbg_crypto_38df2bab126b63dc: function(arg0) {
1579
1589
  const ret = arg0.crypto;
1580
1590
  return ret;
1581
1591
  },
1582
- __wbg_done_57b39ecd9addfe81: function(arg0) {
1592
+ __wbg_done_08ce71ee07e3bd17: function(arg0) {
1583
1593
  const ret = arg0.done;
1584
1594
  return ret;
1585
1595
  },
1586
- __wbg_error_7534b8e9a36f1ab4: function(arg0, arg1) {
1596
+ __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
1587
1597
  let deferred0_0;
1588
1598
  let deferred0_1;
1589
1599
  try {
@@ -1594,22 +1604,22 @@ function __wbg_get_imports() {
1594
1604
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1595
1605
  }
1596
1606
  },
1597
- __wbg_getRandomValues_bcb4912f16000dc4: function() { return handleError(function (arg0, arg1) {
1607
+ __wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
1598
1608
  arg0.getRandomValues(arg1);
1599
1609
  }, arguments); },
1600
- __wbg_get_9b94d73e6221f75c: function(arg0, arg1) {
1601
- const ret = arg0[arg1 >>> 0];
1602
- return ret;
1603
- },
1604
- __wbg_get_b3ed3ad4be2bc8ac: function() { return handleError(function (arg0, arg1) {
1610
+ __wbg_get_326e41e095fb2575: function() { return handleError(function (arg0, arg1) {
1605
1611
  const ret = Reflect.get(arg0, arg1);
1606
1612
  return ret;
1607
1613
  }, arguments); },
1608
- __wbg_get_with_ref_key_1dc361bd10053bfe: function(arg0, arg1) {
1614
+ __wbg_get_unchecked_329cfe50afab7352: function(arg0, arg1) {
1615
+ const ret = arg0[arg1 >>> 0];
1616
+ return ret;
1617
+ },
1618
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
1609
1619
  const ret = arg0[arg1];
1610
1620
  return ret;
1611
1621
  },
1612
- __wbg_instanceof_ArrayBuffer_c367199e2fa2aa04: function(arg0) {
1622
+ __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6: function(arg0) {
1613
1623
  let result;
1614
1624
  try {
1615
1625
  result = arg0 instanceof ArrayBuffer;
@@ -1619,7 +1629,7 @@ function __wbg_get_imports() {
1619
1629
  const ret = result;
1620
1630
  return ret;
1621
1631
  },
1622
- __wbg_instanceof_Uint8Array_9b9075935c74707c: function(arg0) {
1632
+ __wbg_instanceof_Uint8Array_740438561a5b956d: function(arg0) {
1623
1633
  let result;
1624
1634
  try {
1625
1635
  result = arg0 instanceof Uint8Array;
@@ -1629,69 +1639,65 @@ function __wbg_get_imports() {
1629
1639
  const ret = result;
1630
1640
  return ret;
1631
1641
  },
1632
- __wbg_isArray_d314bb98fcf08331: function(arg0) {
1642
+ __wbg_isArray_33b91feb269ff46e: function(arg0) {
1633
1643
  const ret = Array.isArray(arg0);
1634
1644
  return ret;
1635
1645
  },
1636
- __wbg_isSafeInteger_bfbc7332a9768d2a: function(arg0) {
1646
+ __wbg_isSafeInteger_ecd6a7f9c3e053cd: function(arg0) {
1637
1647
  const ret = Number.isSafeInteger(arg0);
1638
1648
  return ret;
1639
1649
  },
1640
- __wbg_iterator_6ff6560ca1568e55: function() {
1650
+ __wbg_iterator_d8f549ec8fb061b1: function() {
1641
1651
  const ret = Symbol.iterator;
1642
1652
  return ret;
1643
1653
  },
1644
- __wbg_length_32ed9a279acd054c: function(arg0) {
1654
+ __wbg_length_b3416cf66a5452c8: function(arg0) {
1645
1655
  const ret = arg0.length;
1646
1656
  return ret;
1647
1657
  },
1648
- __wbg_length_35a7bace40f36eac: function(arg0) {
1658
+ __wbg_length_ea16607d7b61445b: function(arg0) {
1649
1659
  const ret = arg0.length;
1650
1660
  return ret;
1651
1661
  },
1652
- __wbg_msCrypto_0a36e2ec3a343d26: function(arg0) {
1662
+ __wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
1653
1663
  const ret = arg0.msCrypto;
1654
1664
  return ret;
1655
1665
  },
1656
- __wbg_new_8a6f238a6ece86ea: function() {
1666
+ __wbg_new_227d7c05414eb861: function() {
1657
1667
  const ret = new Error();
1658
1668
  return ret;
1659
1669
  },
1660
- __wbg_new_dd2b680c8bf6ae29: function(arg0) {
1670
+ __wbg_new_5f486cdf45a04d78: function(arg0) {
1661
1671
  const ret = new Uint8Array(arg0);
1662
1672
  return ret;
1663
1673
  },
1664
- __wbg_new_no_args_1c7c842f08d00ebb: function(arg0, arg1) {
1665
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1666
- return ret;
1667
- },
1668
- __wbg_new_with_length_a2c39cbe88fd8ff1: function(arg0) {
1674
+ __wbg_new_with_length_825018a1616e9e55: function(arg0) {
1669
1675
  const ret = new Uint8Array(arg0 >>> 0);
1670
1676
  return ret;
1671
1677
  },
1672
- __wbg_next_3482f54c49e8af19: function() { return handleError(function (arg0) {
1678
+ __wbg_next_11b99ee6237339e3: function() { return handleError(function (arg0) {
1673
1679
  const ret = arg0.next();
1674
1680
  return ret;
1675
1681
  }, arguments); },
1676
- __wbg_next_418f80d8f5303233: function(arg0) {
1682
+ __wbg_next_e01a967809d1aa68: function(arg0) {
1677
1683
  const ret = arg0.next;
1678
1684
  return ret;
1679
1685
  },
1680
- __wbg_node_02999533c4ea02e3: function(arg0) {
1686
+ __wbg_node_84ea875411254db1: function(arg0) {
1681
1687
  const ret = arg0.node;
1682
1688
  return ret;
1683
1689
  },
1684
- __wbg_process_5c1d670bc53614b8: function(arg0) {
1690
+ __wbg_process_44c7a14e11e9f69e: function(arg0) {
1685
1691
  const ret = arg0.process;
1686
1692
  return ret;
1687
1693
  },
1688
- __wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
1694
+ __wbg_prototypesetcall_d62e5099504357e6: function(arg0, arg1, arg2) {
1689
1695
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1690
1696
  },
1691
- __wbg_randomFillSync_ab2cfe79ebbf2740: function() { return handleError(function (arg0, arg1) {
1697
+ __wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
1692
1698
  arg0.randomFillSync(arg1);
1693
1699
  }, arguments); },
1694
- __wbg_require_79b1e9274cde3c87: function() { return handleError(function () {
1700
+ __wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
1695
1701
  const ret = module.require;
1696
1702
  return ret;
1697
1703
  }, arguments); },
@@ -1703,30 +1709,30 @@ function __wbg_get_imports() {
1703
1709
  const ret = ServerIdAddr.__unwrap(arg0);
1704
1710
  return ret;
1705
1711
  },
1706
- __wbg_stack_0ed75d68575b0f3c: function(arg0, arg1) {
1712
+ __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
1707
1713
  const ret = arg1.stack;
1708
1714
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1709
1715
  const len1 = WASM_VECTOR_LEN;
1710
1716
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1711
1717
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1712
1718
  },
1713
- __wbg_static_accessor_GLOBAL_12837167ad935116: function() {
1719
+ __wbg_static_accessor_GLOBAL_8adb955bd33fac2f: function() {
1714
1720
  const ret = typeof global === 'undefined' ? null : global;
1715
1721
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1716
1722
  },
1717
- __wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function() {
1723
+ __wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913: function() {
1718
1724
  const ret = typeof globalThis === 'undefined' ? null : globalThis;
1719
1725
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1720
1726
  },
1721
- __wbg_static_accessor_SELF_a621d3dfbb60d0ce: function() {
1727
+ __wbg_static_accessor_SELF_f207c857566db248: function() {
1722
1728
  const ret = typeof self === 'undefined' ? null : self;
1723
1729
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1724
1730
  },
1725
- __wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function() {
1731
+ __wbg_static_accessor_WINDOW_bb9f1ba69d61b386: function() {
1726
1732
  const ret = typeof window === 'undefined' ? null : window;
1727
1733
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1728
1734
  },
1729
- __wbg_subarray_a96e1fef17ed23cb: function(arg0, arg1, arg2) {
1735
+ __wbg_subarray_a068d24e39478a8a: function(arg0, arg1, arg2) {
1730
1736
  const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1731
1737
  return ret;
1732
1738
  },
@@ -1754,11 +1760,11 @@ function __wbg_get_imports() {
1754
1760
  const ret = UserDecryptionResponse.__unwrap(arg0);
1755
1761
  return ret;
1756
1762
  },
1757
- __wbg_value_0546255b415e96c1: function(arg0) {
1763
+ __wbg_value_21fc78aab0322612: function(arg0) {
1758
1764
  const ret = arg0.value;
1759
1765
  return ret;
1760
1766
  },
1761
- __wbg_versions_c71aa1626a93e0a1: function(arg0) {
1767
+ __wbg_versions_276b2795b1c6a219: function(arg0) {
1762
1768
  const ret = arg0.versions;
1763
1769
  return ret;
1764
1770
  },
@@ -2048,5 +2054,5 @@ let WASM_VECTOR_LEN = 0;
2048
2054
  const wasmPath = `${__dirname}/kms_lib_bg.wasm`;
2049
2055
  const wasmBytes = require('fs').readFileSync(wasmPath);
2050
2056
  const wasmModule = new WebAssembly.Module(wasmBytes);
2051
- const wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
2057
+ let wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
2052
2058
  wasm.__wbindgen_start();
package/kms_lib_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "Zama"
5
5
  ],
6
6
  "description": "Key Management System for the Zama Protocol.",
7
- "version": "v0.13.10",
7
+ "version": "v0.13.20-0",
8
8
  "license": "BSD-3-Clause-Clear",
9
9
  "repository": {
10
10
  "type": "git",