node-tkms 0.9.1-rc3 → 0.11.0-rc3

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,13 +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
- let WASM_VECTOR_LEN = 0;
26
-
27
18
  let cachedTextEncoder = new TextEncoder('utf-8');
28
19
 
29
20
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -78,10 +69,6 @@ function passStringToWasm0(arg, malloc, realloc) {
78
69
  return ptr;
79
70
  }
80
71
 
81
- function isLikeNone(x) {
82
- return x === undefined || x === null;
83
- }
84
-
85
72
  let cachedDataViewMemory0 = null;
86
73
 
87
74
  function getDataViewMemory0() {
@@ -91,6 +78,34 @@ function getDataViewMemory0() {
91
78
  return cachedDataViewMemory0;
92
79
  }
93
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]'
@@ -160,7 +175,6 @@ function _assertClass(instance, klass) {
160
175
  if (!(instance instanceof klass)) {
161
176
  throw new Error(`expected instance of ${klass.name}`);
162
177
  }
163
- return instance.ptr;
164
178
  }
165
179
 
166
180
  function getArrayU8FromWasm0(ptr, len) {
@@ -187,7 +201,7 @@ function passArray8ToWasm0(arg, malloc) {
187
201
  }
188
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;
@@ -501,7 +509,7 @@ module.exports.cryptobox_decrypt = function(ct, my_sk, their_pk) {
501
509
  * @param {PublicEncKey} enc_pk
502
510
  * @param {PrivateEncKey} enc_sk
503
511
  * @param {boolean} verify
504
- * @returns {Uint8Array}
512
+ * @returns {(TypedPlaintext)[]}
505
513
  */
506
514
  module.exports.process_reencryption_resp_from_js = function(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
507
515
  _assertClass(client, Client);
@@ -511,8 +519,8 @@ module.exports.process_reencryption_resp_from_js = function(client, request, eip
511
519
  if (ret[3]) {
512
520
  throw takeFromExternrefTable0(ret[2]);
513
521
  }
514
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
515
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
522
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
523
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
516
524
  return v1;
517
525
  };
518
526
 
@@ -545,7 +553,7 @@ module.exports.process_reencryption_resp_from_js = function(client, request, eip
545
553
  * @param {PublicEncKey} enc_pk
546
554
  * @param {PrivateEncKey} enc_sk
547
555
  * @param {boolean} verify
548
- * @returns {Uint8Array}
556
+ * @returns {(TypedPlaintext)[]}
549
557
  */
550
558
  module.exports.process_reencryption_resp = function(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
551
559
  _assertClass(client, Client);
@@ -567,23 +575,49 @@ module.exports.process_reencryption_resp = function(client, request, eip712_doma
567
575
  if (ret[3]) {
568
576
  throw takeFromExternrefTable0(ret[2]);
569
577
  }
570
- var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
571
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
578
+ var v4 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
579
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
572
580
  return v4;
573
581
  };
574
582
 
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
583
  /**
584
584
  * The plaintext types that can be encrypted in a fhevm ciphertext.
585
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11}
585
586
  */
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", });
587
+ module.exports.FheType = Object.freeze({
588
+ Ebool: 0, "0": "Ebool",
589
+ Euint4: 1, "1": "Euint4",
590
+ Euint8: 2, "2": "Euint8",
591
+ Euint16: 3, "3": "Euint16",
592
+ Euint32: 4, "4": "Euint32",
593
+ Euint64: 5, "5": "Euint64",
594
+ Euint128: 6, "6": "Euint128",
595
+ Euint160: 7, "7": "Euint160",
596
+ Euint256: 8, "8": "Euint256",
597
+ Euint512: 9, "9": "Euint512",
598
+ Euint1024: 10, "10": "Euint1024",
599
+ Euint2048: 11, "11": "Euint2048",
600
+ });
601
+
602
+ const CiphertextHandleFinalization = (typeof FinalizationRegistry === 'undefined')
603
+ ? { register: () => {}, unregister: () => {} }
604
+ : new FinalizationRegistry(ptr => wasm.__wbg_ciphertexthandle_free(ptr >>> 0, 1));
605
+
606
+ class CiphertextHandle {
607
+
608
+ __destroy_into_raw() {
609
+ const ptr = this.__wbg_ptr;
610
+ this.__wbg_ptr = 0;
611
+ CiphertextHandleFinalization.unregister(this);
612
+ return ptr;
613
+ }
614
+
615
+ free() {
616
+ const ptr = this.__destroy_into_raw();
617
+ wasm.__wbg_ciphertexthandle_free(ptr, 0);
618
+ }
619
+ }
620
+ module.exports.CiphertextHandle = CiphertextHandle;
587
621
 
588
622
  const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
589
623
  ? { register: () => {}, unregister: () => {} }
@@ -936,25 +970,6 @@ class ReencryptionRequest {
936
970
  const ptr = this.__destroy_into_raw();
937
971
  wasm.__wbg_reencryptionrequest_free(ptr, 0);
938
972
  }
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
973
  /**
959
974
  * @returns {ReencryptionRequestPayload | undefined}
960
975
  */
@@ -1041,21 +1056,6 @@ class ReencryptionRequestPayload {
1041
1056
  const ptr = this.__destroy_into_raw();
1042
1057
  wasm.__wbg_reencryptionrequestpayload_free(ptr, 0);
1043
1058
  }
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);
1058
- }
1059
1059
  /**
1060
1060
  * The client's (blockchain wallet) address,
1061
1061
  * encoded using EIP-55.
@@ -1106,21 +1106,6 @@ class ReencryptionRequestPayload {
1106
1106
  const len0 = WASM_VECTOR_LEN;
1107
1107
  wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1108
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);
1123
- }
1124
1109
  /**
1125
1110
  * The key id to use for decryption. Will be the request_id used during key
1126
1111
  * generation
@@ -1144,51 +1129,23 @@ class ReencryptionRequestPayload {
1144
1129
  wasm.__wbg_set_reencryptionrequestpayload_key_id(this.__wbg_ptr, ptr0);
1145
1130
  }
1146
1131
  /**
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}
1132
+ * The list of ciphertexts to reencrypt.
1133
+ * @returns {(TypedCiphertext)[]}
1177
1134
  */
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);
1135
+ get typed_ciphertexts() {
1136
+ const ret = wasm.__wbg_get_reencryptionrequestpayload_typed_ciphertexts(this.__wbg_ptr);
1137
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1138
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1182
1139
  return v1;
1183
1140
  }
1184
1141
  /**
1185
- * The SHA3 digest of the ciphertext above.
1186
- * @param {Uint8Array} arg0
1142
+ * The list of ciphertexts to reencrypt.
1143
+ * @param {(TypedCiphertext)[]} arg0
1187
1144
  */
1188
- set ciphertext_digest(arg0) {
1189
- const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1145
+ set typed_ciphertexts(arg0) {
1146
+ const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
1190
1147
  const len0 = WASM_VECTOR_LEN;
1191
- wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
1148
+ wasm.__wbg_set_reencryptionrequestpayload_typed_ciphertexts(this.__wbg_ptr, ptr0, len0);
1192
1149
  }
1193
1150
  }
1194
1151
  module.exports.ReencryptionRequestPayload = ReencryptionRequestPayload;
@@ -1282,21 +1239,6 @@ class ReencryptionResponsePayload {
1282
1239
  const ptr = this.__destroy_into_raw();
1283
1240
  wasm.__wbg_reencryptionresponsepayload_free(ptr, 0);
1284
1241
  }
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);
1299
- }
1300
1242
  /**
1301
1243
  * The server's signature verification key.
1302
1244
  * Encoded using SEC1.
@@ -1346,40 +1288,21 @@ class ReencryptionResponsePayload {
1346
1288
  wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1347
1289
  }
1348
1290
  /**
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}
1291
+ * @returns {(TypedSigncryptedCiphertext)[]}
1367
1292
  */
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);
1293
+ get signcrypted_ciphertexts() {
1294
+ const ret = wasm.__wbg_get_reencryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr);
1295
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1296
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1372
1297
  return v1;
