node-tkms 0.10.0-rc1 → 0.11.0-rc5

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,12 +248,6 @@ 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
253
  const mem = getDataViewMemory0();
@@ -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
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,7 +292,7 @@ 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;
@@ -447,12 +455,13 @@ module.exports.cryptobox_decrypt = function(ct, my_sk, their_pk) {
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,7 +510,7 @@ 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
515
  module.exports.process_reencryption_resp_from_js = function(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
507
516
  _assertClass(client, Client);
@@ -511,8 +520,8 @@ module.exports.process_reencryption_resp_from_js = function(client, request, eip
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
 
@@ -545,7 +554,7 @@ module.exports.process_reencryption_resp_from_js = function(client, request, eip
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
559
  module.exports.process_reencryption_resp = function(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
551
560
  _assertClass(client, Client);
@@ -567,23 +576,49 @@ module.exports.process_reencryption_resp = function(client, request, eip712_doma
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);
581
- }
582
- }
583
584
  /**
584
- * The plaintext types that can be encrypted in a fhevm ciphertext.
585
+ * The plaintext types that can be encrypted in a HTTPZ ciphertext.
586
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11}
585
587
  */
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", });
588
+ module.exports.FheType = Object.freeze({
589
+ Ebool: 0, "0": "Ebool",
590
+ Euint4: 1, "1": "Euint4",
591
+ Euint8: 2, "2": "Euint8",
592
+ Euint16: 3, "3": "Euint16",
593
+ Euint32: 4, "4": "Euint32",
594
+ Euint64: 5, "5": "Euint64",
595
+ Euint128: 6, "6": "Euint128",
596
+ Euint160: 7, "7": "Euint160",
597
+ Euint256: 8, "8": "Euint256",
598
+ Euint512: 9, "9": "Euint512",
599
+ Euint1024: 10, "10": "Euint1024",
600
+ Euint2048: 11, "11": "Euint2048",
601
+ });
602
+
603
+ const CiphertextHandleFinalization = (typeof FinalizationRegistry === 'undefined')
604
+ ? { register: () => {}, unregister: () => {} }
605
+ : new FinalizationRegistry(ptr => wasm.__wbg_ciphertexthandle_free(ptr >>> 0, 1));
606
+
607
+ class CiphertextHandle {
608
+
609
+ __destroy_into_raw() {
610
+ const ptr = this.__wbg_ptr;
611
+ this.__wbg_ptr = 0;
612
+ CiphertextHandleFinalization.unregister(this);
613
+ return ptr;
614
+ }
615
+
616
+ free() {
617
+ const ptr = this.__destroy_into_raw();
618
+ wasm.__wbg_ciphertexthandle_free(ptr, 0);
619
+ }
620
+ }
621
+ module.exports.CiphertextHandle = CiphertextHandle;
587
622
 
588
623
  const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
589
624
  ? { register: () => {}, unregister: () => {} }
@@ -937,124 +972,67 @@ class ReencryptionRequest {
937
972
  wasm.__wbg_reencryptionrequest_free(ptr, 0);
938
973
  }
939
974
  /**
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}
975
+ * The 32 Byte / 256 Bit ID of the user decryption request, without `0x` prefix.
976
+ * Future queries for the result must use this request ID.
977
+ * @returns {RequestId | undefined}
960
978
  */
961
- get payload() {
962
- const ret = wasm.__wbg_get_reencryptionrequest_payload(this.__wbg_ptr);
963
- return ret === 0 ? undefined : ReencryptionRequestPayload.__wrap(ret);
979
+ get request_id() {
980
+ const ret = wasm.__wbg_get_reencryptionrequest_request_id(this.__wbg_ptr);
981
+ return ret === 0 ? undefined : RequestId.__wrap(ret);
964
982
  }
965
983
  /**
966
- * @param {ReencryptionRequestPayload | undefined} [arg0]
984
+ * The 32 Byte / 256 Bit ID of the user decryption request, without `0x` prefix.
985
+ * Future queries for the result must use this request ID.
986
+ * @param {RequestId | undefined} [arg0]
967
987
  */
968
- set payload(arg0) {
988
+ set request_id(arg0) {
969
989
  let ptr0 = 0;
970
990
  if (!isLikeNone(arg0)) {
971
- _assertClass(arg0, ReencryptionRequestPayload);
991
+ _assertClass(arg0, RequestId);
972
992
  ptr0 = arg0.__destroy_into_raw();
973
993
  }
974
- wasm.__wbg_set_reencryptionrequest_payload(this.__wbg_ptr, ptr0);
994
+ wasm.__wbg_set_reencryptionrequest_request_id(this.__wbg_ptr, ptr0);
975
995
  }
976
996
  /**
977
- * @returns {Eip712DomainMsg | undefined}
997
+ * The list of ciphertexts to reencrypt.
998
+ * @returns {(TypedCiphertext)[]}
978
999
  */
979
- get domain() {
980
- const ret = wasm.__wbg_get_reencryptionrequest_domain(this.__wbg_ptr);
981
- return ret === 0 ? undefined : Eip712DomainMsg.__wrap(ret);
1000
+ get typed_ciphertexts() {
1001
+ const ret = wasm.__wbg_get_reencryptionrequest_typed_ciphertexts(this.__wbg_ptr);
1002
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1003
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1004
+ return v1;
982
1005
  }
983
1006
  /**
984
- * @param {Eip712DomainMsg | undefined} [arg0]
1007
+ * The list of ciphertexts to reencrypt.
1008
+ * @param {(TypedCiphertext)[]} arg0
985
1009
  */
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);
1010
+ set typed_ciphertexts(arg0) {
1011
+ const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
1012
+ const len0 = WASM_VECTOR_LEN;
1013
+ wasm.__wbg_set_reencryptionrequest_typed_ciphertexts(this.__wbg_ptr, ptr0, len0);
993
1014
  }
994
1015
  /**
995
- * The ID that identifies this request.
996
- * Future queries for the result must use this request ID.
1016
+ * The 32 Byte / 256 Bit key id to use for decryption. This is the request_id used for key
1017
+ * generation
997
1018
  * @returns {RequestId | undefined}
998
1019
  */
999
- get request_id() {
1000
- const ret = wasm.__wbg_get_reencryptionrequest_request_id(this.__wbg_ptr);
1020
+ get key_id() {
1021
+ const ret = wasm.__wbg_get_reencryptionrequest_key_id(this.__wbg_ptr);
1001
1022
  return ret === 0 ? undefined : RequestId.__wrap(ret);
1002
1023
  }
1003
1024
  /**
1004
- * The ID that identifies this request.
1005
- * Future queries for the result must use this request ID.
1025
+ * The 32 Byte / 256 Bit key id to use for decryption. This is the request_id used for key
1026
+ * generation
1006
1027
  * @param {RequestId | undefined} [arg0]
1007
1028
  */
1008
- set request_id(arg0) {
1029
+ set key_id(arg0) {
1009
1030
  let ptr0 = 0;
1010
1031
  if (!isLikeNone(arg0)) {
1011
1032
  _assertClass(arg0, RequestId);
1012
1033
  ptr0 = arg0.__destroy_into_raw();
1013
1034
  }
1014
- wasm.__wbg_set_reencryptionrequest_request_id(this.__wbg_ptr, ptr0);
1015
- }
1016
- }
1017
- module.exports.ReencryptionRequest = ReencryptionRequest;
1018
-
1019
- const ReencryptionRequestPayloadFinalization = (typeof FinalizationRegistry === 'undefined')
1020
- ? { register: () => {}, unregister: () => {} }
1021
- : new FinalizationRegistry(ptr => wasm.__wbg_reencryptionrequestpayload_free(ptr >>> 0, 1));
1022
-
1023
- class ReencryptionRequestPayload {
1024
-
1025
- static __wrap(ptr) {
1026
- ptr = ptr >>> 0;
1027
- const obj = Object.create(ReencryptionRequestPayload.prototype);
1028
- obj.__wbg_ptr = ptr;
1029
- ReencryptionRequestPayloadFinalization.register(obj, obj.__wbg_ptr, obj);
1030
- return obj;
1031
- }
1032
-
1033
- __destroy_into_raw() {
1034
- const ptr = this.__wbg_ptr;
1035
- this.__wbg_ptr = 0;
1036
- ReencryptionRequestPayloadFinalization.unregister(this);
1037
- return ptr;
1038
- }
1039
-
1040
- free() {
1041
- const ptr = this.__destroy_into_raw();
1042
- wasm.__wbg_reencryptionrequestpayload_free(ptr, 0);
1043
- }
1044
- /**
1045
- * Version of the request format.
1046
- * @returns {number}
1047
- */
1048
- get version() {
1049
- const ret = wasm.__wbg_get_reencryptionrequestpayload_version(this.__wbg_ptr);
1050
- return ret >>> 0;
1051
- }
1052
- /**
1053
- * Version of the request format.
1054
- * @param {number} arg0
1055
- */
1056
- set version(arg0) {
1057
- wasm.__wbg_set_reencryptionrequestpayload_version(this.__wbg_ptr, arg0);
1035
+ wasm.__wbg_set_reencryptionrequest_key_id(this.__wbg_ptr, ptr0);
1058
1036
  }
1059
1037
  /**
1060
1038
  * The client's (blockchain wallet) address,
@@ -1065,7 +1043,7 @@ class ReencryptionRequestPayload {
1065
1043
  let deferred1_0;
1066
1044
  let deferred1_1;
1067
1045
  try {
1068
- const ret = wasm.__wbg_get_reencryptionrequestpayload_client_address(this.__wbg_ptr);
1046
+ const ret = wasm.__wbg_get_reencryptionrequest_client_address(this.__wbg_ptr);
1069
1047
  deferred1_0 = ret[0];
1070
1048
  deferred1_1 = ret[1];
1071
1049
  return getStringFromWasm0(ret[0], ret[1]);
@@ -1081,7 +1059,7 @@ class ReencryptionRequestPayload {
1081
1059
  set client_address(arg0) {
1082
1060
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1083
1061
  const len0 = WASM_VECTOR_LEN;
1084
- wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1062
+ wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1085
1063
  }
1086
1064
  /**
1087
1065
  * Encoding of the user's public encryption key for this request.
@@ -1090,7 +1068,7 @@ class ReencryptionRequestPayload {
1090
1068
  * @returns {Uint8Array}
1091
1069
  */
1092
1070
  get enc_key() {
1093
- const ret = wasm.__wbg_get_reencryptionrequestpayload_enc_key(this.__wbg_ptr);
1071
+ const ret = wasm.__wbg_get_reencryptionrequest_enc_key(this.__wbg_ptr);
1094
1072
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1095
1073
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1096
1074
  return v1;
@@ -1104,94 +1082,28 @@ class ReencryptionRequestPayload {
1104
1082
  set enc_key(arg0) {
1105
1083
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1106
1084
  const len0 = WASM_VECTOR_LEN;
1107
- wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1108
- }
1109
- /**
1110
- * The type of plaintext encrypted.
1111
- * @returns {number}
1112
- */
1113
- get fhe_type() {
1114
- const ret = wasm.__wbg_get_reencryptionrequestpayload_fhe_type(this.__wbg_ptr);
1115
- return ret;
1116
- }
1117
- /**
1118
- * The type of plaintext encrypted.
1119
- * @param {number} arg0
1120
- */
1121
- set fhe_type(arg0) {
1122
- wasm.__wbg_set_reencryptionrequestpayload_fhe_type(this.__wbg_ptr, arg0);
1085
+ wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
1123
1086
  }
1124
1087
  /**
1125
- * The key id to use for decryption. Will be the request_id used during key
1126
- * generation
1127
- * @returns {RequestId | undefined}
1088
+ * @returns {Eip712DomainMsg | undefined}
1128
1089
  */
1129
- get key_id() {
1130
- const ret = wasm.__wbg_get_reencryptionrequestpayload_key_id(this.__wbg_ptr);
1131
- return ret === 0 ? undefined : RequestId.__wrap(ret);
1090
+ get domain() {
1091
+ const ret = wasm.__wbg_get_reencryptionrequest_domain(this.__wbg_ptr);
1092
+ return ret === 0 ? undefined : Eip712DomainMsg.__wrap(ret);
1132
1093
  }
1133
1094
  /**
1134
- * The key id to use for decryption. Will be the request_id used during key
1135
- * generation
1136
- * @param {RequestId | undefined} [arg0]
1095
+ * @param {Eip712DomainMsg | undefined} [arg0]
1137
1096
  */
1138
- set key_id(arg0) {
1097
+ set domain(arg0) {
1139
1098
  let ptr0 = 0;
1140
1099
  if (!isLikeNone(arg0)) {
1141
- _assertClass(arg0, RequestId);
1100
+ _assertClass(arg0, Eip712DomainMsg);
1142
1101
  ptr0 = arg0.__destroy_into_raw();
1143
1102
  }
1144
- wasm.__wbg_set_reencryptionrequestpayload_key_id(this.__wbg_ptr, ptr0);
1145
- }
1146
- /**
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}
1152
- */
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);
1159
- }
1160
- return v1;
1161
- }
1162
- /**
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]
1168
- */
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);
1173
- }
1174
- /**
1175
- * The SHA3 digest of the ciphertext above.
1176
- * @returns {Uint8Array}
1177
- */
1178
- get ciphertext_digest() {
1179
- const ret = wasm.__wbg_get_reencryptionrequestpayload_ciphertext_digest(this.__wbg_ptr);
1180
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1181
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1182
- return v1;
1183
- }
1184
- /**
1185
- * The SHA3 digest of the ciphertext above.
1186
- * @param {Uint8Array} arg0
1187
- */
1188
- set ciphertext_digest(arg0) {
1189
- const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1190
- const len0 = WASM_VECTOR_LEN;
1191
- wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
1103
+ wasm.__wbg_set_reencryptionrequest_domain(this.__wbg_ptr, ptr0);
1192
1104
  }
1193
1105
  }
1194
- module.exports.ReencryptionRequestPayload = ReencryptionRequestPayload;
1106
+ module.exports.ReencryptionRequest = ReencryptionRequest;
1195
1107
 
1196
1108
  const ReencryptionResponseFinalization = (typeof FinalizationRegistry === 'undefined')
1197
1109
  ? { register: () => {}, unregister: () => {} }
@@ -1235,7 +1147,38 @@ class ReencryptionResponse {
1235
1147
  wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1236
1148
  }
1237
1149
  /**
1238
- * Signature of the serialization of \[ReencryptionResponsePayload\].
1150
+ * This is the external signature created from the Eip712 domain
1151
+ * on the structure, where reencryptedShare is bincode::serialize(&payload)
1152
+ * struct UserDecryptResponseVerification {
1153
+ * bytes publicKey;
1154
+ * uint256\[\] ctHandles;
1155
+ * bytes reencryptedShare;
1156
+ * }
1157
+ * @returns {Uint8Array}
1158
+ */
1159
+ get external_signature() {
1160
+ const ret = wasm.__wbg_get_reencryptionresponse_external_signature(this.__wbg_ptr);
1161
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1162
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1163
+ return v1;
1164
+ }
1165
+ /**
1166
+ * This is the external signature created from the Eip712 domain
1167
+ * on the structure, where reencryptedShare is bincode::serialize(&payload)
1168
+ * struct UserDecryptResponseVerification {
1169
+ * bytes publicKey;
1170
+ * uint256\[\] ctHandles;
1171
+ * bytes reencryptedShare;
1172
+ * }
1173
+ * @param {Uint8Array} arg0
1174
+ */
1175
+ set external_signature(arg0) {
1176
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1177
+ const len0 = WASM_VECTOR_LEN;
1178
+ wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1179
+ }
1180
+ /**
1181
+ * The actual \[ReencryptionResponsePayload\].
1239
1182
  * @returns {ReencryptionResponsePayload | undefined}
1240
1183
  */
1241
1184
  get payload() {
@@ -1243,7 +1186,7 @@ class ReencryptionResponse {
1243
1186
  return ret === 0 ? undefined : ReencryptionResponsePayload.__wrap(ret);
1244
1187
  }
1245
1188
  /**
1246
- * Signature of the serialization of \[ReencryptionResponsePayload\].
1189
+ * The actual \[ReencryptionResponsePayload\].
1247
1190
  * @param {ReencryptionResponsePayload | undefined} [arg0]
1248
1191
  */
1249
1192
  set payload(arg0) {
@@ -1283,23 +1226,7 @@ class ReencryptionResponsePayload {
1283
1226
  wasm.__wbg_reencryptionresponsepayload_free(ptr, 0);
1284
1227
  }
1285
1228
  /**
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);
1299
- }
1300
- /**
1301
- * The server's signature verification key.
1302
- * Encoded using SEC1.
1229
+ * The server's signature verification key, Encoded using SEC1.
1303
1230
  * Needed to validate the response, but MUST also be linked to a list of
1304
1231
  * trusted keys.
1305
1232
  * @returns {Uint8Array}
@@ -1311,8 +1238,7 @@ class ReencryptionResponsePayload {
1311
1238
  return v1;
1312
1239
  }
1313
1240
  /**
1314
- * The server's signature verification key.
1315
- * Encoded using SEC1.
1241
+ * The server's signature verification key, Encoded using SEC1.
1316
1242
  * Needed to validate the response, but MUST also be linked to a list of
1317
1243
  * trusted keys.
1318
1244
  * @param {Uint8Array} arg0
@@ -1323,9 +1249,9 @@ class ReencryptionResponsePayload {
1323
1249
  wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1324
1250
  }
1325
1251
  /**
1326
- * The concatenation of two digests:
1327
- * (eip712_signing_hash(pk, domain) || ciphertext digest).
1328
1252
  * This is needed to ensure the response corresponds to the request.
1253
+ * It is the digest of UserDecryptionLinker hashed using EIP712
1254
+ * under the given domain in the request.
1329
1255
  * @returns {Uint8Array}
1330
1256
  */
1331
1257
  get digest() {
@@ -1335,9 +1261,9 @@ class ReencryptionResponsePayload {
1335
1261
  return v1;
1336
1262
  }
1337
1263
  /**
1338
- * The concatenation of two digests:
1339
- * (eip712_signing_hash(pk, domain) || ciphertext digest).
1340
1264
  * This is needed to ensure the response corresponds to the request.
1265
+ * It is the digest of UserDecryptionLinker hashed using EIP712
1266
+ * under the given domain in the request.
1341
1267
  * @param {Uint8Array} arg0
1342
1268
  */
1343
1269
  set digest(arg0) {
@@ -1346,40 +1272,27 @@ class ReencryptionResponsePayload {
1346
1272
  wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1347
1273
  }
1348
1274
  /**
1349
- * The type of plaintext encrypted.
1350
- * @returns {number}
1351
- */
1352
- get fhe_type() {
1353
- const ret = wasm.__wbg_get_reencryptionresponsepayload_fhe_type(this.__wbg_ptr);
1354
- return ret;
1355
- }
1356
- /**
1357
- * The type of plaintext encrypted.
1358
- * @param {number} arg0
1359
- */
1360
- set fhe_type(arg0) {
1361
- wasm.__wbg_set_reencryptionresponsepayload_fhe_type(this.__wbg_ptr, arg0);
1362
- }
1363
- /**
1364
- * The signcrypted payload, using a hybrid encryption approach in
1365
- * sign-then-encrypt.
1366
- * @returns {Uint8Array}
1275
+ * The resulting signcrypted ciphertexts, each ciphertext
1276
+ * must be decrypted and then reconstructed with the other shares
1277
+ * to produce the final plaintext.
1278
+ * @returns {(TypedSigncryptedCiphertext)[]}
1367
1279
  */
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);
1280
+ get signcrypted_ciphertexts() {
1281
+ const ret = wasm.__wbg_get_reencryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr);
1282
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1283
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1372
1284
  return v1;
1373
1285
  }
1374
1286
  /**
1375
- * The signcrypted payload, using a hybrid encryption approach in
1376
- * sign-then-encrypt.
1377
- * @param {Uint8Array} arg0
1287
+ * The resulting signcrypted ciphertexts, each ciphertext
1288
+ * must be decrypted and then reconstructed with the other shares
1289
+ * to produce the final plaintext.
1290
+ * @param {(TypedSigncryptedCiphertext)[]} arg0
1378
1291
  */
1379
- set signcrypted_ciphertext(arg0) {
1380
- const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1292
+ set signcrypted_ciphertexts(arg0) {
1293
+ const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
1381
1294
  const len0 = WASM_VECTOR_LEN;
1382
- wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
1295
+ wasm.__wbg_set_reencryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr, ptr0, len0);
1383
1296
  }
1384
1297
  /**
1385
1298
  * The ID of the MPC party doing the reencryption. Used for polynomial
@@ -1420,8 +1333,8 @@ const RequestIdFinalization = (typeof FinalizationRegistry === 'undefined')
1420
1333
  ? { register: () => {}, unregister: () => {} }
1421
1334
  : new FinalizationRegistry(ptr => wasm.__wbg_requestid_free(ptr >>> 0, 1));
1422
1335
  /**
1423
- * Simple response to return an ID, to be used to retrieve the computed result
1424
- * later on.
1336
+ * Simple response to return a 32 Byte / 256 Bit ID, to be used to retrieve the computed result
1337
+ * later on. This string does NOT contain a `0x` prefix.
1425
1338
  */
1426
1339
  class RequestId {
1427
1340
 
@@ -1470,101 +1383,299 @@ class RequestId {
1470
1383
  }
1471
1384
  module.exports.RequestId = RequestId;
1472
1385
 
1473
- module.exports.__wbindgen_error_new = function(arg0, arg1) {
1474
- const ret = new Error(getStringFromWasm0(arg0, arg1));
1475
- return ret;
1476
- };
1477
-
1478
- module.exports.__wbg_reencryptionresponse_unwrap = function(arg0) {
1479
- const ret = ReencryptionResponse.__unwrap(arg0);
1480
- return ret;
1481
- };
1386
+ const TypedCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
1387
+ ? { register: () => {}, unregister: () => {} }
1388
+ : new FinalizationRegistry(ptr => wasm.__wbg_typedciphertext_free(ptr >>> 0, 1));
1482
1389
 
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);
1488
- };
1390
+ class TypedCiphertext {
1489
1391
 
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
- };
1392
+ static __wrap(ptr) {
1393
+ ptr = ptr >>> 0;
1394
+ const obj = Object.create(TypedCiphertext.prototype);
1395
+ obj.__wbg_ptr = ptr;
1396
+ TypedCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
1397
+ return obj;
1398
+ }
1498
1399
 
1499
- module.exports.__wbindgen_is_object = function(arg0) {
1500
- const val = arg0;
1501
- const ret = typeof(val) === 'object' && val !== null;
1502
- return ret;
1503
- };
1400
+ static __unwrap(jsValue) {
1401
+ if (!(jsValue instanceof TypedCiphertext)) {
1402
+ return 0;
1403
+ }
1404
+ return jsValue.__destroy_into_raw();
1405
+ }
1504
1406
 
1505
- module.exports.__wbindgen_is_undefined = function(arg0) {
1506
- const ret = arg0 === undefined;
1507
- return ret;
1508
- };
1407
+ __destroy_into_raw() {
1408
+ const ptr = this.__wbg_ptr;
1409
+ this.__wbg_ptr = 0;
1410
+ TypedCiphertextFinalization.unregister(this);
1411
+ return ptr;
1412
+ }
1509
1413
 
1510
- module.exports.__wbindgen_in = function(arg0, arg1) {
1511
- const ret = arg0 in arg1;
1512
- return ret;
1513
- };
1414
+ free() {
1415
+ const ptr = this.__destroy_into_raw();
1416
+ wasm.__wbg_typedciphertext_free(ptr, 0);
1417
+ }
1418
+ /**
1419
+ * The actual ciphertext to decrypt, taken directly from HTTPZ.
1420
+ * @returns {Uint8Array}
1421
+ */
1422
+ get ciphertext() {
1423
+ const ret = wasm.__wbg_get_typedciphertext_ciphertext(this.__wbg_ptr);
1424
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1425
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1426
+ return v1;
1427
+ }
1428
+ /**
1429
+ * The actual ciphertext to decrypt, taken directly from HTTPZ.
1430
+ * @param {Uint8Array} arg0
1431
+ */
1432
+ set ciphertext(arg0) {
1433
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1434
+ const len0 = WASM_VECTOR_LEN;
1435
+ wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1436
+ }
1437
+ /**
1438
+ * The type of plaintext encrypted.
1439
+ * @returns {number}
1440
+ */
1441
+ get fhe_type() {
1442
+ const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
1443
+ return ret;
1444
+ }
1445
+ /**
1446
+ * The type of plaintext encrypted.
1447
+ * @param {number} arg0
1448
+ */
1449
+ set fhe_type(arg0) {
1450
+ wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
1451
+ }
1452
+ /**
1453
+ * The external handle of the ciphertext (the handle used in the copro).
1454
+ * @returns {Uint8Array}
1455
+ */
1456
+ get external_handle() {
1457
+ const ret = wasm.__wbg_get_typedciphertext_external_handle(this.__wbg_ptr);
1458
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1459
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1460
+ return v1;
1461
+ }
1462
+ /**
1463
+ * The external handle of the ciphertext (the handle used in the copro).
1464
+ * @param {Uint8Array} arg0
1465
+ */
1466
+ set external_handle(arg0) {
1467
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1468
+ const len0 = WASM_VECTOR_LEN;
1469
+ wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1470
+ }
1471
+ /**
1472
+ * The ciphertext format, see CiphertextFormat documentation for details.
1473
+ * CiphertextFormat::default() is used if unspecified.
1474
+ * @returns {number}
1475
+ */
1476
+ get ciphertext_format() {
1477
+ const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
1478
+ return ret;
1479
+ }
1480
+ /**
1481
+ * The ciphertext format, see CiphertextFormat documentation for details.
1482
+ * CiphertextFormat::default() is used if unspecified.
1483
+ * @param {number} arg0
1484
+ */
1485
+ set ciphertext_format(arg0) {
1486
+ wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
1487
+ }
1488
+ }
1489
+ module.exports.TypedCiphertext = TypedCiphertext;
1514
1490
 
1515
- module.exports.__wbindgen_is_null = function(arg0) {
1516
- const ret = arg0 === null;
1517
- return ret;
1518
- };
1491
+ const TypedPlaintextFinalization = (typeof FinalizationRegistry === 'undefined')
1492
+ ? { register: () => {}, unregister: () => {} }
1493
+ : new FinalizationRegistry(ptr => wasm.__wbg_typedplaintext_free(ptr >>> 0, 1));
1494
+ /**
1495
+ * The typed plaintext type, which is the result of decryption.
1496
+ */
1497
+ class TypedPlaintext {
1519
1498
 
1520
- module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
1521
- const ret = arg0 == arg1;
1522
- return ret;
1523
- };
1499
+ static __wrap(ptr) {
1500
+ ptr = ptr >>> 0;
1501
+ const obj = Object.create(TypedPlaintext.prototype);
1502
+ obj.__wbg_ptr = ptr;
1503
+ TypedPlaintextFinalization.register(obj, obj.__wbg_ptr, obj);
1504
+ return obj;
1505
+ }
1524
1506
 
1525
- module.exports.__wbindgen_boolean_get = function(arg0) {
1526
- const v = arg0;
1527
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1528
- return ret;
1529
- };
1507
+ __destroy_into_raw() {
1508
+ const ptr = this.__wbg_ptr;
1509
+ this.__wbg_ptr = 0;
1510
+ TypedPlaintextFinalization.unregister(this);
1511
+ return ptr;
1512
+ }
1530
1513
 
1531
- module.exports.__wbindgen_as_number = function(arg0) {
1532
- const ret = +arg0;
1533
- return ret;
1534
- };
1514
+ free() {
1515
+ const ptr = this.__destroy_into_raw();
1516
+ wasm.__wbg_typedplaintext_free(ptr, 0);
1517
+ }
1518
+ /**
1519
+ * The actual plaintext in bytes.
1520
+ * @returns {Uint8Array}
1521
+ */
1522
+ get bytes() {
1523
+ const ret = wasm.__wbg_get_typedplaintext_bytes(this.__wbg_ptr);
1524
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1525
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1526
+ return v1;
1527
+ }
1528
+ /**
1529
+ * The actual plaintext in bytes.
1530
+ * @param {Uint8Array} arg0
1531
+ */
1532
+ set bytes(arg0) {
1533
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1534
+ const len0 = WASM_VECTOR_LEN;
1535
+ wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1536
+ }
1537
+ /**
1538
+ * The type of plaintext encrypted.
1539
+ * @returns {number}
1540
+ */
1541
+ get fhe_type() {
1542
+ const ret = wasm.__wbg_get_typedplaintext_fhe_type(this.__wbg_ptr);
1543
+ return ret;
1544
+ }
1545
+ /**
1546
+ * The type of plaintext encrypted.
1547
+ * @param {number} arg0
1548
+ */
1549
+ set fhe_type(arg0) {
1550
+ wasm.__wbg_set_typedplaintext_fhe_type(this.__wbg_ptr, arg0);
1551
+ }
1552
+ }
1553
+ module.exports.TypedPlaintext = TypedPlaintext;
1535
1554
 
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
- };
1555
+ const TypedSigncryptedCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
1556
+ ? { register: () => {}, unregister: () => {} }
1557
+ : new FinalizationRegistry(ptr => wasm.__wbg_typedsigncryptedciphertext_free(ptr >>> 0, 1));
1543
1558
 
1544
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
1545
- const ret = getStringFromWasm0(arg0, arg1);
1546
- return ret;
1547
- };
1559
+ class TypedSigncryptedCiphertext {
1548
1560
 
1549
- module.exports.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
1550
- const ret = arg0[arg1];
1551
- return ret;
1552
- };
1561
+ static __wrap(ptr) {
1562
+ ptr = ptr >>> 0;
1563
+ const obj = Object.create(TypedSigncryptedCiphertext.prototype);
1564
+ obj.__wbg_ptr = ptr;
1565
+ TypedSigncryptedCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
1566
+ return obj;
1567
+ }
1553
1568
 
1554
- module.exports.__wbg_new_abda76e883ba8a5f = function() {
1555
- const ret = new Error();
1556
- return ret;
1557
- };
1569
+ static __unwrap(jsValue) {
1570
+ if (!(jsValue instanceof TypedSigncryptedCiphertext)) {
1571
+ return 0;
1572
+ }
1573
+ return jsValue.__destroy_into_raw();
1574
+ }
1558
1575
 
1559
- module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
1560
- const ret = arg1.stack;
1576
+ __destroy_into_raw() {
1577
+ const ptr = this.__wbg_ptr;
1578
+ this.__wbg_ptr = 0;
1579
+ TypedSigncryptedCiphertextFinalization.unregister(this);
1580
+ return ptr;
1581
+ }
1582
+
1583
+ free() {
1584
+ const ptr = this.__destroy_into_raw();
1585
+ wasm.__wbg_typedsigncryptedciphertext_free(ptr, 0);
1586
+ }
1587
+ /**
1588
+ * The type of plaintext encrypted.
1589
+ * @returns {number}
1590
+ */
1591
+ get fhe_type() {
1592
+ const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
1593
+ return ret;
1594
+ }
1595
+ /**
1596
+ * The type of plaintext encrypted.
1597
+ * @param {number} arg0
1598
+ */
1599
+ set fhe_type(arg0) {
1600
+ wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
1601
+ }
1602
+ /**
1603
+ * The signcrypted payload, using a hybrid encryption approach in
1604
+ * sign-then-encrypt.
1605
+ * @returns {Uint8Array}
1606
+ */
1607
+ get signcrypted_ciphertext() {
1608
+ const ret = wasm.__wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext(this.__wbg_ptr);
1609
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1610
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1611
+ return v1;
1612
+ }
1613
+ /**
1614
+ * The signcrypted payload, using a hybrid encryption approach in
1615
+ * sign-then-encrypt.
1616
+ * @param {Uint8Array} arg0
1617
+ */
1618
+ set signcrypted_ciphertext(arg0) {
1619
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1620
+ const len0 = WASM_VECTOR_LEN;
1621
+ wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1622
+ }
1623
+ /**
1624
+ * The external handles that were originally in the request.
1625
+ * @returns {Uint8Array}
1626
+ */
1627
+ get external_handle() {
1628
+ const ret = wasm.__wbg_get_typedsigncryptedciphertext_external_handle(this.__wbg_ptr);
1629
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1630
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1631
+ return v1;
1632
+ }
1633
+ /**
1634
+ * The external handles that were originally in the request.
1635
+ * @param {Uint8Array} arg0
1636
+ */
1637
+ set external_handle(arg0) {
1638
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1639
+ const len0 = WASM_VECTOR_LEN;
1640
+ wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1641
+ }
1642
+ }
1643
+ module.exports.TypedSigncryptedCiphertext = TypedSigncryptedCiphertext;
1644
+
1645
+ module.exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
1646
+ const ret = String(arg1);
1561
1647
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1562
1648
  const len1 = WASM_VECTOR_LEN;
1563
1649
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1564
1650
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1565
1651
  };
