node-tkms 0.9.0-rc3 → 0.9.0-rc30

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
@@ -22,35 +22,6 @@ function getStringFromWasm0(ptr, len) {
22
22
  return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
23
23
  }
24
24
 
25
- const heap = new Array(128).fill(undefined);
26
-
27
- heap.push(undefined, null, true, false);
28
-
29
- let heap_next = heap.length;
30
-
31
- function addHeapObject(obj) {
32
- if (heap_next === heap.length) heap.push(heap.length + 1);
33
- const idx = heap_next;
34
- heap_next = heap[idx];
35
-
36
- heap[idx] = obj;
37
- return idx;
38
- }
39
-
40
- function getObject(idx) { return heap[idx]; }
41
-
42
- function dropObject(idx) {
43
- if (idx < 132) return;
44
- heap[idx] = heap_next;
45
- heap_next = idx;
46
- }
47
-
48
- function takeObject(idx) {
49
- const ret = getObject(idx);
50
- dropObject(idx);
51
- return ret;
52
- }
53
-
54
25
  function isLikeNone(x) {
55
26
  return x === undefined || x === null;
56
27
  }
@@ -197,22 +168,15 @@ function getArrayU8FromWasm0(ptr, len) {
197
168
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
198
169
  }
199
170
  /**
200
- * @param {PublicSigKey} pk
201
- * @returns {Uint8Array}
202
- */
171
+ * @param {PublicSigKey} pk
172
+ * @returns {Uint8Array}
173
+ */
203
174
  module.exports.public_sig_key_to_u8vec = function(pk) {
204
- try {
205
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
206
- _assertClass(pk, PublicSigKey);
207
- wasm.public_sig_key_to_u8vec(retptr, pk.__wbg_ptr);
208
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
209
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
210
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
211
- wasm.__wbindgen_free(r0, r1 * 1, 1);
212
- return v1;
213
- } finally {
214
- wasm.__wbindgen_add_to_stack_pointer(16);
215
- }
175
+ _assertClass(pk, PublicSigKey);
176
+ const ret = wasm.public_sig_key_to_u8vec(pk.__wbg_ptr);
177
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
178
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
179
+ return v1;
216
180
  };
217
181
 