1373
1298
  }
1374
1299
  /**
1375
- * The signcrypted payload, using a hybrid encryption approach in
1376
- * sign-then-encrypt.
1377
- * @param {Uint8Array} arg0
1300
+ * @param {(TypedSigncryptedCiphertext)[]} arg0
1378
1301
  */
1379
- set signcrypted_ciphertext(arg0) {
1380
- const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1302
+ set signcrypted_ciphertexts(arg0) {
1303
+ const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
1381
1304
  const len0 = WASM_VECTOR_LEN;
1382
- wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
1305
+ wasm.__wbg_set_reencryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr, ptr0, len0);
1383
1306
  }
1384
1307
  /**
1385
1308
  * The ID of the MPC party doing the reencryption. Used for polynomial
@@ -1413,6 +1336,37 @@ class ReencryptionResponsePayload {
1413
1336
  set degree(arg0) {
1414
1337
  wasm.__wbg_set_reencryptionresponsepayload_degree(this.__wbg_ptr, arg0);
1415
1338
  }
1339
+ /**
1340
+ * This is the external signature created from the Eip712 domain
1341
+ * on the structure, where reencryptedShare is bincode::serialize(&signcrypted_ciphertexts)
1342
+ * struct UserDecryptionResult {
1343
+ * bytes publicKey;
1344
+ * uint256\[\] handles;
1345
+ * bytes reencryptedShare;
1346
+ * }
1347
+ * @returns {Uint8Array}
1348
+ */
1349
+ get external_signature() {
1350
+ const ret = wasm.__wbg_get_reencryptionresponsepayload_external_signature(this.__wbg_ptr);
1351
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1352
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1353
+ return v1;
1354
+ }
1355
+ /**
1356
+ * This is the external signature created from the Eip712 domain
1357
+ * on the structure, where reencryptedShare is bincode::serialize(&signcrypted_ciphertexts)
1358
+ * struct UserDecryptionResult {
1359
+ * bytes publicKey;
1360
+ * uint256\[\] handles;
1361
+ * bytes reencryptedShare;
1362
+ * }
1363
+ * @param {Uint8Array} arg0
1364
+ */
1365
+ set external_signature(arg0) {
1366
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1367
+ const len0 = WASM_VECTOR_LEN;
1368
+ wasm.__wbg_set_eip712domainmsg_verifying_contract(this.__wbg_ptr, ptr0, len0);
1369
+ }
1416
1370
  }
