tkms 0.11.0-rc9 → 0.11.0
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.d.ts +209 -174
- package/kms_lib.js +606 -517
- package/kms_lib_bg.wasm +0 -0
- package/package.json +1 -1
package/kms_lib.js
CHANGED
|
@@ -166,6 +166,21 @@ function debugString(val) {
|
|
|
166
166
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
167
167
|
return className;
|
|
168
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* @returns {number}
|
|
171
|
+
*/
|
|
172
|
+
export function ml_kem_pke_pk_len() {
|
|
173
|
+
const ret = wasm.ml_kem_pke_pk_len();
|
|
174
|
+
return ret >>> 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* @returns {number}
|
|
179
|
+
*/
|
|
180
|
+
export function ml_kem_pke_sk_len() {
|
|
181
|
+
const ret = wasm.ml_kem_pke_sk_len();
|
|
182
|
+
return ret >>> 0;
|
|
183
|
+
}
|
|
169
184
|
|
|
170
185
|
function _assertClass(instance, klass) {
|
|
171
186
|
if (!(instance instanceof klass)) {
|
|
@@ -244,6 +259,23 @@ export function u8vec_to_private_sig_key(v) {
|
|
|
244
259
|
return PrivateSigKey.__wrap(ret[0]);
|
|
245
260
|
}
|
|
246
261
|
|
|
262
|
+
/**
|
|
263
|
+
* Create a new [ServerIdAddr] structure that holds an ID and an address
|
|
264
|
+
* which must be a valid EIP-55 address, notably prefixed with "0x".
|
|
265
|
+
* @param {number} id
|
|
266
|
+
* @param {string} addr
|
|
267
|
+
* @returns {ServerIdAddr}
|
|
268
|
+
*/
|
|
269
|
+
export function new_server_id_addr(id, addr) {
|
|
270
|
+
const ptr0 = passStringToWasm0(addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
271
|
+
const len0 = WASM_VECTOR_LEN;
|
|
272
|
+
const ret = wasm.new_server_id_addr(id, ptr0, len0);
|
|
273
|
+
if (ret[2]) {
|
|
274
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
275
|
+
}
|
|
276
|
+
return ServerIdAddr.__wrap(ret[0]);
|
|
277
|
+
}
|
|
278
|
+
|
|
247
279
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
248
280
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
249
281
|
for (let i = 0; i < array.length; i++) {
|
|
@@ -256,15 +288,15 @@ function passArrayJsValueToWasm0(array, malloc) {
|
|
|
256
288
|
/**
|
|
257
289
|
* Instantiate a new client.
|
|
258
290
|
*
|
|
259
|
-
* * `server_addrs` - a list of KMS server EIP-55 addresses,
|
|
260
|
-
*
|
|
291
|
+
* * `server_addrs` - a list of KMS server ID with EIP-55 addresses,
|
|
292
|
+
* the elements in the list can be created using [new_server_id_addr].
|
|
261
293
|
*
|
|
262
294
|
* * `client_address_hex` - the client (wallet) address in hex,
|
|
263
295
|
* must be prefixed with "0x".
|
|
264
296
|
*
|
|
265
297
|
* * `fhe_parameter` - the parameter choice, which can be either `"test"` or `"default"`.
|
|
266
298
|
* The "default" parameter choice is selected if no matching string is found.
|
|
267
|
-
* @param {
|
|
299
|
+
* @param {ServerIdAddr[]} server_addrs
|
|
268
300
|
* @param {string} client_address_hex
|
|
269
301
|
* @param {string} fhe_parameter
|
|
270
302
|
* @returns {Client}
|
|
@@ -295,7 +327,7 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
295
327
|
}
|
|
296
328
|
/**
|
|
297
329
|
* @param {Client} client
|
|
298
|
-
* @returns {
|
|
330
|
+
* @returns {ServerIdAddr[]}
|
|
299
331
|
*/
|
|
300
332
|
export function get_server_addrs(client) {
|
|
301
333
|
_assertClass(client, Client);
|
|
@@ -334,30 +366,30 @@ export function get_client_address(client) {
|
|
|
334
366
|
}
|
|
335
367
|
|
|
336
368
|
/**
|
|
337
|
-
* @returns {
|
|
369
|
+
* @returns {PrivateEncKeyMlKem512}
|
|
338
370
|
*/
|
|
339
|
-
export function
|
|
340
|
-
const ret = wasm.
|
|
341
|
-
return
|
|
371
|
+
export function ml_kem_pke_keygen() {
|
|
372
|
+
const ret = wasm.ml_kem_pke_keygen();
|
|
373
|
+
return PrivateEncKeyMlKem512.__wrap(ret);
|
|
342
374
|
}
|
|
343
375
|
|
|
344
376
|
/**
|
|
345
|
-
* @param {
|
|
346
|
-
* @returns {
|
|
377
|
+
* @param {PrivateEncKeyMlKem512} sk
|
|
378
|
+
* @returns {PublicEncKeyMlKem512}
|
|
347
379
|
*/
|
|
348
|
-
export function
|
|
349
|
-
_assertClass(sk,
|
|
350
|
-
const ret = wasm.
|
|
351
|
-
return
|
|
380
|
+
export function ml_kem_pke_get_pk(sk) {
|
|
381
|
+
_assertClass(sk, PrivateEncKeyMlKem512);
|
|
382
|
+
const ret = wasm.ml_kem_pke_get_pk(sk.__wbg_ptr);
|
|
383
|
+
return PublicEncKeyMlKem512.__wrap(ret);
|
|
352
384
|
}
|
|
353
385
|
|
|
354
386
|
/**
|
|
355
|
-
* @param {
|
|
387
|
+
* @param {PublicEncKeyMlKem512} pk
|
|
356
388
|
* @returns {Uint8Array}
|
|
357
389
|
*/
|
|
358
|
-
export function
|
|
359
|
-
_assertClass(pk,
|
|
360
|
-
const ret = wasm.
|
|
390
|
+
export function ml_kem_pke_pk_to_u8vec(pk) {
|
|
391
|
+
_assertClass(pk, PublicEncKeyMlKem512);
|
|
392
|
+
const ret = wasm.ml_kem_pke_pk_to_u8vec(pk.__wbg_ptr);
|
|
361
393
|
if (ret[3]) {
|
|
362
394
|
throw takeFromExternrefTable0(ret[2]);
|
|
363
395
|
}
|
|
@@ -367,12 +399,12 @@ export function cryptobox_pk_to_u8vec(pk) {
|
|
|
367
399
|
}
|
|
368
400
|
|
|
369
401
|
/**
|
|
370
|
-
* @param {
|
|
402
|
+
* @param {PrivateEncKeyMlKem512} sk
|
|
371
403
|
* @returns {Uint8Array}
|
|
372
404
|
*/
|
|
373
|
-
export function
|
|
374
|
-
_assertClass(sk,
|
|
375
|
-
const ret = wasm.
|
|
405
|
+
export function ml_kem_pke_sk_to_u8vec(sk) {
|
|
406
|
+
_assertClass(sk, PrivateEncKeyMlKem512);
|
|
407
|
+
const ret = wasm.ml_kem_pke_sk_to_u8vec(sk.__wbg_ptr);
|
|
376
408
|
if (ret[3]) {
|
|
377
409
|
throw takeFromExternrefTable0(ret[2]);
|
|
378
410
|
}
|
|
@@ -383,71 +415,75 @@ export function cryptobox_sk_to_u8vec(sk) {
|
|
|
383
415
|
|
|
384
416
|
/**
|
|
385
417
|
* @param {Uint8Array} v
|
|
386
|
-
* @returns {
|
|
418
|
+
* @returns {PublicEncKeyMlKem512}
|
|
387
419
|
*/
|
|
388
|
-
export function
|
|
420
|
+
export function u8vec_to_ml_kem_pke_pk(v) {
|
|
389
421
|
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
390
422
|
const len0 = WASM_VECTOR_LEN;
|
|
391
|
-
const ret = wasm.
|
|
423
|
+
const ret = wasm.u8vec_to_ml_kem_pke_pk(ptr0, len0);
|
|
392
424
|
if (ret[2]) {
|
|
393
425
|
throw takeFromExternrefTable0(ret[1]);
|
|
394
426
|
}
|
|
395
|
-
return
|
|
427
|
+
return PublicEncKeyMlKem512.__wrap(ret[0]);
|
|
396
428
|
}
|
|
397
429
|
|
|
398
430
|
/**
|
|
399
431
|
* @param {Uint8Array} v
|
|
400
|
-
* @returns {
|
|
432
|
+
* @returns {PrivateEncKeyMlKem512}
|
|
401
433
|
*/
|
|
402
|
-
export function
|
|
434
|
+
export function u8vec_to_ml_kem_pke_sk(v) {
|
|
403
435
|
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
404
436
|
const len0 = WASM_VECTOR_LEN;
|
|
405
|
-
const ret = wasm.
|
|
437
|
+
const ret = wasm.u8vec_to_ml_kem_pke_sk(ptr0, len0);
|
|
406
438
|
if (ret[2]) {
|
|
407
439
|
throw takeFromExternrefTable0(ret[1]);
|
|
408
440
|
}
|
|
409
|
-
return
|
|
441
|
+
return PrivateEncKeyMlKem512.__wrap(ret[0]);
|
|
410
442
|
}
|
|
411
443
|
|
|
412
444
|
/**
|
|
445
|
+
* This function is *not* used by relayer-sdk because the encryption
|
|
446
|
+
* happens on the KMS side. It's just here for completeness and tests.
|
|
413
447
|
* @param {Uint8Array} msg
|
|
414
|
-
* @param {
|
|
415
|
-
* @
|
|
416
|
-
* @returns {CryptoBoxCt}
|
|
448
|
+
* @param {PublicEncKeyMlKem512} their_pk
|
|
449
|
+
* @returns {Uint8Array}
|
|
417
450
|
*/
|
|
418
|
-
export function
|
|
451
|
+
export function ml_kem_pke_encrypt(msg, their_pk) {
|
|
419
452
|
const ptr0 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
|
|
420
453
|
const len0 = WASM_VECTOR_LEN;
|
|
421
|
-
_assertClass(their_pk,
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
454
|
+
_assertClass(their_pk, PublicEncKeyMlKem512);
|
|
455
|
+
const ret = wasm.ml_kem_pke_encrypt(ptr0, len0, their_pk.__wbg_ptr);
|
|
456
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
457
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
458
|
+
return v2;
|
|
425
459
|
}
|
|
426
460
|
|
|
427
461
|
/**
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
*
|
|
462
|
+
* This function is *not* used by relayer-sdk because the decryption
|
|
463
|
+
* is handled by [process_user_decryption_resp].
|
|
464
|
+
* It's just here for completeness and tests.
|
|
465
|
+
* @param {Uint8Array} ct
|
|
466
|
+
* @param {PrivateEncKeyMlKem512} my_sk
|
|
431
467
|
* @returns {Uint8Array}
|
|
432
468
|
*/
|
|
433
|
-
export function
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
_assertClass(
|
|
437
|
-
const ret = wasm.
|
|
438
|
-
var
|
|
469
|
+
export function ml_kem_pke_decrypt(ct, my_sk) {
|
|
470
|
+
const ptr0 = passArray8ToWasm0(ct, wasm.__wbindgen_malloc);
|
|
471
|
+
const len0 = WASM_VECTOR_LEN;
|
|
472
|
+
_assertClass(my_sk, PrivateEncKeyMlKem512);
|
|
473
|
+
const ret = wasm.ml_kem_pke_decrypt(ptr0, len0, my_sk.__wbg_ptr);
|
|
474
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
439
475
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
440
|
-
return
|
|
476
|
+
return v2;
|
|
441
477
|
}
|
|
442
478
|
|
|
443
479
|
/**
|
|
444
|
-
* Process the
|
|
480
|
+
* Process the user_decryption response from JavaScript objects.
|
|
445
481
|
* The returned result is a byte array representing a plaintext of any length,
|
|
446
482
|
* postprocessing is returned to turn it into an integer.
|
|
447
483
|
*
|
|
448
|
-
* * `client` - client that wants to perform
|
|
484
|
+
* * `client` - client that wants to perform user_decryption.
|
|
449
485
|
*
|
|
450
|
-
* * `request` - the initial
|
|
486
|
+
* * `request` - the initial user_decryption request JS object.
|
|
451
487
|
* It can be set to null if `verify` is false.
|
|
452
488
|
* Otherwise the caller needs to give the following JS object.
|
|
453
489
|
* Note that `client_address` and `eip712_verifying_contract` follow EIP-55.
|
|
@@ -488,7 +524,8 @@ export function cryptobox_decrypt(ct, my_sk, their_pk) {
|
|
|
488
524
|
* [
|
|
489
525
|
* {
|
|
490
526
|
* signature: '69e7e040cab157aa819015b321c012dccb1545ffefd325b359b492653f0347517e28e66c572cdc299e259024329859ff9fcb0096e1ce072af0b6e1ca1fe25ec6',
|
|
491
|
-
* payload: '0100000029...'
|
|
527
|
+
* payload: '0100000029...',
|
|
528
|
+
* extra_data: '01234...',
|
|
492
529
|
* }
|
|
493
530
|
* ]
|
|
494
531
|
* ```
|
|
@@ -503,16 +540,16 @@ export function cryptobox_decrypt(ct, my_sk, their_pk) {
|
|
|
503
540
|
* @param {any} request
|
|
504
541
|
* @param {any} eip712_domain
|
|
505
542
|
* @param {any} agg_resp
|
|
506
|
-
* @param {
|
|
507
|
-
* @param {
|
|
543
|
+
* @param {PublicEncKeyMlKem512} enc_pk
|
|
544
|
+
* @param {PrivateEncKeyMlKem512} enc_sk
|
|
508
545
|
* @param {boolean} verify
|
|
509
546
|
* @returns {TypedPlaintext[]}
|
|
510
547
|
*/
|
|
511
|
-
export function
|
|
548
|
+
export function process_user_decryption_resp_from_js(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
|
|
512
549
|
_assertClass(client, Client);
|
|
513
|
-
_assertClass(enc_pk,
|
|
514
|
-
_assertClass(enc_sk,
|
|
515
|
-
const ret = wasm.
|
|
550
|
+
_assertClass(enc_pk, PublicEncKeyMlKem512);
|
|
551
|
+
_assertClass(enc_sk, PrivateEncKeyMlKem512);
|
|
552
|
+
const ret = wasm.process_user_decryption_resp_from_js(client.__wbg_ptr, request, eip712_domain, agg_resp, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
|
|
516
553
|
if (ret[3]) {
|
|
517
554
|
throw takeFromExternrefTable0(ret[2]);
|
|
518
555
|
}
|
|
@@ -522,20 +559,20 @@ export function process_reencryption_resp_from_js(client, request, eip712_domain
|
|
|
522
559
|
}
|
|
523
560
|
|
|
524
561
|
/**
|
|
525
|
-
* Process the
|
|
526
|
-
* Consider using [
|
|
562
|
+
* Process the user_decryption response from Rust objects.
|
|
563
|
+
* Consider using [process_user_decryption_resp_from_js]
|
|
527
564
|
* when using the JS API.
|
|
528
565
|
* The result is a byte array representing a plaintext of any length.
|
|
529
566
|
*
|
|
530
|
-
* * `client` - client that wants to perform
|
|
567
|
+
* * `client` - client that wants to perform user_decryption.
|
|
531
568
|
*
|
|
532
|
-
* * `request` - the initial
|
|
569
|
+
* * `request` - the initial user_decryption request.
|
|
533
570
|
* Must be given if `verify` is true.
|
|
534
571
|
*
|
|
535
572
|
* * `eip712_domain` - the EIP-712 domain.
|
|
536
573
|
* Must be given if `verify` is true.
|
|
537
574
|
*
|
|
538
|
-
* * `agg_resp` - the vector of
|
|
575
|
+
* * `agg_resp` - the vector of user_decryption responses.
|
|
539
576
|
*
|
|
540
577
|
* * `enc_pk` - The ephemeral public key.
|
|
541
578
|
*
|
|
@@ -544,19 +581,19 @@ export function process_reencryption_resp_from_js(client, request, eip712_domain
|
|
|
544
581
|
* * `verify` - Whether to perform signature verification for the response.
|
|
545
582
|
* It is insecure if `verify = false`!
|
|
546
583
|
* @param {Client} client
|
|
547
|
-
* @param {
|
|
584
|
+
* @param {ParsedUserDecryptionRequest | null | undefined} request
|
|
548
585
|
* @param {Eip712DomainMsg | null | undefined} eip712_domain
|
|
549
|
-
* @param {
|
|
550
|
-
* @param {
|
|
551
|
-
* @param {
|
|
586
|
+
* @param {UserDecryptionResponse[]} agg_resp
|
|
587
|
+
* @param {PublicEncKeyMlKem512} enc_pk
|
|
588
|
+
* @param {PrivateEncKeyMlKem512} enc_sk
|
|
552
589
|
* @param {boolean} verify
|
|
553
590
|
* @returns {TypedPlaintext[]}
|
|
554
591
|
*/
|
|
555
|
-
export function
|
|
592
|
+
export function process_user_decryption_resp(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
|
|
556
593
|
_assertClass(client, Client);
|
|
557
594
|
let ptr0 = 0;
|
|
558
595
|
if (!isLikeNone(request)) {
|
|
559
|
-
_assertClass(request,
|
|
596
|
+
_assertClass(request, ParsedUserDecryptionRequest);
|
|
560
597
|
ptr0 = request.__destroy_into_raw();
|
|
561
598
|
}
|
|
562
599
|
let ptr1 = 0;
|
|
@@ -566,9 +603,9 @@ export function process_reencryption_resp(client, request, eip712_domain, agg_re
|
|
|
566
603
|
}
|
|
567
604
|
const ptr2 = passArrayJsValueToWasm0(agg_resp, wasm.__wbindgen_malloc);
|
|
568
605
|
const len2 = WASM_VECTOR_LEN;
|
|
569
|
-
_assertClass(enc_pk,
|
|
570
|
-
_assertClass(enc_sk,
|
|
571
|
-
const ret = wasm.
|
|
606
|
+
_assertClass(enc_pk, PublicEncKeyMlKem512);
|
|
607
|
+
_assertClass(enc_sk, PrivateEncKeyMlKem512);
|
|
608
|
+
const ret = wasm.process_user_decryption_resp(client.__wbg_ptr, ptr0, ptr1, ptr2, len2, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
|
|
572
609
|
if (ret[3]) {
|
|
573
610
|
throw takeFromExternrefTable0(ret[2]);
|
|
574
611
|
}
|
|
@@ -629,40 +666,13 @@ export class Client {
|
|
|
629
666
|
}
|
|
630
667
|
}
|
|
631
668
|
|
|
632
|
-
const CryptoBoxCtFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
633
|
-
? { register: () => {}, unregister: () => {} }
|
|
634
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_cryptoboxct_free(ptr >>> 0, 1));
|
|
635
|
-
|
|
636
|
-
export class CryptoBoxCt {
|
|
637
|
-
|
|
638
|
-
static __wrap(ptr) {
|
|
639
|
-
ptr = ptr >>> 0;
|
|
640
|
-
const obj = Object.create(CryptoBoxCt.prototype);
|
|
641
|
-
obj.__wbg_ptr = ptr;
|
|
642
|
-
CryptoBoxCtFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
643
|
-
return obj;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
__destroy_into_raw() {
|
|
647
|
-
const ptr = this.__wbg_ptr;
|
|
648
|
-
this.__wbg_ptr = 0;
|
|
649
|
-
CryptoBoxCtFinalization.unregister(this);
|
|
650
|
-
return ptr;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
free() {
|
|
654
|
-
const ptr = this.__destroy_into_raw();
|
|
655
|
-
wasm.__wbg_cryptoboxct_free(ptr, 0);
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
|
|
659
669
|
const Eip712DomainMsgFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
660
670
|
? { register: () => {}, unregister: () => {} }
|
|
661
671
|
: new FinalizationRegistry(ptr => wasm.__wbg_eip712domainmsg_free(ptr >>> 0, 1));
|
|
662
672
|
/**
|
|
663
|
-
*
|
|
664
|
-
*
|
|
665
|
-
*
|
|
673
|
+
* Eip712 domain information.
|
|
674
|
+
* Any constraints specified in the [standard](<https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>) _must_ be fulfilled.
|
|
675
|
+
* Furthermore, be aware that all parameters will eventually be parsed into Solidity types.
|
|
666
676
|
*/
|
|
667
677
|
export class Eip712DomainMsg {
|
|
668
678
|
|
|
@@ -793,51 +803,51 @@ export class Eip712DomainMsg {
|
|
|
793
803
|
}
|
|
794
804
|
}
|
|
795
805
|
|
|
796
|
-
const
|
|
806
|
+
const ParsedUserDecryptionRequestFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
797
807
|
? { register: () => {}, unregister: () => {} }
|
|
798
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
808
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_parseduserdecryptionrequest_free(ptr >>> 0, 1));
|
|
799
809
|
/**
|
|
800
810
|
* Validity of this struct is not checked.
|
|
801
811
|
*/
|
|
802
|
-
export class
|
|
812
|
+
export class ParsedUserDecryptionRequest {
|
|
803
813
|
|
|
804
814
|
__destroy_into_raw() {
|
|
805
815
|
const ptr = this.__wbg_ptr;
|
|
806
816
|
this.__wbg_ptr = 0;
|
|
807
|
-
|
|
817
|
+
ParsedUserDecryptionRequestFinalization.unregister(this);
|
|
808
818
|
return ptr;
|
|
809
819
|
}
|
|
810
820
|
|
|
811
821
|
free() {
|
|
812
822
|
const ptr = this.__destroy_into_raw();
|
|
813
|
-
wasm.
|
|
823
|
+
wasm.__wbg_parseduserdecryptionrequest_free(ptr, 0);
|
|
814
824
|
}
|
|
815
825
|
}
|
|
816
826
|
|
|
817
|
-
const
|
|
827
|
+
const PrivateEncKeyMlKem512Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
818
828
|
? { register: () => {}, unregister: () => {} }
|
|
819
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
829
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_privateenckeymlkem512_free(ptr >>> 0, 1));
|
|
820
830
|
|
|
821
|
-
export class
|
|
831
|
+
export class PrivateEncKeyMlKem512 {
|
|
822
832
|
|
|
823
833
|
static __wrap(ptr) {
|
|
824
834
|
ptr = ptr >>> 0;
|
|
825
|
-
const obj = Object.create(
|
|
835
|
+
const obj = Object.create(PrivateEncKeyMlKem512.prototype);
|
|
826
836
|
obj.__wbg_ptr = ptr;
|
|
827
|
-
|
|
837
|
+
PrivateEncKeyMlKem512Finalization.register(obj, obj.__wbg_ptr, obj);
|
|
828
838
|
return obj;
|
|
829
839
|
}
|
|
830
840
|
|
|
831
841
|
__destroy_into_raw() {
|
|
832
842
|
const ptr = this.__wbg_ptr;
|
|
833
843
|
this.__wbg_ptr = 0;
|
|
834
|
-
|
|
844
|
+
PrivateEncKeyMlKem512Finalization.unregister(this);
|
|
835
845
|
return ptr;
|
|
836
846
|
}
|
|
837
847
|
|
|
838
848
|
free() {
|
|
839
849
|
const ptr = this.__destroy_into_raw();
|
|
840
|
-
wasm.
|
|
850
|
+
wasm.__wbg_privateenckeymlkem512_free(ptr, 0);
|
|
841
851
|
}
|
|
842
852
|
}
|
|
843
853
|
|
|
@@ -868,30 +878,30 @@ export class PrivateSigKey {
|
|
|
868
878
|
}
|
|
869
879
|
}
|
|
870
880
|
|
|
871
|
-
const
|
|
881
|
+
const PublicEncKeyMlKem512Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
872
882
|
? { register: () => {}, unregister: () => {} }
|
|
873
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
883
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_publicenckeymlkem512_free(ptr >>> 0, 1));
|
|
874
884
|
|
|
875
|
-
export class
|
|
885
|
+
export class PublicEncKeyMlKem512 {
|
|
876
886
|
|
|
877
887
|
static __wrap(ptr) {
|
|
878
888
|
ptr = ptr >>> 0;
|
|
879
|
-
const obj = Object.create(
|
|
889
|
+
const obj = Object.create(PublicEncKeyMlKem512.prototype);
|
|
880
890
|
obj.__wbg_ptr = ptr;
|
|
881
|
-
|
|
891
|
+
PublicEncKeyMlKem512Finalization.register(obj, obj.__wbg_ptr, obj);
|
|
882
892
|
return obj;
|
|
883
893
|
}
|
|
884
894
|
|
|
885
895
|
__destroy_into_raw() {
|
|
886
896
|
const ptr = this.__wbg_ptr;
|
|
887
897
|
this.__wbg_ptr = 0;
|
|
888
|
-
|
|
898
|
+
PublicEncKeyMlKem512Finalization.unregister(this);
|
|
889
899
|
return ptr;
|
|
890
900
|
}
|
|
891
901
|
|
|
892
902
|
free() {
|
|
893
903
|
const ptr = this.__destroy_into_raw();
|
|
894
|
-
wasm.
|
|
904
|
+
wasm.__wbg_publicenckeymlkem512_free(ptr, 0);
|
|
895
905
|
}
|
|
896
906
|
}
|
|
897
907
|
|
|
@@ -922,96 +932,43 @@ export class PublicSigKey {
|
|
|
922
932
|
}
|
|
923
933
|
}
|
|
924
934
|
|
|
925
|
-
const
|
|
935
|
+
const RequestIdFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
926
936
|
? { register: () => {}, unregister: () => {} }
|
|
927
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
937
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_requestid_free(ptr >>> 0, 1));
|
|
938
|
+
/**
|
|
939
|
+
* / A unique 32 Byte / 256 Bit ID, to be used to identify a request and
|
|
940
|
+
* / for retrieving the computed result later on.
|
|
941
|
+
* / Must be encoded in lower-case hex. The string must NOT contain a `0x` prefix.
|
|
942
|
+
*/
|
|
943
|
+
export class RequestId {
|
|
928
944
|
|
|
929
|
-
|
|
945
|
+
static __wrap(ptr) {
|
|
946
|
+
ptr = ptr >>> 0;
|
|
947
|
+
const obj = Object.create(RequestId.prototype);
|
|
948
|
+
obj.__wbg_ptr = ptr;
|
|
949
|
+
RequestIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
950
|
+
return obj;
|
|
951
|
+
}
|
|
930
952
|
|
|
931
953
|
__destroy_into_raw() {
|
|
932
954
|
const ptr = this.__wbg_ptr;
|
|
933
955
|
this.__wbg_ptr = 0;
|
|
934
|
-
|
|
956
|
+
RequestIdFinalization.unregister(this);
|
|
935
957
|
return ptr;
|
|
936
958
|
}
|
|
937
959
|
|
|
938
960
|
free() {
|
|
939
961
|
const ptr = this.__destroy_into_raw();
|
|
940
|
-
wasm.
|
|
941
|
-
}
|
|
942
|
-
/**
|
|
943
|
-
* The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
|
|
944
|
-
* prefix. Future queries for the result must use this request ID.
|
|
945
|
-
* @returns {RequestId | undefined}
|
|
946
|
-
*/
|
|
947
|
-
get request_id() {
|
|
948
|
-
const ret = wasm.__wbg_get_reencryptionrequest_request_id(this.__wbg_ptr);
|
|
949
|
-
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
950
|
-
}
|
|
951
|
-
/**
|
|
952
|
-
* The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
|
|
953
|
-
* prefix. Future queries for the result must use this request ID.
|
|
954
|
-
* @param {RequestId | null} [arg0]
|
|
955
|
-
*/
|
|
956
|
-
set request_id(arg0) {
|
|
957
|
-
let ptr0 = 0;
|
|
958
|
-
if (!isLikeNone(arg0)) {
|
|
959
|
-
_assertClass(arg0, RequestId);
|
|
960
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
961
|
-
}
|
|
962
|
-
wasm.__wbg_set_reencryptionrequest_request_id(this.__wbg_ptr, ptr0);
|
|
963
|
-
}
|
|
964
|
-
/**
|
|
965
|
-
* The list of ciphertexts to reencrypt.
|
|
966
|
-
* @returns {TypedCiphertext[]}
|
|
967
|
-
*/
|
|
968
|
-
get typed_ciphertexts() {
|
|
969
|
-
const ret = wasm.__wbg_get_reencryptionrequest_typed_ciphertexts(this.__wbg_ptr);
|
|
970
|
-
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
971
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
972
|
-
return v1;
|
|
973
|
-
}
|
|
974
|
-
/**
|
|
975
|
-
* The list of ciphertexts to reencrypt.
|
|
976
|
-
* @param {TypedCiphertext[]} arg0
|
|
977
|
-
*/
|
|
978
|
-
set typed_ciphertexts(arg0) {
|
|
979
|
-
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
980
|
-
const len0 = WASM_VECTOR_LEN;
|
|
981
|
-
wasm.__wbg_set_reencryptionrequest_typed_ciphertexts(this.__wbg_ptr, ptr0, len0);
|
|
982
|
-
}
|
|
983
|
-
/**
|
|
984
|
-
* The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
|
|
985
|
-
* used for key generation
|
|
986
|
-
* @returns {RequestId | undefined}
|
|
987
|
-
*/
|
|
988
|
-
get key_id() {
|
|
989
|
-
const ret = wasm.__wbg_get_reencryptionrequest_key_id(this.__wbg_ptr);
|
|
990
|
-
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
991
|
-
}
|
|
992
|
-
/**
|
|
993
|
-
* The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
|
|
994
|
-
* used for key generation
|
|
995
|
-
* @param {RequestId | null} [arg0]
|
|
996
|
-
*/
|
|
997
|
-
set key_id(arg0) {
|
|
998
|
-
let ptr0 = 0;
|
|
999
|
-
if (!isLikeNone(arg0)) {
|
|
1000
|
-
_assertClass(arg0, RequestId);
|
|
1001
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
1002
|
-
}
|
|
1003
|
-
wasm.__wbg_set_reencryptionrequest_key_id(this.__wbg_ptr, ptr0);
|
|
962
|
+
wasm.__wbg_requestid_free(ptr, 0);
|
|
1004
963
|
}
|
|
1005
964
|
/**
|
|
1006
|
-
* The client's (blockchain wallet) address,
|
|
1007
|
-
* encoded using EIP-55.
|
|
1008
965
|
* @returns {string}
|
|
1009
966
|
*/
|
|
1010
|
-
get
|
|
967
|
+
get request_id() {
|
|
1011
968
|
let deferred1_0;
|
|
1012
969
|
let deferred1_1;
|
|
1013
970
|
try {
|
|
1014
|
-
const ret = wasm.
|
|
971
|
+
const ret = wasm.__wbg_get_requestid_request_id(this.__wbg_ptr);
|
|
1015
972
|
deferred1_0 = ret[0];
|
|
1016
973
|
deferred1_1 = ret[1];
|
|
1017
974
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -1020,66 +977,65 @@ export class ReencryptionRequest {
|
|
|
1020
977
|
}
|
|
1021
978
|
}
|
|
1022
979
|
/**
|
|
1023
|
-
* The client's (blockchain wallet) address,
|
|
1024
|
-
* encoded using EIP-55.
|
|
1025
980
|
* @param {string} arg0
|
|
1026
981
|
*/
|
|
1027
|
-
set
|
|
982
|
+
set request_id(arg0) {
|
|
1028
983
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1029
984
|
const len0 = WASM_VECTOR_LEN;
|
|
1030
|
-
wasm.
|
|
985
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1031
986
|
}
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
const ServerIdAddrFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
990
|
+
? { register: () => {}, unregister: () => {} }
|
|
991
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_serveridaddr_free(ptr >>> 0, 1));
|
|
992
|
+
|
|
993
|
+
export class ServerIdAddr {
|
|
994
|
+
|
|
995
|
+
static __wrap(ptr) {
|
|
996
|
+
ptr = ptr >>> 0;
|
|
997
|
+
const obj = Object.create(ServerIdAddr.prototype);
|
|
998
|
+
obj.__wbg_ptr = ptr;
|
|
999
|
+
ServerIdAddrFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1000
|
+
return obj;
|
|
1043
1001
|
}
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
set enc_key(arg0) {
|
|
1051
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1052
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1053
|
-
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
1002
|
+
|
|
1003
|
+
static __unwrap(jsValue) {
|
|
1004
|
+
if (!(jsValue instanceof ServerIdAddr)) {
|
|
1005
|
+
return 0;
|
|
1006
|
+
}
|
|
1007
|
+
return jsValue.__destroy_into_raw();
|
|
1054
1008
|
}
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
return
|
|
1009
|
+
|
|
1010
|
+
__destroy_into_raw() {
|
|
1011
|
+
const ptr = this.__wbg_ptr;
|
|
1012
|
+
this.__wbg_ptr = 0;
|
|
1013
|
+
ServerIdAddrFinalization.unregister(this);
|
|
1014
|
+
return ptr;
|
|
1061
1015
|
}
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
let ptr0 = 0;
|
|
1067
|
-
if (!isLikeNone(arg0)) {
|
|
1068
|
-
_assertClass(arg0, Eip712DomainMsg);
|
|
1069
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
1070
|
-
}
|
|
1071
|
-
wasm.__wbg_set_reencryptionrequest_domain(this.__wbg_ptr, ptr0);
|
|
1016
|
+
|
|
1017
|
+
free() {
|
|
1018
|
+
const ptr = this.__destroy_into_raw();
|
|
1019
|
+
wasm.__wbg_serveridaddr_free(ptr, 0);
|
|
1072
1020
|
}
|
|
1073
1021
|
}
|
|
1074
1022
|
|
|
1075
|
-
const
|
|
1023
|
+
const TypedCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1076
1024
|
? { register: () => {}, unregister: () => {} }
|
|
1077
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1025
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_typedciphertext_free(ptr >>> 0, 1));
|
|
1026
|
+
|
|
1027
|
+
export class TypedCiphertext {
|
|
1078
1028
|
|
|
1079
|
-
|
|
1029
|
+
static __wrap(ptr) {
|
|
1030
|
+
ptr = ptr >>> 0;
|
|
1031
|
+
const obj = Object.create(TypedCiphertext.prototype);
|
|
1032
|
+
obj.__wbg_ptr = ptr;
|
|
1033
|
+
TypedCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1034
|
+
return obj;
|
|
1035
|
+
}
|
|
1080
1036
|
|
|
1081
1037
|
static __unwrap(jsValue) {
|
|
1082
|
-
if (!(jsValue instanceof
|
|
1038
|
+
if (!(jsValue instanceof TypedCiphertext)) {
|
|
1083
1039
|
return 0;
|
|
1084
1040
|
}
|
|
1085
1041
|
return jsValue.__destroy_into_raw();
|
|
@@ -1088,248 +1044,348 @@ export class ReencryptionResponse {
|
|
|
1088
1044
|
__destroy_into_raw() {
|
|
1089
1045
|
const ptr = this.__wbg_ptr;
|
|
1090
1046
|
this.__wbg_ptr = 0;
|
|
1091
|
-
|
|
1047
|
+
TypedCiphertextFinalization.unregister(this);
|
|
1092
1048
|
return ptr;
|
|
1093
1049
|
}
|
|
1094
1050
|
|
|
1095
1051
|
free() {
|
|
1096
1052
|
const ptr = this.__destroy_into_raw();
|
|
1097
|
-
wasm.
|
|
1053
|
+
wasm.__wbg_typedciphertext_free(ptr, 0);
|
|
1098
1054
|
}
|
|
1099
1055
|
/**
|
|
1056
|
+
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
1100
1057
|
* @returns {Uint8Array}
|
|
1101
1058
|
*/
|
|
1102
|
-
get
|
|
1103
|
-
const ret = wasm.
|
|
1059
|
+
get ciphertext() {
|
|
1060
|
+
const ret = wasm.__wbg_get_typedciphertext_ciphertext(this.__wbg_ptr);
|
|
1104
1061
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1105
1062
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1106
1063
|
return v1;
|
|
1107
1064
|
}
|
|
1108
1065
|
/**
|
|
1066
|
+
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
1109
1067
|
* @param {Uint8Array} arg0
|
|
1110
1068
|
*/
|
|
1111
|
-
set
|
|
1069
|
+
set ciphertext(arg0) {
|
|
1112
1070
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1113
1071
|
const len0 = WASM_VECTOR_LEN;
|
|
1114
1072
|
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1115
1073
|
}
|
|
1116
1074
|
/**
|
|
1117
|
-
*
|
|
1118
|
-
*
|
|
1119
|
-
*
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1075
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1076
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1077
|
+
* @returns {number}
|
|
1078
|
+
*/
|
|
1079
|
+
get fhe_type() {
|
|
1080
|
+
const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
|
|
1081
|
+
return ret;
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1085
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1086
|
+
* @param {number} arg0
|
|
1087
|
+
*/
|
|
1088
|
+
set fhe_type(arg0) {
|
|
1089
|
+
wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
|
|
1090
|
+
}
|
|
1091
|
+
/**
|
|
1092
|
+
* The external handle of the ciphertext (the handle used in the copro).
|
|
1124
1093
|
* @returns {Uint8Array}
|
|
1125
1094
|
*/
|
|
1126
|
-
get
|
|
1127
|
-
const ret = wasm.
|
|
1095
|
+
get external_handle() {
|
|
1096
|
+
const ret = wasm.__wbg_get_typedciphertext_external_handle(this.__wbg_ptr);
|
|
1128
1097
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1129
1098
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1130
1099
|
return v1;
|
|
1131
1100
|
}
|
|
1132
1101
|
/**
|
|
1133
|
-
*
|
|
1134
|
-
* on the structure, where reencryptedShare is bincode::serialize(&payload)
|
|
1135
|
-
* struct UserDecryptResponseVerification {
|
|
1136
|
-
* bytes publicKey;
|
|
1137
|
-
* uint256\[\] ctHandles;
|
|
1138
|
-
* bytes reencryptedShare;
|
|
1139
|
-
* }
|
|
1102
|
+
* The external handle of the ciphertext (the handle used in the copro).
|
|
1140
1103
|
* @param {Uint8Array} arg0
|
|
1141
1104
|
*/
|
|
1142
|
-
set
|
|
1105
|
+
set external_handle(arg0) {
|
|
1143
1106
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1144
1107
|
const len0 = WASM_VECTOR_LEN;
|
|
1145
1108
|
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1146
1109
|
}
|
|
1147
1110
|
/**
|
|
1148
|
-
* The
|
|
1149
|
-
*
|
|
1111
|
+
* The ciphertext format, see CiphertextFormat documentation for details.
|
|
1112
|
+
* CiphertextFormat::default() is used if unspecified.
|
|
1113
|
+
* @returns {number}
|
|
1150
1114
|
*/
|
|
1151
|
-
get
|
|
1152
|
-
const ret = wasm.
|
|
1153
|
-
return ret
|
|
1115
|
+
get ciphertext_format() {
|
|
1116
|
+
const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
|
|
1117
|
+
return ret;
|
|
1154
1118
|
}
|
|
1155
1119
|
/**
|
|
1156
|
-
* The
|
|
1157
|
-
*
|
|
1120
|
+
* The ciphertext format, see CiphertextFormat documentation for details.
|
|
1121
|
+
* CiphertextFormat::default() is used if unspecified.
|
|
1122
|
+
* @param {number} arg0
|
|
1158
1123
|
*/
|
|
1159
|
-
set
|
|
1160
|
-
|
|
1161
|
-
if (!isLikeNone(arg0)) {
|
|
1162
|
-
_assertClass(arg0, ReencryptionResponsePayload);
|
|
1163
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
1164
|
-
}
|
|
1165
|
-
wasm.__wbg_set_reencryptionresponse_payload(this.__wbg_ptr, ptr0);
|
|
1124
|
+
set ciphertext_format(arg0) {
|
|
1125
|
+
wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
|
|
1166
1126
|
}
|
|
1167
1127
|
}
|
|
1168
1128
|
|
|
1169
|
-
const
|
|
1129
|
+
const TypedPlaintextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1170
1130
|
? { register: () => {}, unregister: () => {} }
|
|
1171
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1131
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_typedplaintext_free(ptr >>> 0, 1));
|
|
1172
1132
|
|
|
1173
|
-
export class
|
|
1133
|
+
export class TypedPlaintext {
|
|
1174
1134
|
|
|
1175
1135
|
static __wrap(ptr) {
|
|
1176
1136
|
ptr = ptr >>> 0;
|
|
1177
|
-
const obj = Object.create(
|
|
1137
|
+
const obj = Object.create(TypedPlaintext.prototype);
|
|
1178
1138
|
obj.__wbg_ptr = ptr;
|
|
1179
|
-
|
|
1139
|
+
TypedPlaintextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1180
1140
|
return obj;
|
|
1181
1141
|
}
|
|
1182
1142
|
|
|
1183
1143
|
__destroy_into_raw() {
|
|
1184
1144
|
const ptr = this.__wbg_ptr;
|
|
1185
1145
|
this.__wbg_ptr = 0;
|
|
1186
|
-
|
|
1146
|
+
TypedPlaintextFinalization.unregister(this);
|
|
1187
1147
|
return ptr;
|
|
1188
1148
|
}
|
|
1189
1149
|
|
|
1190
1150
|
free() {
|
|
1191
1151
|
const ptr = this.__destroy_into_raw();
|
|
1192
|
-
wasm.
|
|
1152
|
+
wasm.__wbg_typedplaintext_free(ptr, 0);
|
|
1193
1153
|
}
|
|
1194
1154
|
/**
|
|
1195
|
-
* The
|
|
1196
|
-
* Needed to validate the response, but MUST also be linked to a list of
|
|
1197
|
-
* trusted keys.
|
|
1155
|
+
* The actual plaintext in bytes.
|
|
1198
1156
|
* @returns {Uint8Array}
|
|
1199
1157
|
*/
|
|
1200
|
-
get
|
|
1201
|
-
const ret = wasm.
|
|
1158
|
+
get bytes() {
|
|
1159
|
+
const ret = wasm.__wbg_get_typedplaintext_bytes(this.__wbg_ptr);
|
|
1202
1160
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1203
1161
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1204
1162
|
return v1;
|
|
1205
1163
|
}
|
|
1206
1164
|
/**
|
|
1207
|
-
* The
|
|
1208
|
-
* Needed to validate the response, but MUST also be linked to a list of
|
|
1209
|
-
* trusted keys.
|
|
1165
|
+
* The actual plaintext in bytes.
|
|
1210
1166
|
* @param {Uint8Array} arg0
|
|
1211
1167
|
*/
|
|
1212
|
-
set
|
|
1168
|
+
set bytes(arg0) {
|
|
1213
1169
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1214
1170
|
const len0 = WASM_VECTOR_LEN;
|
|
1215
1171
|
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1216
1172
|
}
|
|
1217
1173
|
/**
|
|
1218
|
-
*
|
|
1219
|
-
*
|
|
1220
|
-
*
|
|
1174
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1175
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1176
|
+
* @returns {number}
|
|
1177
|
+
*/
|
|
1178
|
+
get fhe_type() {
|
|
1179
|
+
const ret = wasm.__wbg_get_typedplaintext_fhe_type(this.__wbg_ptr);
|
|
1180
|
+
return ret;
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1184
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1185
|
+
* @param {number} arg0
|
|
1186
|
+
*/
|
|
1187
|
+
set fhe_type(arg0) {
|
|
1188
|
+
wasm.__wbg_set_typedplaintext_fhe_type(this.__wbg_ptr, arg0);
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
const TypedSigncryptedCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1193
|
+
? { register: () => {}, unregister: () => {} }
|
|
1194
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_typedsigncryptedciphertext_free(ptr >>> 0, 1));
|
|
1195
|
+
|
|
1196
|
+
export class TypedSigncryptedCiphertext {
|
|
1197
|
+
|
|
1198
|
+
static __wrap(ptr) {
|
|
1199
|
+
ptr = ptr >>> 0;
|
|
1200
|
+
const obj = Object.create(TypedSigncryptedCiphertext.prototype);
|
|
1201
|
+
obj.__wbg_ptr = ptr;
|
|
1202
|
+
TypedSigncryptedCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1203
|
+
return obj;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
static __unwrap(jsValue) {
|
|
1207
|
+
if (!(jsValue instanceof TypedSigncryptedCiphertext)) {
|
|
1208
|
+
return 0;
|
|
1209
|
+
}
|
|
1210
|
+
return jsValue.__destroy_into_raw();
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
__destroy_into_raw() {
|
|
1214
|
+
const ptr = this.__wbg_ptr;
|
|
1215
|
+
this.__wbg_ptr = 0;
|
|
1216
|
+
TypedSigncryptedCiphertextFinalization.unregister(this);
|
|
1217
|
+
return ptr;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
free() {
|
|
1221
|
+
const ptr = this.__destroy_into_raw();
|
|
1222
|
+
wasm.__wbg_typedsigncryptedciphertext_free(ptr, 0);
|
|
1223
|
+
}
|
|
1224
|
+
/**
|
|
1225
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1226
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1227
|
+
* @returns {number}
|
|
1228
|
+
*/
|
|
1229
|
+
get fhe_type() {
|
|
1230
|
+
const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
|
|
1231
|
+
return ret;
|
|
1232
|
+
}
|
|
1233
|
+
/**
|
|
1234
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1235
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1236
|
+
* @param {number} arg0
|
|
1237
|
+
*/
|
|
1238
|
+
set fhe_type(arg0) {
|
|
1239
|
+
wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* The signcrypted payload, using a hybrid encryption approach in
|
|
1243
|
+
* sign-then-encrypt.
|
|
1221
1244
|
* @returns {Uint8Array}
|
|
1222
1245
|
*/
|
|
1223
|
-
get
|
|
1224
|
-
const ret = wasm.
|
|
1246
|
+
get signcrypted_ciphertext() {
|
|
1247
|
+
const ret = wasm.__wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext(this.__wbg_ptr);
|
|
1225
1248
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1226
1249
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1227
1250
|
return v1;
|
|
1228
1251
|
}
|
|
1229
1252
|
/**
|
|
1230
|
-
*
|
|
1231
|
-
*
|
|
1232
|
-
* under the given domain in the request.
|
|
1253
|
+
* The signcrypted payload, using a hybrid encryption approach in
|
|
1254
|
+
* sign-then-encrypt.
|
|
1233
1255
|
* @param {Uint8Array} arg0
|
|
1234
1256
|
*/
|
|
1235
|
-
set
|
|
1257
|
+
set signcrypted_ciphertext(arg0) {
|
|
1236
1258
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1237
1259
|
const len0 = WASM_VECTOR_LEN;
|
|
1238
|
-
wasm.
|
|
1260
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1239
1261
|
}
|
|
1240
1262
|
/**
|
|
1241
|
-
* The
|
|
1242
|
-
*
|
|
1243
|
-
* to produce the final plaintext.
|
|
1244
|
-
* @returns {TypedSigncryptedCiphertext[]}
|
|
1263
|
+
* The external handles that were originally in the request.
|
|
1264
|
+
* @returns {Uint8Array}
|
|
1245
1265
|
*/
|
|
1246
|
-
get
|
|
1247
|
-
const ret = wasm.
|
|
1248
|
-
var v1 =
|
|
1249
|
-
wasm.__wbindgen_free(ret[0], ret[1] *
|
|
1266
|
+
get external_handle() {
|
|
1267
|
+
const ret = wasm.__wbg_get_typedsigncryptedciphertext_external_handle(this.__wbg_ptr);
|
|
1268
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1269
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1250
1270
|
return v1;
|
|
1251
1271
|
}
|
|
1252
1272
|
/**
|
|
1253
|
-
* The
|
|
1254
|
-
*
|
|
1255
|
-
* to produce the final plaintext.
|
|
1256
|
-
* @param {TypedSigncryptedCiphertext[]} arg0
|
|
1273
|
+
* The external handles that were originally in the request.
|
|
1274
|
+
* @param {Uint8Array} arg0
|
|
1257
1275
|
*/
|
|
1258
|
-
set
|
|
1259
|
-
const ptr0 =
|
|
1276
|
+
set external_handle(arg0) {
|
|
1277
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1260
1278
|
const len0 = WASM_VECTOR_LEN;
|
|
1261
|
-
wasm.
|
|
1262
|
-
}
|
|
1263
|
-
/**
|
|
1264
|
-
* The ID of the MPC party doing the reencryption. Used for polynomial
|
|
1265
|
-
* reconstruction.
|
|
1266
|
-
* @returns {number}
|
|
1267
|
-
*/
|
|
1268
|
-
get party_id() {
|
|
1269
|
-
const ret = wasm.__wbg_get_reencryptionresponsepayload_party_id(this.__wbg_ptr);
|
|
1270
|
-
return ret >>> 0;
|
|
1271
|
-
}
|
|
1272
|
-
/**
|
|
1273
|
-
* The ID of the MPC party doing the reencryption. Used for polynomial
|
|
1274
|
-
* reconstruction.
|
|
1275
|
-
* @param {number} arg0
|
|
1276
|
-
*/
|
|
1277
|
-
set party_id(arg0) {
|
|
1278
|
-
wasm.__wbg_set_reencryptionresponsepayload_party_id(this.__wbg_ptr, arg0);
|
|
1279
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1279
1280
|
}
|
|
1280
1281
|
/**
|
|
1281
|
-
* The
|
|
1282
|
+
* The packing factor determines whether the decrypted plaintext
|
|
1283
|
+
* has a different way of packing compared to what is specified in the plaintext modulus.
|
|
1282
1284
|
* @returns {number}
|
|
1283
1285
|
*/
|
|
1284
|
-
get
|
|
1285
|
-
const ret = wasm.
|
|
1286
|
+
get packing_factor() {
|
|
1287
|
+
const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
|
|
1286
1288
|
return ret >>> 0;
|
|
1287
1289
|
}
|
|
1288
1290
|
/**
|
|
1289
|
-
* The
|
|
1291
|
+
* The packing factor determines whether the decrypted plaintext
|
|
1292
|
+
* has a different way of packing compared to what is specified in the plaintext modulus.
|
|
1290
1293
|
* @param {number} arg0
|
|
1291
1294
|
*/
|
|
1292
|
-
set
|
|
1293
|
-
wasm.
|
|
1295
|
+
set packing_factor(arg0) {
|
|
1296
|
+
wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
|
|
1294
1297
|
}
|
|
1295
1298
|
}
|
|
1296
1299
|
|
|
1297
|
-
const
|
|
1300
|
+
const UserDecryptionRequestFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1298
1301
|
? { register: () => {}, unregister: () => {} }
|
|
1299
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1300
|
-
/**
|
|
1301
|
-
* Simple response to return a 32 Byte / 256 Bit ID, to be used to retrieve the
|
|
1302
|
-
* computed result later on. This string does NOT contain a `0x` prefix.
|
|
1303
|
-
*/
|
|
1304
|
-
export class RequestId {
|
|
1302
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_userdecryptionrequest_free(ptr >>> 0, 1));
|
|
1305
1303
|
|
|
1306
|
-
|
|
1307
|
-
ptr = ptr >>> 0;
|
|
1308
|
-
const obj = Object.create(RequestId.prototype);
|
|
1309
|
-
obj.__wbg_ptr = ptr;
|
|
1310
|
-
RequestIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1311
|
-
return obj;
|
|
1312
|
-
}
|
|
1304
|
+
export class UserDecryptionRequest {
|
|
1313
1305
|
|
|
1314
1306
|
__destroy_into_raw() {
|
|
1315
1307
|
const ptr = this.__wbg_ptr;
|
|
1316
1308
|
this.__wbg_ptr = 0;
|
|
1317
|
-
|
|
1309
|
+
UserDecryptionRequestFinalization.unregister(this);
|
|
1318
1310
|
return ptr;
|
|
1319
1311
|
}
|
|
1320
1312
|
|
|
1321
1313
|
free() {
|
|
1322
1314
|
const ptr = this.__destroy_into_raw();
|
|
1323
|
-
wasm.
|
|
1315
|
+
wasm.__wbg_userdecryptionrequest_free(ptr, 0);
|
|
1324
1316
|
}
|
|
1325
1317
|
/**
|
|
1326
|
-
*
|
|
1318
|
+
* The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
|
|
1319
|
+
* prefix. Future queries for the result must use this request ID.
|
|
1320
|
+
* @returns {RequestId | undefined}
|
|
1327
1321
|
*/
|
|
1328
1322
|
get request_id() {
|
|
1323
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_request_id(this.__wbg_ptr);
|
|
1324
|
+
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
|
|
1328
|
+
* prefix. Future queries for the result must use this request ID.
|
|
1329
|
+
* @param {RequestId | null} [arg0]
|
|
1330
|
+
*/
|
|
1331
|
+
set request_id(arg0) {
|
|
1332
|
+
let ptr0 = 0;
|
|
1333
|
+
if (!isLikeNone(arg0)) {
|
|
1334
|
+
_assertClass(arg0, RequestId);
|
|
1335
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1336
|
+
}
|
|
1337
|
+
wasm.__wbg_set_userdecryptionrequest_request_id(this.__wbg_ptr, ptr0);
|
|
1338
|
+
}
|
|
1339
|
+
/**
|
|
1340
|
+
* The list of ciphertexts to decrypt for the user.
|
|
1341
|
+
* @returns {TypedCiphertext[]}
|
|
1342
|
+
*/
|
|
1343
|
+
get typed_ciphertexts() {
|
|
1344
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_typed_ciphertexts(this.__wbg_ptr);
|
|
1345
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1346
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1347
|
+
return v1;
|
|
1348
|
+
}
|
|
1349
|
+
/**
|
|
1350
|
+
* The list of ciphertexts to decrypt for the user.
|
|
1351
|
+
* @param {TypedCiphertext[]} arg0
|
|
1352
|
+
*/
|
|
1353
|
+
set typed_ciphertexts(arg0) {
|
|
1354
|
+
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1355
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1356
|
+
wasm.__wbg_set_userdecryptionrequest_typed_ciphertexts(this.__wbg_ptr, ptr0, len0);
|
|
1357
|
+
}
|
|
1358
|
+
/**
|
|
1359
|
+
* The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
|
|
1360
|
+
* used for key generation
|
|
1361
|
+
* @returns {RequestId | undefined}
|
|
1362
|
+
*/
|
|
1363
|
+
get key_id() {
|
|
1364
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_key_id(this.__wbg_ptr);
|
|
1365
|
+
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
|
|
1369
|
+
* used for key generation
|
|
1370
|
+
* @param {RequestId | null} [arg0]
|
|
1371
|
+
*/
|
|
1372
|
+
set key_id(arg0) {
|
|
1373
|
+
let ptr0 = 0;
|
|
1374
|
+
if (!isLikeNone(arg0)) {
|
|
1375
|
+
_assertClass(arg0, RequestId);
|
|
1376
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1377
|
+
}
|
|
1378
|
+
wasm.__wbg_set_userdecryptionrequest_key_id(this.__wbg_ptr, ptr0);
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* The client's (blockchain wallet) address, encoded using EIP-55. I.e. including `0x`.
|
|
1382
|
+
* @returns {string}
|
|
1383
|
+
*/
|
|
1384
|
+
get client_address() {
|
|
1329
1385
|
let deferred1_0;
|
|
1330
1386
|
let deferred1_1;
|
|
1331
1387
|
try {
|
|
1332
|
-
const ret = wasm.
|
|
1388
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_client_address(this.__wbg_ptr);
|
|
1333
1389
|
deferred1_0 = ret[0];
|
|
1334
1390
|
deferred1_1 = ret[1];
|
|
1335
1391
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -1338,291 +1394,316 @@ export class RequestId {
|
|
|
1338
1394
|
}
|
|
1339
1395
|
}
|
|
1340
1396
|
/**
|
|
1397
|
+
* The client's (blockchain wallet) address, encoded using EIP-55. I.e. including `0x`.
|
|
1341
1398
|
* @param {string} arg0
|
|
1342
1399
|
*/
|
|
1343
|
-
set
|
|
1400
|
+
set client_address(arg0) {
|
|
1344
1401
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1345
1402
|
const len0 = WASM_VECTOR_LEN;
|
|
1346
|
-
wasm.
|
|
1347
|
-
}
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
const TypedCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1351
|
-
? { register: () => {}, unregister: () => {} }
|
|
1352
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_typedciphertext_free(ptr >>> 0, 1));
|
|
1353
|
-
|
|
1354
|
-
export class TypedCiphertext {
|
|
1355
|
-
|
|
1356
|
-
static __wrap(ptr) {
|
|
1357
|
-
ptr = ptr >>> 0;
|
|
1358
|
-
const obj = Object.create(TypedCiphertext.prototype);
|
|
1359
|
-
obj.__wbg_ptr = ptr;
|
|
1360
|
-
TypedCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1361
|
-
return obj;
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
static __unwrap(jsValue) {
|
|
1365
|
-
if (!(jsValue instanceof TypedCiphertext)) {
|
|
1366
|
-
return 0;
|
|
1367
|
-
}
|
|
1368
|
-
return jsValue.__destroy_into_raw();
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1371
|
-
__destroy_into_raw() {
|
|
1372
|
-
const ptr = this.__wbg_ptr;
|
|
1373
|
-
this.__wbg_ptr = 0;
|
|
1374
|
-
TypedCiphertextFinalization.unregister(this);
|
|
1375
|
-
return ptr;
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
|
-
free() {
|
|
1379
|
-
const ptr = this.__destroy_into_raw();
|
|
1380
|
-
wasm.__wbg_typedciphertext_free(ptr, 0);
|
|
1403
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1381
1404
|
}
|
|
1382
1405
|
/**
|
|
1383
|
-
*
|
|
1406
|
+
* Encoding of the user's public encryption key for this request.
|
|
1407
|
+
* This must be a bincode (v.1) encoded ML-KEM 512 key.
|
|
1384
1408
|
* @returns {Uint8Array}
|
|
1385
1409
|
*/
|
|
1386
|
-
get
|
|
1387
|
-
const ret = wasm.
|
|
1410
|
+
get enc_key() {
|
|
1411
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_enc_key(this.__wbg_ptr);
|
|
1388
1412
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1389
1413
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1390
1414
|
return v1;
|
|
1391
1415
|
}
|
|
1392
1416
|
/**
|
|
1393
|
-
*
|
|
1417
|
+
* Encoding of the user's public encryption key for this request.
|
|
1418
|
+
* This must be a bincode (v.1) encoded ML-KEM 512 key.
|
|
1394
1419
|
* @param {Uint8Array} arg0
|
|
1395
1420
|
*/
|
|
1396
|
-
set
|
|
1421
|
+
set enc_key(arg0) {
|
|
1397
1422
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1398
1423
|
const len0 = WASM_VECTOR_LEN;
|
|
1399
|
-
wasm.
|
|
1424
|
+
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
1400
1425
|
}
|
|
1401
1426
|
/**
|
|
1402
|
-
* The
|
|
1403
|
-
*
|
|
1404
|
-
* @returns {number}
|
|
1427
|
+
* The user's EIP712 domain. This MUST be present. Furthermore, the `verifying_contract` MUST be set and be distinct from `client_address`.
|
|
1428
|
+
* @returns {Eip712DomainMsg | undefined}
|
|
1405
1429
|
*/
|
|
1406
|
-
get
|
|
1407
|
-
const ret = wasm.
|
|
1408
|
-
return ret;
|
|
1430
|
+
get domain() {
|
|
1431
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_domain(this.__wbg_ptr);
|
|
1432
|
+
return ret === 0 ? undefined : Eip712DomainMsg.__wrap(ret);
|
|
1409
1433
|
}
|
|
1410
1434
|
/**
|
|
1411
|
-
* The
|
|
1412
|
-
*
|
|
1413
|
-
* @param {number} arg0
|
|
1435
|
+
* The user's EIP712 domain. This MUST be present. Furthermore, the `verifying_contract` MUST be set and be distinct from `client_address`.
|
|
1436
|
+
* @param {Eip712DomainMsg | null} [arg0]
|
|
1414
1437
|
*/
|
|
1415
|
-
set
|
|
1416
|
-
|
|
1438
|
+
set domain(arg0) {
|
|
1439
|
+
let ptr0 = 0;
|
|
1440
|
+
if (!isLikeNone(arg0)) {
|
|
1441
|
+
_assertClass(arg0, Eip712DomainMsg);
|
|
1442
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1443
|
+
}
|
|
1444
|
+
wasm.__wbg_set_userdecryptionrequest_domain(this.__wbg_ptr, ptr0);
|
|
1417
1445
|
}
|
|
1418
1446
|
/**
|
|
1419
|
-
*
|
|
1447
|
+
* Extra data from the gateway.
|
|
1420
1448
|
* @returns {Uint8Array}
|
|
1421
1449
|
*/
|
|
1422
|
-
get
|
|
1423
|
-
const ret = wasm.
|
|
1450
|
+
get extra_data() {
|
|
1451
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_extra_data(this.__wbg_ptr);
|
|
1424
1452
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1425
1453
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1426
1454
|
return v1;
|
|
1427
1455
|
}
|
|
1428
1456
|
/**
|
|
1429
|
-
*
|
|
1457
|
+
* Extra data from the gateway.
|
|
1430
1458
|
* @param {Uint8Array} arg0
|
|
1431
1459
|
*/
|
|
1432
|
-
set
|
|
1460
|
+
set extra_data(arg0) {
|
|
1433
1461
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1434
1462
|
const len0 = WASM_VECTOR_LEN;
|
|
1435
|
-
wasm.
|
|
1436
|
-
}
|
|
1437
|
-
/**
|
|
1438
|
-
* The ciphertext format, see CiphertextFormat documentation for details.
|
|
1439
|
-
* CiphertextFormat::default() is used if unspecified.
|
|
1440
|
-
* @returns {number}
|
|
1441
|
-
*/
|
|
1442
|
-
get ciphertext_format() {
|
|
1443
|
-
const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
|
|
1444
|
-
return ret;
|
|
1445
|
-
}
|
|
1446
|
-
/**
|
|
1447
|
-
* The ciphertext format, see CiphertextFormat documentation for details.
|
|
1448
|
-
* CiphertextFormat::default() is used if unspecified.
|
|
1449
|
-
* @param {number} arg0
|
|
1450
|
-
*/
|
|
1451
|
-
set ciphertext_format(arg0) {
|
|
1452
|
-
wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
|
|
1463
|
+
wasm.__wbg_set_eip712domainmsg_verifying_contract(this.__wbg_ptr, ptr0, len0);
|
|
1453
1464
|
}
|
|
1454
1465
|
}
|
|
1455
1466
|
|
|
1456
|
-
const
|
|
1467
|
+
const UserDecryptionResponseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1457
1468
|
? { register: () => {}, unregister: () => {} }
|
|
1458
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1459
|
-
/**
|
|
1460
|
-
* The typed plaintext type, which is the result of decryption.
|
|
1461
|
-
*/
|
|
1462
|
-
export class TypedPlaintext {
|
|
1469
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_userdecryptionresponse_free(ptr >>> 0, 1));
|
|
1463
1470
|
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1471
|
+
export class UserDecryptionResponse {
|
|
1472
|
+
|
|
1473
|
+
static __unwrap(jsValue) {
|
|
1474
|
+
if (!(jsValue instanceof UserDecryptionResponse)) {
|
|
1475
|
+
return 0;
|
|
1476
|
+
}
|
|
1477
|
+
return jsValue.__destroy_into_raw();
|
|
1470
1478
|
}
|
|
1471
1479
|
|
|
1472
1480
|
__destroy_into_raw() {
|
|
1473
1481
|
const ptr = this.__wbg_ptr;
|
|
1474
1482
|
this.__wbg_ptr = 0;
|
|
1475
|
-
|
|
1483
|
+
UserDecryptionResponseFinalization.unregister(this);
|
|
1476
1484
|
return ptr;
|
|
1477
1485
|
}
|
|
1478
1486
|
|
|
1479
1487
|
free() {
|
|
1480
1488
|
const ptr = this.__destroy_into_raw();
|
|
1481
|
-
wasm.
|
|
1489
|
+
wasm.__wbg_userdecryptionresponse_free(ptr, 0);
|
|
1482
1490
|
}
|
|
1483
1491
|
/**
|
|
1484
|
-
* The actual plaintext in bytes.
|
|
1485
1492
|
* @returns {Uint8Array}
|
|
1486
1493
|
*/
|
|
1487
|
-
get
|
|
1488
|
-
const ret = wasm.
|
|
1494
|
+
get signature() {
|
|
1495
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_signature(this.__wbg_ptr);
|
|
1489
1496
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1490
1497
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1491
1498
|
return v1;
|
|
1492
1499
|
}
|
|
1493
1500
|
/**
|
|
1494
|
-
* The actual plaintext in bytes.
|
|
1495
1501
|
* @param {Uint8Array} arg0
|
|
1496
1502
|
*/
|
|
1497
|
-
set
|
|
1503
|
+
set signature(arg0) {
|
|
1498
1504
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1499
1505
|
const len0 = WASM_VECTOR_LEN;
|
|
1500
1506
|
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1501
1507
|
}
|
|
1502
1508
|
/**
|
|
1503
|
-
*
|
|
1504
|
-
*
|
|
1505
|
-
*
|
|
1509
|
+
* This is the external signature created from the Eip712 domain
|
|
1510
|
+
* on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
|
|
1511
|
+
* struct UserDecryptResponseVerification {
|
|
1512
|
+
* bytes publicKey;
|
|
1513
|
+
* uint256\[\] ctHandles;
|
|
1514
|
+
* bytes userDecryptedShare; // serialization of payload
|
|
1515
|
+
* bytes extraData;
|
|
1516
|
+
* }
|
|
1517
|
+
* @returns {Uint8Array}
|
|
1506
1518
|
*/
|
|
1507
|
-
get
|
|
1508
|
-
const ret = wasm.
|
|
1509
|
-
|
|
1519
|
+
get external_signature() {
|
|
1520
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_external_signature(this.__wbg_ptr);
|
|
1521
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1522
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1523
|
+
return v1;
|
|
1510
1524
|
}
|
|
1511
1525
|
/**
|
|
1512
|
-
*
|
|
1513
|
-
*
|
|
1514
|
-
*
|
|
1526
|
+
* This is the external signature created from the Eip712 domain
|
|
1527
|
+
* on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
|
|
1528
|
+
* struct UserDecryptResponseVerification {
|
|
1529
|
+
* bytes publicKey;
|
|
1530
|
+
* uint256\[\] ctHandles;
|
|
1531
|
+
* bytes userDecryptedShare; // serialization of payload
|
|
1532
|
+
* bytes extraData;
|
|
1533
|
+
* }
|
|
1534
|
+
* @param {Uint8Array} arg0
|
|
1515
1535
|
*/
|
|
1516
|
-
set
|
|
1517
|
-
|
|
1536
|
+
set external_signature(arg0) {
|
|
1537
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1538
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1539
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1540
|
+
}
|
|
1541
|
+
/**
|
|
1542
|
+
* The actual \[UserDecryptionResponsePayload\].
|
|
1543
|
+
* @returns {UserDecryptionResponsePayload | undefined}
|
|
1544
|
+
*/
|
|
1545
|
+
get payload() {
|
|
1546
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_payload(this.__wbg_ptr);
|
|
1547
|
+
return ret === 0 ? undefined : UserDecryptionResponsePayload.__wrap(ret);
|
|
1548
|
+
}
|
|
1549
|
+
/**
|
|
1550
|
+
* The actual \[UserDecryptionResponsePayload\].
|
|
1551
|
+
* @param {UserDecryptionResponsePayload | null} [arg0]
|
|
1552
|
+
*/
|
|
1553
|
+
set payload(arg0) {
|
|
1554
|
+
let ptr0 = 0;
|
|
1555
|
+
if (!isLikeNone(arg0)) {
|
|
1556
|
+
_assertClass(arg0, UserDecryptionResponsePayload);
|
|
1557
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1558
|
+
}
|
|
1559
|
+
wasm.__wbg_set_userdecryptionresponse_payload(this.__wbg_ptr, ptr0);
|
|
1560
|
+
}
|
|
1561
|
+
/**
|
|
1562
|
+
* Extra data used in the EIP712 signature - external_signature.
|
|
1563
|
+
* @returns {Uint8Array}
|
|
1564
|
+
*/
|
|
1565
|
+
get extra_data() {
|
|
1566
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_extra_data(this.__wbg_ptr);
|
|
1567
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1568
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1569
|
+
return v1;
|
|
1570
|
+
}
|
|
1571
|
+
/**
|
|
1572
|
+
* Extra data used in the EIP712 signature - external_signature.
|
|
1573
|
+
* @param {Uint8Array} arg0
|
|
1574
|
+
*/
|
|
1575
|
+
set extra_data(arg0) {
|
|
1576
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1577
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1578
|
+
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
1518
1579
|
}
|
|
1519
1580
|
}
|
|
1520
1581
|
|
|
1521
|
-
const
|
|
1582
|
+
const UserDecryptionResponsePayloadFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1522
1583
|
? { register: () => {}, unregister: () => {} }
|
|
1523
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1584
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_userdecryptionresponsepayload_free(ptr >>> 0, 1));
|
|
1524
1585
|
|
|
1525
|
-
export class
|
|
1586
|
+
export class UserDecryptionResponsePayload {
|
|
1526
1587
|
|
|
1527
1588
|
static __wrap(ptr) {
|
|
1528
1589
|
ptr = ptr >>> 0;
|
|
1529
|
-
const obj = Object.create(
|
|
1590
|
+
const obj = Object.create(UserDecryptionResponsePayload.prototype);
|
|
1530
1591
|
obj.__wbg_ptr = ptr;
|
|
1531
|
-
|
|
1592
|
+
UserDecryptionResponsePayloadFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1532
1593
|
return obj;
|
|
1533
1594
|
}
|
|
1534
1595
|
|
|
1535
|
-
static __unwrap(jsValue) {
|
|
1536
|
-
if (!(jsValue instanceof TypedSigncryptedCiphertext)) {
|
|
1537
|
-
return 0;
|
|
1538
|
-
}
|
|
1539
|
-
return jsValue.__destroy_into_raw();
|
|
1540
|
-
}
|
|
1541
|
-
|
|
1542
1596
|
__destroy_into_raw() {
|
|
1543
1597
|
const ptr = this.__wbg_ptr;
|
|
1544
1598
|
this.__wbg_ptr = 0;
|
|
1545
|
-
|
|
1599
|
+
UserDecryptionResponsePayloadFinalization.unregister(this);
|
|
1546
1600
|
return ptr;
|
|
1547
1601
|
}
|
|
1548
1602
|
|
|
1549
1603
|
free() {
|
|
1550
1604
|
const ptr = this.__destroy_into_raw();
|
|
1551
|
-
wasm.
|
|
1605
|
+
wasm.__wbg_userdecryptionresponsepayload_free(ptr, 0);
|
|
1552
1606
|
}
|
|
1553
1607
|
/**
|
|
1554
|
-
* The
|
|
1555
|
-
*
|
|
1556
|
-
*
|
|
1557
|
-
*/
|
|
1558
|
-
get fhe_type() {
|
|
1559
|
-
const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
|
|
1560
|
-
return ret;
|
|
1561
|
-
}
|
|
1562
|
-
/**
|
|
1563
|
-
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1564
|
-
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1565
|
-
* @param {number} arg0
|
|
1566
|
-
*/
|
|
1567
|
-
set fhe_type(arg0) {
|
|
1568
|
-
wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
|
|
1569
|
-
}
|
|
1570
|
-
/**
|
|
1571
|
-
* The signcrypted payload, using a hybrid encryption approach in
|
|
1572
|
-
* sign-then-encrypt.
|
|
1608
|
+
* The server's signature verification key, Encoded using SEC1.
|
|
1609
|
+
* Needed to validate the response, but MUST also be linked to a list of
|
|
1610
|
+
* trusted keys.
|
|
1573
1611
|
* @returns {Uint8Array}
|
|
1574
1612
|
*/
|
|
1575
|
-
get
|
|
1576
|
-
const ret = wasm.
|
|
1613
|
+
get verification_key() {
|
|
1614
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_verification_key(this.__wbg_ptr);
|
|
1577
1615
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1578
1616
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1579
1617
|
return v1;
|
|
1580
1618
|
}
|
|
1581
1619
|
/**
|
|
1582
|
-
* The
|
|
1583
|
-
*
|
|
1620
|
+
* The server's signature verification key, Encoded using SEC1.
|
|
1621
|
+
* Needed to validate the response, but MUST also be linked to a list of
|
|
1622
|
+
* trusted keys.
|
|
1584
1623
|
* @param {Uint8Array} arg0
|
|
1585
1624
|
*/
|
|
1586
|
-
set
|
|
1625
|
+
set verification_key(arg0) {
|
|
1587
1626
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1588
1627
|
const len0 = WASM_VECTOR_LEN;
|
|
1589
1628
|
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1590
1629
|
}
|
|
1591
1630
|
/**
|
|
1592
|
-
*
|
|
1631
|
+
* This is needed to ensure the response corresponds to the request.
|
|
1632
|
+
* It is the digest of UserDecryptionLinker hashed using EIP712
|
|
1633
|
+
* under the given domain in the request.
|
|
1593
1634
|
* @returns {Uint8Array}
|
|
1594
1635
|
*/
|
|
1595
|
-
get
|
|
1596
|
-
const ret = wasm.
|
|
1636
|
+
get digest() {
|
|
1637
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_digest(this.__wbg_ptr);
|
|
1597
1638
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1598
1639
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1599
1640
|
return v1;
|
|
1600
1641
|
}
|
|
1601
1642
|
/**
|
|
1602
|
-
*
|
|
1643
|
+
* This is needed to ensure the response corresponds to the request.
|
|
1644
|
+
* It is the digest of UserDecryptionLinker hashed using EIP712
|
|
1645
|
+
* under the given domain in the request.
|
|
1603
1646
|
* @param {Uint8Array} arg0
|
|
1604
1647
|
*/
|
|
1605
|
-
set
|
|
1648
|
+
set digest(arg0) {
|
|
1606
1649
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1607
1650
|
const len0 = WASM_VECTOR_LEN;
|
|
1608
1651
|
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1609
1652
|
}
|
|
1610
1653
|
/**
|
|
1611
|
-
* The
|
|
1612
|
-
*
|
|
1654
|
+
* The resulting signcrypted ciphertexts, each ciphertext
|
|
1655
|
+
* must be decrypted and then reconstructed with the other shares
|
|
1656
|
+
* to produce the final plaintext.
|
|
1657
|
+
* @returns {TypedSigncryptedCiphertext[]}
|
|
1658
|
+
*/
|
|
1659
|
+
get signcrypted_ciphertexts() {
|
|
1660
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr);
|
|
1661
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1662
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1663
|
+
return v1;
|
|
1664
|
+
}
|
|
1665
|
+
/**
|
|
1666
|
+
* The resulting signcrypted ciphertexts, each ciphertext
|
|
1667
|
+
* must be decrypted and then reconstructed with the other shares
|
|
1668
|
+
* to produce the final plaintext.
|
|
1669
|
+
* @param {TypedSigncryptedCiphertext[]} arg0
|
|
1670
|
+
*/
|
|
1671
|
+
set signcrypted_ciphertexts(arg0) {
|
|
1672
|
+
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1673
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1674
|
+
wasm.__wbg_set_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr, ptr0, len0);
|
|
1675
|
+
}
|
|
1676
|
+
/**
|
|
1677
|
+
* The ID of the MPC party doing the user decryption. Used for polynomial
|
|
1678
|
+
* reconstruction.
|
|
1613
1679
|
* @returns {number}
|
|
1614
1680
|
*/
|
|
1615
|
-
get
|
|
1616
|
-
const ret = wasm.
|
|
1681
|
+
get party_id() {
|
|
1682
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_party_id(this.__wbg_ptr);
|
|
1617
1683
|
return ret >>> 0;
|
|
1618
1684
|
}
|
|
1619
1685
|
/**
|
|
1620
|
-
* The
|
|
1621
|
-
*
|
|
1686
|
+
* The ID of the MPC party doing the user decryption. Used for polynomial
|
|
1687
|
+
* reconstruction.
|
|
1622
1688
|
* @param {number} arg0
|
|
1623
1689
|
*/
|
|
1624
|
-
set
|
|
1625
|
-
wasm.
|
|
1690
|
+
set party_id(arg0) {
|
|
1691
|
+
wasm.__wbg_set_userdecryptionresponsepayload_party_id(this.__wbg_ptr, arg0);
|
|
1692
|
+
}
|
|
1693
|
+
/**
|
|
1694
|
+
* The degree of the sharing scheme used.
|
|
1695
|
+
* @returns {number}
|
|
1696
|
+
*/
|
|
1697
|
+
get degree() {
|
|
1698
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_degree(this.__wbg_ptr);
|
|
1699
|
+
return ret >>> 0;
|
|
1700
|
+
}
|
|
1701
|
+
/**
|
|
1702
|
+
* The degree of the sharing scheme used.
|
|
1703
|
+
* @param {number} arg0
|
|
1704
|
+
*/
|
|
1705
|
+
set degree(arg0) {
|
|
1706
|
+
wasm.__wbg_set_userdecryptionresponsepayload_degree(this.__wbg_ptr, arg0);
|
|
1626
1707
|
}
|
|
1627
1708
|
}
|
|
1628
1709
|
|
|
@@ -1796,14 +1877,18 @@ function __wbg_get_imports() {
|
|
|
1796
1877
|
imports.wbg.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
|
|
1797
1878
|
arg0.randomFillSync(arg1);
|
|
1798
1879
|
}, arguments) };
|
|
1799
|
-
imports.wbg.__wbg_reencryptionresponse_unwrap = function(arg0) {
|
|
1800
|
-
const ret = ReencryptionResponse.__unwrap(arg0);
|
|
1801
|
-
return ret;
|
|
1802
|
-
};
|
|
1803
1880
|
imports.wbg.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
|
|
1804
1881
|
const ret = module.require;
|
|
1805
1882
|
return ret;
|
|
1806
1883
|
}, arguments) };
|
|
1884
|
+
imports.wbg.__wbg_serveridaddr_new = function(arg0) {
|
|
1885
|
+
const ret = ServerIdAddr.__wrap(arg0);
|
|
1886
|
+
return ret;
|
|
1887
|
+
};
|
|
1888
|
+
imports.wbg.__wbg_serveridaddr_unwrap = function(arg0) {
|
|
1889
|
+
const ret = ServerIdAddr.__unwrap(arg0);
|
|
1890
|
+
return ret;
|
|
1891
|
+
};
|
|
1807
1892
|
imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
1808
1893
|
arg0.set(arg1, arg2 >>> 0);
|
|
1809
1894
|
};
|
|
@@ -1854,6 +1939,10 @@ function __wbg_get_imports() {
|
|
|
1854
1939
|
const ret = TypedSigncryptedCiphertext.__unwrap(arg0);
|
|
1855
1940
|
return ret;
|
|
1856
1941
|
};
|
|
1942
|
+
imports.wbg.__wbg_userdecryptionresponse_unwrap = function(arg0) {
|
|
1943
|
+
const ret = UserDecryptionResponse.__unwrap(arg0);
|
|
1944
|
+
return ret;
|
|
1945
|
+
};
|
|
1857
1946
|
imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
|
1858
1947
|
const ret = arg0.value;
|
|
1859
1948
|
return ret;
|