218
182
  function passArray8ToWasm0(arg, malloc) {
@@ -221,119 +185,98 @@ function passArray8ToWasm0(arg, malloc) {
221
185
  WASM_VECTOR_LEN = arg.length;
222
186
  return ptr;
223
187
  }
188
+
189
+ function takeFromExternrefTable0(idx) {
190
+ const value = wasm.__wbindgen_export_2.get(idx);
191
+ wasm.__externref_table_dealloc(idx);
192
+ return value;
193
+ }
224
194
  /**
225
- * @param {Uint8Array} v
226
- * @returns {PublicSigKey}
227
- */
195
+ * @param {Uint8Array} v
196
+ * @returns {PublicSigKey}
197
+ */
228
198
  module.exports.u8vec_to_public_sig_key = function(v) {
229
- try {
230
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
231
- const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
232
- const len0 = WASM_VECTOR_LEN;
233
- wasm.u8vec_to_public_sig_key(retptr, ptr0, len0);
234
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
235
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
236
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
237
- if (r2) {
238
- throw takeObject(r1);
239
- }
240
- return PublicSigKey.__wrap(r0);
241
- } finally {
242
- wasm.__wbindgen_add_to_stack_pointer(16);
199
+ const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
200
+ const len0 = WASM_VECTOR_LEN;
201
+ const ret = wasm.u8vec_to_public_sig_key(ptr0, len0);
202
+ if (ret[2]) {
203
+ throw takeFromExternrefTable0(ret[1]);
243
204
  }
205
+ return PublicSigKey.__wrap(ret[0]);
244
206
  };
245
207
 
246
208
  /**
247
- * @param {PrivateSigKey} sk
248
- * @returns {Uint8Array}
249
- */
209
+ * @param {PrivateSigKey} sk
210
+ * @returns {Uint8Array}
211
+ */
250
212
  module.exports.private_sig_key_to_u8vec = function(sk) {
251
- try {
252
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
253
- _assertClass(sk, PrivateSigKey);
254
- wasm.private_sig_key_to_u8vec(retptr, sk.__wbg_ptr);
255
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
256
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
257
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
258
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
259
- if (r3) {
260
- throw takeObject(r2);
261
- }
262
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
263
- wasm.__wbindgen_free(r0, r1 * 1, 1);
264
- return v1;
265
- } finally {
266
- wasm.__wbindgen_add_to_stack_pointer(16);
213
+ _assertClass(sk, PrivateSigKey);
214
+ const ret = wasm.private_sig_key_to_u8vec(sk.__wbg_ptr);
215
+ if (ret[3]) {
216
+ throw takeFromExternrefTable0(ret[2]);
267
217
  }
218
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
219
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
220
+ return v1;
268
221
  };
269
222
 
270
223
  /**
271
- * @param {Uint8Array} v
272
- * @returns {PrivateSigKey}
273
- */
224
+ * @param {Uint8Array} v
225
+ * @returns {PrivateSigKey}
226
+ */
274
227
  module.exports.u8vec_to_private_sig_key = function(v) {
275
- try {
276
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
277
- const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
278
- const len0 = WASM_VECTOR_LEN;
279
- wasm.u8vec_to_private_sig_key(retptr, ptr0, len0);
280
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
281
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
282
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
283
- if (r2) {
284
- throw takeObject(r1);
285
- }
286
- return PrivateSigKey.__wrap(r0);
287
- } finally {
288
- wasm.__wbindgen_add_to_stack_pointer(16);
228
+ const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
229
+ const len0 = WASM_VECTOR_LEN;
230
+ const ret = wasm.u8vec_to_private_sig_key(ptr0, len0);
231
+ if (ret[2]) {
232
+ throw takeFromExternrefTable0(ret[1]);
289
233
  }
234
+ return PrivateSigKey.__wrap(ret[0]);
290
235
  };
291
236
 
237
+ function addToExternrefTable0(obj) {
238
+ const idx = wasm.__externref_table_alloc();
239
+ wasm.__wbindgen_export_2.set(idx, obj);
240
+ return idx;
241
+ }
242
+
292
243
  function passArrayJsValueToWasm0(array, malloc) {
293
244
  const ptr = malloc(array.length * 4, 4) >>> 0;
294
245
  const mem = getDataViewMemory0();
295
246
  for (let i = 0; i < array.length; i++) {
296
- mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
247
+ mem.setUint32(ptr + 4 * i, addToExternrefTable0(array[i]), true);
297
248
  }
298
249
  WASM_VECTOR_LEN = array.length;
299
250
  return ptr;
300
251
  }
301
252
  /**
302
- * Instantiate a new client.
303
- *
304
- * * `server_pks` - a list of KMS server signature public keys,
305
- * which can parsed using [u8vec_to_public_sig_key].
306
- *
307
- * * `client_address_hex` - the client (wallet) address in hex,
308
- * must be prefixed with "0x".
309
- *
310
- * * `param_choice` - the parameter choice, which can be either `"test"` or `"default"`.
311
- * The "default" parameter choice is selected if no matching string is found.
312
- * @param {(PublicSigKey)[]} server_pks
313
- * @param {string} client_address_hex
314
- * @param {string} param_choice
315
- * @returns {Client}
316
- */
317
- module.exports.new_client = function(server_pks, client_address_hex, param_choice) {
318
- try {
319
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
320
- const ptr0 = passArrayJsValueToWasm0(server_pks, wasm.__wbindgen_malloc);
321
- const len0 = WASM_VECTOR_LEN;
322
- const ptr1 = passStringToWasm0(client_address_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
323
- const len1 = WASM_VECTOR_LEN;
324
- const ptr2 = passStringToWasm0(param_choice, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
325
- const len2 = WASM_VECTOR_LEN;
326
- wasm.new_client(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
327
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
328
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
329
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
330
- if (r2) {
331
- throw takeObject(r1);
332
- }
333
- return Client.__wrap(r0);
334
- } finally {
335
- wasm.__wbindgen_add_to_stack_pointer(16);
253
+ * Instantiate a new client.
254
+ *
255
+ * * `server_addrs` - a list of KMS server EIP-55 addresses,
256
+ * must be prefixed with "0x".
257
+ *
258
+ * * `client_address_hex` - the client (wallet) address in hex,
259
+ * must be prefixed with "0x".
260
+ *
261
+ * * `param_choice` - the parameter choice, which can be either `"test"` or `"default"`.
262
+ * The "default" parameter choice is selected if no matching string is found.
263
+ * @param {(string)[]} server_addrs
264
+ * @param {string} client_address_hex
265
+ * @param {string} param_choice
266
+ * @returns {Client}
267
+ */
268
+ module.exports.new_client = function(server_addrs, client_address_hex, param_choice) {
269
+ const ptr0 = passArrayJsValueToWasm0(server_addrs, wasm.__wbindgen_malloc);
270
+ const len0 = WASM_VECTOR_LEN;
271
+ const ptr1 = passStringToWasm0(client_address_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
272
+ const len1 = WASM_VECTOR_LEN;
273
+ const ptr2 = passStringToWasm0(param_choice, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
274
+ const len2 = WASM_VECTOR_LEN;
275
+ const ret = wasm.new_client(ptr0, len0, ptr1, len1, ptr2, len2);
276
+ if (ret[2]) {
277
+ throw takeFromExternrefTable0(ret[1]);
336
278
  }
279
+ return Client.__wrap(ret[0]);
337
280
  };
338
281
 
339
282
  function getArrayJsValueFromWasm0(ptr, len) {
@@ -341,33 +284,27 @@ function getArrayJsValueFromWasm0(ptr, len) {
341
284
  const mem = getDataViewMemory0();
342
285
  const result = [];
343
286
  for (let i = ptr; i < ptr + 4 * len; i += 4) {
344
- result.push(takeObject(mem.getUint32(i, true)));
287
+ result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
345
288
  }
289
+ wasm.__externref_drop_slice(ptr, len);
346
290
  return result;
347
291
  }
348
292
  /**
349
- * @param {Client} client
350
- * @returns {(PublicSigKey)[]}
351
- */
352
- module.exports.get_server_public_keys = function(client) {
353
- try {
354
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
355
- _assertClass(client, Client);
356
- wasm.get_server_public_keys(retptr, client.__wbg_ptr);
357
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
358
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
359
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
360
- wasm.__wbindgen_free(r0, r1 * 4, 4);
361
- return v1;
362
- } finally {
363
- wasm.__wbindgen_add_to_stack_pointer(16);
364
- }
293
+ * @param {Client} client
294
+ * @returns {(string)[]}
295
+ */
296
+ module.exports.get_server_addrs = function(client) {
297
+ _assertClass(client, Client);
298
+ const ret = wasm.get_server_addrs(client.__wbg_ptr);
299
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
300
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
301
+ return v1;
365
302
  };
366
303
 
367
304
  /**
368
- * @param {Client} client
369
- * @returns {PrivateSigKey | undefined}
370
- */
305
+ * @param {Client} client
306
+ * @returns {PrivateSigKey | undefined}
307
+ */
371
308
  module.exports.get_client_secret_key = function(client) {
372
309
  _assertClass(client, Client);
373
310
  const ret = wasm.get_client_secret_key(client.__wbg_ptr);
@@ -375,39 +312,35 @@ module.exports.get_client_secret_key = function(client) {
375
312
  };
376
313
 
377
314
  /**
378
- * @param {Client} client
379
- * @returns {string}
380
- */
315
+ * @param {Client} client
316
+ * @returns {string}
317
+ */
381
318
  module.exports.get_client_address = function(client) {
382
319
  let deferred1_0;
383
320
  let deferred1_1;
384
321
  try {
385
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
386
322
  _assertClass(client, Client);
387
- wasm.get_client_address(retptr, client.__wbg_ptr);
388
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
389
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
390
- deferred1_0 = r0;
391
- deferred1_1 = r1;
392
- return getStringFromWasm0(r0, r1);
323
+ const ret = wasm.get_client_address(client.__wbg_ptr);
324
+ deferred1_0 = ret[0];
325
+ deferred1_1 = ret[1];
326
+ return getStringFromWasm0(ret[0], ret[1]);
393
327
  } finally {
394
- wasm.__wbindgen_add_to_stack_pointer(16);
395
328
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
396
329
  }
397
330
  };
398
331
 
399
332
  /**
400
- * @returns {PrivateEncKey}
401
- */
333
+ * @returns {PrivateEncKey}
334
+ */
402
335
  module.exports.cryptobox_keygen = function() {
403
336
  const ret = wasm.cryptobox_keygen();
404
337
  return PrivateEncKey.__wrap(ret);
405
338
  };
406
339
 
407
340
  /**
408
- * @param {PrivateEncKey} sk
409
- * @returns {PublicEncKey}
410
- */
341
+ * @param {PrivateEncKey} sk
342
+ * @returns {PublicEncKey}
343
+ */
411
344
  module.exports.cryptobox_get_pk = function(sk) {
412
345
  _assertClass(sk, PrivateEncKey);
413
346
  const ret = wasm.cryptobox_get_pk(sk.__wbg_ptr);
@@ -415,103 +348,69 @@ module.exports.cryptobox_get_pk = function(sk) {
415
348
  };
416
349
 
417
350
  /**
418
- * @param {PublicEncKey} pk
419
- * @returns {Uint8Array}
420
- */
351
+ * @param {PublicEncKey} pk
352
+ * @returns {Uint8Array}
353
+ */
421
354
  module.exports.cryptobox_pk_to_u8vec = function(pk) {
422
- try {
423
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
424
- _assertClass(pk, PublicEncKey);
425
- wasm.cryptobox_pk_to_u8vec(retptr, pk.__wbg_ptr);
426
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
427
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
428
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
429
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
430
- if (r3) {
431
- throw takeObject(r2);
432
- }
433
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
434
- wasm.__wbindgen_free(r0, r1 * 1, 1);
435
- return v1;
436
- } finally {
437
- wasm.__wbindgen_add_to_stack_pointer(16);
355
+ _assertClass(pk, PublicEncKey);
356
+ const ret = wasm.cryptobox_pk_to_u8vec(pk.__wbg_ptr);
357
+ if (ret[3]) {
358
+ throw takeFromExternrefTable0(ret[2]);
438
359
  }
360
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
361
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
362
+ return v1;
439
363
  };
440
364
 
441
365
  /**
442
- * @param {PrivateEncKey} sk
443
- * @returns {Uint8Array}
444
- */
366
+ * @param {PrivateEncKey} sk
367
+ * @returns {Uint8Array}
368
+ */
445
369
  module.exports.cryptobox_sk_to_u8vec = function(sk) {
446
- try {
447
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
448
- _assertClass(sk, PrivateEncKey);
449
- wasm.cryptobox_sk_to_u8vec(retptr, sk.__wbg_ptr);
450
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
451
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
452
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
453
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
454
- if (r3) {
455
- throw takeObject(r2);
456
- }
457
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
458
- wasm.__wbindgen_free(r0, r1 * 1, 1);
459
- return v1;
460
- } finally {
461
- wasm.__wbindgen_add_to_stack_pointer(16);
370
+ _assertClass(sk, PrivateEncKey);
371
+ const ret = wasm.cryptobox_sk_to_u8vec(sk.__wbg_ptr);
372
+ if (ret[3]) {
373
+ throw takeFromExternrefTable0(ret[2]);
462
374
  }
375
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
376
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
377
+ return v1;
463
378
  };
464
379
 
465
380
  /**
466
- * @param {Uint8Array} v
467
- * @returns {PublicEncKey}
468
- */
381
+ * @param {Uint8Array} v
382
+ * @returns {PublicEncKey}
383
+ */
469
384
  module.exports.u8vec_to_cryptobox_pk = function(v) {
470
- try {
471
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
472
- const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
473
- const len0 = WASM_VECTOR_LEN;
474
- wasm.u8vec_to_cryptobox_pk(retptr, ptr0, len0);
475
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
476
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
477
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
478
- if (r2) {
479
- throw takeObject(r1);
480
- }
481
- return PublicEncKey.__wrap(r0);
482
- } finally {
483
- wasm.__wbindgen_add_to_stack_pointer(16);
385
+ const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
386
+ const len0 = WASM_VECTOR_LEN;
387
+ const ret = wasm.u8vec_to_cryptobox_pk(ptr0, len0);
388
+ if (ret[2]) {
389
+ throw takeFromExternrefTable0(ret[1]);
484
390
  }
391
+ return PublicEncKey.__wrap(ret[0]);
485
392
  };
486
393
 
487
394
  /**
488
- * @param {Uint8Array} v
489
- * @returns {PrivateEncKey}
490
- */
395
+ * @param {Uint8Array} v
396
+ * @returns {PrivateEncKey}
397
+ */
491
398
  module.exports.u8vec_to_cryptobox_sk = function(v) {
492
- try {
493
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
494
- const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
495
- const len0 = WASM_VECTOR_LEN;
496
- wasm.u8vec_to_cryptobox_sk(retptr, ptr0, len0);
497
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
498
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
499
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
500
- if (r2) {
501
- throw takeObject(r1);
502
- }
503
- return PrivateEncKey.__wrap(r0);
504
- } finally {
505
- wasm.__wbindgen_add_to_stack_pointer(16);
399
+ const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
400
+ const len0 = WASM_VECTOR_LEN;
401
+ const ret = wasm.u8vec_to_cryptobox_sk(ptr0, len0);
402
+ if (ret[2]) {
403
+ throw takeFromExternrefTable0(ret[1]);
506
404
  }
405
+ return PrivateEncKey.__wrap(ret[0]);
507
406
  };
508
407
 
509
408
  /**
510
- * @param {Uint8Array} msg
511
- * @param {PublicEncKey} their_pk
512
- * @param {PrivateEncKey} my_sk
513
- * @returns {CryptoBoxCt}
514
- */
409
+ * @param {Uint8Array} msg
410
+ * @param {PublicEncKey} their_pk
411
+ * @param {PrivateEncKey} my_sk
412
+ * @returns {CryptoBoxCt}
413
+ */
515
414
  module.exports.cryptobox_encrypt = function(msg, their_pk, my_sk) {
516
415
  const ptr0 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
517
416
  const len0 = WASM_VECTOR_LEN;
@@ -522,201 +421,178 @@ module.exports.cryptobox_encrypt = function(msg, their_pk, my_sk) {
522
421
  };
523
422
 
524
423
  /**
525
- * @param {CryptoBoxCt} ct
526
- * @param {PrivateEncKey} my_sk
527
- * @param {PublicEncKey} their_pk
528
- * @returns {Uint8Array}
529
- */
424
+ * @param {CryptoBoxCt} ct
425
+ * @param {PrivateEncKey} my_sk
426
+ * @param {PublicEncKey} their_pk
427
+ * @returns {Uint8Array}
428
+ */
530
429
  module.exports.cryptobox_decrypt = function(ct, my_sk, their_pk) {
531
- try {
532
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
533
- _assertClass(ct, CryptoBoxCt);
534
- _assertClass(my_sk, PrivateEncKey);
535
- _assertClass(their_pk, PublicEncKey);
536
- wasm.cryptobox_decrypt(retptr, ct.__wbg_ptr, my_sk.__wbg_ptr, their_pk.__wbg_ptr);
537
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
538
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
539
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
540
- wasm.__wbindgen_free(r0, r1 * 1, 1);
541
- return v1;
542
- } finally {
543
- wasm.__wbindgen_add_to_stack_pointer(16);
544
- }
430
+ _assertClass(ct, CryptoBoxCt);
431
+ _assertClass(my_sk, PrivateEncKey);
432
+ _assertClass(their_pk, PublicEncKey);
433
+ const ret = wasm.cryptobox_decrypt(ct.__wbg_ptr, my_sk.__wbg_ptr, their_pk.__wbg_ptr);
434
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
435
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
436
+ return v1;
545
437
  };
546
438
 
547
439
  /**
548
- * Process the reencryption response from JavaScript objects.
549
- * The result is a byte array representing a plaintext of any length.
550
- *
551
- * * `client` - client that wants to perform reencryption.
552
- *
553
- * * `request` - the initial reencryption request JS object.
554
- * It can be set to null if `verify` is false.
555
- * Otherwise the caller needs to give the following JS object.
556
- * Note that `client_address` and `eip712_verifying_contract` follow EIP-55.
557
- * ```
558
- * {
559
- * signature: '15a4f9a8eb61459cfba7d103d8f911fb04ce91ecf841b34c49c0d56a70b896d20cbc31986188f91efc3842b7df215cee8acb40178daedb8b63d0ba5d199bce121c',
560
- * client_address: '0x17853A630aAe15AED549B2B874de08B73C0F59c5',
561
- * enc_key: '2000000000000000df2fcacb774f03187f3802a27259f45c06d33cefa68d9c53426b15ad531aa822',
562
- * ciphertext_digest: '0748b542afe2353c86cb707e3d21044b0be1fd18efc7cbaa6a415af055bfb358',
563
- * eip712_verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657'
564
- * }
565
- * ```
566
- *
567
- * * `eip712_domain` - the EIP-712 domain JS object.
568
- * It can be set to null if `verify` is false.
569
- * Otherwise the caller needs to give the following JS object.
570
- * Note that `salt` is optional and `verifying_contract` follows EIP-55,
571
- * additionally, `chain_id` is an array of u8.
572
- * ```
573
- * {
574
- * name: 'Authorization token',
575
- * version: '1',
576
- * chain_id: [
577
- * 70, 31, 0, 0, 0, 0, 0, 0, 0,
578
- * 0, 0, 0, 0, 0, 0, 0, 0, 0,
579
- * 0, 0, 0, 0, 0, 0, 0, 0, 0,
580
- * 0, 0, 0, 0, 0
581
- * ],
582
- * verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657',
583
- * salt: []
584
- * }
585
- * ```
586
- *
587
- * * `agg_resp` - the response JS object from the gateway.
588
- * It has two fields like so, both are hex encoded byte arrays.
589
- * ```
590
- * [
591
- * {
592
- * signature: '69e7e040cab157aa819015b321c012dccb1545ffefd325b359b492653f0347517e28e66c572cdc299e259024329859ff9fcb0096e1ce072af0b6e1ca1fe25ec6',
593
- * payload: '0100000029...'
594
- * }
595
- * ]
596
- * ```
597
- *
598
- * * `enc_pk` - The ephemeral public key.
599
- *
600
- * * `enc_sk` - The ephemeral secret key.
601
- *
602
- * * `verify` - Whether to perform signature verification for the response.
603
- * It is insecure if `verify = false`!
604
- * @param {Client} client
605
- * @param {any} request
606
- * @param {any} eip712_domain
607
- * @param {any} agg_resp
608
- * @param {PublicEncKey} enc_pk
609
- * @param {PrivateEncKey} enc_sk
610
- * @param {boolean} verify
611
- * @returns {Uint8Array}
612
- */
440
+ * Process the reencryption response from JavaScript objects.
441
+ * The returned result is a byte array representing a plaintext of any length,
442
+ * postprocessing is returned to turn it into an integer.
443
+ *
444
+ * * `client` - client that wants to perform reencryption.
445
+ *
446
+ * * `request` - the initial reencryption request JS object.
447
+ * It can be set to null if `verify` is false.
448
+ * Otherwise the caller needs to give the following JS object.
449
+ * Note that `client_address` and `eip712_verifying_contract` follow EIP-55.
450
+ * ```
451
+ * {
452
+ * signature: '15a4f9a8eb61459cfba7d103d8f911fb04ce91ecf841b34c49c0d56a70b896d20cbc31986188f91efc3842b7df215cee8acb40178daedb8b63d0ba5d199bce121c',
453
+ * client_address: '0x17853A630aAe15AED549B2B874de08B73C0F59c5',
454
+ * enc_key: '2000000000000000df2fcacb774f03187f3802a27259f45c06d33cefa68d9c53426b15ad531aa822',
455
+ * ciphertext_handle: '0748b542afe2353c86cb707e3d21044b0be1fd18efc7cbaa6a415af055bfb358',
456
+ * eip712_verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657'
457
+ * }
458
+ * ```
459
+ *
460
+ * * `eip712_domain` - the EIP-712 domain JS object.
461
+ * It can be set to null if `verify` is false.
462
+ * Otherwise the caller needs to give the following JS object.
463
+ * Note that `salt` is optional and `verifying_contract` follows EIP-55,
464
+ * additionally, `chain_id` is an array of u8.
465
+ * ```
466
+ * {
467
+ * name: 'Authorization token',
468
+ * version: '1',
469
+ * chain_id: [
470
+ * 70, 31, 0, 0, 0, 0, 0, 0, 0,
471
+ * 0, 0, 0, 0, 0, 0, 0, 0, 0,
472
+ * 0, 0, 0, 0, 0, 0, 0, 0, 0,
473
+ * 0, 0, 0, 0, 0
474
+ * ],
475
+ * verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657',
476
+ * salt: []
477
+ * }
478
+ * ```
479
+ *
480
+ * * `agg_resp` - the response JS object from the gateway.
481
+ * It has two fields like so, both are hex encoded byte arrays.
482
+ * ```
483
+ * [
484
+ * {
485
+ * signature: '69e7e040cab157aa819015b321c012dccb1545ffefd325b359b492653f0347517e28e66c572cdc299e259024329859ff9fcb0096e1ce072af0b6e1ca1fe25ec6',
486
+ * payload: '0100000029...'
487
+ * }
488
+ * ]
489
+ * ```
490
+ *
491
+ * * `enc_pk` - The ephemeral public key.
492
+ *
493
+ * * `enc_sk` - The ephemeral secret key.
494
+ *
495
+ * * `verify` - Whether to perform signature verification for the response.
496
+ * It is insecure if `verify = false`!
497
+ * @param {Client} client
498
+ * @param {any} request
499
+ * @param {any} eip712_domain
500
+ * @param {any} agg_resp
501
+ * @param {PublicEncKey} enc_pk
502
+ * @param {PrivateEncKey} enc_sk
503
+ * @param {boolean} verify
504
+ * @returns {Uint8Array}
505
+ */
613
506
  module.exports.process_reencryption_resp_from_js = function(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
614
- try {
615
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
616
- _assertClass(client, Client);
617
- _assertClass(enc_pk, PublicEncKey);
618
- _assertClass(enc_sk, PrivateEncKey);
619
- wasm.process_reencryption_resp_from_js(retptr, client.__wbg_ptr, addHeapObject(request), addHeapObject(eip712_domain), addHeapObject(agg_resp), enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
620
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
621
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
622
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
623
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
624
- if (r3) {
625
- throw takeObject(r2);
626
- }
627
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
628
- wasm.__wbindgen_free(r0, r1 * 1, 1);
629
- return v1;
630
- } finally {
631
- wasm.__wbindgen_add_to_stack_pointer(16);
507
+ _assertClass(client, Client);
508
+ _assertClass(enc_pk, PublicEncKey);
509
+ _assertClass(enc_sk, PrivateEncKey);
510
+ const ret = wasm.process_reencryption_resp_from_js(client.__wbg_ptr, request, eip712_domain, agg_resp, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
511
+ if (ret[3]) {
512
+ throw takeFromExternrefTable0(ret[2]);
632
513
  }
514
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
515
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
516
+ return v1;
633
517
  };
634
518
 
635
519
  /**
636
- * Process the reencryption response from Rust objects.
637
- * Consider using [process_reencryption_resp_from_js]
638
- * when using the JS API.
639
- * The result is a byte array representing a plaintext of any length.
640
- *
641
- * * `client` - client that wants to perform reencryption.
642
- *
643
- * * `request` - the initial reencryption request.
644
- * Must be given if `verify` is true.
645
- *
646
- * * `eip712_domain` - the EIP-712 domain.
647
- * Must be given if `verify` is true.
648
- *
649
- * * `agg_resp` - the vector of reencryption responses.
650
- *
651
- * * `enc_pk` - The ephemeral public key.
652
- *
653
- * * `enc_sk` - The ephemeral secret key.
654
- *
655
- * * `verify` - Whether to perform signature verification for the response.
656
- * It is insecure if `verify = false`!
657
- * @param {Client} client
658
- * @param {ParsedReencryptionRequest | undefined} request
659
- * @param {Eip712DomainMsg | undefined} eip712_domain
660
- * @param {(ReencryptionResponse)[]} agg_resp
661
- * @param {PublicEncKey} enc_pk
662
- * @param {PrivateEncKey} enc_sk
663
- * @param {boolean} verify
664
- * @returns {Uint8Array}
665
- */
520
+ * Process the reencryption response from Rust objects.
521
+ * Consider using [process_reencryption_resp_from_js]
522
+ * when using the JS API.
523
+ * The result is a byte array representing a plaintext of any length.
524
+ *
525
+ * * `client` - client that wants to perform reencryption.
526
+ *
527
+ * * `request` - the initial reencryption request.
528
+ * Must be given if `verify` is true.
529
+ *
530
+ * * `eip712_domain` - the EIP-712 domain.
531
+ * Must be given if `verify` is true.
532
+ *
533
+ * * `agg_resp` - the vector of reencryption responses.
534
+ *
535
+ * * `enc_pk` - The ephemeral public key.
536
+ *
537
+ * * `enc_sk` - The ephemeral secret key.
538
+ *
539
+ * * `verify` - Whether to perform signature verification for the response.
540
+ * It is insecure if `verify = false`!
541
+ * @param {Client} client
542
+ * @param {ParsedReencryptionRequest | undefined} request
543
+ * @param {Eip712DomainMsg | undefined} eip712_domain
544
+ * @param {(ReencryptionResponse)[]} agg_resp
545
+ * @param {PublicEncKey} enc_pk
546
+ * @param {PrivateEncKey} enc_sk
547
+ * @param {boolean} verify
548
+ * @returns {Uint8Array}
549
+ */
666
550
  module.exports.process_reencryption_resp = function(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
667
- try {
668
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
669
- _assertClass(client, Client);
670
- let ptr0 = 0;
671
- if (!isLikeNone(request)) {
672
- _assertClass(request, ParsedReencryptionRequest);
673
- ptr0 = request.__destroy_into_raw();
674
- }
675
- let ptr1 = 0;
676
- if (!isLikeNone(eip712_domain)) {
677
- _assertClass(eip712_domain, Eip712DomainMsg);
678
- ptr1 = eip712_domain.__destroy_into_raw();
679
- }
680
- const ptr2 = passArrayJsValueToWasm0(agg_resp, wasm.__wbindgen_malloc);
681
- const len2 = WASM_VECTOR_LEN;
682
- _assertClass(enc_pk, PublicEncKey);
683
- _assertClass(enc_sk, PrivateEncKey);
684
- wasm.process_reencryption_resp(retptr, client.__wbg_ptr, ptr0, ptr1, ptr2, len2, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
685
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
686
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
687
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
688
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
689
- if (r3) {
690
- throw takeObject(r2);
691
- }
692
- var v4 = getArrayU8FromWasm0(r0, r1).slice();
693
- wasm.__wbindgen_free(r0, r1 * 1, 1);
694
- return v4;
695
- } finally {
696
- wasm.__wbindgen_add_to_stack_pointer(16);
551
+ _assertClass(client, Client);
552
+ let ptr0 = 0;
553
+ if (!isLikeNone(request)) {
554
+ _assertClass(request, ParsedReencryptionRequest);
555
+ ptr0 = request.__destroy_into_raw();
697
556
  }
557
+ let ptr1 = 0;
558
+ if (!isLikeNone(eip712_domain)) {
559
+ _assertClass(eip712_domain, Eip712DomainMsg);
560
+ ptr1 = eip712_domain.__destroy_into_raw();
561
+ }
562
+ const ptr2 = passArrayJsValueToWasm0(agg_resp, wasm.__wbindgen_malloc);
563
+ const len2 = WASM_VECTOR_LEN;
564
+ _assertClass(enc_pk, PublicEncKey);
565
+ _assertClass(enc_sk, PrivateEncKey);
566
+ const ret = wasm.process_reencryption_resp(client.__wbg_ptr, ptr0, ptr1, ptr2, len2, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
567
+ if (ret[3]) {
568
+ throw takeFromExternrefTable0(ret[2]);
569
+ }
570
+ var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
571
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
572
+ return v4;
698
573
  };
699
574
 
700
575
  function handleError(f, args) {
701
576
  try {
702
577
  return f.apply(this, args);
703
578
  } catch (e) {
704
- wasm.__wbindgen_exn_store(addHeapObject(e));
579
+ const idx = addToExternrefTable0(e);
580
+ wasm.__wbindgen_exn_store(idx);
705
581
  }
706
582
  }
707
583
  /**
708
- * The plaintext types that can be encrypted in a fhevm ciphertext.
709
- */
584
+ * The plaintext types that can be encrypted in a fhevm ciphertext.
585
+ */
710
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", });
711
587
 
712
588
  const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
713
589
  ? { register: () => {}, unregister: () => {} }
714
590
  : new FinalizationRegistry(ptr => wasm.__wbg_client_free(ptr >>> 0, 1));
715
591
  /**
716
- * Simple client to interact with the KMS servers. This can be seen as a proof-of-concept
717
- * and reference code for validating the KMS. The logic supplied by the client will be
718
- * distributed across the aggregator/proxy and smart contracts.
719
- */
592
+ * Simple client to interact with the KMS servers. This can be seen as a proof-of-concept
593
+ * and reference code for validating the KMS. The logic supplied by the client will be
594
+ * distributed across the aggregator/proxy and smart contracts.
595
+ */
720
596
  class Client {
721
597
 
722
598
  static __wrap(ptr) {
@@ -744,8 +620,7 @@ module.exports.Client = Client;
744
620
  const CryptoBoxCtFinalization = (typeof FinalizationRegistry === 'undefined')
745
621
  ? { register: () => {}, unregister: () => {} }
746
622
  : new FinalizationRegistry(ptr => wasm.__wbg_cryptoboxct_free(ptr >>> 0, 1));
747
- /**
748
- */
623
+
749
624
  class CryptoBoxCt {
750
625
 
751
626
  static __wrap(ptr) {
@@ -774,10 +649,10 @@ const Eip712DomainMsgFinalization = (typeof FinalizationRegistry === 'undefined'
774
649
  ? { register: () => {}, unregister: () => {} }
775
650
  : new FinalizationRegistry(ptr => wasm.__wbg_eip712domainmsg_free(ptr >>> 0, 1));
776
651
  /**
777
- * <https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>
778
- * eventually chain_id, verifying_contract and salt will be parsed in to
779
- * solidity types
780
- */
652
+ * <https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>
653
+ * eventually chain_id, verifying_contract and salt will be parsed in to
654
+ * solidity types
655
+ */
781
656
  class Eip712DomainMsg {
782
657
 
783
658
  static __wrap(ptr) {
@@ -800,132 +675,109 @@ class Eip712DomainMsg {
800
675
  wasm.__wbg_eip712domainmsg_free(ptr, 0);
801
676
  }
802
677
  /**
803
- * @returns {string}
804
- */
678
+ * @returns {string}
679
+ */
805
680
  get name() {
806
681
  let deferred1_0;
807
682
  let deferred1_1;
808
683
  try {
809
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
810
- wasm.__wbg_get_eip712domainmsg_name(retptr, this.__wbg_ptr);
811
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
812
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
813
- deferred1_0 = r0;
814
- deferred1_1 = r1;
815
- return getStringFromWasm0(r0, r1);
684
+ const ret = wasm.__wbg_get_eip712domainmsg_name(this.__wbg_ptr);
685
+ deferred1_0 = ret[0];
686
+ deferred1_1 = ret[1];
687
+ return getStringFromWasm0(ret[0], ret[1]);
816
688
  } finally {
817
- wasm.__wbindgen_add_to_stack_pointer(16);
818
689
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
819
690
  }
820
691
  }
821
692
  /**
822
- * @param {string} arg0
823
- */
693
+ * @param {string} arg0
694
+ */
824
695
  set name(arg0) {
825
696
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
826
697
  const len0 = WASM_VECTOR_LEN;
827
698
  wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
828
699
  }
829
700
  /**
830
- * @returns {string}
831
- */
701
+ * @returns {string}
702
+ */
832
703
  get version() {
833
704
  let deferred1_0;
834
705
  let deferred1_1;
835
706
  try {
836
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
837
- wasm.__wbg_get_eip712domainmsg_version(retptr, this.__wbg_ptr);
838
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
839
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
840
- deferred1_0 = r0;
841
- deferred1_1 = r1;
842
- return getStringFromWasm0(r0, r1);
707
+ const ret = wasm.__wbg_get_eip712domainmsg_version(this.__wbg_ptr);
708
+ deferred1_0 = ret[0];
709
+ deferred1_1 = ret[1];
710
+ return getStringFromWasm0(ret[0], ret[1]);
843
711
  } finally {
844
- wasm.__wbindgen_add_to_stack_pointer(16);
845
712
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
846
713
  }
847
714
  }
848
715
  /**
849
- * @param {string} arg0
850
- */
716
+ * @param {string} arg0
717
+ */
851
718
  set version(arg0) {
852
719
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
853
720
  const len0 = WASM_VECTOR_LEN;
854
721
  wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
855
722
  }
856
723
  /**
857
- * @returns {Uint8Array}
858
- */
724
+ * @returns {Uint8Array}
725
+ */
859
726
  get chain_id() {
860
- try {
861
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
862
- wasm.__wbg_get_eip712domainmsg_chain_id(retptr, this.__wbg_ptr);
863
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
864
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
865
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
866
- wasm.__wbindgen_free(r0, r1 * 1, 1);
867
- return v1;
868
- } finally {
869
- wasm.__wbindgen_add_to_stack_pointer(16);
870
- }
727
+ const ret = wasm.__wbg_get_eip712domainmsg_chain_id(this.__wbg_ptr);
728
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
729
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
730
+ return v1;
871
731
  }
872
732
  /**
873
- * @param {Uint8Array} arg0
874
- */
733
+ * @param {Uint8Array} arg0
734
+ */
875
735
  set chain_id(arg0) {
876
736
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
877
737
  const len0 = WASM_VECTOR_LEN;
878
738
  wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
879
739
  }
880
740
  /**
881
- * @returns {string}
882
- */
741
+ * @returns {string}
742
+ */
883
743
  get verifying_contract() {
884
744
  let deferred1_0;
885
745
  let deferred1_1;
886
746
  try {
887
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
888
- wasm.__wbg_get_eip712domainmsg_verifying_contract(retptr, this.__wbg_ptr);
889
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
890
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
891
- deferred1_0 = r0;
892
- deferred1_1 = r1;
893
- return getStringFromWasm0(r0, r1);
747
+ const ret = wasm.__wbg_get_eip712domainmsg_verifying_contract(this.__wbg_ptr);
748
+ deferred1_0 = ret[0];
749
+ deferred1_1 = ret[1];
750
+ return getStringFromWasm0(ret[0], ret[1]);
894
751
  } finally {
895
- wasm.__wbindgen_add_to_stack_pointer(16);
896
752
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
897
753
  }
898
754
  }
899
755
  /**
900
- * @param {string} arg0
901
- */
756
+ * @param {string} arg0
757
+ */
902
758
  set verifying_contract(arg0) {
903
759
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
904
760
  const len0 = WASM_VECTOR_LEN;
905
761
  wasm.__wbg_set_eip712domainmsg_verifying_contract(this.__wbg_ptr, ptr0, len0);
906
762
  }
907
763
  /**
908
- * @returns {Uint8Array}
909
- */
764
+ * @returns {Uint8Array | undefined}
765
+ */
910
766
  get salt() {
911
- try {
912
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
913
- wasm.__wbg_get_eip712domainmsg_salt(retptr, this.__wbg_ptr);
914
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
915
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
916
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
917
- wasm.__wbindgen_free(r0, r1 * 1, 1);
918
- return v1;
919
- } finally {
920
- wasm.__wbindgen_add_to_stack_pointer(16);
767
+ const ret = wasm.__wbg_get_eip712domainmsg_salt(this.__wbg_ptr);
768
+ let v1;
769
+ if (ret[0] !== 0) {
770
+ v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
771
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
921
772
  }
773
+ return v1;
922
774
  }
923
775
  /**
924
- * @param {Uint8Array} arg0
925
- */
776
+ * @param {Uint8Array | undefined} [arg0]
777
+ */
926
778
  set salt(arg0) {
927
- const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
928
- const len0 = WASM_VECTOR_LEN;
779
+ var ptr0 = isLikeNone(arg0) ? 0 : passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
780
+ var len0 = WASM_VECTOR_LEN;
929
781
  wasm.__wbg_set_eip712domainmsg_salt(this.__wbg_ptr, ptr0, len0);
930
782
  }
931
783
  }
@@ -935,8 +787,8 @@ const ParsedReencryptionRequestFinalization = (typeof FinalizationRegistry === '
935
787
  ? { register: () => {}, unregister: () => {} }
936
788
  : new FinalizationRegistry(ptr => wasm.__wbg_parsedreencryptionrequest_free(ptr >>> 0, 1));
937
789
  /**
938
- * Validity of this struct is not checked.
939
- */
790
+ * Validity of this struct is not checked.
791
+ */
940
792
  class ParsedReencryptionRequest {
941
793
 
942
794
  __destroy_into_raw() {
@@ -956,8 +808,7 @@ module.exports.ParsedReencryptionRequest = ParsedReencryptionRequest;
956
808
  const PlaintextFinalization = (typeof FinalizationRegistry === 'undefined')
957
809
  ? { register: () => {}, unregister: () => {} }
958
810
  : new FinalizationRegistry(ptr => wasm.__wbg_plaintext_free(ptr >>> 0, 1));
959
- /**
960
- */
811
+
961
812
  class Plaintext {
962
813
 
963
814
  __destroy_into_raw() {
@@ -972,24 +823,17 @@ class Plaintext {
972
823
  wasm.__wbg_plaintext_free(ptr, 0);
973
824
  }
974
825
  /**
975
- * @returns {Uint8Array}
976
- */
826
+ * @returns {Uint8Array}
827
+ */
977
828
  get bytes() {
978
- try {
979
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
980
- wasm.__wbg_get_plaintext_bytes(retptr, this.__wbg_ptr);
981
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
982
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
983
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
984
- wasm.__wbindgen_free(r0, r1 * 1, 1);
985
- return v1;
986
- } finally {
987
- wasm.__wbindgen_add_to_stack_pointer(16);
988
- }
829
+ const ret = wasm.__wbg_get_plaintext_bytes(this.__wbg_ptr);
830
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
831
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
832
+ return v1;
989
833
  }
990
834
  /**
991
- * @param {Uint8Array} arg0
992
- */
835
+ * @param {Uint8Array} arg0
836
+ */
993
837
  set bytes(arg0) {
994
838
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
995
839
  const len0 = WASM_VECTOR_LEN;
@@ -1001,8 +845,7 @@ module.exports.Plaintext = Plaintext;
1001
845
  const PrivateEncKeyFinalization = (typeof FinalizationRegistry === 'undefined')
1002
846
  ? { register: () => {}, unregister: () => {} }
1003
847
  : new FinalizationRegistry(ptr => wasm.__wbg_privateenckey_free(ptr >>> 0, 1));
1004
- /**
1005
- */
848
+
1006
849
  class PrivateEncKey {
1007
850
 
1008
851
  static __wrap(ptr) {
@@ -1030,8 +873,7 @@ module.exports.PrivateEncKey = PrivateEncKey;
1030
873
  const PrivateSigKeyFinalization = (typeof FinalizationRegistry === 'undefined')
1031
874
  ? { register: () => {}, unregister: () => {} }
1032
875
  : new FinalizationRegistry(ptr => wasm.__wbg_privatesigkey_free(ptr >>> 0, 1));
1033
- /**
1034
- */
876
+
1035
877
  class PrivateSigKey {
1036
878
 
1037
879
  static __wrap(ptr) {
@@ -1059,8 +901,7 @@ module.exports.PrivateSigKey = PrivateSigKey;
1059
901
  const PublicEncKeyFinalization = (typeof FinalizationRegistry === 'undefined')
1060
902
  ? { register: () => {}, unregister: () => {} }
1061
903
  : new FinalizationRegistry(ptr => wasm.__wbg_publicenckey_free(ptr >>> 0, 1));
1062
- /**
1063
- */
904
+
1064
905
  class PublicEncKey {
1065
906
 
1066
907
  static __wrap(ptr) {
@@ -1088,8 +929,7 @@ module.exports.PublicEncKey = PublicEncKey;
1088
929
  const PublicSigKeyFinalization = (typeof FinalizationRegistry === 'undefined')
1089
930
  ? { register: () => {}, unregister: () => {} }
1090
931
  : new FinalizationRegistry(ptr => wasm.__wbg_publicsigkey_free(ptr >>> 0, 1));
1091
- /**
1092
- */
932
+
1093
933
  class PublicSigKey {
1094
934
 
1095
935
  static __wrap(ptr) {
@@ -1100,13 +940,6 @@ class PublicSigKey {
1100
940
  return obj;
1101
941
  }
1102
942
 
1103
- static __unwrap(jsValue) {
1104
- if (!(jsValue instanceof PublicSigKey)) {
1105
- return 0;
1106
- }
1107
- return jsValue.__destroy_into_raw();
1108
- }
1109
-
1110
943
  __destroy_into_raw() {
1111
944
  const ptr = this.__wbg_ptr;
1112
945
  this.__wbg_ptr = 0;
@@ -1124,8 +957,7 @@ module.exports.PublicSigKey = PublicSigKey;
1124
957
  const ReencryptionRequestFinalization = (typeof FinalizationRegistry === 'undefined')
1125
958
  ? { register: () => {}, unregister: () => {} }
1126
959
  : new FinalizationRegistry(ptr => wasm.__wbg_reencryptionrequest_free(ptr >>> 0, 1));
1127
- /**
1128
- */
960
+
1129
961
  class ReencryptionRequest {
1130
962
 
1131
963
  __destroy_into_raw() {
@@ -1140,41 +972,34 @@ class ReencryptionRequest {
1140
972
  wasm.__wbg_reencryptionrequest_free(ptr, 0);
1141
973
  }
1142
974
  /**
1143
- * Signature of the serialization of \[ReencryptionRequestPayload\].
1144
- * @returns {Uint8Array}
1145
- */
975
+ * Signature of the serialization of \[ReencryptionRequestPayload\].
976
+ * @returns {Uint8Array}
977
+ */
1146
978
  get signature() {
1147
- try {
1148
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1149
- wasm.__wbg_get_reencryptionrequest_signature(retptr, this.__wbg_ptr);
1150
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1151
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1152
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
1153
- wasm.__wbindgen_free(r0, r1 * 1, 1);
1154
- return v1;
1155
- } finally {
1156
- wasm.__wbindgen_add_to_stack_pointer(16);
1157
- }
979
+ const ret = wasm.__wbg_get_reencryptionrequest_signature(this.__wbg_ptr);
980
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
981
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
982
+ return v1;
1158
983
  }
1159
984
  /**
1160
- * Signature of the serialization of \[ReencryptionRequestPayload\].
1161
- * @param {Uint8Array} arg0
1162
- */
985
+ * Signature of the serialization of \[ReencryptionRequestPayload\].
986
+ * @param {Uint8Array} arg0
987
+ */
1163
988
  set signature(arg0) {
1164
989
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1165
990
  const len0 = WASM_VECTOR_LEN;
1166
991
  wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1167
992
  }
1168
993
  /**
1169
- * @returns {ReencryptionRequestPayload | undefined}
1170
- */
994
+ * @returns {ReencryptionRequestPayload | undefined}
995
+ */
1171
996
  get payload() {
1172
997
  const ret = wasm.__wbg_get_reencryptionrequest_payload(this.__wbg_ptr);
1173
998
  return ret === 0 ? undefined : ReencryptionRequestPayload.__wrap(ret);
1174
999
  }
1175
1000
  /**
1176
- * @param {ReencryptionRequestPayload | undefined} [arg0]
1177
- */
1001
+ * @param {ReencryptionRequestPayload | undefined} [arg0]
1002
+ */
1178
1003
  set payload(arg0) {
1179
1004
  let ptr0 = 0;
1180
1005
  if (!isLikeNone(arg0)) {
@@ -1184,15 +1009,15 @@ class ReencryptionRequest {
1184
1009
  wasm.__wbg_set_reencryptionrequest_payload(this.__wbg_ptr, ptr0);
1185
1010
  }
1186
1011
  /**
1187
- * @returns {Eip712DomainMsg | undefined}
1188
- */
1012
+ * @returns {Eip712DomainMsg | undefined}
1013
+ */
1189
1014
  get domain() {
1190
1015
  const ret = wasm.__wbg_get_reencryptionrequest_domain(this.__wbg_ptr);
1191
1016
  return ret === 0 ? undefined : Eip712DomainMsg.__wrap(ret);
1192
1017
  }
1193
1018
  /**
1194
- * @param {Eip712DomainMsg | undefined} [arg0]
1195
- */
1019
+ * @param {Eip712DomainMsg | undefined} [arg0]
1020
+ */
1196
1021
  set domain(arg0) {
1197
1022
  let ptr0 = 0;
1198
1023
  if (!isLikeNone(arg0)) {
@@ -1202,19 +1027,19 @@ class ReencryptionRequest {
1202
1027
  wasm.__wbg_set_reencryptionrequest_domain(this.__wbg_ptr, ptr0);
1203
1028
  }
1204
1029
  /**
1205
- * The ID that identifies this request.
1206
- * Future queries for the result must use this request ID.
1207
- * @returns {RequestId | undefined}
1208
- */
1030
+ * The ID that identifies this request.
1031
+ * Future queries for the result must use this request ID.
1032
+ * @returns {RequestId | undefined}
1033
+ */
1209
1034
  get request_id() {
1210
1035
  const ret = wasm.__wbg_get_reencryptionrequest_request_id(this.__wbg_ptr);
1211
1036
  return ret === 0 ? undefined : RequestId.__wrap(ret);
1212
1037
  }
1213
1038
  /**
1214
- * The ID that identifies this request.
1215
- * Future queries for the result must use this request ID.
1216
- * @param {RequestId | undefined} [arg0]
1217
- */
1039
+ * The ID that identifies this request.
1040
+ * Future queries for the result must use this request ID.
1041
+ * @param {RequestId | undefined} [arg0]
1042
+ */
1218
1043
  set request_id(arg0) {
1219
1044
  let ptr0 = 0;
1220
1045
  if (!isLikeNone(arg0)) {
@@ -1229,8 +1054,7 @@ module.exports.ReencryptionRequest = ReencryptionRequest;
1229
1054
  const ReencryptionRequestPayloadFinalization = (typeof FinalizationRegistry === 'undefined')
1230
1055
  ? { register: () => {}, unregister: () => {} }
1231
1056
  : new FinalizationRegistry(ptr => wasm.__wbg_reencryptionrequestpayload_free(ptr >>> 0, 1));
1232
- /**
1233
- */
1057
+
1234
1058
  class ReencryptionRequestPayload {
1235
1059
 
1236
1060
  static __wrap(ptr) {
@@ -1253,110 +1077,99 @@ class ReencryptionRequestPayload {
1253
1077
  wasm.__wbg_reencryptionrequestpayload_free(ptr, 0);
1254
1078
  }
1255
1079
  /**
1256
- * Version of the request format.
1257
- * @returns {number}
1258
- */
1080
+ * Version of the request format.
1081
+ * @returns {number}
1082
+ */
1259
1083
  get version() {
1260
1084
  const ret = wasm.__wbg_get_reencryptionrequestpayload_version(this.__wbg_ptr);
1261
1085
  return ret >>> 0;
1262
1086
  }
1263
1087
  /**
1264
- * Version of the request format.
1265
- * @param {number} arg0
1266
- */
1088
+ * Version of the request format.
1089
+ * @param {number} arg0
1090
+ */
1267
1091
  set version(arg0) {
1268
1092
  wasm.__wbg_set_reencryptionrequestpayload_version(this.__wbg_ptr, arg0);
1269
1093
  }
1270
1094
  /**
1271
- * The client's (blockchain wallet) address,
1272
- * encoded using EIP-55.
1273
- * @returns {string}
1274
- */
1095
+ * The client's (blockchain wallet) address,
1096
+ * encoded using EIP-55.
1097
+ * @returns {string}
1098
+ */
1275
1099
  get client_address() {
1276
1100
  let deferred1_0;
1277
1101
  let deferred1_1;
1278
1102
  try {
1279
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1280
- wasm.__wbg_get_eip712domainmsg_name(retptr, this.__wbg_ptr);
1281
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1282
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1283
- deferred1_0 = r0;
1284
- deferred1_1 = r1;
1285
- return getStringFromWasm0(r0, r1);
1103
+ const ret = wasm.__wbg_get_reencryptionrequestpayload_client_address(this.__wbg_ptr);
1104
+ deferred1_0 = ret[0];
1105
+ deferred1_1 = ret[1];
1106
+ return getStringFromWasm0(ret[0], ret[1]);
1286
1107
  } finally {
1287
- wasm.__wbindgen_add_to_stack_pointer(16);
1288
1108
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1289
1109
  }
1290
1110
  }
1291
1111
  /**
1292
- * The client's (blockchain wallet) address,
1293
- * encoded using EIP-55.
1294
- * @param {string} arg0
1295
- */
1112
+ * The client's (blockchain wallet) address,
1113
+ * encoded using EIP-55.
1114
+ * @param {string} arg0
1115
+ */
1296
1116
  set client_address(arg0) {
1297
1117
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1298
1118
  const len0 = WASM_VECTOR_LEN;
1299
1119
  wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1300
1120
  }
1301
1121
  /**
1302
- * Encoding of the user's public encryption key for this request.
1303
- * Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
1304
- * Montgomery point.
1305
- * @returns {Uint8Array}
1306
- */
1122
+ * Encoding of the user's public encryption key for this request.
1123
+ * Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
1124
+ * Montgomery point.
1125
+ * @returns {Uint8Array}
1126
+ */
1307
1127
  get enc_key() {
1308
- try {
1309
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1310
- wasm.__wbg_get_reencryptionrequestpayload_enc_key(retptr, this.__wbg_ptr);
1311
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1312
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1313
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
1314
- wasm.__wbindgen_free(r0, r1 * 1, 1);
1315
- return v1;
1316
- } finally {
1317
- wasm.__wbindgen_add_to_stack_pointer(16);
1318
- }
1128
+ const ret = wasm.__wbg_get_reencryptionrequestpayload_enc_key(this.__wbg_ptr);
1129
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1130
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1131
+ return v1;
1319
1132
  }
1320
1133
  /**
1321
- * Encoding of the user's public encryption key for this request.
1322
- * Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
1323
- * Montgomery point.
1324
- * @param {Uint8Array} arg0
1325
- */
1134
+ * Encoding of the user's public encryption key for this request.
1135
+ * Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
1136
+ * Montgomery point.
1137
+ * @param {Uint8Array} arg0
1138
+ */
1326
1139
  set enc_key(arg0) {
1327
1140
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1328
1141
  const len0 = WASM_VECTOR_LEN;
1329
1142
  wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1330
1143
  }
1331
1144
  /**
1332
- * The type of plaintext encrypted.
1333
- * @returns {number}
1334
- */
1145
+ * The type of plaintext encrypted.
1146
+ * @returns {number}
1147
+ */
1335
1148
  get fhe_type() {
1336
1149
  const ret = wasm.__wbg_get_reencryptionrequestpayload_fhe_type(this.__wbg_ptr);
1337
1150
  return ret;
1338
1151
  }
1339
1152
  /**
1340
- * The type of plaintext encrypted.
1341
- * @param {number} arg0
1342
- */
1153
+ * The type of plaintext encrypted.
1154
+ * @param {number} arg0
1155
+ */
1343
1156
  set fhe_type(arg0) {
1344
1157
  wasm.__wbg_set_reencryptionrequestpayload_fhe_type(this.__wbg_ptr, arg0);
1345
1158
  }
1346
1159
  /**
1347
- * The key id to use for decryption. Will be the request_id used during key
1348
- * generation
1349
- * @returns {RequestId | undefined}
1350
- */
1160
+ * The key id to use for decryption. Will be the request_id used during key
1161
+ * generation
1162
+ * @returns {RequestId | undefined}
1163
+ */
1351
1164
  get key_id() {
1352
1165
  const ret = wasm.__wbg_get_reencryptionrequestpayload_key_id(this.__wbg_ptr);
1353
1166
  return ret === 0 ? undefined : RequestId.__wrap(ret);
1354
1167
  }
1355
1168
  /**
1356
- * The key id to use for decryption. Will be the request_id used during key
1357
- * generation
1358
- * @param {RequestId | undefined} [arg0]
1359
- */
1169
+ * The key id to use for decryption. Will be the request_id used during key
1170
+ * generation
1171
+ * @param {RequestId | undefined} [arg0]
1172
+ */
1360
1173
  set key_id(arg0) {
1361
1174
  let ptr0 = 0;
1362
1175
  if (!isLikeNone(arg0)) {
@@ -1366,61 +1179,47 @@ class ReencryptionRequestPayload {
1366
1179
  wasm.__wbg_set_reencryptionrequestpayload_key_id(this.__wbg_ptr, ptr0);
1367
1180
  }
1368
1181
  /**
1369
- * The actual ciphertext to decrypt, taken directly from the fhevm.
1370
- * When creating the payload, this field may be empty,
1371
- * it is the responsibility of the gateway to fetch the
1372
- * ciphertext for the given digest below.
1373
- * @returns {Uint8Array | undefined}
1374
- */
1182
+ * The actual ciphertext to decrypt, taken directly from the fhevm.
1183
+ * When creating the payload, this field may be empty,
1184
+ * it is the responsibility of the gateway to fetch the
1185
+ * ciphertext for the given digest below.
1186
+ * @returns {Uint8Array | undefined}
1187
+ */
1375
1188
  get ciphertext() {
1376
- try {
1377
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1378
- wasm.__wbg_get_reencryptionrequestpayload_ciphertext(retptr, this.__wbg_ptr);
1379
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1380
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1381
- let v1;
1382
- if (r0 !== 0) {
1383
- v1 = getArrayU8FromWasm0(r0, r1).slice();
1384
- wasm.__wbindgen_free(r0, r1 * 1, 1);
1385
- }
1386
- return v1;
1387
- } finally {
1388
- wasm.__wbindgen_add_to_stack_pointer(16);
1189
+ const ret = wasm.__wbg_get_reencryptionrequestpayload_ciphertext(this.__wbg_ptr);
1190
+ let v1;
1191
+ if (ret[0] !== 0) {
1192
+ v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1193
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1389
1194
  }
1195
+ return v1;
1390
1196
  }
1391
1197
  /**
1392
- * The actual ciphertext to decrypt, taken directly from the fhevm.
1393
- * When creating the payload, this field may be empty,
1394
- * it is the responsibility of the gateway to fetch the
1395
- * ciphertext for the given digest below.
1396
- * @param {Uint8Array | undefined} [arg0]
1397
- */
1198
+ * The actual ciphertext to decrypt, taken directly from the fhevm.
1199
+ * When creating the payload, this field may be empty,
1200
+ * it is the responsibility of the gateway to fetch the
1201
+ * ciphertext for the given digest below.
1202
+ * @param {Uint8Array | undefined} [arg0]
1203
+ */
1398
1204
  set ciphertext(arg0) {
1399
1205
  var ptr0 = isLikeNone(arg0) ? 0 : passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1400
1206
  var len0 = WASM_VECTOR_LEN;
1401
- wasm.__wbg_set_reencryptionrequestpayload_ciphertext(this.__wbg_ptr, ptr0, len0);
1207
+ wasm.__wbg_set_eip712domainmsg_salt(this.__wbg_ptr, ptr0, len0);
1402
1208
  }
1403
1209
  /**
1404
- * The SHA3 digest of the ciphertext above.
1405
- * @returns {Uint8Array}
1406
- */
1210
+ * The SHA3 digest of the ciphertext above.
1211
+ * @returns {Uint8Array}
1212
+ */
1407
1213
  get ciphertext_digest() {
1408
- try {
1409
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1410
- wasm.__wbg_get_eip712domainmsg_chain_id(retptr, this.__wbg_ptr);
1411
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1412
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1413
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
1414
- wasm.__wbindgen_free(r0, r1 * 1, 1);
1415
- return v1;
1416
- } finally {
1417
- wasm.__wbindgen_add_to_stack_pointer(16);
1418
- }
1214
+ const ret = wasm.__wbg_get_reencryptionrequestpayload_ciphertext_digest(this.__wbg_ptr);
1215
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1216
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1217
+ return v1;
1419
1218
  }
1420
1219
  /**
1421
- * The SHA3 digest of the ciphertext above.
1422
- * @param {Uint8Array} arg0
1423
- */
1220
+ * The SHA3 digest of the ciphertext above.
1221
+ * @param {Uint8Array} arg0
1222
+ */
1424
1223
  set ciphertext_digest(arg0) {
1425
1224
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1426
1225
  const len0 = WASM_VECTOR_LEN;
@@ -1432,8 +1231,7 @@ module.exports.ReencryptionRequestPayload = ReencryptionRequestPayload;
1432
1231
  const ReencryptionResponseFinalization = (typeof FinalizationRegistry === 'undefined')
1433
1232
  ? { register: () => {}, unregister: () => {} }
1434
1233
  : new FinalizationRegistry(ptr => wasm.__wbg_reencryptionresponse_free(ptr >>> 0, 1));
1435
- /**
1436
- */
1234
+
1437
1235
  class ReencryptionResponse {
1438
1236
 
1439
1237
  static __unwrap(jsValue) {
@@ -1455,41 +1253,34 @@ class ReencryptionResponse {
1455
1253
  wasm.__wbg_reencryptionresponse_free(ptr, 0);
1456
1254
  }
1457
1255
  /**
1458
- * @returns {Uint8Array}
1459
- */
1256
+ * @returns {Uint8Array}
1257
+ */
1460
1258
  get signature() {
1461
- try {
1462
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1463
- wasm.__wbg_get_reencryptionrequest_signature(retptr, this.__wbg_ptr);
1464
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1465
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1466
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
1467
- wasm.__wbindgen_free(r0, r1 * 1, 1);
1468
- return v1;
1469
- } finally {
1470
- wasm.__wbindgen_add_to_stack_pointer(16);
1471
- }
1259
+ const ret = wasm.__wbg_get_reencryptionresponse_signature(this.__wbg_ptr);
1260
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1261
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1262
+ return v1;
1472
1263
  }
1473
1264
  /**
1474
- * @param {Uint8Array} arg0
1475
- */
1265
+ * @param {Uint8Array} arg0
1266
+ */
1476
1267
  set signature(arg0) {
1477
1268
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1478
1269
  const len0 = WASM_VECTOR_LEN;
1479
1270
  wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1480
1271
  }
1481
1272
  /**
1482
- * Signature of the serialization of \[ReencryptionResponsePayload\].
1483
- * @returns {ReencryptionResponsePayload | undefined}
1484
- */
1273
+ * Signature of the serialization of \[ReencryptionResponsePayload\].
1274
+ * @returns {ReencryptionResponsePayload | undefined}
1275
+ */
1485
1276
  get payload() {
1486
1277
  const ret = wasm.__wbg_get_reencryptionresponse_payload(this.__wbg_ptr);
1487
1278
  return ret === 0 ? undefined : ReencryptionResponsePayload.__wrap(ret);
1488
1279
  }
1489
1280
  /**
1490
- * Signature of the serialization of \[ReencryptionResponsePayload\].
1491
- * @param {ReencryptionResponsePayload | undefined} [arg0]
1492
- */
1281
+ * Signature of the serialization of \[ReencryptionResponsePayload\].
1282
+ * @param {ReencryptionResponsePayload | undefined} [arg0]
1283
+ */
1493
1284
  set payload(arg0) {
1494
1285
  let ptr0 = 0;
1495
1286
  if (!isLikeNone(arg0)) {
@@ -1504,8 +1295,7 @@ module.exports.ReencryptionResponse = ReencryptionResponse;
1504
1295
  const ReencryptionResponsePayloadFinalization = (typeof FinalizationRegistry === 'undefined')
1505
1296
  ? { register: () => {}, unregister: () => {} }
1506
1297
  : new FinalizationRegistry(ptr => wasm.__wbg_reencryptionresponsepayload_free(ptr >>> 0, 1));
1507
- /**
1508
- */
1298
+
1509
1299
  class ReencryptionResponsePayload {
1510
1300
 
1511
1301
  static __wrap(ptr) {
@@ -1528,154 +1318,133 @@ class ReencryptionResponsePayload {
1528
1318
  wasm.__wbg_reencryptionresponsepayload_free(ptr, 0);
1529
1319
  }
1530
1320
  /**
1531
- * Version of the response format.
1532
- * @returns {number}
1533
- */
1321
+ * Version of the response format.
1322
+ * @returns {number}
1323
+ */
1534
1324
  get version() {
1535
1325
  const ret = wasm.__wbg_get_reencryptionresponsepayload_version(this.__wbg_ptr);
1536
1326
  return ret >>> 0;
1537
1327
  }
1538
1328
  /**
1539
- * Version of the response format.
1540
- * @param {number} arg0
1541
- */
1329
+ * Version of the response format.
1330
+ * @param {number} arg0
1331
+ */
1542
1332
  set version(arg0) {
1543
1333
  wasm.__wbg_set_reencryptionresponsepayload_version(this.__wbg_ptr, arg0);
1544
1334
  }
1545
1335
  /**
1546
- * The server's signature verification key.
1547
- * Encoded using SEC1.
1548
- * Needed to validate the response, but MUST also be linked to a list of
1549
- * trusted keys.
1550
- * @returns {Uint8Array}
1551
- */
1336
+ * The server's signature verification key.
1337
+ * Encoded using SEC1.
1338
+ * Needed to validate the response, but MUST also be linked to a list of
1339
+ * trusted keys.
1340
+ * @returns {Uint8Array}
1341
+ */
1552
1342
  get verification_key() {
1553
- try {
1554
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1555
- wasm.__wbg_get_reencryptionrequest_signature(retptr, this.__wbg_ptr);
1556
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1557
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1558
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
1559
- wasm.__wbindgen_free(r0, r1 * 1, 1);
1560
- return v1;
1561
- } finally {
1562
- wasm.__wbindgen_add_to_stack_pointer(16);
1563
- }
1343
+ const ret = wasm.__wbg_get_reencryptionresponsepayload_verification_key(this.__wbg_ptr);
1344
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1345
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1346
+ return v1;
1564
1347
  }
1565
1348
  /**
1566
- * The server's signature verification key.
1567
- * Encoded using SEC1.
1568
- * Needed to validate the response, but MUST also be linked to a list of
1569
- * trusted keys.
1570
- * @param {Uint8Array} arg0
1571
- */
1349
+ * The server's signature verification key.
1350
+ * Encoded using SEC1.
1351
+ * Needed to validate the response, but MUST also be linked to a list of
1352
+ * trusted keys.
1353
+ * @param {Uint8Array} arg0
1354
+ */
1572
1355
  set verification_key(arg0) {
1573
1356
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1574
1357
  const len0 = WASM_VECTOR_LEN;
1575
1358
  wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1576
1359
  }
1577
1360
  /**
1578
- * The concatenation of two digests:
1579
- * (eip712_signing_hash(pk, domain) || ciphertext digest).
1580
- * This is needed to ensure the response corresponds to the request.
1581
- * @returns {Uint8Array}
1582
- */
1361
+ * The concatenation of two digests:
1362
+ * (eip712_signing_hash(pk, domain) || ciphertext digest).
1363
+ * This is needed to ensure the response corresponds to the request.
1364
+ * @returns {Uint8Array}
1365
+ */
1583
1366
  get digest() {
1584
- try {
1585
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1586
- wasm.__wbg_get_reencryptionrequestpayload_enc_key(retptr, this.__wbg_ptr);
1587
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1588
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1589
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
1590
- wasm.__wbindgen_free(r0, r1 * 1, 1);
1591
- return v1;
1592
- } finally {
1593
- wasm.__wbindgen_add_to_stack_pointer(16);
1594
- }
1367
+ const ret = wasm.__wbg_get_reencryptionresponsepayload_digest(this.__wbg_ptr);
1368
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1369
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1370
+ return v1;
1595
1371
  }
1596
1372
  /**
1597
- * The concatenation of two digests:
1598
- * (eip712_signing_hash(pk, domain) || ciphertext digest).
1599
- * This is needed to ensure the response corresponds to the request.
1600
- * @param {Uint8Array} arg0
1601
- */
1373
+ * The concatenation of two digests:
1374
+ * (eip712_signing_hash(pk, domain) || ciphertext digest).
1375
+ * This is needed to ensure the response corresponds to the request.
1376
+ * @param {Uint8Array} arg0
1377
+ */
1602
1378
  set digest(arg0) {
1603
1379
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1604
1380
  const len0 = WASM_VECTOR_LEN;
1605
1381
  wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1606
1382
  }
1607
1383
  /**
1608
- * The type of plaintext encrypted.
1609
- * @returns {number}
1610
- */
1384
+ * The type of plaintext encrypted.
1385
+ * @returns {number}
1386
+ */
1611
1387
  get fhe_type() {
1612
1388
  const ret = wasm.__wbg_get_reencryptionresponsepayload_fhe_type(this.__wbg_ptr);
1613
1389
  return ret;
1614
1390
  }
1615
1391
  /**
1616
- * The type of plaintext encrypted.
1617
- * @param {number} arg0
1618
- */
1392
+ * The type of plaintext encrypted.
1393
+ * @param {number} arg0
1394
+ */
1619
1395
  set fhe_type(arg0) {
1620
1396
  wasm.__wbg_set_reencryptionresponsepayload_fhe_type(this.__wbg_ptr, arg0);
1621
1397
  }
1622
1398
  /**
1623
- * The signcrypted payload, using a hybrid encryption approach in
1624
- * sign-then-encrypt.
1625
- * @returns {Uint8Array}
1626
- */
1399
+ * The signcrypted payload, using a hybrid encryption approach in
1400
+ * sign-then-encrypt.
1401
+ * @returns {Uint8Array}
1402
+ */
1627
1403
  get signcrypted_ciphertext() {
1628
- try {
1629
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1630
- wasm.__wbg_get_eip712domainmsg_chain_id(retptr, this.__wbg_ptr);
1631
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1632
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1633
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
1634
- wasm.__wbindgen_free(r0, r1 * 1, 1);
1635
- return v1;
1636
- } finally {
1637
- wasm.__wbindgen_add_to_stack_pointer(16);
1638
- }
1404
+ const ret = wasm.__wbg_get_reencryptionresponsepayload_signcrypted_ciphertext(this.__wbg_ptr);
1405
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1406
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1407
+ return v1;
1639
1408
  }
1640
1409
  /**
1641
- * The signcrypted payload, using a hybrid encryption approach in
1642
- * sign-then-encrypt.
1643
- * @param {Uint8Array} arg0
1644
- */
1410
+ * The signcrypted payload, using a hybrid encryption approach in
1411
+ * sign-then-encrypt.
1412
+ * @param {Uint8Array} arg0
1413
+ */
1645
1414
  set signcrypted_ciphertext(arg0) {
1646
1415
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1647
1416
  const len0 = WASM_VECTOR_LEN;
1648
1417
  wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
1649
1418
  }
1650
1419
  /**
1651
- * The ID of the MPC party doing the reencryption. Used for polynomial
1652
- * reconstruction.
1653
- * @returns {number}
1654
- */
1420
+ * The ID of the MPC party doing the reencryption. Used for polynomial
1421
+ * reconstruction.
1422
+ * @returns {number}
1423
+ */
1655
1424
  get party_id() {
1656
1425
  const ret = wasm.__wbg_get_reencryptionresponsepayload_party_id(this.__wbg_ptr);
1657
1426
  return ret >>> 0;
1658
1427
  }
1659
1428
  /**
1660
- * The ID of the MPC party doing the reencryption. Used for polynomial
1661
- * reconstruction.
1662
- * @param {number} arg0
1663
- */
1429
+ * The ID of the MPC party doing the reencryption. Used for polynomial
1430
+ * reconstruction.
1431
+ * @param {number} arg0
1432
+ */
1664
1433
  set party_id(arg0) {
1665
1434
  wasm.__wbg_set_reencryptionresponsepayload_party_id(this.__wbg_ptr, arg0);
1666
1435
  }
1667
1436
  /**
1668
- * The degree of the sharing scheme used.
1669
- * @returns {number}
1670
- */
1437
+ * The degree of the sharing scheme used.
1438
+ * @returns {number}
1439
+ */
1671
1440
  get degree() {
1672
1441
  const ret = wasm.__wbg_get_reencryptionresponsepayload_degree(this.__wbg_ptr);
1673
1442
  return ret >>> 0;
1674
1443
  }
1675
1444
  /**
1676
- * The degree of the sharing scheme used.
1677
- * @param {number} arg0
1678
- */
1445
+ * The degree of the sharing scheme used.
1446
+ * @param {number} arg0
1447
+ */
1679
1448
  set degree(arg0) {
1680
1449
  wasm.__wbg_set_reencryptionresponsepayload_degree(this.__wbg_ptr, arg0);
1681
1450
  }
@@ -1686,9 +1455,9 @@ const RequestIdFinalization = (typeof FinalizationRegistry === 'undefined')
1686
1455
  ? { register: () => {}, unregister: () => {} }
1687
1456
  : new FinalizationRegistry(ptr => wasm.__wbg_requestid_free(ptr >>> 0, 1));
1688
1457
  /**
1689
- * Simple response to return an ID, to be used to retrieve the computed result
1690
- * later on.
1691
- */
1458
+ * Simple response to return an ID, to be used to retrieve the computed result
1459
+ * later on.
1460
+ */
1692
1461
  class RequestId {
1693
1462
 
1694
1463
  static __wrap(ptr) {
@@ -1711,27 +1480,23 @@ class RequestId {
1711
1480
  wasm.__wbg_requestid_free(ptr, 0);
1712
1481
  }
1713
1482
  /**
1714
- * @returns {string}
1715
- */
1483
+ * @returns {string}
1484
+ */
1716
1485
  get request_id() {
1717
1486
  let deferred1_0;
1718
1487
  let deferred1_1;
1719
1488
  try {
1720
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1721
- wasm.__wbg_get_eip712domainmsg_name(retptr, this.__wbg_ptr);
1722
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1723
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1724
- deferred1_0 = r0;
1725
- deferred1_1 = r1;
1726
- return getStringFromWasm0(r0, r1);
1489
+ const ret = wasm.__wbg_get_requestid_request_id(this.__wbg_ptr);
1490
+ deferred1_0 = ret[0];
1491
+ deferred1_1 = ret[1];
1492
+ return getStringFromWasm0(ret[0], ret[1]);
1727
1493
  } finally {
1728
- wasm.__wbindgen_add_to_stack_pointer(16);
1729
1494
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1730
1495
  }
1731
1496
  }
1732
1497
  /**
1733
- * @param {string} arg0
1734
- */
1498
+ * @param {string} arg0
1499
+ */
1735
1500
  set request_id(arg0) {
1736
1501
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1737
1502
  const len0 = WASM_VECTOR_LEN;
@@ -1742,37 +1507,23 @@ module.exports.RequestId = RequestId;
1742
1507
 
1743
1508
  module.exports.__wbindgen_error_new = function(arg0, arg1) {
1744
1509
  const ret = new Error(getStringFromWasm0(arg0, arg1));
1745
- return addHeapObject(ret);
1746
- };
1747
-
1748
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
1749
- takeObject(arg0);
1750
- };
1751
-
1752
- module.exports.__wbg_publicsigkey_new = function(arg0) {
1753
- const ret = PublicSigKey.__wrap(arg0);
1754
- return addHeapObject(ret);
1510
+ return ret;
1755
1511
  };
1756
1512
 
1757
1513
  module.exports.__wbindgen_number_get = function(arg0, arg1) {
1758
- const obj = getObject(arg1);
1514
+ const obj = arg1;
1759
1515
  const ret = typeof(obj) === 'number' ? obj : undefined;
1760
1516
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1761
1517
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1762
1518
  };
1763
1519
 
1764
- module.exports.__wbg_publicsigkey_unwrap = function(arg0) {
1765
- const ret = PublicSigKey.__unwrap(takeObject(arg0));
1766
- return ret;
1767
- };
1768
-
1769
1520
  module.exports.__wbg_reencryptionresponse_unwrap = function(arg0) {
1770
- const ret = ReencryptionResponse.__unwrap(takeObject(arg0));
1521
+ const ret = ReencryptionResponse.__unwrap(arg0);
1771
1522
  return ret;
1772
1523
  };
1773
1524
 
1774
1525
  module.exports.__wbindgen_string_get = function(arg0, arg1) {
1775
- const obj = getObject(arg1);
1526
+ const obj = arg1;
1776
1527
  const ret = typeof(obj) === 'string' ? obj : undefined;
1777
1528
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1778
1529
  var len1 = WASM_VECTOR_LEN;
@@ -1781,72 +1532,67 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
1781
1532
  };
1782
1533
 
1783
1534
  module.exports.__wbindgen_is_object = function(arg0) {
1784
- const val = getObject(arg0);
1535
+ const val = arg0;
1785
1536
  const ret = typeof(val) === 'object' && val !== null;
1786
1537
  return ret;
1787
1538
  };
1788
1539
 
1789
1540
  module.exports.__wbindgen_is_undefined = function(arg0) {
1790
- const ret = getObject(arg0) === undefined;
1541
+ const ret = arg0 === undefined;
1791
1542
  return ret;
1792
1543
  };
1793
1544
 
1794
1545
  module.exports.__wbindgen_in = function(arg0, arg1) {
1795
- const ret = getObject(arg0) in getObject(arg1);
1546
+ const ret = arg0 in arg1;
1796
1547
  return ret;
1797
1548
  };
1798
1549
 
1799
1550
  module.exports.__wbindgen_is_null = function(arg0) {
1800
- const ret = getObject(arg0) === null;
1551
+ const ret = arg0 === null;
1801
1552
  return ret;
1802
1553
  };
1803
1554
 
1804
1555
  module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
1805
- const ret = getObject(arg0) == getObject(arg1);
1556
+ const ret = arg0 == arg1;
1806
1557
  return ret;
1807
1558
  };
1808
1559
 
1809
1560
  module.exports.__wbindgen_boolean_get = function(arg0) {
1810
- const v = getObject(arg0);
1561
+ const v = arg0;
1811
1562
  const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1812
1563
  return ret;
1813
1564
  };
1814
1565
 
1815
1566
  module.exports.__wbindgen_as_number = function(arg0) {
1816
- const ret = +getObject(arg0);
1567
+ const ret = +arg0;
1817
1568
  return ret;
1818
1569
  };
1819
1570
 
1820
1571
  module.exports.__wbg_String_b9412f8799faab3e = function(arg0, arg1) {
1821
- const ret = String(getObject(arg1));
1572
+ const ret = String(arg1);
1822
1573
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1823
1574
  const len1 = WASM_VECTOR_LEN;
1824
1575
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1825
1576
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1826
1577
  };
1827
1578
 
1828
- module.exports.__wbindgen_object_clone_ref = function(arg0) {
1829
- const ret = getObject(arg0);
1830
- return addHeapObject(ret);
1831
- };
1832
-
1833
1579
  module.exports.__wbindgen_string_new = function(arg0, arg1) {
1834
1580
  const ret = getStringFromWasm0(arg0, arg1);
1835
- return addHeapObject(ret);
1581
+ return ret;
1836
1582
  };
1837
1583
 
1838
1584
  module.exports.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
1839
- const ret = getObject(arg0)[getObject(arg1)];
1840
- return addHeapObject(ret);
1585
+ const ret = arg0[arg1];
1586
+ return ret;
1841
1587
  };
1842
1588
 
1843
1589
  module.exports.__wbg_new_abda76e883ba8a5f = function() {
1844
1590
  const ret = new Error();
1845
- return addHeapObject(ret);
1591
+ return ret;
1846
1592
  };
1847
1593
 
1848
1594
  module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
1849
- const ret = getObject(arg1).stack;
1595
+ const ret = arg1.stack;
1850
1596
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1851
1597
  const len1 = WASM_VECTOR_LEN;
1852
1598
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
@@ -1866,132 +1612,132 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
1866
1612
  };
1867
1613
 
1868
1614
  module.exports.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
1869
- const ret = getObject(arg0).crypto;
1870
- return addHeapObject(ret);
1615
+ const ret = arg0.crypto;
1616
+ return ret;
1871
1617
  };
1872
1618
 
1873
1619
  module.exports.__wbg_process_4a72847cc503995b = function(arg0) {
1874
- const ret = getObject(arg0).process;
1875
- return addHeapObject(ret);
1620
+ const ret = arg0.process;
1621
+ return ret;
1876
1622
  };
1877
1623
 
1878
1624
  module.exports.__wbg_versions_f686565e586dd935 = function(arg0) {
1879
- const ret = getObject(arg0).versions;
1880
- return addHeapObject(ret);
1625
+ const ret = arg0.versions;
1626
+ return ret;
1881
1627
  };
1882
1628
 
1883
1629
  module.exports.__wbg_node_104a2ff8d6ea03a2 = function(arg0) {
1884
- const ret = getObject(arg0).node;
1885
- return addHeapObject(ret);
1630
+ const ret = arg0.node;
1631
+ return ret;
1886
1632
  };
1887
1633
 
1888
1634
  module.exports.__wbindgen_is_string = function(arg0) {
1889
- const ret = typeof(getObject(arg0)) === 'string';
1635
+ const ret = typeof(arg0) === 'string';
1890
1636
  return ret;
1891
1637
  };
1892
1638
 
1893
1639
  module.exports.__wbg_require_cca90b1a94a0255b = function() { return handleError(function () {
1894
1640
  const ret = module.require;
1895
- return addHeapObject(ret);
1641
+ return ret;
1896
1642
  }, arguments) };
1897
1643
 
1898
1644
  module.exports.__wbindgen_is_function = function(arg0) {
1899
- const ret = typeof(getObject(arg0)) === 'function';
1645
+ const ret = typeof(arg0) === 'function';
1900
1646
  return ret;
1901
1647
  };
1902
1648
 
1903
1649
  module.exports.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
1904
- const ret = getObject(arg0).msCrypto;
1905
- return addHeapObject(ret);
1650
+ const ret = arg0.msCrypto;
1651
+ return ret;
1906
1652
  };
1907
1653
 
1908
1654
  module.exports.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
1909
- getObject(arg0).randomFillSync(takeObject(arg1));
1655
+ arg0.randomFillSync(arg1);
1910
1656
  }, arguments) };
1911
1657
 
1912
1658
  module.exports.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
1913
- getObject(arg0).getRandomValues(getObject(arg1));
1659
+ arg0.getRandomValues(arg1);
1914
1660
  }, arguments) };
1915
1661
 
1916
- module.exports.__wbg_get_3baa728f9d58d3f6 = function(arg0, arg1) {
1917
- const ret = getObject(arg0)[arg1 >>> 0];
1918
- return addHeapObject(ret);
1662
+ module.exports.__wbg_get_5419cf6b954aa11d = function(arg0, arg1) {
1663
+ const ret = arg0[arg1 >>> 0];
1664
+ return ret;
1919
1665
  };
1920
1666
 
1921
- module.exports.__wbg_length_ae22078168b726f5 = function(arg0) {
1922
- const ret = getObject(arg0).length;
1667
+ module.exports.__wbg_length_f217bbbf7e8e4df4 = function(arg0) {
1668
+ const ret = arg0.length;
1923
1669
  return ret;
1924
1670
  };
1925
1671
 
1926
- module.exports.__wbg_newnoargs_76313bd6ff35d0f2 = function(arg0, arg1) {
1672
+ module.exports.__wbg_newnoargs_1ede4bf2ebbaaf43 = function(arg0, arg1) {
1927
1673
  const ret = new Function(getStringFromWasm0(arg0, arg1));
1928
- return addHeapObject(ret);
1674
+ return ret;
1929
1675
  };
1930
1676
 
1931
- module.exports.__wbg_next_de3e9db4440638b2 = function(arg0) {
1932
- const ret = getObject(arg0).next;
1933
- return addHeapObject(ret);
1677
+ module.exports.__wbg_next_13b477da1eaa3897 = function(arg0) {
1678
+ const ret = arg0.next;
1679
+ return ret;
1934
1680
  };
1935
1681
 
1936
- module.exports.__wbg_next_f9cb570345655b9a = function() { return handleError(function (arg0) {
1937
- const ret = getObject(arg0).next();
1938
- return addHeapObject(ret);
1682
+ module.exports.__wbg_next_b06e115d1b01e10b = function() { return handleError(function (arg0) {
1683
+ const ret = arg0.next();
1684
+ return ret;
1939
1685
  }, arguments) };
1940
1686
 
1941
- module.exports.__wbg_done_bfda7aa8f252b39f = function(arg0) {
1942
- const ret = getObject(arg0).done;
1687
+ module.exports.__wbg_done_983b5ffcaec8c583 = function(arg0) {
1688
+ const ret = arg0.done;
1943
1689
  return ret;
1944
1690
  };
1945
1691
 
1946
- module.exports.__wbg_value_6d39332ab4788d86 = function(arg0) {
1947
- const ret = getObject(arg0).value;
1948
- return addHeapObject(ret);
1692
+ module.exports.__wbg_value_2ab8a198c834c26a = function(arg0) {
1693
+ const ret = arg0.value;
1694
+ return ret;
1949
1695
  };
1950
1696
 
1951
- module.exports.__wbg_iterator_888179a48810a9fe = function() {
1697
+ module.exports.__wbg_iterator_695d699a44d6234c = function() {
1952
1698
  const ret = Symbol.iterator;
1953
- return addHeapObject(ret);
1699
+ return ret;
1954
1700
  };
1955
1701
 
1956
- module.exports.__wbg_get_224d16597dbbfd96 = function() { return handleError(function (arg0, arg1) {
1957
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
1958
- return addHeapObject(ret);
1702
+ module.exports.__wbg_get_ef828680c64da212 = function() { return handleError(function (arg0, arg1) {
1703
+ const ret = Reflect.get(arg0, arg1);
1704
+ return ret;
1959
1705
  }, arguments) };
1960
1706
 
1961
- module.exports.__wbg_call_1084a111329e68ce = function() { return handleError(function (arg0, arg1) {
1962
- const ret = getObject(arg0).call(getObject(arg1));
1963
- return addHeapObject(ret);
1707
+ module.exports.__wbg_call_a9ef466721e824f2 = function() { return handleError(function (arg0, arg1) {
1708
+ const ret = arg0.call(arg1);
1709
+ return ret;
1964
1710
  }, arguments) };
1965
1711
 
1966
- module.exports.__wbg_self_3093d5d1f7bcb682 = function() { return handleError(function () {
1712
+ module.exports.__wbg_self_bf91bf94d9e04084 = function() { return handleError(function () {
1967
1713
  const ret = self.self;
1968
- return addHeapObject(ret);
1714
+ return ret;
1969
1715
  }, arguments) };
1970
1716
 
1971
- module.exports.__wbg_window_3bcfc4d31bc012f8 = function() { return handleError(function () {
1717
+ module.exports.__wbg_window_52dd9f07d03fd5f8 = function() { return handleError(function () {
1972
1718
  const ret = window.window;
1973
- return addHeapObject(ret);
1719
+ return ret;
1974
1720
  }, arguments) };
1975
1721
 
1976
- module.exports.__wbg_globalThis_86b222e13bdf32ed = function() { return handleError(function () {
1722
+ module.exports.__wbg_globalThis_05c129bf37fcf1be = function() { return handleError(function () {
1977
1723
  const ret = globalThis.globalThis;
1978
- return addHeapObject(ret);
1724
+ return ret;
1979
1725
  }, arguments) };
1980
1726
 
1981
- module.exports.__wbg_global_e5a3fe56f8be9485 = function() { return handleError(function () {
1727
+ module.exports.__wbg_global_3eca19bb09e9c484 = function() { return handleError(function () {
1982
1728
  const ret = global.global;
1983
- return addHeapObject(ret);
1729
+ return ret;
1984
1730
  }, arguments) };
1985
1731
 
1986
- module.exports.__wbg_isArray_8364a5371e9737d8 = function(arg0) {
1987
- const ret = Array.isArray(getObject(arg0));
1732
+ module.exports.__wbg_isArray_6f3b47f09adb61b5 = function(arg0) {
1733
+ const ret = Array.isArray(arg0);
1988
1734
  return ret;
1989
1735
  };
1990
1736
 
1991
- module.exports.__wbg_instanceof_ArrayBuffer_61dfc3198373c902 = function(arg0) {
1737
+ module.exports.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function(arg0) {
1992
1738
  let result;
1993
1739
  try {
1994
- result = getObject(arg0) instanceof ArrayBuffer;
1740
+ result = arg0 instanceof ArrayBuffer;
1995
1741
  } catch (_) {
1996
1742
  result = false;
1997
1743
  }
@@ -1999,44 +1745,44 @@ module.exports.__wbg_instanceof_ArrayBuffer_61dfc3198373c902 = function(arg0) {
1999
1745
  return ret;
2000
1746
  };
2001
1747
 
2002
- module.exports.__wbg_call_89af060b4e1523f2 = function() { return handleError(function (arg0, arg1, arg2) {
2003
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
2004
- return addHeapObject(ret);
1748
+ module.exports.__wbg_call_3bfa248576352471 = function() { return handleError(function (arg0, arg1, arg2) {
1749
+ const ret = arg0.call(arg1, arg2);
1750
+ return ret;
2005
1751
  }, arguments) };
2006
1752
 
2007
- module.exports.__wbg_isSafeInteger_7f1ed56200d90674 = function(arg0) {
2008
- const ret = Number.isSafeInteger(getObject(arg0));
1753
+ module.exports.__wbg_isSafeInteger_b9dff570f01a9100 = function(arg0) {
1754
+ const ret = Number.isSafeInteger(arg0);
2009
1755
  return ret;
2010
1756
  };
2011
1757
 
2012
- module.exports.__wbg_buffer_b7b08af79b0b0974 = function(arg0) {
2013
- const ret = getObject(arg0).buffer;
2014
- return addHeapObject(ret);
1758
+ module.exports.__wbg_buffer_ccaed51a635d8a2d = function(arg0) {
1759
+ const ret = arg0.buffer;
1760
+ return ret;
2015
1761
  };
2016
1762
 
2017
- module.exports.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9 = function(arg0, arg1, arg2) {
2018
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
2019
- return addHeapObject(ret);
1763
+ module.exports.__wbg_newwithbyteoffsetandlength_7e3eb787208af730 = function(arg0, arg1, arg2) {
1764
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1765
+ return ret;
2020
1766
  };
2021
1767
 
2022
- module.exports.__wbg_new_ea1883e1e5e86686 = function(arg0) {
2023
- const ret = new Uint8Array(getObject(arg0));
2024
- return addHeapObject(ret);
1768
+ module.exports.__wbg_new_fec2611eb9180f95 = function(arg0) {
1769
+ const ret = new Uint8Array(arg0);
1770
+ return ret;
2025
1771
  };
2026
1772
 
2027
- module.exports.__wbg_set_d1e79e2388520f18 = function(arg0, arg1, arg2) {
2028
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1773
+ module.exports.__wbg_set_ec2fcf81bc573fd9 = function(arg0, arg1, arg2) {
1774
+ arg0.set(arg1, arg2 >>> 0);
2029
1775
  };
2030
1776
 
2031
- module.exports.__wbg_length_8339fcf5d8ecd12e = function(arg0) {
2032
- const ret = getObject(arg0).length;
1777
+ module.exports.__wbg_length_9254c4bd3b9f23c4 = function(arg0) {
1778
+ const ret = arg0.length;
2033
1779
  return ret;
2034
1780
  };
2035
1781
 
2036
- module.exports.__wbg_instanceof_Uint8Array_247a91427532499e = function(arg0) {
1782
+ module.exports.__wbg_instanceof_Uint8Array_df0761410414ef36 = function(arg0) {
2037
1783
  let result;
2038
1784
  try {
2039
- result = getObject(arg0) instanceof Uint8Array;
1785
+ result = arg0 instanceof Uint8Array;
2040
1786
  } catch (_) {
2041
1787
  result = false;
2042
1788
  }
@@ -2044,18 +1790,18 @@ module.exports.__wbg_instanceof_Uint8Array_247a91427532499e = function(arg0) {
2044
1790
  return ret;
2045
1791
  };
2046
1792
 
2047
- module.exports.__wbg_newwithlength_ec548f448387c968 = function(arg0) {
1793
+ module.exports.__wbg_newwithlength_76462a666eca145f = function(arg0) {
2048
1794
  const ret = new Uint8Array(arg0 >>> 0);
2049
- return addHeapObject(ret);
1795
+ return ret;
2050
1796
  };
2051
1797
 
2052
- module.exports.__wbg_subarray_7c2e3576afe181d1 = function(arg0, arg1, arg2) {
2053
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
2054
- return addHeapObject(ret);
1798
+ module.exports.__wbg_subarray_975a06f9dbd16995 = function(arg0, arg1, arg2) {
1799
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1800
+ return ret;
2055
1801
  };
2056
1802
 
2057
1803
  module.exports.__wbindgen_debug_string = function(arg0, arg1) {
2058
- const ret = debugString(getObject(arg1));
1804
+ const ret = debugString(arg1);
2059
1805
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2060
1806
  const len1 = WASM_VECTOR_LEN;
2061
1807
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
@@ -2068,7 +1814,18 @@ module.exports.__wbindgen_throw = function(arg0, arg1) {
2068
1814
 
2069
1815
  module.exports.__wbindgen_memory = function() {
2070
1816
  const ret = wasm.memory;
2071
- return addHeapObject(ret);
1817
+ return ret;
1818
+ };
1819
+
1820
+ module.exports.__wbindgen_init_externref_table = function() {
1821
+ const table = wasm.__wbindgen_export_2;
1822
+ const offset = table.grow(4);
1823
+ table.set(0, undefined);
1824
+ table.set(offset + 0, undefined);
1825
+ table.set(offset + 1, null);
1826
+ table.set(offset + 2, true);
1827
+ table.set(offset + 3, false);
1828
+ ;
2072
1829
  };
2073
1830
 
2074
1831
  const path = require('path').join(__dirname, 'kms_lib_bg.wasm');
@@ -2079,3 +1836,5 @@ const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
2079
1836
  wasm = wasmInstance.exports;
2080
1837
  module.exports.__wasm = wasm;
2081
1838
 
1839
+ wasm.__wbindgen_start();
1840
+