1417
1371
  module.exports.ReencryptionResponsePayload = ReencryptionResponsePayload;
1418
1372
 
@@ -1470,70 +1424,249 @@ class RequestId {
1470
1424
  }
1471
1425
  module.exports.RequestId = RequestId;
1472
1426
 
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.__wbindgen_string_get = function(arg0, arg1) {
1479
- const obj = arg1;
1480
- const ret = typeof(obj) === 'string' ? obj : undefined;
1481
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1482
- var len1 = WASM_VECTOR_LEN;
1483
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1484
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1485
- };
1486
-
1487
- module.exports.__wbindgen_is_object = function(arg0) {
1488
- const val = arg0;
1489
- const ret = typeof(val) === 'object' && val !== null;
1490
- return ret;
1491
- };
1492
-
1493
- module.exports.__wbindgen_is_undefined = function(arg0) {
1494
- const ret = arg0 === undefined;
1495
- return ret;
1496
- };
1427
+ const TypedCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
1428
+ ? { register: () => {}, unregister: () => {} }
1429
+ : new FinalizationRegistry(ptr => wasm.__wbg_typedciphertext_free(ptr >>> 0, 1));
1497
1430
 
1498
- module.exports.__wbindgen_in = function(arg0, arg1) {
1499
- const ret = arg0 in arg1;
1500
- return ret;
1501
- };
1431
+ class TypedCiphertext {
1502
1432
 
1503
- module.exports.__wbindgen_is_null = function(arg0) {
1504
- const ret = arg0 === null;
1505
- return ret;
1506
- };
1433
+ static __wrap(ptr) {
1434
+ ptr = ptr >>> 0;
1435
+ const obj = Object.create(TypedCiphertext.prototype);
1436
+ obj.__wbg_ptr = ptr;
1437
+ TypedCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
1438
+ return obj;
1439
+ }
1507
1440
 
1508
- module.exports.__wbg_reencryptionresponse_unwrap = function(arg0) {
1509
- const ret = ReencryptionResponse.__unwrap(arg0);
1510
- return ret;
1511
- };
1441
+ static __unwrap(jsValue) {
1442
+ if (!(jsValue instanceof TypedCiphertext)) {
1443
+ return 0;
1444
+ }
1445
+ return jsValue.__destroy_into_raw();
1446
+ }
1512
1447
 
1513
- module.exports.__wbindgen_number_get = function(arg0, arg1) {
1514
- const obj = arg1;
1515
- const ret = typeof(obj) === 'number' ? obj : undefined;
1516
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1517
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1518
- };
1448
+ __destroy_into_raw() {
1449
+ const ptr = this.__wbg_ptr;
1450
+ this.__wbg_ptr = 0;
1451
+ TypedCiphertextFinalization.unregister(this);
1452
+ return ptr;
1453
+ }
1519
1454
 
1520
- module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
1521
- const ret = arg0 == arg1;
1522
- return ret;
1523
- };
1455
+ free() {
1456
+ const ptr = this.__destroy_into_raw();
1457
+ wasm.__wbg_typedciphertext_free(ptr, 0);
1458
+ }
1459
+ /**
1460
+ * The actual ciphertext to decrypt, taken directly from the fhevm.
1461
+ * @returns {Uint8Array}
1462
+ */
1463
+ get ciphertext() {
1464
+ const ret = wasm.__wbg_get_typedciphertext_ciphertext(this.__wbg_ptr);
1465
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1466
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1467
+ return v1;
1468
+ }
1469
+ /**
1470
+ * The actual ciphertext to decrypt, taken directly from the fhevm.
1471
+ * @param {Uint8Array} arg0
1472
+ */
1473
+ set ciphertext(arg0) {
1474
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1475
+ const len0 = WASM_VECTOR_LEN;
1476
+ wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1477
+ }
1478
+ /**
1479
+ * The type of plaintext encrypted.
1480
+ * @returns {number}
1481
+ */
1482
+ get fhe_type() {
1483
+ const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
1484
+ return ret;
1485
+ }
1486
+ /**
1487
+ * The type of plaintext encrypted.
1488
+ * @param {number} arg0
1489
+ */
1490
+ set fhe_type(arg0) {
1491
+ wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
1492
+ }
1493
+ /**
1494
+ * The external handle of the ciphertext (the handle used in the copro).
1495
+ * @returns {Uint8Array}
1496
+ */
1497
+ get external_handle() {
1498
+ const ret = wasm.__wbg_get_typedciphertext_external_handle(this.__wbg_ptr);
1499
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1500
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1501
+ return v1;
1502
+ }
1503
+ /**
1504
+ * The external handle of the ciphertext (the handle used in the copro).
1505
+ * @param {Uint8Array} arg0
1506
+ */
1507
+ set external_handle(arg0) {
1508
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1509
+ const len0 = WASM_VECTOR_LEN;
1510
+ wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1511
+ }
1512
+ }
1513
+ module.exports.TypedCiphertext = TypedCiphertext;
1524
1514
 
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
- };
1515
+ const TypedPlaintextFinalization = (typeof FinalizationRegistry === 'undefined')
1516
+ ? { register: () => {}, unregister: () => {} }
1517
+ : new FinalizationRegistry(ptr => wasm.__wbg_typedplaintext_free(ptr >>> 0, 1));
1518
+ /**
1519
+ * The typed plaintext type, which is the result of decryption.
1520
+ */
1521
+ class TypedPlaintext {
1530
1522
 
1531
- module.exports.__wbindgen_as_number = function(arg0) {
1532
- const ret = +arg0;
1533
- return ret;
1534
- };
1523
+ static __wrap(ptr) {
1524
+ ptr = ptr >>> 0;
1525
+ const obj = Object.create(TypedPlaintext.prototype);
1526
+ obj.__wbg_ptr = ptr;
1527
+ TypedPlaintextFinalization.register(obj, obj.__wbg_ptr, obj);
1528
+ return obj;
1529
+ }
1530
+
1531
+ __destroy_into_raw() {
1532
+ const ptr = this.__wbg_ptr;
1533
+ this.__wbg_ptr = 0;
1534
+ TypedPlaintextFinalization.unregister(this);
1535
+ return ptr;
1536
+ }
1537
+
1538
+ free() {
1539
+ const ptr = this.__destroy_into_raw();
1540
+ wasm.__wbg_typedplaintext_free(ptr, 0);
1541
+ }
1542
+ /**
1543
+ * The actual plaintext in bytes.
1544
+ * @returns {Uint8Array}
1545
+ */
1546
+ get bytes() {
1547
+ const ret = wasm.__wbg_get_typedplaintext_bytes(this.__wbg_ptr);
1548
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1549
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1550
+ return v1;
1551
+ }
1552
+ /**
1553
+ * The actual plaintext in bytes.
1554
+ * @param {Uint8Array} arg0
1555
+ */
1556
+ set bytes(arg0) {
1557
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1558
+ const len0 = WASM_VECTOR_LEN;
1559
+ wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1560
+ }
1561
+ /**
1562
+ * The type of plaintext encrypted.
1563
+ * @returns {number}
1564
+ */
1565
+ get fhe_type() {
1566
+ const ret = wasm.__wbg_get_typedplaintext_fhe_type(this.__wbg_ptr);
1567
+ return ret;
1568
+ }
1569
+ /**
1570
+ * The type of plaintext encrypted.
1571
+ * @param {number} arg0
1572
+ */
1573
+ set fhe_type(arg0) {
1574
+ wasm.__wbg_set_typedplaintext_fhe_type(this.__wbg_ptr, arg0);
1575
+ }
1576
+ }
1577
+ module.exports.TypedPlaintext = TypedPlaintext;
1578
+
1579
+ const TypedSigncryptedCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
1580
+ ? { register: () => {}, unregister: () => {} }
1581
+ : new FinalizationRegistry(ptr => wasm.__wbg_typedsigncryptedciphertext_free(ptr >>> 0, 1));
1582
+
1583
+ class TypedSigncryptedCiphertext {
1584
+
1585
+ static __wrap(ptr) {
1586
+ ptr = ptr >>> 0;
1587
+ const obj = Object.create(TypedSigncryptedCiphertext.prototype);
1588
+ obj.__wbg_ptr = ptr;
1589
+ TypedSigncryptedCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
1590
+ return obj;
1591
+ }
1592
+
1593
+ static __unwrap(jsValue) {
1594
+ if (!(jsValue instanceof TypedSigncryptedCiphertext)) {
1595
+ return 0;
1596
+ }
1597
+ return jsValue.__destroy_into_raw();
1598
+ }
1599
+
1600
+ __destroy_into_raw() {
1601
+ const ptr = this.__wbg_ptr;
1602
+ this.__wbg_ptr = 0;
1603
+ TypedSigncryptedCiphertextFinalization.unregister(this);
1604
+ return ptr;
1605
+ }
1535
1606
 
1536
- module.exports.__wbg_String_b9412f8799faab3e = function(arg0, arg1) {
1607
+ free() {
1608
+ const ptr = this.__destroy_into_raw();
1609
+ wasm.__wbg_typedsigncryptedciphertext_free(ptr, 0);
1610
+ }
1611
+ /**
1612
+ * The type of plaintext encrypted.
1613
+ * @returns {number}
1614
+ */
1615
+ get fhe_type() {
1616
+ const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
1617
+ return ret;
1618
+ }
1619
+ /**
1620
+ * The type of plaintext encrypted.
1621
+ * @param {number} arg0
1622
+ */
1623
+ set fhe_type(arg0) {
1624
+ wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
1625
+ }
1626
+ /**
1627
+ * The signcrypted payload, using a hybrid encryption approach in
1628
+ * sign-then-encrypt.
1629
+ * @returns {Uint8Array}
1630
+ */
1631
+ get signcrypted_ciphertext() {
1632
+ const ret = wasm.__wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext(this.__wbg_ptr);
1633
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1634
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1635
+ return v1;
1636
+ }
1637
+ /**
1638
+ * The signcrypted payload, using a hybrid encryption approach in
1639
+ * sign-then-encrypt.
1640
+ * @param {Uint8Array} arg0
1641
+ */
1642
+ set signcrypted_ciphertext(arg0) {
1643
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1644
+ const len0 = WASM_VECTOR_LEN;
1645
+ wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1646
+ }
1647
+ /**
1648
+ * The external handles that were originally in the request.
1649
+ * @returns {Uint8Array}
1650
+ */
1651
+ get external_handle() {
1652
+ const ret = wasm.__wbg_get_typedsigncryptedciphertext_external_handle(this.__wbg_ptr);
1653
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1654
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1655
+ return v1;
1656
+ }
1657
+ /**
1658
+ * The external handles that were originally in the request.
1659
+ * @param {Uint8Array} arg0
1660
+ */
1661
+ set external_handle(arg0) {
1662
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1663
+ const len0 = WASM_VECTOR_LEN;
1664
+ wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1665
+ }
1666
+ }
1667
+ module.exports.TypedSigncryptedCiphertext = TypedSigncryptedCiphertext;
1668
+
1669
+ module.exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
1537
1670
  const ret = String(arg1);
1538
1671
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1539
1672
  const len1 = WASM_VECTOR_LEN;
@@ -1541,30 +1674,32 @@ module.exports.__wbg_String_b9412f8799faab3e = function(arg0, arg1) {
1541
1674
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1542
1675
  };
1543
1676
 
1544
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
1545
- const ret = getStringFromWasm0(arg0, arg1);
1677
+ module.exports.__wbg_buffer_61b7ce01341d7f88 = function(arg0) {
1678
+ const ret = arg0.buffer;
1546
1679
  return ret;
1547
1680
  };
1548
1681
 
1549
- module.exports.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
1550
- const ret = arg0[arg1];
1682
+ module.exports.__wbg_call_500db948e69c7330 = function() { return handleError(function (arg0, arg1, arg2) {
1683
+ const ret = arg0.call(arg1, arg2);
1551
1684
  return ret;
1552
- };
1685
+ }, arguments) };
1553
1686
 
