node-tkms 0.9.0-rc5 → 0.9.1-rc1

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