1566
1652
 
1567
- module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
1653
+ module.exports.__wbg_buffer_61b7ce01341d7f88 = function(arg0) {
1654
+ const ret = arg0.buffer;
1655
+ return ret;
1656
+ };
1657
+
1658
+ module.exports.__wbg_call_500db948e69c7330 = function() { return handleError(function (arg0, arg1, arg2) {
1659
+ const ret = arg0.call(arg1, arg2);
1660
+ return ret;
1661
+ }, arguments) };
1662
+
1663
+ module.exports.__wbg_call_b0d8e36992d9900d = function() { return handleError(function (arg0, arg1) {
1664
+ const ret = arg0.call(arg1);
1665
+ return ret;
1666
+ }, arguments) };
1667
+
1668
+ module.exports.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
1669
+ const ret = arg0.crypto;
1670
+ return ret;
1671
+ };
1672
+
1673
+ module.exports.__wbg_done_f22c1561fa919baa = function(arg0) {
1674
+ const ret = arg0.done;
1675
+ return ret;
1676
+ };
1677
+
1678
+ module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1568
1679
  let deferred0_0;
1569
1680
  let deferred0_1;
1570
1681
  try {
@@ -1576,192 +1687,216 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
1576
1687
  }
1577
1688
  };
1578
1689
 