1554
- module.exports.__wbg_new_abda76e883ba8a5f = function() {
1555
- const ret = new Error();
1687
+ module.exports.__wbg_call_b0d8e36992d9900d = function() { return handleError(function (arg0, arg1) {
1688
+ const ret = arg0.call(arg1);
1689
+ return ret;
1690
+ }, arguments) };
1691
+
1692
+ module.exports.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
1693
+ const ret = arg0.crypto;
1556
1694
  return ret;
1557
1695
  };
1558
1696
 
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);
1697
+ module.exports.__wbg_done_f22c1561fa919baa = function(arg0) {
1698
+ const ret = arg0.done;
1699
+ return ret;
1565
1700
  };
1566
1701
 
1567
- module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
1702
+ module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1568
1703
  let deferred0_0;
1569
1704
  let deferred0_1;
1570
1705
  try {
@@ -1576,192 +1711,216 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
1576
1711
  }
1577
1712
  };
1578
1713
 
1579
- module.exports.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
1580
- const ret = arg0.crypto;
1714
+ module.exports.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
1715
+ arg0.getRandomValues(arg1);
1716
+ }, arguments) };
1717
+
1718
+ module.exports.__wbg_get_9aa3dff3f0266054 = function(arg0, arg1) {
1719
+ const ret = arg0[arg1 >>> 0];
1581
1720
  return ret;
1582
1721
  };
