node-tkms 0.10.0-rc1 → 0.11.0-rc13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/kms_lib.js CHANGED
@@ -2,11 +2,9 @@
2
2
  let imports = {};
3
3
  imports['__wbindgen_placeholder__'] = module.exports;
4
4
  let wasm;
5
- const { TextDecoder, TextEncoder } = require(`util`);
5
+ const { TextEncoder, TextDecoder } = require(`util`);
6
6
 
7
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
8
-
9
- cachedTextDecoder.decode();
7
+ let WASM_VECTOR_LEN = 0;
10
8
 
11
9
  let cachedUint8ArrayMemory0 = null;
12
10
 
@@ -17,26 +15,6 @@ function getUint8ArrayMemory0() {
17
15
  return cachedUint8ArrayMemory0;
18
16
  }
19
17
 
20
- function getStringFromWasm0(ptr, len) {
21
- ptr = ptr >>> 0;
22
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
23
- }
24
-
25
- function isLikeNone(x) {
26
- return x === undefined || x === null;
27
- }
28
-
29
- let cachedDataViewMemory0 = null;
30
-
31
- function getDataViewMemory0() {
32
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
33
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
34
- }
35
- return cachedDataViewMemory0;
36
- }
37
-
38
- let WASM_VECTOR_LEN = 0;
39
-
40
18
  let cachedTextEncoder = new TextEncoder('utf-8');
41
19
 
42
20
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -91,6 +69,43 @@ function passStringToWasm0(arg, malloc, realloc) {
91
69
  return ptr;
92
70
  }
93
71
 