1579
- module.exports.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
1580
- const ret = arg0.crypto;
1690
+ module.exports.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
1691
+ arg0.getRandomValues(arg1);
1692
+ }, arguments) };
1693
+
1694
+ module.exports.__wbg_get_9aa3dff3f0266054 = function(arg0, arg1) {
1695
+ const ret = arg0[arg1 >>> 0];
1581
1696
  return ret;
1582
1697
  };
1583
1698
 
1584
- module.exports.__wbg_process_4a72847cc503995b = function(arg0) {
1585
- const ret = arg0.process;
1699
+ module.exports.__wbg_get_bbccf8970793c087 = function() { return handleError(function (arg0, arg1) {
1700
+ const ret = Reflect.get(arg0, arg1);
1586
1701
  return ret;
1587
- };
1702
+ }, arguments) };
1588
1703
 
1589
- module.exports.__wbg_versions_f686565e586dd935 = function(arg0) {
1590
- const ret = arg0.versions;
1704
+ module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
1705
+ const ret = arg0[arg1];
1591
1706
  return ret;
1592
1707
  };
1593
1708
 
1594
- module.exports.__wbg_node_104a2ff8d6ea03a2 = function(arg0) {
1595
- const ret = arg0.node;
1709
+ module.exports.__wbg_instanceof_ArrayBuffer_670ddde44cdb2602 = function(arg0) {
1710
+ let result;
1711
+ try {
1712
+ result = arg0 instanceof ArrayBuffer;
1713
+ } catch (_) {
1714
+ result = false;
1715
+ }
1716
+ const ret = result;
1596
1717
  return ret;
1597
1718
  };
1598
1719
 
1599
- module.exports.__wbindgen_is_string = function(arg0) {
1600
- const ret = typeof(arg0) === 'string';
1720
+ module.exports.__wbg_instanceof_Uint8Array_28af5bc19d6acad8 = function(arg0) {
1721
+ let result;
1722
+ try {
1723
+ result = arg0 instanceof Uint8Array;
1724
+ } catch (_) {
1725
+ result = false;
1726
+ }
1727
+ const ret = result;
1601
1728
  return ret;
1602
1729
  };
1603
1730
 
1604
- module.exports.__wbg_require_cca90b1a94a0255b = function() { return handleError(function () {
1605
- const ret = module.require;
1731
+ module.exports.__wbg_isArray_1ba11a930108ec51 = function(arg0) {
1732
+ const ret = Array.isArray(arg0);
1606
1733
  return ret;
1607
- }, arguments) };
1734
+ };
1608
1735
 
1609
- module.exports.__wbindgen_is_function = function(arg0) {
1610
- const ret = typeof(arg0) === 'function';
1736
+ module.exports.__wbg_isSafeInteger_12f5549b2fca23f4 = function(arg0) {
1737
+ const ret = Number.isSafeInteger(arg0);
1611
1738
  return ret;
1612
1739
  };
1613
1740
 
1614
- module.exports.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
1615
- const ret = arg0.msCrypto;
1741
+ module.exports.__wbg_iterator_23604bb983791576 = function() {
1742
+ const ret = Symbol.iterator;
1616
1743
  return ret;
1617
1744
  };
1618
1745
 
1619
- module.exports.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
1620
- arg0.randomFillSync(arg1);
1621
- }, arguments) };
1622
-
1623
- module.exports.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
1624
- arg0.getRandomValues(arg1);
1625
- }, arguments) };
1626
-
1627
- module.exports.__wbg_get_5419cf6b954aa11d = function(arg0, arg1) {
1628
- const ret = arg0[arg1 >>> 0];
1746
+ module.exports.__wbg_length_65d1cd11729ced11 = function(arg0) {
1747
+ const ret = arg0.length;
1629
1748
  return ret;
1630
1749
  };
1631
1750
 
1632
- module.exports.__wbg_length_f217bbbf7e8e4df4 = function(arg0) {
1751
+ module.exports.__wbg_length_d65cf0786bfc5739 = function(arg0) {
1633
1752
  const ret = arg0.length;
1634
1753
  return ret;
1635
1754
  };
1636
1755
 
1637
- module.exports.__wbg_newnoargs_1ede4bf2ebbaaf43 = function(arg0, arg1) {
1638
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1756
+ module.exports.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
1757
+ const ret = arg0.msCrypto;
1639
1758
  return ret;
1640
1759
  };
1641
1760
 
1642
- module.exports.__wbg_next_13b477da1eaa3897 = function(arg0) {
1643
- const ret = arg0.next;
1761
+ module.exports.__wbg_new_3ff5b33b1ce712df = function(arg0) {
1762
+ const ret = new Uint8Array(arg0);
1644
1763
  return ret;
1645
1764
  };
1646
1765
 
1647
- module.exports.__wbg_next_b06e115d1b01e10b = function() { return handleError(function (arg0) {
1648
- const ret = arg0.next();
1766
+ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
1767
+ const ret = new Error();
1649
1768
  return ret;
1650
- }, arguments) };
1769
+ };
1651
1770
 
1652
- module.exports.__wbg_done_983b5ffcaec8c583 = function(arg0) {
1653
- const ret = arg0.done;
1771
+ module.exports.__wbg_newnoargs_fd9e4bf8be2bc16d = function(arg0, arg1) {
1772
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
1654
1773
  return ret;
1655
1774
  };
1656
1775
 
1657
- module.exports.__wbg_value_2ab8a198c834c26a = function(arg0) {
1658
- const ret = arg0.value;
1776
+ module.exports.__wbg_newwithbyteoffsetandlength_ba35896968751d91 = function(arg0, arg1, arg2) {
1777
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1659
1778
  return ret;
1660
1779
  };
1661
1780
 
1662
- module.exports.__wbg_iterator_695d699a44d6234c = function() {
1663
- const ret = Symbol.iterator;
1781
+ module.exports.__wbg_newwithlength_34ce8f1051e74449 = function(arg0) {
1782
+ const ret = new Uint8Array(arg0 >>> 0);
1664
1783
  return ret;
1665
1784
  };
1666
1785
 
1667
- module.exports.__wbg_get_ef828680c64da212 = function() { return handleError(function (arg0, arg1) {
1668
- const ret = Reflect.get(arg0, arg1);
1786
+ module.exports.__wbg_next_01dd9234a5bf6d05 = function() { return handleError(function (arg0) {
1787
+ const ret = arg0.next();
1669
1788
  return ret;
1670
1789
  }, arguments) };
1671
1790
 
1672
- module.exports.__wbg_call_a9ef466721e824f2 = function() { return handleError(function (arg0, arg1) {
1673
- const ret = arg0.call(arg1);
1791
+ module.exports.__wbg_next_137428deb98342b0 = function(arg0) {
1792
+ const ret = arg0.next;
1674
1793
  return ret;
1675
- }, arguments) };
1794
+ };
1676
1795
 
1677
- module.exports.__wbg_self_bf91bf94d9e04084 = function() { return handleError(function () {
1678
- const ret = self.self;
1796
+ module.exports.__wbg_node_02999533c4ea02e3 = function(arg0) {
1797
+ const ret = arg0.node;
1679
1798
  return ret;
1680
- }, arguments) };
1799
+ };
1681
1800
 
1682
- module.exports.__wbg_window_52dd9f07d03fd5f8 = function() { return handleError(function () {
1683
- const ret = window.window;
1801
+ module.exports.__wbg_process_5c1d670bc53614b8 = function(arg0) {
1802
+ const ret = arg0.process;
1684
1803
  return ret;
1804
+ };
1805
+
1806
+ module.exports.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
1807
+ arg0.randomFillSync(arg1);
1685
1808
  }, arguments) };
1686
1809
 
1687
- module.exports.__wbg_globalThis_05c129bf37fcf1be = function() { return handleError(function () {
1688
- const ret = globalThis.globalThis;
1810
+ module.exports.__wbg_reencryptionresponse_unwrap = function(arg0) {
1811
+ const ret = ReencryptionResponse.__unwrap(arg0);
1689
1812
  return ret;
1690
- }, arguments) };
1813
+ };
1691
1814
 
1692
- module.exports.__wbg_global_3eca19bb09e9c484 = function() { return handleError(function () {
1693
- const ret = global.global;
1815
+ module.exports.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
1816
+ const ret = module.require;
1694
1817
  return ret;
1695
1818
  }, arguments) };
1696
1819
 
1697
- module.exports.__wbg_isArray_6f3b47f09adb61b5 = function(arg0) {
1698
- const ret = Array.isArray(arg0);
1699
- return ret;
1820
+ module.exports.__wbg_set_23d69db4e5c66a6e = function(arg0, arg1, arg2) {
1821
+ arg0.set(arg1, arg2 >>> 0);
1700
1822
  };
1701
1823
 
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;
1710
- return ret;
1824
+ module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
1825
+ const ret = arg1.stack;
1826
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1827
+ const len1 = WASM_VECTOR_LEN;
1828
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1829
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1711
1830
  };
1712
1831
 
1713
- module.exports.__wbg_call_3bfa248576352471 = function() { return handleError(function (arg0, arg1, arg2) {
1714
- const ret = arg0.call(arg1, arg2);
1832
+ module.exports.__wbg_static_accessor_GLOBAL_0be7472e492ad3e3 = function() {
1833
+ const ret = typeof global === 'undefined' ? null : global;
1834
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1835
+ };
1836
+
1837
+ module.exports.__wbg_static_accessor_GLOBAL_THIS_1a6eb482d12c9bfb = function() {
1838
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1839
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1840
+ };
1841
+
1842
+ module.exports.__wbg_static_accessor_SELF_1dc398a895c82351 = function() {
1843
+ const ret = typeof self === 'undefined' ? null : self;
1844
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1845
+ };
1846
+
1847
+ module.exports.__wbg_static_accessor_WINDOW_ae1c80c7eea8d64a = function() {
1848
+ const ret = typeof window === 'undefined' ? null : window;
1849
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1850
+ };
1851
+
1852
+ module.exports.__wbg_subarray_46adeb9b86949d12 = function(arg0, arg1, arg2) {
1853
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1715
1854
  return ret;
1716
- }, arguments) };
1855
+ };
1717
1856
 
1718
- module.exports.__wbg_isSafeInteger_b9dff570f01a9100 = function(arg0) {
1719
- const ret = Number.isSafeInteger(arg0);
1857
+ module.exports.__wbg_typedciphertext_new = function(arg0) {
1858
+ const ret = TypedCiphertext.__wrap(arg0);
1720
1859
  return ret;
1721
1860
  };
1722
1861
 
1723
- module.exports.__wbg_buffer_ccaed51a635d8a2d = function(arg0) {
1724
- const ret = arg0.buffer;
1862
+ module.exports.__wbg_typedciphertext_unwrap = function(arg0) {
1863
+ const ret = TypedCiphertext.__unwrap(arg0);
1725
1864
  return ret;
1726
1865
  };
1727
1866
 
1728
- module.exports.__wbg_newwithbyteoffsetandlength_7e3eb787208af730 = function(arg0, arg1, arg2) {
1729
- const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1867
+ module.exports.__wbg_typedplaintext_new = function(arg0) {
1868
+ const ret = TypedPlaintext.__wrap(arg0);
1730
1869
  return ret;
1731
1870
  };
1732
1871
 
1733
- module.exports.__wbg_new_fec2611eb9180f95 = function(arg0) {
1734
- const ret = new Uint8Array(arg0);
1872
+ module.exports.__wbg_typedsigncryptedciphertext_new = function(arg0) {
1873
+ const ret = TypedSigncryptedCiphertext.__wrap(arg0);
1735
1874
  return ret;
1736
1875
  };
1737
1876
 
1738
- module.exports.__wbg_set_ec2fcf81bc573fd9 = function(arg0, arg1, arg2) {
1739
- arg0.set(arg1, arg2 >>> 0);
1877
+ module.exports.__wbg_typedsigncryptedciphertext_unwrap = function(arg0) {
1878
+ const ret = TypedSigncryptedCiphertext.__unwrap(arg0);
1879
+ return ret;
1740
1880
  };
1741
1881
 
1742
- module.exports.__wbg_length_9254c4bd3b9f23c4 = function(arg0) {
1743
- const ret = arg0.length;
1882
+ module.exports.__wbg_value_4c32fd138a88eee2 = function(arg0) {
1883
+ const ret = arg0.value;
1744
1884
  return ret;
1745
1885
  };
1746
1886
 
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;
1887
+ module.exports.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
1888
+ const ret = arg0.versions;
1755
1889
  return ret;
1756
1890
  };
1757
1891
 
1758
- module.exports.__wbg_newwithlength_76462a666eca145f = function(arg0) {
1759
- const ret = new Uint8Array(arg0 >>> 0);
1892
+ module.exports.__wbindgen_as_number = function(arg0) {
1893
+ const ret = +arg0;
1760
1894
  return ret;
1761
1895
  };
1762
1896
 
1763
- module.exports.__wbg_subarray_975a06f9dbd16995 = function(arg0, arg1, arg2) {
1764
- const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1897
+ module.exports.__wbindgen_boolean_get = function(arg0) {
1898
+ const v = arg0;
1899
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1765
1900
  return ret;
1766
1901
  };
1767
1902
 
@@ -1773,17 +1908,18 @@ module.exports.__wbindgen_debug_string = function(arg0, arg1) {
1773
1908
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1774
1909
  };
1775
1910
 
1776
- module.exports.__wbindgen_throw = function(arg0, arg1) {
1777
- throw new Error(getStringFromWasm0(arg0, arg1));
1911
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
1912
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1913
+ return ret;
1778
1914
  };
1779
1915
 
1780
- module.exports.__wbindgen_memory = function() {
1781
- const ret = wasm.memory;
1916
+ module.exports.__wbindgen_in = function(arg0, arg1) {
1917
+ const ret = arg0 in arg1;
1782
1918
  return ret;
1783
1919
  };
1784
1920
 
1785
1921
  module.exports.__wbindgen_init_externref_table = function() {
1786
- const table = wasm.__wbindgen_export_2;
1922
+ const table = wasm.__wbindgen_export_4;
1787
1923
  const offset = table.grow(4);
1788
1924
  table.set(0, undefined);
1789
1925
  table.set(offset + 0, undefined);
@@ -1793,6 +1929,67 @@ module.exports.__wbindgen_init_externref_table = function() {
1793
1929
  ;
1794
1930
  };
1795
1931
 
1932
+ module.exports.__wbindgen_is_function = function(arg0) {
1933
+ const ret = typeof(arg0) === 'function';
1934
+ return ret;
1935
+ };
1936
+
1937
+ module.exports.__wbindgen_is_null = function(arg0) {
1938
+ const ret = arg0 === null;
1939
+ return ret;
1940
+ };
1941
+
1942
+ module.exports.__wbindgen_is_object = function(arg0) {
1943
+ const val = arg0;
1944
+ const ret = typeof(val) === 'object' && val !== null;
1945
+ return ret;
1946
+ };
1947
+
1948
+ module.exports.__wbindgen_is_string = function(arg0) {
1949
+ const ret = typeof(arg0) === 'string';
1950
+ return ret;
1951
+ };
1952
+
1953
+ module.exports.__wbindgen_is_undefined = function(arg0) {
1954
+ const ret = arg0 === undefined;
1955
+ return ret;
1956
+ };
1957
+
1958
+ module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
1959
+ const ret = arg0 == arg1;
1960
+ return ret;
1961
+ };
1962
+
1963
+ module.exports.__wbindgen_memory = function() {
1964
+ const ret = wasm.memory;
1965
+ return ret;
1966
+ };
1967
+
1968
+ module.exports.__wbindgen_number_get = function(arg0, arg1) {
1969
+ const obj = arg1;
1970
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1971
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1972
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1973
+ };
1974
+
1975
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
1976
+ const obj = arg1;
1977
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1978
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1979
+ var len1 = WASM_VECTOR_LEN;
1980
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1981
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1982
+ };
1983
+
1984
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
1985
+ const ret = getStringFromWasm0(arg0, arg1);
1986
+ return ret;
1987
+ };
1988
+
1989
+ module.exports.__wbindgen_throw = function(arg0, arg1) {
1990
+ throw new Error(getStringFromWasm0(arg0, arg1));
1991
+ };
1992
+
1796
1993
  const path = require('path').join(__dirname, 'kms_lib_bg.wasm');
1797
1994
  const bytes = require('fs').readFileSync(path);
1798
1995