1583
1722
 
1584
- module.exports.__wbg_process_4a72847cc503995b = function(arg0) {
1585
- const ret = arg0.process;
1723
+ module.exports.__wbg_get_bbccf8970793c087 = function() { return handleError(function (arg0, arg1) {
1724
+ const ret = Reflect.get(arg0, arg1);
1586
1725
  return ret;
1587
- };
1726
+ }, arguments) };
1588
1727
 
1589
- module.exports.__wbg_versions_f686565e586dd935 = function(arg0) {
1590
- const ret = arg0.versions;
1728
+ module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
1729
+ const ret = arg0[arg1];
1591
1730
  return ret;
1592
1731
  };
1593
1732
 
1594
- module.exports.__wbg_node_104a2ff8d6ea03a2 = function(arg0) {
1595
- const ret = arg0.node;
1733
+ module.exports.__wbg_instanceof_ArrayBuffer_670ddde44cdb2602 = function(arg0) {
1734
+ let result;
1735
+ try {
1736
+ result = arg0 instanceof ArrayBuffer;
1737
+ } catch (_) {
1738
+ result = false;
1739
+ }
1740
+ const ret = result;
1596
1741
  return ret;
1597
1742
  };
1598
1743
 
1599
- module.exports.__wbindgen_is_string = function(arg0) {
1600
- const ret = typeof(arg0) === 'string';
1744
+ module.exports.__wbg_instanceof_Uint8Array_28af5bc19d6acad8 = function(arg0) {
1745
+ let result;
1746
+ try {
1747
+ result = arg0 instanceof Uint8Array;
1748
+ } catch (_) {
1749
+ result = false;
1750
+ }
1751
+ const ret = result;
1601
1752
  return ret;
1602
1753
  };
1603
1754
 
1604
- module.exports.__wbg_require_cca90b1a94a0255b = function() { return handleError(function () {
1605
- const ret = module.require;
1755
+ module.exports.__wbg_isArray_1ba11a930108ec51 = function(arg0) {
1756
+ const ret = Array.isArray(arg0);
1606
1757
  return ret;
1607
- }, arguments) };
1758
+ };
1608
1759
 
1609
- module.exports.__wbindgen_is_function = function(arg0) {
1610
- const ret = typeof(arg0) === 'function';
1760
+ module.exports.__wbg_isSafeInteger_12f5549b2fca23f4 = function(arg0) {
1761
+ const ret = Number.isSafeInteger(arg0);
1611
1762
  return ret;
1612
1763
  };
1613
1764
 
1614
- module.exports.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
1615
- const ret = arg0.msCrypto;
1765
+ module.exports.__wbg_iterator_23604bb983791576 = function() {
1766
+ const ret = Symbol.iterator;
1616
1767
  return ret;
1617
1768
  };
1618
1769
 
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];
1770
+ module.exports.__wbg_length_65d1cd11729ced11 = function(arg0) {
1771
+ const ret = arg0.length;
1629
1772
  return ret;
1630
1773
  };
1631
1774
 
1632
- module.exports.__wbg_length_f217bbbf7e8e4df4 = function(arg0) {
1775
+ module.exports.__wbg_length_d65cf0786bfc5739 = function(arg0) {
1633
1776
  const ret = arg0.length;
1634
1777
  return ret;
1635
1778
  };
1636
1779
 
1637
- module.exports.__wbg_newnoargs_1ede4bf2ebbaaf43 = function(arg0, arg1) {
1638
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1780
+ module.exports.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
1781
+ const ret = arg0.msCrypto;
1639
1782
  return ret;
1640
1783
  };
1641
1784
 
1642
- module.exports.__wbg_next_13b477da1eaa3897 = function(arg0) {
1643
- const ret = arg0.next;
1785
+ module.exports.__wbg_new_3ff5b33b1ce712df = function(arg0) {
1786
+ const ret = new Uint8Array(arg0);
1644
1787
  return ret;
1645
1788
  };
1646
1789
 
1647
- module.exports.__wbg_next_b06e115d1b01e10b = function() { return handleError(function (arg0) {
1648
- const ret = arg0.next();
1790
+ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
1791
+ const ret = new Error();
1649
1792
  return ret;
1650
- }, arguments) };
1793
+ };
1651
1794
 
1652
- module.exports.__wbg_done_983b5ffcaec8c583 = function(arg0) {
1653
- const ret = arg0.done;
1795
+ module.exports.__wbg_newnoargs_fd9e4bf8be2bc16d = function(arg0, arg1) {
1796
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
1654
1797
  return ret;
1655
1798
  };
1656
1799
 
1657
- module.exports.__wbg_value_2ab8a198c834c26a = function(arg0) {
1658
- const ret = arg0.value;
1800
+ module.exports.__wbg_newwithbyteoffsetandlength_ba35896968751d91 = function(arg0, arg1, arg2) {
1801
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1659
1802
  return ret;
1660
1803
  };
1661
1804
 
1662
- module.exports.__wbg_iterator_695d699a44d6234c = function() {
1663
- const ret = Symbol.iterator;
1805
+ module.exports.__wbg_newwithlength_34ce8f1051e74449 = function(arg0) {
1806
+ const ret = new Uint8Array(arg0 >>> 0);
1664
1807
  return ret;
1665
1808
  };
1666
1809
 
1667
- module.exports.__wbg_get_ef828680c64da212 = function() { return handleError(function (arg0, arg1) {
1668
- const ret = Reflect.get(arg0, arg1);
1810
+ module.exports.__wbg_next_01dd9234a5bf6d05 = function() { return handleError(function (arg0) {
1811
+ const ret = arg0.next();
1669
1812
  return ret;
1670
1813
  }, arguments) };
1671
1814
 
1672
- module.exports.__wbg_call_a9ef466721e824f2 = function() { return handleError(function (arg0, arg1) {
1673
- const ret = arg0.call(arg1);
1815
+ module.exports.__wbg_next_137428deb98342b0 = function(arg0) {
1816
+ const ret = arg0.next;
1674
1817
  return ret;
1675
- }, arguments) };
1818
+ };
1676
1819
 
1677
- module.exports.__wbg_self_bf91bf94d9e04084 = function() { return handleError(function () {
1678
- const ret = self.self;
1820
+ module.exports.__wbg_node_02999533c4ea02e3 = function(arg0) {
1821
+ const ret = arg0.node;
1679
1822
  return ret;
1680
- }, arguments) };
1823
+ };
1681
1824
 
1682
- module.exports.__wbg_window_52dd9f07d03fd5f8 = function() { return handleError(function () {
1683
- const ret = window.window;
1825
+ module.exports.__wbg_process_5c1d670bc53614b8 = function(arg0) {
1826
+ const ret = arg0.process;
1684
1827
  return ret;
1828
+ };
1829
+
1830
+ module.exports.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
1831
+ arg0.randomFillSync(arg1);
1685
1832
  }, arguments) };
1686
1833
 
1687
- module.exports.__wbg_globalThis_05c129bf37fcf1be = function() { return handleError(function () {
1688
- const ret = globalThis.globalThis;
1834
+ module.exports.__wbg_reencryptionresponse_unwrap = function(arg0) {
1835
+ const ret = ReencryptionResponse.__unwrap(arg0);
1689
1836
  return ret;
1690
- }, arguments) };
1837
+ };
1691
1838
 
1692
- module.exports.__wbg_global_3eca19bb09e9c484 = function() { return handleError(function () {
1693
- const ret = global.global;
1839
+ module.exports.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
1840
+ const ret = module.require;
1694
1841
  return ret;
1695
1842
  }, arguments) };
1696
1843
 
1697
- module.exports.__wbg_isArray_6f3b47f09adb61b5 = function(arg0) {
1698
- const ret = Array.isArray(arg0);
1699
- return ret;
1844
+ module.exports.__wbg_set_23d69db4e5c66a6e = function(arg0, arg1, arg2) {
1845
+ arg0.set(arg1, arg2 >>> 0);
1700
1846
  };
1701
1847
 
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;
1848
+ module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
1849
+ const ret = arg1.stack;
1850
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1851
+ const len1 = WASM_VECTOR_LEN;
1852
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1853
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1711
1854
  };
1712
1855
 
1713
- module.exports.__wbg_call_3bfa248576352471 = function() { return handleError(function (arg0, arg1, arg2) {
1714
- const ret = arg0.call(arg1, arg2);
1856
+ module.exports.__wbg_static_accessor_GLOBAL_0be7472e492ad3e3 = function() {
1857
+ const ret = typeof global === 'undefined' ? null : global;
1858
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1859
+ };
1860
+
1861
+ module.exports.__wbg_static_accessor_GLOBAL_THIS_1a6eb482d12c9bfb = function() {
1862
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1863
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1864
+ };
1865
+
1866
+ module.exports.__wbg_static_accessor_SELF_1dc398a895c82351 = function() {
1867
+ const ret = typeof self === 'undefined' ? null : self;
1868
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1869
+ };
1870
+
1871
+ module.exports.__wbg_static_accessor_WINDOW_ae1c80c7eea8d64a = function() {
1872
+ const ret = typeof window === 'undefined' ? null : window;
1873
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1874
+ };
1875
+
1876
+ module.exports.__wbg_subarray_46adeb9b86949d12 = function(arg0, arg1, arg2) {
1877
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1715
1878
  return ret;
1716
- }, arguments) };
1879
+ };
1717
1880
 
1718
- module.exports.__wbg_isSafeInteger_b9dff570f01a9100 = function(arg0) {
1719
- const ret = Number.isSafeInteger(arg0);
1881
+ module.exports.__wbg_typedciphertext_new = function(arg0) {
1882
+ const ret = TypedCiphertext.__wrap(arg0);
1720
1883
  return ret;
1721
1884
  };
1722
1885
 
1723
- module.exports.__wbg_buffer_ccaed51a635d8a2d = function(arg0) {
1724
- const ret = arg0.buffer;
1886
+ module.exports.__wbg_typedciphertext_unwrap = function(arg0) {
1887
+ const ret = TypedCiphertext.__unwrap(arg0);
1725
1888
  return ret;
1726
1889
  };
1727
1890
 
1728
- module.exports.__wbg_newwithbyteoffsetandlength_7e3eb787208af730 = function(arg0, arg1, arg2) {
1729
- const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1891
+ module.exports.__wbg_typedplaintext_new = function(arg0) {
1892
+ const ret = TypedPlaintext.__wrap(arg0);
1730
1893
  return ret;
1731
1894
  };
1732
1895
 
1733
- module.exports.__wbg_new_fec2611eb9180f95 = function(arg0) {
1734
- const ret = new Uint8Array(arg0);
1896
+ module.exports.__wbg_typedsigncryptedciphertext_new = function(arg0) {
1897
+ const ret = TypedSigncryptedCiphertext.__wrap(arg0);
1735
1898
  return ret;
1736
1899
  };
1737
1900
 
1738
- module.exports.__wbg_set_ec2fcf81bc573fd9 = function(arg0, arg1, arg2) {
1739
- arg0.set(arg1, arg2 >>> 0);
1901
+ module.exports.__wbg_typedsigncryptedciphertext_unwrap = function(arg0) {
1902
+ const ret = TypedSigncryptedCiphertext.__unwrap(arg0);
1903
+ return ret;
1740
1904
  };
1741
1905
 
1742
- module.exports.__wbg_length_9254c4bd3b9f23c4 = function(arg0) {
1743
- const ret = arg0.length;
1906
+ module.exports.__wbg_value_4c32fd138a88eee2 = function(arg0) {
1907
+ const ret = arg0.value;
1744
1908
  return ret;
1745
1909
  };
1746
1910
 
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;
1911
+ module.exports.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
1912
+ const ret = arg0.versions;
1755
1913
  return ret;
1756
1914
  };
1757
1915
 
1758
- module.exports.__wbg_newwithlength_76462a666eca145f = function(arg0) {
1759
- const ret = new Uint8Array(arg0 >>> 0);
1916
+ module.exports.__wbindgen_as_number = function(arg0) {
1917
+ const ret = +arg0;
1760
1918
  return ret;
1761
1919
  };
1762
1920
 
1763
- module.exports.__wbg_subarray_975a06f9dbd16995 = function(arg0, arg1, arg2) {
1764
- const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1921
+ module.exports.__wbindgen_boolean_get = function(arg0) {
1922
+ const v = arg0;
1923
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1765
1924
  return ret;
1766
1925
  };
1767
1926
 
@@ -1773,17 +1932,18 @@ module.exports.__wbindgen_debug_string = function(arg0, arg1) {
1773
1932
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1774
1933
  };
1775
1934
 
1776
- module.exports.__wbindgen_throw = function(arg0, arg1) {
1777
- throw new Error(getStringFromWasm0(arg0, arg1));
1935
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
1936
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1937
+ return ret;
1778
1938
  };
1779
1939
 
1780
- module.exports.__wbindgen_memory = function() {
1781
- const ret = wasm.memory;
1940
+ module.exports.__wbindgen_in = function(arg0, arg1) {
1941
+ const ret = arg0 in arg1;
1782
1942
  return ret;
1783
1943
  };
1784
1944
 
1785
1945
  module.exports.__wbindgen_init_externref_table = function() {
1786
- const table = wasm.__wbindgen_export_2;
1946
+ const table = wasm.__wbindgen_export_4;
1787
1947
  const offset = table.grow(4);
1788
1948
  table.set(0, undefined);
1789
1949
  table.set(offset + 0, undefined);
@@ -1793,6 +1953,67 @@ module.exports.__wbindgen_init_externref_table = function() {
1793
1953
  ;
1794
1954
  };
1795
1955
 
1956
+ module.exports.__wbindgen_is_function = function(arg0) {
1957
+ const ret = typeof(arg0) === 'function';
1958
+ return ret;
1959
+ };
1960
+
1961
+ module.exports.__wbindgen_is_null = function(arg0) {
1962
+ const ret = arg0 === null;
1963
+ return ret;
1964
+ };
1965
+
1966
+ module.exports.__wbindgen_is_object = function(arg0) {
1967
+ const val = arg0;
1968
+ const ret = typeof(val) === 'object' && val !== null;
1969
+ return ret;
1970
+ };
1971
+
1972
+ module.exports.__wbindgen_is_string = function(arg0) {
1973
+ const ret = typeof(arg0) === 'string';
1974
+ return ret;
1975
+ };
1976
+
1977
+ module.exports.__wbindgen_is_undefined = function(arg0) {
1978
+ const ret = arg0 === undefined;
1979
+ return ret;
1980
+ };
1981
+
1982
+ module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
1983
+ const ret = arg0 == arg1;
1984
+ return ret;
1985
+ };
1986
+
1987
+ module.exports.__wbindgen_memory = function() {
1988
+ const ret = wasm.memory;
1989
+ return ret;
1990
+ };
1991
+
1992
+ module.exports.__wbindgen_number_get = function(arg0, arg1) {
1993
+ const obj = arg1;
1994
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1995
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1996
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1997
+ };
1998
+
1999
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
2000
+ const obj = arg1;
2001
+ const ret = typeof(obj) === 'string' ? obj : undefined;
2002
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2003
+ var len1 = WASM_VECTOR_LEN;
2004
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2005
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2006
+ };
2007
+
2008
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
2009
+ const ret = getStringFromWasm0(arg0, arg1);
2010
+ return ret;
2011
+ };
2012
+
2013
+ module.exports.__wbindgen_throw = function(arg0, arg1) {
2014
+ throw new Error(getStringFromWasm0(arg0, arg1));
2015
+ };
2016
+
1796
2017
  const path = require('path').join(__dirname, 'kms_lib_bg.wasm');
1797
2018
  const bytes = require('fs').readFileSync(path);
1798
2019