72
+ let cachedDataViewMemory0 = null;
73
+
74
+ function getDataViewMemory0() {
75
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
76
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
77
+ }
78
+ return cachedDataViewMemory0;
79
+ }
80
+
81
+ function addToExternrefTable0(obj) {
82
+ const idx = wasm.__externref_table_alloc();
83
+ wasm.__wbindgen_export_4.set(idx, obj);
84
+ return idx;
85
+ }
86
+
87
+ function handleError(f, args) {
88
+ try {
89
+ return f.apply(this, args);
90
+ } catch (e) {
91
+ const idx = addToExternrefTable0(e);
92
+ wasm.__wbindgen_exn_store(idx);
93
+ }
94
+ }
95
+
96
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
97
+
98
+ cachedTextDecoder.decode();
99
+
100
+ function getStringFromWasm0(ptr, len) {
101
+ ptr = ptr >>> 0;
102
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
103
+ }
104
+
105
+ function isLikeNone(x) {
106
+ return x === undefined || x === null;
107
+ }
108
+
94
109
  function debugString(val) {
95
110
  // primitive types
96
111
  const type = typeof val;
@@ -132,7 +147,7 @@ function debugString(val) {
132
147
  // Test for built-in
133
148
  const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
134
149
  let className;
135
- if (builtInMatches.length > 1) {
150
+ if (builtInMatches && builtInMatches.length > 1) {
136
151
  className = builtInMatches[1];
137
152
  } else {
138
153
  // Failed to match the standard '[object ClassName]'
@@ -156,23 +171,15 @@ function debugString(val) {
156
171
  return className;
157
172
  }
158
173
 
159
- function getArrayU8FromWasm0(ptr, len) {
160
- ptr = ptr >>> 0;
161
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
162
- }
163
-
164
- function passArray8ToWasm0(arg, malloc) {
165
- const ptr = malloc(arg.length * 1, 1) >>> 0;
166
- getUint8ArrayMemory0().set(arg, ptr / 1);
167
- WASM_VECTOR_LEN = arg.length;
168
- return ptr;
169
- }
170
-
171
174
  function _assertClass(instance, klass) {
172
175
  if (!(instance instanceof klass)) {
173
176
  throw new Error(`expected instance of ${klass.name}`);
174
177
  }
175
- return instance.ptr;
178
+ }
179
+
180
+ function getArrayU8FromWasm0(ptr, len) {
181
+ ptr = ptr >>> 0;
182
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
176
183
  }
177
184
  /**
178
185
  * @param {PublicSigKey} pk
@@ -186,8 +193,15 @@ module.exports.public_sig_key_to_u8vec = function(pk) {
186
193
  return v1;
187
194
  };
188
195
 
196
+ function passArray8ToWasm0(arg, malloc) {
197
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
198
+ getUint8ArrayMemory0().set(arg, ptr / 1);
199
+ WASM_VECTOR_LEN = arg.length;
200
+ return ptr;
201
+ }
202
+
189
203
  function takeFromExternrefTable0(idx) {
190
- const value = wasm.__wbindgen_export_2.get(idx);
204
+ const value = wasm.__wbindgen_export_4.get(idx);
191
205
  wasm.__externref_table_dealloc(idx);
192
206
  return value;
193
207
  }
@@ -234,17 +248,11 @@ module.exports.u8vec_to_private_sig_key = function(v) {
234
248
  return PrivateSigKey.__wrap(ret[0]);
235
249
  };
236
250
 
237
- function addToExternrefTable0(obj) {
238
- const idx = wasm.__externref_table_alloc();
239
- wasm.__wbindgen_export_2.set(idx, obj);
240
- return idx;
241
- }
242
-
243
251
  function passArrayJsValueToWasm0(array, malloc) {
244
252
  const ptr = malloc(array.length * 4, 4) >>> 0;
245
- const mem = getDataViewMemory0();
246
253
  for (let i = 0; i < array.length; i++) {
247
- mem.setUint32(ptr + 4 * i, addToExternrefTable0(array[i]), true);
254
+ const add = addToExternrefTable0(array[i]);
255
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
248
256
  }
249
257
  WASM_VECTOR_LEN = array.length;
250
258
  return ptr;
@@ -258,19 +266,19 @@ function passArrayJsValueToWasm0(array, malloc) {
258
266
  * * `client_address_hex` - the client (wallet) address in hex,
259
267
  * must be prefixed with "0x".
260
268
  *
261
- * * `param_choice` - the parameter choice, which can be either `"test"` or `"default"`.
269
+ * * `fhe_parameter` - the parameter choice, which can be either `"test"` or `"default"`.
262
270
  * The "default" parameter choice is selected if no matching string is found.
263
- * @param {(string)[]} server_addrs
271
+ * @param {string[]} server_addrs
264
272
  * @param {string} client_address_hex
265
- * @param {string} param_choice
273
+ * @param {string} fhe_parameter
266
274
  * @returns {Client}
267
275
  */
268
- module.exports.new_client = function(server_addrs, client_address_hex, param_choice) {
276
+ module.exports.new_client = function(server_addrs, client_address_hex, fhe_parameter) {
269
277
  const ptr0 = passArrayJsValueToWasm0(server_addrs, wasm.__wbindgen_malloc);
270
278
  const len0 = WASM_VECTOR_LEN;
271
279
  const ptr1 = passStringToWasm0(client_address_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
272
280
  const len1 = WASM_VECTOR_LEN;
273
- const ptr2 = passStringToWasm0(param_choice, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
281
+ const ptr2 = passStringToWasm0(fhe_parameter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
274
282
  const len2 = WASM_VECTOR_LEN;
275
283
  const ret = wasm.new_client(ptr0, len0, ptr1, len1, ptr2, len2);
276
284
  if (ret[2]) {
@@ -284,14 +292,14 @@ function getArrayJsValueFromWasm0(ptr, len) {
284
292
  const mem = getDataViewMemory0();
285
293
  const result = [];
286
294
  for (let i = ptr; i < ptr + 4 * len; i += 4) {
287
- result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
295
+ result.push(wasm.__wbindgen_export_4.get(mem.getUint32(i, true)));
288
296
  }
289
297
  wasm.__externref_drop_slice(ptr, len);
290
298
  return result;
291
299
  }
292
300
  /**
293
301
  * @param {Client} client
294
- * @returns {(string)[]}
302
+ * @returns {string[]}
295
303
  */
296
304
  module.exports.get_server_addrs = function(client) {
297
305
  _assertClass(client, Client);
@@ -437,22 +445,23 @@ module.exports.cryptobox_decrypt = function(ct, my_sk, their_pk) {
437
445
  };
438
446
 
439
447
  /**
440
- * Process the reencryption response from JavaScript objects.
448
+ * Process the user_decryption response from JavaScript objects.
441
449
  * The returned result is a byte array representing a plaintext of any length,
442
450
  * postprocessing is returned to turn it into an integer.
443
451
  *
444
- * * `client` - client that wants to perform reencryption.
452
+ * * `client` - client that wants to perform user_decryption.
445
453
  *
446
- * * `request` - the initial reencryption request JS object.
454
+ * * `request` - the initial user_decryption request JS object.
447
455
  * It can be set to null if `verify` is false.
448
456
  * Otherwise the caller needs to give the following JS object.
449
457
  * Note that `client_address` and `eip712_verifying_contract` follow EIP-55.
458
+ * The signature field is not needed.
450
459
  * ```
451
460
  * {
452
- * signature: '15a4f9a8eb61459cfba7d103d8f911fb04ce91ecf841b34c49c0d56a70b896d20cbc31986188f91efc3842b7df215cee8acb40178daedb8b63d0ba5d199bce121c',
461
+ * signature: undefined,
453
462
  * client_address: '0x17853A630aAe15AED549B2B874de08B73C0F59c5',
454
463
  * enc_key: '2000000000000000df2fcacb774f03187f3802a27259f45c06d33cefa68d9c53426b15ad531aa822',
455
- * ciphertext_handle: '0748b542afe2353c86cb707e3d21044b0be1fd18efc7cbaa6a415af055bfb358',
464
+ * ciphertext_handles: [ '0748b542afe2353c86cb707e3d21044b0be1fd18efc7cbaa6a415af055bfb358' ]
456
465
  * eip712_verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657'
457
466
  * }
458
467
  * ```
@@ -501,36 +510,36 @@ module.exports.cryptobox_decrypt = function(ct, my_sk, their_pk) {
501
510
  * @param {PublicEncKey} enc_pk
502
511
  * @param {PrivateEncKey} enc_sk
503
512
  * @param {boolean} verify
504
- * @returns {Uint8Array}
513
+ * @returns {TypedPlaintext[]}
505
514
  */
506
- module.exports.process_reencryption_resp_from_js = function(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
515
+ module.exports.process_user_decryption_resp_from_js = function(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
507
516
  _assertClass(client, Client);
508
517
  _assertClass(enc_pk, PublicEncKey);
509
518
  _assertClass(enc_sk, PrivateEncKey);
510
- const ret = wasm.process_reencryption_resp_from_js(client.__wbg_ptr, request, eip712_domain, agg_resp, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
519
+ 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);
511
520
  if (ret[3]) {
512
521
  throw takeFromExternrefTable0(ret[2]);
513
522
  }
514
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
515
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
523
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
524
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
516
525
  return v1;
517
526
  };
518
527
 
519
528
  /**
520
- * Process the reencryption response from Rust objects.
521
- * Consider using [process_reencryption_resp_from_js]
529
+ * Process the user_decryption response from Rust objects.
530
+ * Consider using [process_user_decryption_resp_from_js]
522
531
  * when using the JS API.
523
532
  * The result is a byte array representing a plaintext of any length.
524
533
  *
525
- * * `client` - client that wants to perform reencryption.
534
+ * * `client` - client that wants to perform user_decryption.
526
535
  *
527
- * * `request` - the initial reencryption request.
536
+ * * `request` - the initial user_decryption request.
528
537
  * Must be given if `verify` is true.
529
538
  *
530
539
  * * `eip712_domain` - the EIP-712 domain.
531
540
  * Must be given if `verify` is true.
532
541
  *
533
- * * `agg_resp` - the vector of reencryption responses.
542
+ * * `agg_resp` - the vector of user_decryption responses.
534
543
  *
535
544
  * * `enc_pk` - The ephemeral public key.
536
545
  *
@@ -539,19 +548,19 @@ module.exports.process_reencryption_resp_from_js = function(client, request, eip
539
548
  * * `verify` - Whether to perform signature verification for the response.
540
549
  * It is insecure if `verify = false`!
541
550
  * @param {Client} client
542
- * @param {ParsedReencryptionRequest | undefined} request
543
- * @param {Eip712DomainMsg | undefined} eip712_domain
544
- * @param {(ReencryptionResponse)[]} agg_resp
551
+ * @param {ParsedUserDecryptionRequest | null | undefined} request
552
+ * @param {Eip712DomainMsg | null | undefined} eip712_domain
553
+ * @param {UserDecryptionResponse[]} agg_resp
545
554
  * @param {PublicEncKey} enc_pk
546
555
  * @param {PrivateEncKey} enc_sk
547
556
  * @param {boolean} verify
548
- * @returns {Uint8Array}
557
+ * @returns {TypedPlaintext[]}
549
558
  */
550
- module.exports.process_reencryption_resp = function(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
559
+ module.exports.process_user_decryption_resp = function(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
551
560
  _assertClass(client, Client);
552
561
  let ptr0 = 0;
553
562
  if (!isLikeNone(request)) {
554
- _assertClass(request, ParsedReencryptionRequest);
563
+ _assertClass(request, ParsedUserDecryptionRequest);
555
564
  ptr0 = request.__destroy_into_raw();
556
565
  }
557
566
  let ptr1 = 0;
@@ -563,27 +572,34 @@ module.exports.process_reencryption_resp = function(client, request, eip712_doma
563
572
  const len2 = WASM_VECTOR_LEN;
564
573
  _assertClass(enc_pk, PublicEncKey);
565
574
  _assertClass(enc_sk, PrivateEncKey);
566
- const ret = wasm.process_reencryption_resp(client.__wbg_ptr, ptr0, ptr1, ptr2, len2, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
575
+ const ret = wasm.process_user_decryption_resp(client.__wbg_ptr, ptr0, ptr1, ptr2, len2, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
567
576
  if (ret[3]) {
568
577
  throw takeFromExternrefTable0(ret[2]);
569
578
  }
570
- var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
571
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
579
+ var v4 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
580
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
572
581
  return v4;
573
582
  };
574
583
 
575
- function handleError(f, args) {
576
- try {
577
- return f.apply(this, args);
578
- } catch (e) {
579
- const idx = addToExternrefTable0(e);
580
- wasm.__wbindgen_exn_store(idx);
584
+ const CiphertextHandleFinalization = (typeof FinalizationRegistry === 'undefined')
585
+ ? { register: () => {}, unregister: () => {} }
586
+ : new FinalizationRegistry(ptr => wasm.__wbg_ciphertexthandle_free(ptr >>> 0, 1));
587
+
588
+ class CiphertextHandle {
589
+
590
+ __destroy_into_raw() {
591
+ const ptr = this.__wbg_ptr;
592
+ this.__wbg_ptr = 0;
593
+ CiphertextHandleFinalization.unregister(this);
594
+ return ptr;
595
+ }
596
+
597
+ free() {
598
+ const ptr = this.__destroy_into_raw();
599
+ wasm.__wbg_ciphertexthandle_free(ptr, 0);
581
600
  }
582
601
  }
583
- /**
584
- * The plaintext types that can be encrypted in a fhevm ciphertext.
585
- */
586
- module.exports.FheType = Object.freeze({ Ebool:0,"0":"Ebool",Euint4:1,"1":"Euint4",Euint8:2,"2":"Euint8",Euint16:3,"3":"Euint16",Euint32:4,"4":"Euint32",Euint64:5,"5":"Euint64",Euint128:6,"6":"Euint128",Euint160:7,"7":"Euint160",Euint256:8,"8":"Euint256",Euint512:9,"9":"Euint512",Euint1024:10,"10":"Euint1024",Euint2048:11,"11":"Euint2048", });
602
+ module.exports.CiphertextHandle = CiphertextHandle;
587
603
 
588
604
  const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
589
605
  ? { register: () => {}, unregister: () => {} }
@@ -775,7 +791,7 @@ class Eip712DomainMsg {
775
791
  return v1;
776
792
  }
777
793
  /**
778
- * @param {Uint8Array | undefined} [arg0]
794
+ * @param {Uint8Array | null} [arg0]
779
795
  */
780
796
  set salt(arg0) {
781
797
  var ptr0 = isLikeNone(arg0) ? 0 : passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
@@ -785,27 +801,27 @@ class Eip712DomainMsg {
785
801
  }
786
802
  module.exports.Eip712DomainMsg = Eip712DomainMsg;
787
803
 
788
- const ParsedReencryptionRequestFinalization = (typeof FinalizationRegistry === 'undefined')
804
+ const ParsedUserDecryptionRequestFinalization = (typeof FinalizationRegistry === 'undefined')
789
805
  ? { register: () => {}, unregister: () => {} }
790
- : new FinalizationRegistry(ptr => wasm.__wbg_parsedreencryptionrequest_free(ptr >>> 0, 1));
806
+ : new FinalizationRegistry(ptr => wasm.__wbg_parseduserdecryptionrequest_free(ptr >>> 0, 1));
791
807
  /**
792
808
  * Validity of this struct is not checked.
793
809
  */
794
- class ParsedReencryptionRequest {
810
+ class ParsedUserDecryptionRequest {
795
811
 
796
812
  __destroy_into_raw() {
797
813
  const ptr = this.__wbg_ptr;
798
814
  this.__wbg_ptr = 0;
799
- ParsedReencryptionRequestFinalization.unregister(this);
815
+ ParsedUserDecryptionRequestFinalization.unregister(this);
800
816
  return ptr;
801
817
  }
802
818
 
803
819
  free() {
804
820
  const ptr = this.__destroy_into_raw();
805
- wasm.__wbg_parsedreencryptionrequest_free(ptr, 0);
821
+ wasm.__wbg_parseduserdecryptionrequest_free(ptr, 0);
806
822
  }
807
823
  }
808
- module.exports.ParsedReencryptionRequest = ParsedReencryptionRequest;
824
+ module.exports.ParsedUserDecryptionRequest = ParsedUserDecryptionRequest;
809
825
 
810
826
  const PrivateEncKeyFinalization = (typeof FinalizationRegistry === 'undefined')
811
827
  ? { register: () => {}, unregister: () => {} }
@@ -919,221 +935,411 @@ class PublicSigKey {
919
935
  }
920
936
  module.exports.PublicSigKey = PublicSigKey;
921
937
 
922
- const ReencryptionRequestFinalization = (typeof FinalizationRegistry === 'undefined')
938
+ const RequestIdFinalization = (typeof FinalizationRegistry === 'undefined')
923
939
  ? { register: () => {}, unregister: () => {} }
924
- : new FinalizationRegistry(ptr => wasm.__wbg_reencryptionrequest_free(ptr >>> 0, 1));
940
+ : new FinalizationRegistry(ptr => wasm.__wbg_requestid_free(ptr >>> 0, 1));
941
+ /**
942
+ * Simple response to return a 32 Byte / 256 Bit ID, to be used to retrieve the
943
+ * computed result later on. This string does NOT contain a `0x` prefix.
944
+ */
945
+ class RequestId {
925
946
 
926
- class ReencryptionRequest {
947
+ static __wrap(ptr) {
948
+ ptr = ptr >>> 0;
949
+ const obj = Object.create(RequestId.prototype);
950
+ obj.__wbg_ptr = ptr;
951
+ RequestIdFinalization.register(obj, obj.__wbg_ptr, obj);
952
+ return obj;
953
+ }
927
954
 
928
955
  __destroy_into_raw() {
929
956
  const ptr = this.__wbg_ptr;
930
957
  this.__wbg_ptr = 0;
931
- ReencryptionRequestFinalization.unregister(this);
958
+ RequestIdFinalization.unregister(this);
932
959
  return ptr;
933
960
  }
934
961
 
935
962
  free() {
936
963
  const ptr = this.__destroy_into_raw();
937
- wasm.__wbg_reencryptionrequest_free(ptr, 0);
938
- }
939
- /**
940
- * Signature of the serialization of \[ReencryptionRequestPayload\].
941
- * @returns {Uint8Array}
942
- */
943
- get signature() {
944
- const ret = wasm.__wbg_get_reencryptionrequest_signature(this.__wbg_ptr);
945
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
946
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
947
- return v1;
948
- }
949
- /**
950
- * Signature of the serialization of \[ReencryptionRequestPayload\].
951
- * @param {Uint8Array} arg0
952
- */
953
- set signature(arg0) {
954
- const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
955
- const len0 = WASM_VECTOR_LEN;
956
- wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
957
- }
958
- /**
959
- * @returns {ReencryptionRequestPayload | undefined}
960
- */
961
- get payload() {
962
- const ret = wasm.__wbg_get_reencryptionrequest_payload(this.__wbg_ptr);
963
- return ret === 0 ? undefined : ReencryptionRequestPayload.__wrap(ret);
964
- }
965
- /**
966
- * @param {ReencryptionRequestPayload | undefined} [arg0]
967
- */
968
- set payload(arg0) {
969
- let ptr0 = 0;
970
- if (!isLikeNone(arg0)) {
971
- _assertClass(arg0, ReencryptionRequestPayload);
972
- ptr0 = arg0.__destroy_into_raw();
973
- }
974
- wasm.__wbg_set_reencryptionrequest_payload(this.__wbg_ptr, ptr0);
975
- }
976
- /**
977
- * @returns {Eip712DomainMsg | undefined}
978
- */
979
- get domain() {
980
- const ret = wasm.__wbg_get_reencryptionrequest_domain(this.__wbg_ptr);
981
- return ret === 0 ? undefined : Eip712DomainMsg.__wrap(ret);
982
- }
983
- /**
984
- * @param {Eip712DomainMsg | undefined} [arg0]
985
- */
986
- set domain(arg0) {
987
- let ptr0 = 0;
988
- if (!isLikeNone(arg0)) {
989
- _assertClass(arg0, Eip712DomainMsg);
990
- ptr0 = arg0.__destroy_into_raw();
991
- }
992
- wasm.__wbg_set_reencryptionrequest_domain(this.__wbg_ptr, ptr0);
964
+ wasm.__wbg_requestid_free(ptr, 0);
993
965
  }
994
966
  /**
995
- * The ID that identifies this request.
996
- * Future queries for the result must use this request ID.
997
- * @returns {RequestId | undefined}
967
+ * @returns {string}
998
968
  */
999
969
  get request_id() {
1000
- const ret = wasm.__wbg_get_reencryptionrequest_request_id(this.__wbg_ptr);
1001
- return ret === 0 ? undefined : RequestId.__wrap(ret);
970
+ let deferred1_0;
971
+ let deferred1_1;
972
+ try {
973
+ const ret = wasm.__wbg_get_requestid_request_id(this.__wbg_ptr);
974
+ deferred1_0 = ret[0];
975
+ deferred1_1 = ret[1];
976
+ return getStringFromWasm0(ret[0], ret[1]);
977
+ } finally {
978
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
979
+ }
1002
980
  }
1003
981
  /**
1004
- * The ID that identifies this request.
1005
- * Future queries for the result must use this request ID.
1006
- * @param {RequestId | undefined} [arg0]
982
+ * @param {string} arg0
1007
983
  */
1008
984
  set request_id(arg0) {
1009
- let ptr0 = 0;
1010
- if (!isLikeNone(arg0)) {
1011
- _assertClass(arg0, RequestId);
1012
- ptr0 = arg0.__destroy_into_raw();
1013
- }
1014
- wasm.__wbg_set_reencryptionrequest_request_id(this.__wbg_ptr, ptr0);
985
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
986
+ const len0 = WASM_VECTOR_LEN;
987
+ wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1015
988
  }
1016
989
  }
1017
- module.exports.ReencryptionRequest = ReencryptionRequest;
990
+ module.exports.RequestId = RequestId;
1018
991
 
1019
- const ReencryptionRequestPayloadFinalization = (typeof FinalizationRegistry === 'undefined')
992
+ const TypedCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
1020
993
  ? { register: () => {}, unregister: () => {} }
1021
- : new FinalizationRegistry(ptr => wasm.__wbg_reencryptionrequestpayload_free(ptr >>> 0, 1));
994
+ : new FinalizationRegistry(ptr => wasm.__wbg_typedciphertext_free(ptr >>> 0, 1));
1022
995
 
1023
- class ReencryptionRequestPayload {
996
+ class TypedCiphertext {
1024
997
 
1025
998
  static __wrap(ptr) {
1026
999
  ptr = ptr >>> 0;
1027
- const obj = Object.create(ReencryptionRequestPayload.prototype);
1000
+ const obj = Object.create(TypedCiphertext.prototype);
1028
1001
  obj.__wbg_ptr = ptr;
1029
- ReencryptionRequestPayloadFinalization.register(obj, obj.__wbg_ptr, obj);
1002
+ TypedCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
1030
1003
  return obj;
1031
1004
  }
1032
1005
 
1006
+ static __unwrap(jsValue) {
1007
+ if (!(jsValue instanceof TypedCiphertext)) {
1008
+ return 0;
1009
+ }
1010
+ return jsValue.__destroy_into_raw();
1011
+ }
1012
+
1033
1013
  __destroy_into_raw() {
1034
1014
  const ptr = this.__wbg_ptr;
1035
1015
  this.__wbg_ptr = 0;
1036
- ReencryptionRequestPayloadFinalization.unregister(this);
1016
+ TypedCiphertextFinalization.unregister(this);
1037
1017
  return ptr;
1038
1018
  }
1039
1019
 
1040
1020
  free() {
1041
1021
  const ptr = this.__destroy_into_raw();
1042
- wasm.__wbg_reencryptionrequestpayload_free(ptr, 0);
1022
+ wasm.__wbg_typedciphertext_free(ptr, 0);
1043
1023
  }
1044
1024
  /**
1045
- * Version of the request format.
1046
- * @returns {number}
1025
+ * The actual ciphertext to decrypt, taken directly from fhevm.
1026
+ * @returns {Uint8Array}
1047
1027
  */
1048
- get version() {
1049
- const ret = wasm.__wbg_get_reencryptionrequestpayload_version(this.__wbg_ptr);
1050
- return ret >>> 0;
1028
+ get ciphertext() {
1029
+ const ret = wasm.__wbg_get_typedciphertext_ciphertext(this.__wbg_ptr);
1030
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1031
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1032
+ return v1;
1051
1033
  }
1052
1034
  /**
1053
- * Version of the request format.
1054
- * @param {number} arg0
1035
+ * The actual ciphertext to decrypt, taken directly from fhevm.
1036
+ * @param {Uint8Array} arg0
1055
1037
  */
1056
- set version(arg0) {
1057
- wasm.__wbg_set_reencryptionrequestpayload_version(this.__wbg_ptr, arg0);
1038
+ set ciphertext(arg0) {
1039
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1040
+ const len0 = WASM_VECTOR_LEN;
1041
+ wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1058
1042
  }
1059
1043
  /**
1060
- * The client's (blockchain wallet) address,
1061
- * encoded using EIP-55.
1062
- * @returns {string}
1044
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
1045
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
1046
+ * @returns {number}
1063
1047
  */
1064
- get client_address() {
1065
- let deferred1_0;
1066
- let deferred1_1;
1067
- try {
1068
- const ret = wasm.__wbg_get_reencryptionrequestpayload_client_address(this.__wbg_ptr);
1069
- deferred1_0 = ret[0];
1070
- deferred1_1 = ret[1];
1071
- return getStringFromWasm0(ret[0], ret[1]);
1072
- } finally {
1073
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1074
- }
1048
+ get fhe_type() {
1049
+ const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
1050
+ return ret;
1075
1051
  }
1076
1052
  /**
1077
- * The client's (blockchain wallet) address,
1078
- * encoded using EIP-55.
1079
- * @param {string} arg0
1053
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
1054
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
1055
+ * @param {number} arg0
1080
1056
  */
1081
- set client_address(arg0) {
1082
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1083
- const len0 = WASM_VECTOR_LEN;
1084
- wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1057
+ set fhe_type(arg0) {
1058
+ wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
1085
1059
  }
1086
1060
  /**
1087
- * Encoding of the user's public encryption key for this request.
1088
- * Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
1089
- * Montgomery point.
1061
+ * The external handle of the ciphertext (the handle used in the copro).
1090
1062
  * @returns {Uint8Array}
1091
1063
  */
1092
- get enc_key() {
1093
- const ret = wasm.__wbg_get_reencryptionrequestpayload_enc_key(this.__wbg_ptr);
1064
+ get external_handle() {
1065
+ const ret = wasm.__wbg_get_typedciphertext_external_handle(this.__wbg_ptr);
1094
1066
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1095
1067
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1096
1068
  return v1;
1097
1069
  }
1098
1070
  /**
1099
- * Encoding of the user's public encryption key for this request.
1100
- * Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
1101
- * Montgomery point.
1071
+ * The external handle of the ciphertext (the handle used in the copro).
1102
1072
  * @param {Uint8Array} arg0
1103
1073
  */
1104
- set enc_key(arg0) {
1074
+ set external_handle(arg0) {
1105
1075
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1106
1076
  const len0 = WASM_VECTOR_LEN;
1107
1077
  wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1108
1078
  }
1109
1079
  /**
1110
- * The type of plaintext encrypted.
1080
+ * The ciphertext format, see CiphertextFormat documentation for details.
1081
+ * CiphertextFormat::default() is used if unspecified.
1111
1082
  * @returns {number}
1112
1083
  */
1113
- get fhe_type() {
1114
- const ret = wasm.__wbg_get_reencryptionrequestpayload_fhe_type(this.__wbg_ptr);
1084
+ get ciphertext_format() {
1085
+ const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
1115
1086
  return ret;
1116
1087
  }
1117
1088
  /**
1118
- * The type of plaintext encrypted.
1089
+ * The ciphertext format, see CiphertextFormat documentation for details.
1090
+ * CiphertextFormat::default() is used if unspecified.
1119
1091
  * @param {number} arg0
1120
1092
  */
1121
- set fhe_type(arg0) {
1122
- wasm.__wbg_set_reencryptionrequestpayload_fhe_type(this.__wbg_ptr, arg0);
1093
+ set ciphertext_format(arg0) {
1094
+ wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
1123
1095
  }
1124
- /**
1125
- * The key id to use for decryption. Will be the request_id used during key
1126
- * generation
1127
- * @returns {RequestId | undefined}
1128
- */
1096
+ }
1097
+ module.exports.TypedCiphertext = TypedCiphertext;
1098
+
1099
+ const TypedPlaintextFinalization = (typeof FinalizationRegistry === 'undefined')
1100
+ ? { register: () => {}, unregister: () => {} }
1101
+ : new FinalizationRegistry(ptr => wasm.__wbg_typedplaintext_free(ptr >>> 0, 1));
1102
+
1103
+ class TypedPlaintext {
1104
+
1105
+ static __wrap(ptr) {
1106
+ ptr = ptr >>> 0;
1107
+ const obj = Object.create(TypedPlaintext.prototype);
1108
+ obj.__wbg_ptr = ptr;
1109
+ TypedPlaintextFinalization.register(obj, obj.__wbg_ptr, obj);
1110
+ return obj;
1111
+ }
1112
+
1113
+ __destroy_into_raw() {
1114
+ const ptr = this.__wbg_ptr;
1115
+ this.__wbg_ptr = 0;
1116
+ TypedPlaintextFinalization.unregister(this);
1117
+ return ptr;
1118
+ }
1119
+
1120
+ free() {
1121
+ const ptr = this.__destroy_into_raw();
1122
+ wasm.__wbg_typedplaintext_free(ptr, 0);
1123
+ }
1124
+ /**
1125
+ * The actual plaintext in bytes.
1126
+ * @returns {Uint8Array}
1127
+ */
1128
+ get bytes() {
1129
+ const ret = wasm.__wbg_get_typedplaintext_bytes(this.__wbg_ptr);
1130
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1131
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1132
+ return v1;
1133
+ }
1134
+ /**
1135
+ * The actual plaintext in bytes.
1136
+ * @param {Uint8Array} arg0
1137
+ */
1138
+ set bytes(arg0) {
1139
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1140
+ const len0 = WASM_VECTOR_LEN;
1141
+ wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1142
+ }
1143
+ /**
1144
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
1145
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
1146
+ * @returns {number}
1147
+ */
1148
+ get fhe_type() {
1149
+ const ret = wasm.__wbg_get_typedplaintext_fhe_type(this.__wbg_ptr);
1150
+ return ret;
1151
+ }
1152
+ /**
1153
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
1154
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
1155
+ * @param {number} arg0
1156
+ */
1157
+ set fhe_type(arg0) {
1158
+ wasm.__wbg_set_typedplaintext_fhe_type(this.__wbg_ptr, arg0);
1159
+ }
1160
+ }
1161
+ module.exports.TypedPlaintext = TypedPlaintext;
1162
+
1163
+ const TypedSigncryptedCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
1164
+ ? { register: () => {}, unregister: () => {} }
1165
+ : new FinalizationRegistry(ptr => wasm.__wbg_typedsigncryptedciphertext_free(ptr >>> 0, 1));
1166
+
1167
+ class TypedSigncryptedCiphertext {
1168
+
1169
+ static __wrap(ptr) {
1170
+ ptr = ptr >>> 0;
1171
+ const obj = Object.create(TypedSigncryptedCiphertext.prototype);
1172
+ obj.__wbg_ptr = ptr;
1173
+ TypedSigncryptedCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
1174
+ return obj;
1175
+ }
1176
+
1177
+ static __unwrap(jsValue) {
1178
+ if (!(jsValue instanceof TypedSigncryptedCiphertext)) {
1179
+ return 0;
1180
+ }
1181
+ return jsValue.__destroy_into_raw();
1182
+ }
1183
+
1184
+ __destroy_into_raw() {
1185
+ const ptr = this.__wbg_ptr;
1186
+ this.__wbg_ptr = 0;
1187
+ TypedSigncryptedCiphertextFinalization.unregister(this);
1188
+ return ptr;
1189
+ }
1190
+
1191
+ free() {
1192
+ const ptr = this.__destroy_into_raw();
1193
+ wasm.__wbg_typedsigncryptedciphertext_free(ptr, 0);
1194
+ }
1195
+ /**
1196
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
1197
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
1198
+ * @returns {number}
1199
+ */
1200
+ get fhe_type() {
1201
+ const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
1202
+ return ret;
1203
+ }
1204
+ /**
1205
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
1206
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
1207
+ * @param {number} arg0
1208
+ */
1209
+ set fhe_type(arg0) {
1210
+ wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
1211
+ }
1212
+ /**
1213
+ * The signcrypted payload, using a hybrid encryption approach in
1214
+ * sign-then-encrypt.
1215
+ * @returns {Uint8Array}
1216
+ */
1217
+ get signcrypted_ciphertext() {
1218
+ const ret = wasm.__wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext(this.__wbg_ptr);
1219
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1220
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1221
+ return v1;
1222
+ }
1223
+ /**
1224
+ * The signcrypted payload, using a hybrid encryption approach in
1225
+ * sign-then-encrypt.
1226
+ * @param {Uint8Array} arg0
1227
+ */
1228
+ set signcrypted_ciphertext(arg0) {
1229
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1230
+ const len0 = WASM_VECTOR_LEN;
1231
+ wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1232
+ }
1233
+ /**
1234
+ * The external handles that were originally in the request.
1235
+ * @returns {Uint8Array}
1236
+ */
1237
+ get external_handle() {
1238
+ const ret = wasm.__wbg_get_typedsigncryptedciphertext_external_handle(this.__wbg_ptr);
1239
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1240
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1241
+ return v1;
1242
+ }
1243
+ /**
1244
+ * The external handles that were originally in the request.
1245
+ * @param {Uint8Array} arg0
1246
+ */
1247
+ set external_handle(arg0) {
1248
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1249
+ const len0 = WASM_VECTOR_LEN;
1250
+ wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1251
+ }
1252
+ /**
1253
+ * The packing factor determines whether the decrypted plaintext
1254
+ * has a different way of packing compared to what is specified in the plaintext modulus.
1255
+ * @returns {number}
1256
+ */
1257
+ get packing_factor() {
1258
+ const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
1259
+ return ret >>> 0;
1260
+ }
1261
+ /**
1262
+ * The packing factor determines whether the decrypted plaintext
1263
+ * has a different way of packing compared to what is specified in the plaintext modulus.
1264
+ * @param {number} arg0
1265
+ */
1266
+ set packing_factor(arg0) {
1267
+ wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
1268
+ }
1269
+ }
1270
+ module.exports.TypedSigncryptedCiphertext = TypedSigncryptedCiphertext;
1271
+
1272
+ const UserDecryptionRequestFinalization = (typeof FinalizationRegistry === 'undefined')
1273
+ ? { register: () => {}, unregister: () => {} }
1274
+ : new FinalizationRegistry(ptr => wasm.__wbg_userdecryptionrequest_free(ptr >>> 0, 1));
1275
+
1276
+ class UserDecryptionRequest {
1277
+
1278
+ __destroy_into_raw() {
1279
+ const ptr = this.__wbg_ptr;
1280
+ this.__wbg_ptr = 0;
1281
+ UserDecryptionRequestFinalization.unregister(this);
1282
+ return ptr;
1283
+ }
1284
+
1285
+ free() {
1286
+ const ptr = this.__destroy_into_raw();
1287
+ wasm.__wbg_userdecryptionrequest_free(ptr, 0);
1288
+ }
1289
+ /**
1290
+ * The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
1291
+ * prefix. Future queries for the result must use this request ID.
1292
+ * @returns {RequestId | undefined}
1293
+ */
1294
+ get request_id() {
1295
+ const ret = wasm.__wbg_get_userdecryptionrequest_request_id(this.__wbg_ptr);
1296
+ return ret === 0 ? undefined : RequestId.__wrap(ret);
1297
+ }
1298
+ /**
1299
+ * The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
1300
+ * prefix. Future queries for the result must use this request ID.
1301
+ * @param {RequestId | null} [arg0]
1302
+ */
1303
+ set request_id(arg0) {
1304
+ let ptr0 = 0;
1305
+ if (!isLikeNone(arg0)) {
1306
+ _assertClass(arg0, RequestId);
1307
+ ptr0 = arg0.__destroy_into_raw();
1308
+ }
1309
+ wasm.__wbg_set_userdecryptionrequest_request_id(this.__wbg_ptr, ptr0);
1310
+ }
1311
+ /**
1312
+ * The list of ciphertexts to decrypt for the user.
1313
+ * @returns {TypedCiphertext[]}
1314
+ */
1315
+ get typed_ciphertexts() {
1316
+ const ret = wasm.__wbg_get_userdecryptionrequest_typed_ciphertexts(this.__wbg_ptr);
1317
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1318
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1319
+ return v1;
1320
+ }
1321
+ /**
1322
+ * The list of ciphertexts to decrypt for the user.
1323
+ * @param {TypedCiphertext[]} arg0
1324
+ */
1325
+ set typed_ciphertexts(arg0) {
1326
+ const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
1327
+ const len0 = WASM_VECTOR_LEN;
1328
+ wasm.__wbg_set_userdecryptionrequest_typed_ciphertexts(this.__wbg_ptr, ptr0, len0);
1329
+ }
1330
+ /**
1331
+ * The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
1332
+ * used for key generation
1333
+ * @returns {RequestId | undefined}
1334
+ */
1129
1335
  get key_id() {
1130
- const ret = wasm.__wbg_get_reencryptionrequestpayload_key_id(this.__wbg_ptr);
1336
+ const ret = wasm.__wbg_get_userdecryptionrequest_key_id(this.__wbg_ptr);
1131
1337
  return ret === 0 ? undefined : RequestId.__wrap(ret);
1132
1338
  }
1133
1339
  /**
1134
- * The key id to use for decryption. Will be the request_id used during key
1135
- * generation
1136
- * @param {RequestId | undefined} [arg0]
1340
+ * The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
1341
+ * used for key generation
1342
+ * @param {RequestId | null} [arg0]
1137
1343
  */
1138
1344
  set key_id(arg0) {
1139
1345
  let ptr0 = 0;
@@ -1141,66 +1347,87 @@ class ReencryptionRequestPayload {
1141
1347
  _assertClass(arg0, RequestId);
1142
1348
  ptr0 = arg0.__destroy_into_raw();
1143
1349
  }
1144
- wasm.__wbg_set_reencryptionrequestpayload_key_id(this.__wbg_ptr, ptr0);
1350
+ wasm.__wbg_set_userdecryptionrequest_key_id(this.__wbg_ptr, ptr0);
1145
1351
  }
1146
1352
  /**
1147
- * The actual ciphertext to decrypt, taken directly from the fhevm.
1148
- * When creating the payload, this field may be empty,
1149
- * it is the responsibility of the gateway to fetch the
1150
- * ciphertext for the given digest below.
1151
- * @returns {Uint8Array | undefined}
1353
+ * The client's (blockchain wallet) address,
1354
+ * encoded using EIP-55.
1355
+ * @returns {string}
1152
1356
  */
1153
- get ciphertext() {
1154
- const ret = wasm.__wbg_get_reencryptionrequestpayload_ciphertext(this.__wbg_ptr);
1155
- let v1;
1156
- if (ret[0] !== 0) {
1157
- v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1158
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1357
+ get client_address() {
1358
+ let deferred1_0;
1359
+ let deferred1_1;
1360
+ try {
1361
+ const ret = wasm.__wbg_get_userdecryptionrequest_client_address(this.__wbg_ptr);
1362
+ deferred1_0 = ret[0];
1363
+ deferred1_1 = ret[1];
1364
+ return getStringFromWasm0(ret[0], ret[1]);
1365
+ } finally {
1366
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1159
1367
  }
1160
- return v1;
1161
1368
  }
1162
1369
  /**
1163
- * The actual ciphertext to decrypt, taken directly from the fhevm.
1164
- * When creating the payload, this field may be empty,
1165
- * it is the responsibility of the gateway to fetch the
1166
- * ciphertext for the given digest below.
1167
- * @param {Uint8Array | undefined} [arg0]
1370
+ * The client's (blockchain wallet) address,
1371
+ * encoded using EIP-55.
1372
+ * @param {string} arg0
1168
1373
  */
1169
- set ciphertext(arg0) {
1170
- var ptr0 = isLikeNone(arg0) ? 0 : passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1171
- var len0 = WASM_VECTOR_LEN;
1172
- wasm.__wbg_set_eip712domainmsg_salt(this.__wbg_ptr, ptr0, len0);
1374
+ set client_address(arg0) {
1375
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1376
+ const len0 = WASM_VECTOR_LEN;
1377
+ wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1173
1378
  }
1174
1379
  /**
1175
- * The SHA3 digest of the ciphertext above.
1380
+ * Encoding of the user's public encryption key for this request.
1381
+ * Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
1382
+ * Montgomery point.
1176
1383
  * @returns {Uint8Array}
1177
1384
  */
1178
- get ciphertext_digest() {
1179
- const ret = wasm.__wbg_get_reencryptionrequestpayload_ciphertext_digest(this.__wbg_ptr);
1385
+ get enc_key() {
1386
+ const ret = wasm.__wbg_get_userdecryptionrequest_enc_key(this.__wbg_ptr);
1180
1387
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1181
1388
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1182
1389
  return v1;
1183
1390
  }
1184
1391
  /**
1185
- * The SHA3 digest of the ciphertext above.
1392
+ * Encoding of the user's public encryption key for this request.
1393
+ * Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
1394
+ * Montgomery point.
1186
1395
  * @param {Uint8Array} arg0
1187
1396
  */
1188
- set ciphertext_digest(arg0) {
1397
+ set enc_key(arg0) {
1189
1398
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1190
1399
  const len0 = WASM_VECTOR_LEN;
1191
1400
  wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
1192
1401
  }
1402
+ /**
1403
+ * @returns {Eip712DomainMsg | undefined}
1404
+ */
1405
+ get domain() {
1406
+ const ret = wasm.__wbg_get_userdecryptionrequest_domain(this.__wbg_ptr);
1407
+ return ret === 0 ? undefined : Eip712DomainMsg.__wrap(ret);
1408
+ }
1409
+ /**
1410
+ * @param {Eip712DomainMsg | null} [arg0]
1411
+ */
1412
+ set domain(arg0) {
1413
+ let ptr0 = 0;
1414
+ if (!isLikeNone(arg0)) {
1415
+ _assertClass(arg0, Eip712DomainMsg);
1416
+ ptr0 = arg0.__destroy_into_raw();
1417
+ }
1418
+ wasm.__wbg_set_userdecryptionrequest_domain(this.__wbg_ptr, ptr0);
1419
+ }
1193
1420
  }
1194
- module.exports.ReencryptionRequestPayload = ReencryptionRequestPayload;
1421
+ module.exports.UserDecryptionRequest = UserDecryptionRequest;
1195
1422
 
1196
- const ReencryptionResponseFinalization = (typeof FinalizationRegistry === 'undefined')
1423
+ const UserDecryptionResponseFinalization = (typeof FinalizationRegistry === 'undefined')
1197
1424
  ? { register: () => {}, unregister: () => {} }
1198
- : new FinalizationRegistry(ptr => wasm.__wbg_reencryptionresponse_free(ptr >>> 0, 1));
1425
+ : new FinalizationRegistry(ptr => wasm.__wbg_userdecryptionresponse_free(ptr >>> 0, 1));
1199
1426
 
1200
- class ReencryptionResponse {
1427
+ class UserDecryptionResponse {
1201
1428
 
1202
1429
  static __unwrap(jsValue) {
1203
- if (!(jsValue instanceof ReencryptionResponse)) {
1430
+ if (!(jsValue instanceof UserDecryptionResponse)) {
1204
1431
  return 0;
1205
1432
  }
1206
1433
  return jsValue.__destroy_into_raw();
@@ -1209,19 +1436,19 @@ class ReencryptionResponse {
1209
1436
  __destroy_into_raw() {
1210
1437
  const ptr = this.__wbg_ptr;
1211
1438
  this.__wbg_ptr = 0;
1212
- ReencryptionResponseFinalization.unregister(this);
1439
+ UserDecryptionResponseFinalization.unregister(this);
1213
1440
  return ptr;
1214
1441
  }
1215
1442
 
1216
1443
  free() {
1217
1444
  const ptr = this.__destroy_into_raw();
1218
- wasm.__wbg_reencryptionresponse_free(ptr, 0);
1445
+ wasm.__wbg_userdecryptionresponse_free(ptr, 0);
1219
1446
  }
1220
1447
  /**
1221
1448
  * @returns {Uint8Array}
1222
1449
  */
1223
1450
  get signature() {
1224
- const ret = wasm.__wbg_get_reencryptionresponse_signature(this.__wbg_ptr);
1451
+ const ret = wasm.__wbg_get_userdecryptionresponse_signature(this.__wbg_ptr);
1225
1452
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1226
1453
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1227
1454
  return v1;
@@ -1235,84 +1462,98 @@ class ReencryptionResponse {
1235
1462
  wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1236
1463
  }
1237
1464
  /**
1238
- * Signature of the serialization of \[ReencryptionResponsePayload\].
1239
- * @returns {ReencryptionResponsePayload | undefined}
1465
+ * This is the external signature created from the Eip712 domain
1466
+ * on the structure, where userDecryptedShare is bincode::serialize(&payload)
1467
+ * struct UserDecryptResponseVerification {
1468
+ * bytes publicKey;
1469
+ * uint256\[\] ctHandles;
1470
+ * bytes userDecryptedShare;
1471
+ * }
1472
+ * @returns {Uint8Array}
1473
+ */
1474
+ get external_signature() {
1475
+ const ret = wasm.__wbg_get_userdecryptionresponse_external_signature(this.__wbg_ptr);
1476
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1477
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1478
+ return v1;
1479
+ }
1480
+ /**
1481
+ * This is the external signature created from the Eip712 domain
1482
+ * on the structure, where userDecryptedShare is bincode::serialize(&payload)
1483
+ * struct UserDecryptResponseVerification {
1484
+ * bytes publicKey;
1485
+ * uint256\[\] ctHandles;
1486
+ * bytes userDecryptedShare;
1487
+ * }
1488
+ * @param {Uint8Array} arg0
1489
+ */
1490
+ set external_signature(arg0) {
1491
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1492
+ const len0 = WASM_VECTOR_LEN;
1493
+ wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1494
+ }
1495
+ /**
1496
+ * The actual \[UserDecryptionResponsePayload\].
1497
+ * @returns {UserDecryptionResponsePayload | undefined}
1240
1498
  */
1241
1499
  get payload() {
1242
- const ret = wasm.__wbg_get_reencryptionresponse_payload(this.__wbg_ptr);
1243
- return ret === 0 ? undefined : ReencryptionResponsePayload.__wrap(ret);
1500
+ const ret = wasm.__wbg_get_userdecryptionresponse_payload(this.__wbg_ptr);
1501
+ return ret === 0 ? undefined : UserDecryptionResponsePayload.__wrap(ret);
1244
1502
  }
1245
1503
  /**
1246
- * Signature of the serialization of \[ReencryptionResponsePayload\].
1247
- * @param {ReencryptionResponsePayload | undefined} [arg0]
1504
+ * The actual \[UserDecryptionResponsePayload\].
1505
+ * @param {UserDecryptionResponsePayload | null} [arg0]
1248
1506
  */
1249
1507
  set payload(arg0) {
1250
1508
  let ptr0 = 0;
1251
1509
  if (!isLikeNone(arg0)) {
1252
- _assertClass(arg0, ReencryptionResponsePayload);
1510
+ _assertClass(arg0, UserDecryptionResponsePayload);
1253
1511
  ptr0 = arg0.__destroy_into_raw();
1254
1512
  }
1255
- wasm.__wbg_set_reencryptionresponse_payload(this.__wbg_ptr, ptr0);
1513
+ wasm.__wbg_set_userdecryptionresponse_payload(this.__wbg_ptr, ptr0);
1256
1514
  }
1257
1515
  }
1258
- module.exports.ReencryptionResponse = ReencryptionResponse;
1516
+ module.exports.UserDecryptionResponse = UserDecryptionResponse;
1259
1517
 
1260
- const ReencryptionResponsePayloadFinalization = (typeof FinalizationRegistry === 'undefined')
1518
+ const UserDecryptionResponsePayloadFinalization = (typeof FinalizationRegistry === 'undefined')
1261
1519
  ? { register: () => {}, unregister: () => {} }
1262
- : new FinalizationRegistry(ptr => wasm.__wbg_reencryptionresponsepayload_free(ptr >>> 0, 1));
1520
+ : new FinalizationRegistry(ptr => wasm.__wbg_userdecryptionresponsepayload_free(ptr >>> 0, 1));
1263
1521
 
1264
- class ReencryptionResponsePayload {
1522
+ class UserDecryptionResponsePayload {
1265
1523
 
1266
1524
  static __wrap(ptr) {
1267
1525
  ptr = ptr >>> 0;
1268
- const obj = Object.create(ReencryptionResponsePayload.prototype);
1526
+ const obj = Object.create(UserDecryptionResponsePayload.prototype);
1269
1527
  obj.__wbg_ptr = ptr;
1270
- ReencryptionResponsePayloadFinalization.register(obj, obj.__wbg_ptr, obj);
1528
+ UserDecryptionResponsePayloadFinalization.register(obj, obj.__wbg_ptr, obj);
1271
1529
  return obj;
1272
1530
  }
1273
1531
 
1274
1532
  __destroy_into_raw() {
1275
1533
  const ptr = this.__wbg_ptr;
1276
1534
  this.__wbg_ptr = 0;
1277
- ReencryptionResponsePayloadFinalization.unregister(this);
1535
+ UserDecryptionResponsePayloadFinalization.unregister(this);
1278
1536
  return ptr;
1279
1537
  }
1280
1538
 
1281
1539
  free() {
1282
1540
  const ptr = this.__destroy_into_raw();
1283
- wasm.__wbg_reencryptionresponsepayload_free(ptr, 0);
1284
- }
1285
- /**
1286
- * Version of the response format.
1287
- * @returns {number}
1288
- */
1289
- get version() {
1290
- const ret = wasm.__wbg_get_reencryptionresponsepayload_version(this.__wbg_ptr);
1291
- return ret >>> 0;
1292
- }
1293
- /**
1294
- * Version of the response format.
1295
- * @param {number} arg0
1296
- */
1297
- set version(arg0) {
1298
- wasm.__wbg_set_reencryptionresponsepayload_version(this.__wbg_ptr, arg0);
1541
+ wasm.__wbg_userdecryptionresponsepayload_free(ptr, 0);
1299
1542
  }
1300
1543
  /**
1301
- * The server's signature verification key.
1302
- * Encoded using SEC1.
1544
+ * The server's signature verification key, Encoded using SEC1.
1303
1545
  * Needed to validate the response, but MUST also be linked to a list of
1304
1546
  * trusted keys.
1305
1547
  * @returns {Uint8Array}
1306
1548
  */
1307
1549
  get verification_key() {
1308
- const ret = wasm.__wbg_get_reencryptionresponsepayload_verification_key(this.__wbg_ptr);
1550
+ const ret = wasm.__wbg_get_userdecryptionresponsepayload_verification_key(this.__wbg_ptr);
1309
1551
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1310
1552
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1311
1553
  return v1;
1312
1554
  }
1313
1555
  /**
1314
- * The server's signature verification key.
1315
- * Encoded using SEC1.
1556
+ * The server's signature verification key, Encoded using SEC1.
1316
1557
  * Needed to validate the response, but MUST also be linked to a list of
1317
1558
  * trusted keys.
1318
1559
  * @param {Uint8Array} arg0
@@ -1323,21 +1564,21 @@ class ReencryptionResponsePayload {
1323
1564
  wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1324
1565
  }
1325
1566
  /**
1326
- * The concatenation of two digests:
1327
- * (eip712_signing_hash(pk, domain) || ciphertext digest).
1328
1567
  * This is needed to ensure the response corresponds to the request.
1568
+ * It is the digest of UserDecryptionLinker hashed using EIP712
1569
+ * under the given domain in the request.
1329
1570
  * @returns {Uint8Array}
1330
1571
  */
1331
1572
  get digest() {
1332
- const ret = wasm.__wbg_get_reencryptionresponsepayload_digest(this.__wbg_ptr);
1573
+ const ret = wasm.__wbg_get_userdecryptionresponsepayload_digest(this.__wbg_ptr);
1333
1574
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1334
1575
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1335
1576
  return v1;
1336
1577
  }
1337
1578
  /**
1338
- * The concatenation of two digests:
1339
- * (eip712_signing_hash(pk, domain) || ciphertext digest).
1340
1579
  * This is needed to ensure the response corresponds to the request.
1580
+ * It is the digest of UserDecryptionLinker hashed using EIP712
1581
+ * under the given domain in the request.
1341
1582
  * @param {Uint8Array} arg0
1342
1583
  */
1343
1584
  set digest(arg0) {
@@ -1346,64 +1587,51 @@ class ReencryptionResponsePayload {
1346
1587
  wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1347
1588
  }
1348
1589
  /**
1349
- * The type of plaintext encrypted.
1350
- * @returns {number}
1590
+ * The resulting signcrypted ciphertexts, each ciphertext
1591
+ * must be decrypted and then reconstructed with the other shares
1592
+ * to produce the final plaintext.
1593
+ * @returns {TypedSigncryptedCiphertext[]}
1351
1594
  */
1352
- get fhe_type() {
1353
- const ret = wasm.__wbg_get_reencryptionresponsepayload_fhe_type(this.__wbg_ptr);
1354
- return ret;
1595
+ get signcrypted_ciphertexts() {
1596
+ const ret = wasm.__wbg_get_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr);
1597
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1598
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1599
+ return v1;
1355
1600
  }
1356
1601
  /**
1357
- * The type of plaintext encrypted.
1358
- * @param {number} arg0
1602
+ * The resulting signcrypted ciphertexts, each ciphertext
1603
+ * must be decrypted and then reconstructed with the other shares
1604
+ * to produce the final plaintext.
1605
+ * @param {TypedSigncryptedCiphertext[]} arg0
1359
1606
  */
1360
- set fhe_type(arg0) {
1361
- wasm.__wbg_set_reencryptionresponsepayload_fhe_type(this.__wbg_ptr, arg0);
1607
+ set signcrypted_ciphertexts(arg0) {
1608
+ const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
1609
+ const len0 = WASM_VECTOR_LEN;
1610
+ wasm.__wbg_set_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr, ptr0, len0);
1362
1611
  }
1363
1612
  /**
1364
- * The signcrypted payload, using a hybrid encryption approach in
1365
- * sign-then-encrypt.
1366
- * @returns {Uint8Array}
1367
- */
1368
- get signcrypted_ciphertext() {
1369
- const ret = wasm.__wbg_get_reencryptionresponsepayload_signcrypted_ciphertext(this.__wbg_ptr);
1370
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1371
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1372
- return v1;
1373
- }
1374
- /**
1375
- * The signcrypted payload, using a hybrid encryption approach in
1376
- * sign-then-encrypt.
1377
- * @param {Uint8Array} arg0
1378
- */
1379
- set signcrypted_ciphertext(arg0) {
1380
- const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1381
- const len0 = WASM_VECTOR_LEN;
1382
- wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
1383
- }
1384
- /**
1385
- * The ID of the MPC party doing the reencryption. Used for polynomial
1386
- * reconstruction.
1387
- * @returns {number}
1613
+ * The ID of the MPC party doing the user decryption. Used for polynomial
1614
+ * reconstruction.
1615
+ * @returns {number}
1388
1616
  */
1389
1617
  get party_id() {
1390
- const ret = wasm.__wbg_get_reencryptionresponsepayload_party_id(this.__wbg_ptr);
1618
+ const ret = wasm.__wbg_get_userdecryptionresponsepayload_party_id(this.__wbg_ptr);
1391
1619
  return ret >>> 0;
1392
1620
  }
1393
1621
  /**
1394
- * The ID of the MPC party doing the reencryption. Used for polynomial
1622
+ * The ID of the MPC party doing the user decryption. Used for polynomial
1395
1623
  * reconstruction.
1396
1624
  * @param {number} arg0
1397
1625
  */
1398
1626
  set party_id(arg0) {
1399
- wasm.__wbg_set_reencryptionresponsepayload_party_id(this.__wbg_ptr, arg0);
1627
+ wasm.__wbg_set_userdecryptionresponsepayload_party_id(this.__wbg_ptr, arg0);
1400
1628
  }
1401
1629
  /**
1402
1630
  * The degree of the sharing scheme used.
1403
1631
  * @returns {number}
1404
1632
  */
1405
1633
  get degree() {
1406
- const ret = wasm.__wbg_get_reencryptionresponsepayload_degree(this.__wbg_ptr);
1634
+ const ret = wasm.__wbg_get_userdecryptionresponsepayload_degree(this.__wbg_ptr);
1407
1635
  return ret >>> 0;
1408
1636
  }
1409
1637
  /**
@@ -1411,386 +1639,357 @@ class ReencryptionResponsePayload {
1411
1639
  * @param {number} arg0
1412
1640
  */
1413
1641
  set degree(arg0) {
1414
- wasm.__wbg_set_reencryptionresponsepayload_degree(this.__wbg_ptr, arg0);
1642
+ wasm.__wbg_set_userdecryptionresponsepayload_degree(this.__wbg_ptr, arg0);
1415
1643
  }
1416
1644
  }
1417
- module.exports.ReencryptionResponsePayload = ReencryptionResponsePayload;
1645
+ module.exports.UserDecryptionResponsePayload = UserDecryptionResponsePayload;
1418
1646
 
1419
- const RequestIdFinalization = (typeof FinalizationRegistry === 'undefined')
1420
- ? { register: () => {}, unregister: () => {} }
1421
- : new FinalizationRegistry(ptr => wasm.__wbg_requestid_free(ptr >>> 0, 1));
1422
- /**
1423
- * Simple response to return an ID, to be used to retrieve the computed result
1424
- * later on.
1425
- */
1426
- class RequestId {
1647
+ module.exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
1648
+ const ret = String(arg1);
1649
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1650
+ const len1 = WASM_VECTOR_LEN;
1651
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1652
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1653
+ };
1427
1654
 
1428
- static __wrap(ptr) {
1429
- ptr = ptr >>> 0;
1430
- const obj = Object.create(RequestId.prototype);
1431
- obj.__wbg_ptr = ptr;
1432
- RequestIdFinalization.register(obj, obj.__wbg_ptr, obj);
1433
- return obj;
1434
- }
1655
+ module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
1656
+ const ret = arg0.buffer;
1657
+ return ret;
1658
+ };
1435
1659
 
1436
- __destroy_into_raw() {
1437
- const ptr = this.__wbg_ptr;
1438
- this.__wbg_ptr = 0;
1439
- RequestIdFinalization.unregister(this);
1440
- return ptr;
1441
- }
1660
+ module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
1661
+ const ret = arg0.call(arg1);
1662
+ return ret;
1663
+ }, arguments) };
1442
1664
 
1443
- free() {
1444
- const ptr = this.__destroy_into_raw();
1445
- wasm.__wbg_requestid_free(ptr, 0);
1446
- }
1447
- /**
1448
- * @returns {string}
1449
- */
1450
- get request_id() {
1451
- let deferred1_0;
1452
- let deferred1_1;
1453
- try {
1454
- const ret = wasm.__wbg_get_requestid_request_id(this.__wbg_ptr);
1455
- deferred1_0 = ret[0];
1456
- deferred1_1 = ret[1];
1457
- return getStringFromWasm0(ret[0], ret[1]);
1458
- } finally {
1459
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1460
- }
1461
- }
1462
- /**
1463
- * @param {string} arg0
1464
- */
1465
- set request_id(arg0) {
1466
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1467
- const len0 = WASM_VECTOR_LEN;
1468
- wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1469
- }
1470
- }
1471
- module.exports.RequestId = RequestId;
1665
+ module.exports.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
1666
+ const ret = arg0.call(arg1, arg2);
1667
+ return ret;
1668
+ }, arguments) };
1472
1669
 
1473
- module.exports.__wbindgen_error_new = function(arg0, arg1) {
1474
- const ret = new Error(getStringFromWasm0(arg0, arg1));
1670
+ module.exports.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
1671
+ const ret = arg0.crypto;
1475
1672
  return ret;
1476
1673
  };
1477
1674
 
1478
- module.exports.__wbg_reencryptionresponse_unwrap = function(arg0) {
1479
- const ret = ReencryptionResponse.__unwrap(arg0);
1675
+ module.exports.__wbg_done_769e5ede4b31c67b = function(arg0) {
1676
+ const ret = arg0.done;
1480
1677
  return ret;
1481
1678
  };
1482
1679
 
1483
- module.exports.__wbindgen_number_get = function(arg0, arg1) {
1484
- const obj = arg1;
1485
- const ret = typeof(obj) === 'number' ? obj : undefined;
1486
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1487
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1680
+ module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1681
+ let deferred0_0;
1682
+ let deferred0_1;
1683
+ try {
1684
+ deferred0_0 = arg0;
1685
+ deferred0_1 = arg1;
1686
+ console.error(getStringFromWasm0(arg0, arg1));
1687
+ } finally {
1688
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1689
+ }
1488
1690
  };
1489
1691
 
1490
- module.exports.__wbindgen_string_get = function(arg0, arg1) {
1491
- const obj = arg1;
1492
- const ret = typeof(obj) === 'string' ? obj : undefined;
1493
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1494
- var len1 = WASM_VECTOR_LEN;
1495
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1496
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1497
- };
1692
+ module.exports.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
1693
+ arg0.getRandomValues(arg1);
1694
+ }, arguments) };
1498
1695
 
1499
- module.exports.__wbindgen_is_object = function(arg0) {
1500
- const val = arg0;
1501
- const ret = typeof(val) === 'object' && val !== null;
1696
+ module.exports.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
1697
+ const ret = Reflect.get(arg0, arg1);
1502
1698
  return ret;
1503
- };
1699
+ }, arguments) };
1504
1700
 
1505
- module.exports.__wbindgen_is_undefined = function(arg0) {
1506
- const ret = arg0 === undefined;
1701
+ module.exports.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
1702
+ const ret = arg0[arg1 >>> 0];
1507
1703
  return ret;
1508
1704
  };
1509
1705
 
1510
- module.exports.__wbindgen_in = function(arg0, arg1) {
1511
- const ret = arg0 in arg1;
1706
+ module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
1707
+ const ret = arg0[arg1];
1512
1708
  return ret;
1513
1709
  };
1514
1710
 
1515
- module.exports.__wbindgen_is_null = function(arg0) {
1516
- const ret = arg0 === null;
1711
+ module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
1712
+ let result;
1713
+ try {
1714
+ result = arg0 instanceof ArrayBuffer;
1715
+ } catch (_) {
1716
+ result = false;
1717
+ }
1718
+ const ret = result;
1517
1719
  return ret;
1518
1720
  };
1519
1721
 
1520
- module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
1521
- const ret = arg0 == arg1;
1722
+ module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
1723
+ let result;
1724
+ try {
1725
+ result = arg0 instanceof Uint8Array;
1726
+ } catch (_) {
1727
+ result = false;
1728
+ }
1729
+ const ret = result;
1522
1730
  return ret;
1523
1731
  };
1524
1732
 
1525
- module.exports.__wbindgen_boolean_get = function(arg0) {
1526
- const v = arg0;
1527
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1733
+ module.exports.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
1734
+ const ret = Array.isArray(arg0);
1528
1735
  return ret;
1529
1736
  };
1530
1737
 
1531
- module.exports.__wbindgen_as_number = function(arg0) {
1532
- const ret = +arg0;
1738
+ module.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
1739
+ const ret = Number.isSafeInteger(arg0);
1533
1740
  return ret;
1534
1741
  };
1535
1742
 
1536
- module.exports.__wbg_String_b9412f8799faab3e = function(arg0, arg1) {
1537
- const ret = String(arg1);
1538
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1539
- const len1 = WASM_VECTOR_LEN;
1540
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1541
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1542
- };
1543
-
1544
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
1545
- const ret = getStringFromWasm0(arg0, arg1);
1743
+ module.exports.__wbg_iterator_9a24c88df860dc65 = function() {
1744
+ const ret = Symbol.iterator;
1546
1745
  return ret;
1547
1746
  };
1548
1747
 
1549
- module.exports.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
1550
- const ret = arg0[arg1];
1748
+ module.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
1749
+ const ret = arg0.length;
1551
1750
  return ret;
1552
1751
  };
1553
1752
 
1554
- module.exports.__wbg_new_abda76e883ba8a5f = function() {
1555
- const ret = new Error();
1753
+ module.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
1754
+ const ret = arg0.length;
1556
1755
  return ret;
1557
1756
  };
1558
1757
 
1559
- module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
1560
- const ret = arg1.stack;
1561
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1562
- const len1 = WASM_VECTOR_LEN;
1563
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1564
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1758
+ module.exports.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
1759
+ const ret = arg0.msCrypto;
1760
+ return ret;
1565
1761
  };
1566
1762
 
1567
- module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
1568
- let deferred0_0;
1569
- let deferred0_1;
1570
- try {
1571
- deferred0_0 = arg0;
1572
- deferred0_1 = arg1;
1573
- console.error(getStringFromWasm0(arg0, arg1));
1574
- } finally {
1575
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1576
- }
1763
+ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
1764
+ const ret = new Error();
1765
+ return ret;
1577
1766
  };
1578
1767
 
1579
- module.exports.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
1580
- const ret = arg0.crypto;
1768
+ module.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
1769
+ const ret = new Uint8Array(arg0);
1581
1770
  return ret;
1582
1771
  };
1583
1772
 
1584
- module.exports.__wbg_process_4a72847cc503995b = function(arg0) {
1585
- const ret = arg0.process;
1773
+ module.exports.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
1774
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
1586
1775
  return ret;
1587
1776
  };
1588
1777
 
1589
- module.exports.__wbg_versions_f686565e586dd935 = function(arg0) {
1590
- const ret = arg0.versions;
1778
+ module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
1779
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1591
1780
  return ret;
1592
1781
  };
1593
1782
 
1594
- module.exports.__wbg_node_104a2ff8d6ea03a2 = function(arg0) {
1595
- const ret = arg0.node;
1783
+ module.exports.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
1784
+ const ret = new Uint8Array(arg0 >>> 0);
1596
1785
  return ret;
1597
1786
  };
1598
1787
 
1599
- module.exports.__wbindgen_is_string = function(arg0) {
1600
- const ret = typeof(arg0) === 'string';
1788
+ module.exports.__wbg_next_25feadfc0913fea9 = function(arg0) {
1789
+ const ret = arg0.next;
1601
1790
  return ret;
1602
1791
  };
1603
1792
 
1604
- module.exports.__wbg_require_cca90b1a94a0255b = function() { return handleError(function () {
1605
- const ret = module.require;
1793
+ module.exports.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
1794
+ const ret = arg0.next();
1606
1795
  return ret;
1607
1796
  }, arguments) };
1608
1797
 
1609
- module.exports.__wbindgen_is_function = function(arg0) {
1610
- const ret = typeof(arg0) === 'function';
1798
+ module.exports.__wbg_node_02999533c4ea02e3 = function(arg0) {
1799
+ const ret = arg0.node;
1611
1800
  return ret;
1612
1801
  };
1613
1802
 
1614
- module.exports.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
1615
- const ret = arg0.msCrypto;
1803
+ module.exports.__wbg_process_5c1d670bc53614b8 = function(arg0) {
1804
+ const ret = arg0.process;
1616
1805
  return ret;
1617
1806
  };
1618
1807
 
1619
- module.exports.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
1808
+ module.exports.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
1620
1809
  arg0.randomFillSync(arg1);
1621
1810
  }, arguments) };
1622
1811
 
1623
- module.exports.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
1624
- arg0.getRandomValues(arg1);
1812
+ module.exports.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
1813
+ const ret = module.require;
1814
+ return ret;
1625
1815
  }, arguments) };
1626
1816
 
1627
- module.exports.__wbg_get_5419cf6b954aa11d = function(arg0, arg1) {
1628
- const ret = arg0[arg1 >>> 0];
1629
- return ret;
1817
+ module.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
1818
+ arg0.set(arg1, arg2 >>> 0);
1630
1819
  };
1631
1820
 
1632
- module.exports.__wbg_length_f217bbbf7e8e4df4 = function(arg0) {
1633
- const ret = arg0.length;
1634
- return ret;
1821
+ module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
1822
+ const ret = arg1.stack;
1823
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1824
+ const len1 = WASM_VECTOR_LEN;
1825
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1826
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1635
1827
  };
1636
1828
 
1637
- module.exports.__wbg_newnoargs_1ede4bf2ebbaaf43 = function(arg0, arg1) {
1638
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1639
- return ret;
1829
+ module.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
1830
+ const ret = typeof global === 'undefined' ? null : global;
1831
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1640
1832
  };
1641
1833
 
1642
- module.exports.__wbg_next_13b477da1eaa3897 = function(arg0) {
1643
- const ret = arg0.next;
1644
- return ret;
1834
+ module.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
1835
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1836
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1645
1837
  };
1646
1838
 
1647
- module.exports.__wbg_next_b06e115d1b01e10b = function() { return handleError(function (arg0) {
1648
- const ret = arg0.next();
1649
- return ret;
1650
- }, arguments) };
1839
+ module.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
1840
+ const ret = typeof self === 'undefined' ? null : self;
1841
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1842
+ };
1651
1843
 
1652
- module.exports.__wbg_done_983b5ffcaec8c583 = function(arg0) {
1653
- const ret = arg0.done;
1654
- return ret;
1844
+ module.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
1845
+ const ret = typeof window === 'undefined' ? null : window;
1846
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1655
1847
  };
1656
1848
 
1657
- module.exports.__wbg_value_2ab8a198c834c26a = function(arg0) {
1658
- const ret = arg0.value;
1849
+ module.exports.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
1850
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1659
1851
  return ret;
1660
1852
  };
1661
1853
 
1662
- module.exports.__wbg_iterator_695d699a44d6234c = function() {
1663
- const ret = Symbol.iterator;
1854
+ module.exports.__wbg_typedciphertext_new = function(arg0) {
1855
+ const ret = TypedCiphertext.__wrap(arg0);
1664
1856
  return ret;
1665
1857
  };
1666
1858
 
1667
- module.exports.__wbg_get_ef828680c64da212 = function() { return handleError(function (arg0, arg1) {
1668
- const ret = Reflect.get(arg0, arg1);
1859
+ module.exports.__wbg_typedciphertext_unwrap = function(arg0) {
1860
+ const ret = TypedCiphertext.__unwrap(arg0);
1669
1861
  return ret;
1670
- }, arguments) };
1862
+ };
1671
1863
 
1672
- module.exports.__wbg_call_a9ef466721e824f2 = function() { return handleError(function (arg0, arg1) {
1673
- const ret = arg0.call(arg1);
1864
+ module.exports.__wbg_typedplaintext_new = function(arg0) {
1865
+ const ret = TypedPlaintext.__wrap(arg0);
1674
1866
  return ret;
1675
- }, arguments) };
1867
+ };
1676
1868
 
1677
- module.exports.__wbg_self_bf91bf94d9e04084 = function() { return handleError(function () {
1678
- const ret = self.self;
1869
+ module.exports.__wbg_typedsigncryptedciphertext_new = function(arg0) {
1870
+ const ret = TypedSigncryptedCiphertext.__wrap(arg0);
1679
1871
  return ret;
1680
- }, arguments) };
1872
+ };
1681
1873
 
1682
- module.exports.__wbg_window_52dd9f07d03fd5f8 = function() { return handleError(function () {
1683
- const ret = window.window;
1874
+ module.exports.__wbg_typedsigncryptedciphertext_unwrap = function(arg0) {
1875
+ const ret = TypedSigncryptedCiphertext.__unwrap(arg0);
1684
1876
  return ret;
1685
- }, arguments) };
1877
+ };
1686
1878
 
1687
- module.exports.__wbg_globalThis_05c129bf37fcf1be = function() { return handleError(function () {
1688
- const ret = globalThis.globalThis;
1879
+ module.exports.__wbg_userdecryptionresponse_unwrap = function(arg0) {
1880
+ const ret = UserDecryptionResponse.__unwrap(arg0);
1689
1881
  return ret;
1690
- }, arguments) };
1882
+ };
1691
1883
 
1692
- module.exports.__wbg_global_3eca19bb09e9c484 = function() { return handleError(function () {
1693
- const ret = global.global;
1884
+ module.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
1885
+ const ret = arg0.value;
1694
1886
  return ret;
1695
- }, arguments) };
1887
+ };
1696
1888
 
1697
- module.exports.__wbg_isArray_6f3b47f09adb61b5 = function(arg0) {
1698
- const ret = Array.isArray(arg0);
1889
+ module.exports.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
1890
+ const ret = arg0.versions;
1699
1891
  return ret;
1700
1892
  };
1701
1893
 
1702
- module.exports.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function(arg0) {
1703
- let result;
1704
- try {
1705
- result = arg0 instanceof ArrayBuffer;
1706
- } catch (_) {
1707
- result = false;
1708
- }
1709
- const ret = result;
1894
+ module.exports.__wbindgen_as_number = function(arg0) {
1895
+ const ret = +arg0;
1710
1896
  return ret;
1711
1897
  };
1712
1898
 
1713
- module.exports.__wbg_call_3bfa248576352471 = function() { return handleError(function (arg0, arg1, arg2) {
1714
- const ret = arg0.call(arg1, arg2);
1899
+ module.exports.__wbindgen_boolean_get = function(arg0) {
1900
+ const v = arg0;
1901
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1715
1902
  return ret;
1716
- }, arguments) };
1903
+ };
1717
1904
 
1718
- module.exports.__wbg_isSafeInteger_b9dff570f01a9100 = function(arg0) {
1719
- const ret = Number.isSafeInteger(arg0);
1905
+ module.exports.__wbindgen_debug_string = function(arg0, arg1) {
1906
+ const ret = debugString(arg1);
1907
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1908
+ const len1 = WASM_VECTOR_LEN;
1909
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1910
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1911
+ };
1912
+
1913
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
1914
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1720
1915
  return ret;
1721
1916
  };
1722
1917
 
1723
- module.exports.__wbg_buffer_ccaed51a635d8a2d = function(arg0) {
1724
- const ret = arg0.buffer;
1918
+ module.exports.__wbindgen_in = function(arg0, arg1) {
1919
+ const ret = arg0 in arg1;
1725
1920
  return ret;
1726
1921
  };
1727
1922
 
1728
- module.exports.__wbg_newwithbyteoffsetandlength_7e3eb787208af730 = function(arg0, arg1, arg2) {
1729
- const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1923
+ module.exports.__wbindgen_init_externref_table = function() {
1924
+ const table = wasm.__wbindgen_export_4;
1925
+ const offset = table.grow(4);
1926
+ table.set(0, undefined);
1927
+ table.set(offset + 0, undefined);
1928
+ table.set(offset + 1, null);
1929
+ table.set(offset + 2, true);
1930
+ table.set(offset + 3, false);
1931
+ ;
1932
+ };
1933
+
1934
+ module.exports.__wbindgen_is_function = function(arg0) {
1935
+ const ret = typeof(arg0) === 'function';
1730
1936
  return ret;
1731
1937
  };
1732
1938
 
1733
- module.exports.__wbg_new_fec2611eb9180f95 = function(arg0) {
1734
- const ret = new Uint8Array(arg0);
1939
+ module.exports.__wbindgen_is_null = function(arg0) {
1940
+ const ret = arg0 === null;
1735
1941
  return ret;
1736
1942
  };
1737
1943
 
1738
- module.exports.__wbg_set_ec2fcf81bc573fd9 = function(arg0, arg1, arg2) {
1739
- arg0.set(arg1, arg2 >>> 0);
1944
+ module.exports.__wbindgen_is_object = function(arg0) {
1945
+ const val = arg0;
1946
+ const ret = typeof(val) === 'object' && val !== null;
1947
+ return ret;
1740
1948
  };
1741
1949
 
1742
- module.exports.__wbg_length_9254c4bd3b9f23c4 = function(arg0) {
1743
- const ret = arg0.length;
1950
+ module.exports.__wbindgen_is_string = function(arg0) {
1951
+ const ret = typeof(arg0) === 'string';
1744
1952
  return ret;
1745
1953
  };
1746
1954
 
1747
- module.exports.__wbg_instanceof_Uint8Array_df0761410414ef36 = function(arg0) {
1748
- let result;
1749
- try {
1750
- result = arg0 instanceof Uint8Array;
1751
- } catch (_) {
1752
- result = false;
1753
- }
1754
- const ret = result;
1955
+ module.exports.__wbindgen_is_undefined = function(arg0) {
1956
+ const ret = arg0 === undefined;
1755
1957
  return ret;
1756
1958
  };
1757
1959
 
1758
- module.exports.__wbg_newwithlength_76462a666eca145f = function(arg0) {
1759
- const ret = new Uint8Array(arg0 >>> 0);
1960
+ module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
1961
+ const ret = arg0 == arg1;
1760
1962
  return ret;
1761
1963
  };
1762
1964
 
1763
- module.exports.__wbg_subarray_975a06f9dbd16995 = function(arg0, arg1, arg2) {
1764
- const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1965
+ module.exports.__wbindgen_memory = function() {
1966
+ const ret = wasm.memory;
1765
1967
  return ret;
1766
1968
  };
1767
1969
 
1768
- module.exports.__wbindgen_debug_string = function(arg0, arg1) {
1769
- const ret = debugString(arg1);
1770
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1771
- const len1 = WASM_VECTOR_LEN;
1772
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1773
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1970
+ module.exports.__wbindgen_number_get = function(arg0, arg1) {
1971
+ const obj = arg1;
1972
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1973
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1974
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1774
1975
  };
1775
1976
 
1776
- module.exports.__wbindgen_throw = function(arg0, arg1) {
1777
- throw new Error(getStringFromWasm0(arg0, arg1));
1977
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
1978
+ const obj = arg1;
1979
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1980
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1981
+ var len1 = WASM_VECTOR_LEN;
1982
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1983
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1778
1984
  };
1779
1985
 
1780
- module.exports.__wbindgen_memory = function() {
1781
- const ret = wasm.memory;
1986
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
1987
+ const ret = getStringFromWasm0(arg0, arg1);
1782
1988
  return ret;
1783
1989
  };
1784
1990
 
1785
- module.exports.__wbindgen_init_externref_table = function() {
1786
- const table = wasm.__wbindgen_export_2;
1787
- const offset = table.grow(4);
1788
- table.set(0, undefined);
1789
- table.set(offset + 0, undefined);
1790
- table.set(offset + 1, null);
1791
- table.set(offset + 2, true);
1792
- table.set(offset + 3, false);
1793
- ;
1991
+ module.exports.__wbindgen_throw = function(arg0, arg1) {
1992
+ throw new Error(getStringFromWasm0(arg0, arg1));
1794
1993
  };
1795
1994
 
1796
1995
  const path = require('path').join(__dirname, 'kms_lib_bg.wasm');