@keyhive/keyhive 0.1.0-alpha.3 → 0.1.0-alpha.5

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.
@@ -46,56 +46,6 @@ class Access {
46
46
  if (Symbol.dispose) Access.prototype[Symbol.dispose] = Access.prototype.free;
47
47
  exports.Access = Access;
48
48
 
49
- /**
50
- * The result of adding a member: the membership delegation, plus any new leaf
51
- * secrets produced by auto-rekeying a non-forward-secret document on add.
52
- */
53
- class AddMemberUpdate {
54
- static __wrap(ptr) {
55
- const obj = Object.create(AddMemberUpdate.prototype);
56
- obj.__wbg_ptr = ptr;
57
- AddMemberUpdateFinalization.register(obj, obj.__wbg_ptr, obj);
58
- return obj;
59
- }
60
- __destroy_into_raw() {
61
- const ptr = this.__wbg_ptr;
62
- this.__wbg_ptr = 0;
63
- AddMemberUpdateFinalization.unregister(this);
64
- return ptr;
65
- }
66
- free() {
67
- const ptr = this.__destroy_into_raw();
68
- wasm.__wbg_addmemberupdate_free(ptr, 0);
69
- }
70
- /**
71
- * @returns {SignedDelegation}
72
- */
73
- get delegation() {
74
- const ret = wasm.addmemberupdate_delegation(this.__wbg_ptr);
75
- return SignedDelegation.__wrap(ret);
76
- }
77
- /**
78
- * New leaf secret keypairs from auto-rekeying a non-forward-secret document
79
- * when this reader was added, serialized as a
80
- * `BTreeMap<ShareKey, ShareSecretKey>` (the format `importPrekeySecrets`
81
- * accepts). A sibling instance of this identity (e.g. a tab and its
82
- * SharedWorker) installs them to derive the rotated key. `undefined` when
83
- * no rotation occurred (a forward-secret document).
84
- * @returns {Uint8Array | undefined}
85
- */
86
- get leafSecrets() {
87
- const ret = wasm.addmemberupdate_leafSecrets(this.__wbg_ptr);
88
- let v1;
89
- if (ret[0] !== 0) {
90
- v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
91
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
92
- }
93
- return v1;
94
- }
95
- }
96
- if (Symbol.dispose) AddMemberUpdate.prototype[Symbol.dispose] = AddMemberUpdate.prototype.free;
97
- exports.AddMemberUpdate = AddMemberUpdate;
98
-
99
49
  class Agent {
100
50
  static __wrap(ptr) {
101
51
  const obj = Object.create(Agent.prototype);
@@ -615,6 +565,50 @@ class ContactCard {
615
565
  if (Symbol.dispose) ContactCard.prototype[Symbol.dispose] = ContactCard.prototype.free;
616
566
  exports.ContactCard = ContactCard;
617
567
 
568
+ /**
569
+ * Plaintext plus the application secret key that decrypted it.
570
+ */
571
+ class DecryptedKeyed {
572
+ static __wrap(ptr) {
573
+ const obj = Object.create(DecryptedKeyed.prototype);
574
+ obj.__wbg_ptr = ptr;
575
+ DecryptedKeyedFinalization.register(obj, obj.__wbg_ptr, obj);
576
+ return obj;
577
+ }
578
+ __destroy_into_raw() {
579
+ const ptr = this.__wbg_ptr;
580
+ this.__wbg_ptr = 0;
581
+ DecryptedKeyedFinalization.unregister(this);
582
+ return ptr;
583
+ }
584
+ free() {
585
+ const ptr = this.__destroy_into_raw();
586
+ wasm.__wbg_decryptedkeyed_free(ptr, 0);
587
+ }
588
+ /**
589
+ * The 32-byte application secret key used to decrypt this content.
590
+ * Treat as secret: do not log or persist unencrypted.
591
+ * @returns {Uint8Array}
592
+ */
593
+ get applicationSecret() {
594
+ const ret = wasm.decryptedkeyed_applicationSecret(this.__wbg_ptr);
595
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
596
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
597
+ return v1;
598
+ }
599
+ /**
600
+ * @returns {Uint8Array}
601
+ */
602
+ get plaintext() {
603
+ const ret = wasm.decryptedkeyed_plaintext(this.__wbg_ptr);
604
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
605
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
606
+ return v1;
607
+ }
608
+ }
609
+ if (Symbol.dispose) DecryptedKeyed.prototype[Symbol.dispose] = DecryptedKeyed.prototype.free;
610
+ exports.DecryptedKeyed = DecryptedKeyed;
611
+
618
612
  class Delegation {
619
613
  static __wrap(ptr) {
620
614
  const obj = Object.create(Delegation.prototype);
@@ -898,6 +892,23 @@ class Encrypted {
898
892
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
899
893
  return v1;
900
894
  }
895
+ /**
896
+ * Decrypt this content with an explicit 32-byte application secret key,
897
+ * bypassing CGKA.
898
+ * @param {Uint8Array} key
899
+ * @returns {Uint8Array}
900
+ */
901
+ decryptWithKey(key) {
902
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
903
+ const len0 = WASM_VECTOR_LEN;
904
+ const ret = wasm.encrypted_decryptWithKey(this.__wbg_ptr, ptr0, len0);
905
+ if (ret[3]) {
906
+ throw takeFromExternrefTable0(ret[2]);
907
+ }
908
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
909
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
910
+ return v2;
911
+ }
901
912
  /**
902
913
  * @param {Uint8Array} bytes
903
914
  * @returns {Encrypted}
@@ -998,6 +1009,54 @@ class EncryptedContentWithUpdate {
998
1009
  if (Symbol.dispose) EncryptedContentWithUpdate.prototype[Symbol.dispose] = EncryptedContentWithUpdate.prototype.free;
999
1010
  exports.EncryptedContentWithUpdate = EncryptedContentWithUpdate;
1000
1011
 
1012
+ /**
1013
+ * Encrypted content plus the application secret key it was encrypted under.
1014
+ */
1015
+ class EncryptedKeyed {
1016
+ static __wrap(ptr) {
1017
+ const obj = Object.create(EncryptedKeyed.prototype);
1018
+ obj.__wbg_ptr = ptr;
1019
+ EncryptedKeyedFinalization.register(obj, obj.__wbg_ptr, obj);
1020
+ return obj;
1021
+ }
1022
+ __destroy_into_raw() {
1023
+ const ptr = this.__wbg_ptr;
1024
+ this.__wbg_ptr = 0;
1025
+ EncryptedKeyedFinalization.unregister(this);
1026
+ return ptr;
1027
+ }
1028
+ free() {
1029
+ const ptr = this.__destroy_into_raw();
1030
+ wasm.__wbg_encryptedkeyed_free(ptr, 0);
1031
+ }
1032
+ /**
1033
+ * The 32-byte application secret key used to encrypt this content.
1034
+ * @returns {Uint8Array}
1035
+ */
1036
+ get applicationSecret() {
1037
+ const ret = wasm.encryptedkeyed_applicationSecret(this.__wbg_ptr);
1038
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1039
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1040
+ return v1;
1041
+ }
1042
+ /**
1043
+ * @returns {Encrypted}
1044
+ */
1045
+ encrypted_content() {
1046
+ const ret = wasm.encryptedkeyed_encrypted_content(this.__wbg_ptr);
1047
+ return Encrypted.__wrap(ret);
1048
+ }
1049
+ /**
1050
+ * @returns {SignedCgkaOperation | undefined}
1051
+ */
1052
+ update_op() {
1053
+ const ret = wasm.encryptedkeyed_update_op(this.__wbg_ptr);
1054
+ return ret === 0 ? undefined : SignedCgkaOperation.__wrap(ret);
1055
+ }
1056
+ }
1057
+ if (Symbol.dispose) EncryptedKeyed.prototype[Symbol.dispose] = EncryptedKeyed.prototype.free;
1058
+ exports.EncryptedKeyed = EncryptedKeyed;
1059
+
1001
1060
  class Event {
1002
1061
  static __wrap(ptr) {
1003
1062
  const obj = Object.create(Event.prototype);
@@ -1455,7 +1514,7 @@ class Keyhive {
1455
1514
  * @param {Membered} membered
1456
1515
  * @param {Access} access
1457
1516
  * @param {Document[]} other_relevant_docs
1458
- * @returns {Promise<AddMemberUpdate>}
1517
+ * @returns {Promise<SignedDelegation>}
1459
1518
  */
1460
1519
  addMember(to_add, membered, access, other_relevant_docs) {
1461
1520
  _assertClass(to_add, Agent);
@@ -1528,8 +1587,7 @@ class Keyhive {
1528
1587
  /**
1529
1588
  * Force a PCS key rotation and return the new leaf secret, serialized as a
1530
1589
  * one-entry `BTreeMap<ShareKey, ShareSecretKey>` (the exact format
1531
- * `importPrekeySecrets` accepts). A sibling instance of this identity can
1532
- * install it to derive the rotated key without re-importing the whole bundle.
1590
+ * `importPrekeySecrets` accepts).
1533
1591
  * @param {Document} doc
1534
1592
  * @returns {Promise<Uint8Array>}
1535
1593
  */
@@ -1539,8 +1597,6 @@ class Keyhive {
1539
1597
  return ret;
1540
1598
  }
1541
1599
  /**
1542
- * Generate a document. Whether it provides forward secrecy is determined by
1543
- * this peer's forward-secrecy policy (chosen at `Keyhive.init`).
1544
1600
  * @param {Peer[]} coparents
1545
1601
  * @param {ChangeId} initial_content_ref_head
1546
1602
  * @param {ChangeId[]} more_initial_content_refs
@@ -1665,23 +1721,15 @@ class Keyhive {
1665
1721
  return ret;
1666
1722
  }
1667
1723
  /**
1668
- * Initialize a peer.
1669
- *
1670
- * `forward_secrecy` is this peer's policy for all documents it creates or
1671
- * receives. When `false`, documents carry the CGKA predecessor key chain
1672
- * (a member added later reads the whole prior history) and adding a reader
1673
- * auto-rekeys (see `addMember`'s `leafSecrets`). When `true`, a member
1674
- * added later cannot read content from before they joined.
1675
1724
  * @param {Signer} signer
1676
1725
  * @param {CiphertextStore} ciphertext_store
1677
1726
  * @param {Function} event_handler
1678
- * @param {boolean} forward_secrecy
1679
1727
  * @returns {Promise<Keyhive>}
1680
1728
  */
1681
- static init(signer, ciphertext_store, event_handler, forward_secrecy) {
1729
+ static init(signer, ciphertext_store, event_handler) {
1682
1730
  _assertClass(signer, Signer);
1683
1731
  _assertClass(ciphertext_store, CiphertextStore);
1684
- const ret = wasm.keyhive_init(signer.__wbg_ptr, ciphertext_store.__wbg_ptr, event_handler, forward_secrecy);
1732
+ const ret = wasm.keyhive_init(signer.__wbg_ptr, ciphertext_store.__wbg_ptr, event_handler);
1685
1733
  return ret;
1686
1734
  }
1687
1735
  /**
@@ -1779,6 +1827,18 @@ class Keyhive {
1779
1827
  const ret = wasm.keyhive_tryDecrypt(this.__wbg_ptr, doc.__wbg_ptr, encrypted.__wbg_ptr);
1780
1828
  return ret;
1781
1829
  }
1830
+ /**
1831
+ * Decrypt content and also return the 32-byte application secret key used.
1832
+ * @param {Document} doc
1833
+ * @param {Encrypted} encrypted
1834
+ * @returns {Promise<DecryptedKeyed>}
1835
+ */
1836
+ tryDecryptKeyed(doc, encrypted) {
1837
+ _assertClass(doc, Document);
1838
+ _assertClass(encrypted, Encrypted);
1839
+ const ret = wasm.keyhive_tryDecryptKeyed(this.__wbg_ptr, doc.__wbg_ptr, encrypted.__wbg_ptr);
1840
+ return ret;
1841
+ }
1782
1842
  /**
1783
1843
  * @param {Document} doc
1784
1844
  * @param {ChangeId} content_ref
@@ -1813,6 +1873,25 @@ class Keyhive {
1813
1873
  const ret = wasm.keyhive_tryEncryptArchive(this.__wbg_ptr, doc.__wbg_ptr, content_ref.__wbg_ptr, ptr0, len0, ptr1, len1);
1814
1874
  return ret;
1815
1875
  }
1876
+ /**
1877
+ * Encrypt content and also return the application secret key it was
1878
+ * encrypted under.
1879
+ * @param {Document} doc
1880
+ * @param {ChangeId} content_ref
1881
+ * @param {ChangeId[]} js_pred_refs
1882
+ * @param {Uint8Array} content
1883
+ * @returns {Promise<EncryptedKeyed>}
1884
+ */
1885
+ tryEncryptKeyed(doc, content_ref, js_pred_refs, content) {
1886
+ _assertClass(doc, Document);
1887
+ _assertClass(content_ref, ChangeId);
1888
+ const ptr0 = passArrayJsValueToWasm0(js_pred_refs, wasm.__wbindgen_malloc);
1889
+ const len0 = WASM_VECTOR_LEN;
1890
+ const ptr1 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
1891
+ const len1 = WASM_VECTOR_LEN;
1892
+ const ret = wasm.keyhive_tryEncryptKeyed(this.__wbg_ptr, doc.__wbg_ptr, content_ref.__wbg_ptr, ptr0, len0, ptr1, len1);
1893
+ return ret;
1894
+ }
1816
1895
  /**
1817
1896
  * @param {Document} doc
1818
1897
  * @returns {Promise<Uint8Array | undefined>}
@@ -2619,10 +2698,55 @@ function setPanicHook() {
2619
2698
  wasm.setPanicHook();
2620
2699
  }
2621
2700
  exports.setPanicHook = setPanicHook;
2701
+
2702
+ /**
2703
+ * Inverse of [`symmetric_encrypt`]. Reads `nonce(24) || ciphertext`.
2704
+ * @param {Uint8Array} key
2705
+ * @param {Uint8Array} blob
2706
+ * @returns {Uint8Array}
2707
+ */
2708
+ function symmetricDecrypt(key, blob) {
2709
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2710
+ const len0 = WASM_VECTOR_LEN;
2711
+ const ptr1 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
2712
+ const len1 = WASM_VECTOR_LEN;
2713
+ const ret = wasm.symmetricDecrypt(ptr0, len0, ptr1, len1);
2714
+ if (ret[3]) {
2715
+ throw takeFromExternrefTable0(ret[2]);
2716
+ }
2717
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2718
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2719
+ return v3;
2720
+ }
2721
+ exports.symmetricDecrypt = symmetricDecrypt;
2722
+
2723
+ /**
2724
+ * Encrypt `plaintext` under a 32-byte `key`, returning `nonce(24) || ciphertext`.
2725
+ * @param {Uint8Array} key
2726
+ * @param {Uint8Array} plaintext
2727
+ * @param {Uint8Array} associated_data
2728
+ * @returns {Uint8Array}
2729
+ */
2730
+ function symmetricEncrypt(key, plaintext, associated_data) {
2731
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2732
+ const len0 = WASM_VECTOR_LEN;
2733
+ const ptr1 = passArray8ToWasm0(plaintext, wasm.__wbindgen_malloc);
2734
+ const len1 = WASM_VECTOR_LEN;
2735
+ const ptr2 = passArray8ToWasm0(associated_data, wasm.__wbindgen_malloc);
2736
+ const len2 = WASM_VECTOR_LEN;
2737
+ const ret = wasm.symmetricEncrypt(ptr0, len0, ptr1, len1, ptr2, len2);
2738
+ if (ret[3]) {
2739
+ throw takeFromExternrefTable0(ret[2]);
2740
+ }
2741
+ var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2742
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2743
+ return v4;
2744
+ }
2745
+ exports.symmetricEncrypt = symmetricEncrypt;
2622
2746
  function __wbg_get_imports() {
2623
2747
  const import0 = {
2624
2748
  __proto__: null,
2625
- __wbg_Error_fdd633d4bb5dd76a: function(arg0, arg1) {
2749
+ __wbg_Error_92b29b0548f8b746: function(arg0, arg1) {
2626
2750
  const ret = Error(getStringFromWasm0(arg0, arg1));
2627
2751
  return ret;
2628
2752
  },
@@ -2644,48 +2768,44 @@ function __wbg_get_imports() {
2644
2768
  var ptr1 = ret.__destroy_into_raw();
2645
2769
  return ptr1;
2646
2770
  },
2647
- __wbg___wbindgen_debug_string_8a447059637473e2: function(arg0, arg1) {
2771
+ __wbg___wbindgen_debug_string_c25d447a39f5578f: function(arg0, arg1) {
2648
2772
  const ret = debugString(arg1);
2649
2773
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2650
2774
  const len1 = WASM_VECTOR_LEN;
2651
2775
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2652
2776
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2653
2777
  },
2654
- __wbg___wbindgen_is_function_acc5528be2b923f2: function(arg0) {
2778
+ __wbg___wbindgen_is_function_1ff95bcc5517c252: function(arg0) {
2655
2779
  const ret = typeof(arg0) === 'function';
2656
2780
  return ret;
2657
2781
  },
2658
- __wbg___wbindgen_is_object_0beba4a1980d3eea: function(arg0) {
2782
+ __wbg___wbindgen_is_object_a27215656b807791: function(arg0) {
2659
2783
  const val = arg0;
2660
2784
  const ret = typeof(val) === 'object' && val !== null;
2661
2785
  return ret;
2662
2786
  },
2663
- __wbg___wbindgen_is_string_1fca8072260dd261: function(arg0) {
2787
+ __wbg___wbindgen_is_string_ea5e6cc2e4141dfe: function(arg0) {
2664
2788
  const ret = typeof(arg0) === 'string';
2665
2789
  return ret;
2666
2790
  },
2667
- __wbg___wbindgen_is_undefined_721f8decd50c87a3: function(arg0) {
2791
+ __wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
2668
2792
  const ret = arg0 === undefined;
2669
2793
  return ret;
2670
2794
  },
2671
- __wbg___wbindgen_throw_ea4887a5f8f9a9db: function(arg0, arg1) {
2795
+ __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
2672
2796
  throw new Error(getStringFromWasm0(arg0, arg1));
2673
2797
  },
2674
- __wbg__wbg_cb_unref_33c39e13d73b25f6: function(arg0) {
2798
+ __wbg__wbg_cb_unref_fffb441def202758: function(arg0) {
2675
2799
  arg0._wbg_cb_unref();
2676
2800
  },
2677
2801
  __wbg_access_new: function(arg0) {
2678
2802
  const ret = Access.__wrap(arg0);
2679
2803
  return ret;
2680
2804
  },
2681
- __wbg_add_8db1450e4b353bba: function(arg0, arg1) {
2805
+ __wbg_add_6c7b67a080be853e: function(arg0, arg1) {
2682
2806
  const ret = arg0.add(arg1);
2683
2807
  return ret;
2684
2808
  },
2685
- __wbg_addmemberupdate_new: function(arg0) {
2686
- const ret = AddMemberUpdate.__wrap(arg0);
2687
- return ret;
2688
- },
2689
2809
  __wbg_agent_new: function(arg0) {
2690
2810
  const ret = Agent.__wrap(arg0);
2691
2811
  return ret;
@@ -2698,7 +2818,7 @@ function __wbg_get_imports() {
2698
2818
  const ret = Archive.__wrap(arg0);
2699
2819
  return ret;
2700
2820
  },
2701
- __wbg_call_5575218572ead796: function() { return handleError(function (arg0, arg1, arg2) {
2821
+ __wbg_call_a6e5c5dce5018821: function() { return handleError(function (arg0, arg1, arg2) {
2702
2822
  const ret = arg0.call(arg1, arg2);
2703
2823
  return ret;
2704
2824
  }, arguments); },
@@ -2752,6 +2872,10 @@ function __wbg_get_imports() {
2752
2872
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2753
2873
  }
2754
2874
  },
2875
+ __wbg_decryptedkeyed_new: function(arg0) {
2876
+ const ret = DecryptedKeyed.__wrap(arg0);
2877
+ return ret;
2878
+ },
2755
2879
  __wbg_doccontentrefs_new: function(arg0) {
2756
2880
  const ret = DocContentRefs.__wrap(arg0);
2757
2881
  return ret;
@@ -2764,6 +2888,10 @@ function __wbg_get_imports() {
2764
2888
  const ret = EncryptedContentWithUpdate.__wrap(arg0);
2765
2889
  return ret;
2766
2890
  },
2891
+ __wbg_encryptedkeyed_new: function(arg0) {
2892
+ const ret = EncryptedKeyed.__wrap(arg0);
2893
+ return ret;
2894
+ },
2767
2895
  __wbg_error_8b62d3db440cf4a8: function(arg0, arg1) {
2768
2896
  let deferred0_0;
2769
2897
  let deferred0_1;
@@ -2801,11 +2929,11 @@ function __wbg_get_imports() {
2801
2929
  const ret = Event.__wrap(arg0);
2802
2930
  return ret;
2803
2931
  },
2804
- __wbg_exportKey_1ce2ce04d90beed3: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2932
+ __wbg_exportKey_31e8893b69d9dc95: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2805
2933
  const ret = arg0.exportKey(getStringFromWasm0(arg1, arg2), arg3);
2806
2934
  return ret;
2807
2935
  }, arguments); },
2808
- __wbg_generateKey_d7565f8a873b2758: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2936
+ __wbg_generateKey_3ed60dd4e2cb2a81: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2809
2937
  const ret = arg0.generateKey(getStringFromWasm0(arg1, arg2), arg3 !== 0, arg4);
2810
2938
  return ret;
2811
2939
  }, arguments); },
@@ -2816,19 +2944,19 @@ function __wbg_get_imports() {
2816
2944
  __wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
2817
2945
  arg0.getRandomValues(arg1);
2818
2946
  }, arguments); },
2819
- __wbg_get_197a3fe98f169e38: function(arg0, arg1) {
2947
+ __wbg_get_507a50627bffa49b: function(arg0, arg1) {
2820
2948
  const ret = arg0[arg1 >>> 0];
2821
2949
  return ret;
2822
2950
  },
2823
- __wbg_get_dddb90ff5d27a080: function() { return handleError(function (arg0, arg1) {
2951
+ __wbg_get_78f252d074a84d0b: function() { return handleError(function (arg0, arg1) {
2824
2952
  const ret = Reflect.get(arg0, arg1);
2825
2953
  return ret;
2826
2954
  }, arguments); },
2827
- __wbg_get_private_key_5512a2630ab9366a: function(arg0) {
2955
+ __wbg_get_private_key_a1d2a3ef4e88bcd6: function(arg0) {
2828
2956
  const ret = arg0.privateKey;
2829
2957
  return ret;
2830
2958
  },
2831
- __wbg_get_public_key_bd0de162bf5c6832: function(arg0) {
2959
+ __wbg_get_public_key_eae90acbeb39e965: function(arg0) {
2832
2960
  const ret = arg0.publicKey;
2833
2961
  return ret;
2834
2962
  },
@@ -2840,7 +2968,7 @@ function __wbg_get_imports() {
2840
2968
  const ret = Individual.__wrap(arg0);
2841
2969
  return ret;
2842
2970
  },
2843
- __wbg_instanceof_Crypto_cecf3f85e92e02f6: function(arg0) {
2971
+ __wbg_instanceof_Crypto_5e73263038417c75: function(arg0) {
2844
2972
  let result;
2845
2973
  try {
2846
2974
  result = arg0 instanceof Crypto;
@@ -2854,11 +2982,11 @@ function __wbg_get_imports() {
2854
2982
  const ret = Keyhive.__wrap(arg0);
2855
2983
  return ret;
2856
2984
  },
2857
- __wbg_length_589238bdcf171f0e: function(arg0) {
2985
+ __wbg_length_1f0964f4a5e2c6d8: function(arg0) {
2858
2986
  const ret = arg0.length;
2859
2987
  return ret;
2860
2988
  },
2861
- __wbg_length_c6054974c0a6cdb9: function(arg0) {
2989
+ __wbg_length_370319915dc99107: function(arg0) {
2862
2990
  const ret = arg0.length;
2863
2991
  return ret;
2864
2992
  },
@@ -2915,38 +3043,38 @@ function __wbg_get_imports() {
2915
3043
  const ret = new Error();
2916
3044
  return ret;
2917
3045
  },
2918
- __wbg_new_3444eb7412549f0b: function() {
2919
- const ret = new Map();
3046
+ __wbg_new_32b398fb48b6d94a: function() {
3047
+ const ret = new Array();
2920
3048
  return ret;
2921
3049
  },
2922
- __wbg_new_36e147a8ced3c6e0: function() {
2923
- const ret = new Array();
3050
+ __wbg_new_7796ffc7ed656783: function() {
3051
+ const ret = new Map();
2924
3052
  return ret;
2925
3053
  },
2926
- __wbg_new_4a05b166716eeed6: function(arg0) {
2927
- const ret = new Set(arg0);
3054
+ __wbg_new_b667d279fd5aa943: function(arg0, arg1) {
3055
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
2928
3056
  return ret;
2929
3057
  },
2930
- __wbg_new_81880fb5002cb255: function(arg0) {
3058
+ __wbg_new_cd45aabdf6073e84: function(arg0) {
2931
3059
  const ret = new Uint8Array(arg0);
2932
3060
  return ret;
2933
3061
  },
2934
- __wbg_new_e66a4b7758dd2e5c: function(arg0, arg1) {
2935
- const ret = new Error(getStringFromWasm0(arg0, arg1));
3062
+ __wbg_new_e64f7b1e88921146: function(arg0) {
3063
+ const ret = new Set(arg0);
2936
3064
  return ret;
2937
3065
  },
2938
- __wbg_new_from_slice_543b875b27789a8f: function(arg0, arg1) {
3066
+ __wbg_new_from_slice_77cdfb7977362f3c: function(arg0, arg1) {
2939
3067
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
2940
3068
  return ret;
2941
3069
  },
2942
- __wbg_new_typed_00a409eb4ec4f2d9: function(arg0, arg1) {
3070
+ __wbg_new_typed_1824d93f294193e5: function(arg0, arg1) {
2943
3071
  try {
2944
3072
  var state0 = {a: arg0, b: arg1};
2945
3073
  var cb0 = (arg0, arg1) => {
2946
3074
  const a = state0.a;
2947
3075
  state0.a = 0;
2948
3076
  try {
2949
- return wasm_bindgen__convert__closures_____invoke__h1ce7fe53f08aa9a8(a, state0.b, arg0, arg1);
3077
+ return wasm_bindgen__convert__closures_____invoke__h58982df154245cbc(a, state0.b, arg0, arg1);
2950
3078
  } finally {
2951
3079
  state0.a = a;
2952
3080
  }
@@ -2957,7 +3085,7 @@ function __wbg_get_imports() {
2957
3085
  state0.a = 0;
2958
3086
  }
2959
3087
  },
2960
- __wbg_new_with_length_9b650f44b5c44a4e: function(arg0) {
3088
+ __wbg_new_with_length_e6785c33c8e4cce8: function(arg0) {
2961
3089
  const ret = new Uint8Array(arg0 >>> 0);
2962
3090
  return ret;
2963
3091
  },
@@ -2969,18 +3097,18 @@ function __wbg_get_imports() {
2969
3097
  const ret = arg0.process;
2970
3098
  return ret;
2971
3099
  },
2972
- __wbg_prototypesetcall_d721637c7ca66eb8: function(arg0, arg1, arg2) {
3100
+ __wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
2973
3101
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
2974
3102
  },
2975
- __wbg_push_f724b5db8acf89d2: function(arg0, arg1) {
3103
+ __wbg_push_d2ae3af0c1217ae6: function(arg0, arg1) {
2976
3104
  const ret = arg0.push(arg1);
2977
3105
  return ret;
2978
3106
  },
2979
- __wbg_queueMicrotask_1c9b3800e321a967: function(arg0) {
3107
+ __wbg_queueMicrotask_0ab5b2d2393e99b9: function(arg0) {
2980
3108
  const ret = arg0.queueMicrotask;
2981
3109
  return ret;
2982
3110
  },
2983
- __wbg_queueMicrotask_311744e534a929a3: function(arg0) {
3111
+ __wbg_queueMicrotask_6a09b7bc46549209: function(arg0) {
2984
3112
  queueMicrotask(arg0);
2985
3113
  },
2986
3114
  __wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
@@ -2990,22 +3118,22 @@ function __wbg_get_imports() {
2990
3118
  const ret = module.require;
2991
3119
  return ret;
2992
3120
  }, arguments); },
2993
- __wbg_resolve_d82363d90af6928a: function(arg0) {
3121
+ __wbg_resolve_2191a4dfe481c25b: function(arg0) {
2994
3122
  const ret = Promise.resolve(arg0);
2995
3123
  return ret;
2996
3124
  },
2997
- __wbg_set_9a1d61e17de7054c: function(arg0, arg1, arg2) {
3125
+ __wbg_set_575dd786d51585f8: function(arg0, arg1, arg2) {
2998
3126
  const ret = arg0.set(arg1, arg2);
2999
3127
  return ret;
3000
3128
  },
3001
- __wbg_set_name_15bb90053efbc017: function(arg0, arg1, arg2) {
3129
+ __wbg_set_name_3bbc583faefa4193: function(arg0, arg1, arg2) {
3002
3130
  arg0.name = getStringFromWasm0(arg1, arg2);
3003
3131
  },
3004
3132
  __wbg_sharekey_new: function(arg0) {
3005
3133
  const ret = ShareKey.__wrap(arg0);
3006
3134
  return ret;
3007
3135
  },
3008
- __wbg_sign_12a498c8600b5618: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
3136
+ __wbg_sign_1b8fb33c8d16115e: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
3009
3137
  const ret = arg0.sign(arg1, arg2, getArrayU8FromWasm0(arg3, arg4));
3010
3138
  return ret;
3011
3139
  }, arguments); },
@@ -3032,19 +3160,19 @@ function __wbg_get_imports() {
3032
3160
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3033
3161
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3034
3162
  },
3035
- __wbg_static_accessor_GLOBAL_THIS_2fee5048bcca5938: function() {
3036
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
3163
+ __wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
3164
+ const ret = typeof global === 'undefined' ? null : global;
3037
3165
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3038
3166
  },
3039
- __wbg_static_accessor_GLOBAL_ce44e66a4935da8c: function() {
3040
- const ret = typeof global === 'undefined' ? null : global;
3167
+ __wbg_static_accessor_GLOBAL_THIS_8d1badc68b5a74f4: function() {
3168
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
3041
3169
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3042
3170
  },
3043
- __wbg_static_accessor_SELF_44f6e0cb5e67cdad: function() {
3171
+ __wbg_static_accessor_SELF_146583524fe1469b: function() {
3044
3172
  const ret = typeof self === 'undefined' ? null : self;
3045
3173
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3046
3174
  },
3047
- __wbg_static_accessor_WINDOW_168f178805d978fe: function() {
3175
+ __wbg_static_accessor_WINDOW_f2829a2234d7819e: function() {
3048
3176
  const ret = typeof window === 'undefined' ? null : window;
3049
3177
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3050
3178
  },
@@ -3052,11 +3180,11 @@ function __wbg_get_imports() {
3052
3180
  const ret = Stats.__wrap(arg0);
3053
3181
  return ret;
3054
3182
  },
3055
- __wbg_subarray_b0e8ac4ed313fea8: function(arg0, arg1, arg2) {
3183
+ __wbg_subarray_3ed232c8a6baee09: function(arg0, arg1, arg2) {
3056
3184
  const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
3057
3185
  return ret;
3058
3186
  },
3059
- __wbg_subtle_1287656b3b345d44: function(arg0) {
3187
+ __wbg_subtle_ed1dfcaede24af07: function(arg0) {
3060
3188
  const ret = arg0.subtle;
3061
3189
  return ret;
3062
3190
  },
@@ -3064,11 +3192,11 @@ function __wbg_get_imports() {
3064
3192
  const ret = Summary.__wrap(arg0);
3065
3193
  return ret;
3066
3194
  },
3067
- __wbg_then_05edfc8a4fea5106: function(arg0, arg1, arg2) {
3195
+ __wbg_then_16d107c451e9905d: function(arg0, arg1, arg2) {
3068
3196
  const ret = arg0.then(arg1, arg2);
3069
3197
  return ret;
3070
3198
  },
3071
- __wbg_then_591b6b3a75ee817a: function(arg0, arg1) {
3199
+ __wbg_then_6ec10ae38b3e92f7: function(arg0, arg1) {
3072
3200
  const ret = arg0.then(arg1);
3073
3201
  return ret;
3074
3202
  },
@@ -3099,8 +3227,8 @@ function __wbg_get_imports() {
3099
3227
  }
3100
3228
  },
3101
3229
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
3102
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 711, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3103
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hd575a1431d676418);
3230
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 716, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3231
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h9887d5ab72723f8a);
3104
3232
  return ret;
3105
3233
  },
3106
3234
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
@@ -3185,23 +3313,20 @@ function __wbg_get_imports() {
3185
3313
  };
3186
3314
  }
3187
3315
 
3188
- function wasm_bindgen__convert__closures_____invoke__hd575a1431d676418(arg0, arg1, arg2) {
3189
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__hd575a1431d676418(arg0, arg1, arg2);
3316
+ function wasm_bindgen__convert__closures_____invoke__h9887d5ab72723f8a(arg0, arg1, arg2) {
3317
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h9887d5ab72723f8a(arg0, arg1, arg2);
3190
3318
  if (ret[1]) {
3191
3319
  throw takeFromExternrefTable0(ret[0]);
3192
3320
  }
3193
3321
  }
3194
3322
 
3195
- function wasm_bindgen__convert__closures_____invoke__h1ce7fe53f08aa9a8(arg0, arg1, arg2, arg3) {
3196
- wasm.wasm_bindgen__convert__closures_____invoke__h1ce7fe53f08aa9a8(arg0, arg1, arg2, arg3);
3323
+ function wasm_bindgen__convert__closures_____invoke__h58982df154245cbc(arg0, arg1, arg2, arg3) {
3324
+ wasm.wasm_bindgen__convert__closures_____invoke__h58982df154245cbc(arg0, arg1, arg2, arg3);
3197
3325
  }
3198
3326
 
3199
3327
  const AccessFinalization = (typeof FinalizationRegistry === 'undefined')
3200
3328
  ? { register: () => {}, unregister: () => {} }
3201
3329
  : new FinalizationRegistry(ptr => wasm.__wbg_access_free(ptr, 1));
3202
- const AddMemberUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
3203
- ? { register: () => {}, unregister: () => {} }
3204
- : new FinalizationRegistry(ptr => wasm.__wbg_addmemberupdate_free(ptr, 1));
3205
3330
  const AgentFinalization = (typeof FinalizationRegistry === 'undefined')
3206
3331
  ? { register: () => {}, unregister: () => {} }
3207
3332
  : new FinalizationRegistry(ptr => wasm.__wbg_agent_free(ptr, 1));
@@ -3232,6 +3357,9 @@ const CiphertextStoreFinalization = (typeof FinalizationRegistry === 'undefined'
3232
3357
  const ContactCardFinalization = (typeof FinalizationRegistry === 'undefined')
3233
3358
  ? { register: () => {}, unregister: () => {} }
3234
3359
  : new FinalizationRegistry(ptr => wasm.__wbg_contactcard_free(ptr, 1));
3360
+ const DecryptedKeyedFinalization = (typeof FinalizationRegistry === 'undefined')
3361
+ ? { register: () => {}, unregister: () => {} }
3362
+ : new FinalizationRegistry(ptr => wasm.__wbg_decryptedkeyed_free(ptr, 1));
3235
3363
  const DelegationFinalization = (typeof FinalizationRegistry === 'undefined')
3236
3364
  ? { register: () => {}, unregister: () => {} }
3237
3365
  : new FinalizationRegistry(ptr => wasm.__wbg_delegation_free(ptr, 1));
@@ -3250,6 +3378,9 @@ const EncryptedFinalization = (typeof FinalizationRegistry === 'undefined')
3250
3378
  const EncryptedContentWithUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
3251
3379
  ? { register: () => {}, unregister: () => {} }
3252
3380
  : new FinalizationRegistry(ptr => wasm.__wbg_encryptedcontentwithupdate_free(ptr, 1));
3381
+ const EncryptedKeyedFinalization = (typeof FinalizationRegistry === 'undefined')
3382
+ ? { register: () => {}, unregister: () => {} }
3383
+ : new FinalizationRegistry(ptr => wasm.__wbg_encryptedkeyed_free(ptr, 1));
3253
3384
  const EventFinalization = (typeof FinalizationRegistry === 'undefined')
3254
3385
  ? { register: () => {}, unregister: () => {} }
3255
3386
  : new FinalizationRegistry(ptr => wasm.__wbg_event_free(ptr, 1));