tkms 0.11.0-rc9 → 0.11.1
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 +237 -176
- package/kms_lib.js +655 -520
- 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,31 +1394,130 @@ export class RequestId {
|
|
|
1338
1394
|
}
|
|
1339
1395
|
}
|
|
1340
1396
|
/**
|
|
1341
|
-
*
|
|
1397
|
+
* The client's (blockchain wallet) address, encoded using EIP-55. I.e. including `0x`.
|
|
1398
|
+
* @param {string} arg0
|
|
1399
|
+
*/
|
|
1400
|
+
set client_address(arg0) {
|
|
1401
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1402
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1403
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1404
|
+
}
|
|
1405
|
+
/**
|
|
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.
|
|
1408
|
+
* @returns {Uint8Array}
|
|
1409
|
+
*/
|
|
1410
|
+
get enc_key() {
|
|
1411
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_enc_key(this.__wbg_ptr);
|
|
1412
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1413
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1414
|
+
return v1;
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
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.
|
|
1419
|
+
* @param {Uint8Array} arg0
|
|
1420
|
+
*/
|
|
1421
|
+
set enc_key(arg0) {
|
|
1422
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1423
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1424
|
+
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
1425
|
+
}
|
|
1426
|
+
/**
|
|
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}
|
|
1429
|
+
*/
|
|
1430
|
+
get domain() {
|
|
1431
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_domain(this.__wbg_ptr);
|
|
1432
|
+
return ret === 0 ? undefined : Eip712DomainMsg.__wrap(ret);
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
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]
|
|
1437
|
+
*/
|
|
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);
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
* Extra data from the gateway.
|
|
1448
|
+
* @returns {Uint8Array}
|
|
1449
|
+
*/
|
|
1450
|
+
get extra_data() {
|
|
1451
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_extra_data(this.__wbg_ptr);
|
|
1452
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1453
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1454
|
+
return v1;
|
|
1455
|
+
}
|
|
1456
|
+
/**
|
|
1457
|
+
* Extra data from the gateway.
|
|
1458
|
+
* @param {Uint8Array} arg0
|
|
1459
|
+
*/
|
|
1460
|
+
set extra_data(arg0) {
|
|
1461
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1462
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1463
|
+
wasm.__wbg_set_eip712domainmsg_verifying_contract(this.__wbg_ptr, ptr0, len0);
|
|
1464
|
+
}
|
|
1465
|
+
/**
|
|
1466
|
+
* MPC context ID which is used to identify the context to use for this request.
|
|
1467
|
+
*
|
|
1468
|
+
* NOTE: at the moment this can be None since we do not fully support multiple contexts.
|
|
1469
|
+
* See <https://github.com/zama-ai/kms-internal/issues/2530>
|
|
1470
|
+
* @returns {RequestId | undefined}
|
|
1471
|
+
*/
|
|
1472
|
+
get context_id() {
|
|
1473
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_context_id(this.__wbg_ptr);
|
|
1474
|
+
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
1475
|
+
}
|
|
1476
|
+
/**
|
|
1477
|
+
* MPC context ID which is used to identify the context to use for this request.
|
|
1478
|
+
*
|
|
1479
|
+
* NOTE: at the moment this can be None since we do not fully support multiple contexts.
|
|
1480
|
+
* See <https://github.com/zama-ai/kms-internal/issues/2530>
|
|
1481
|
+
* @param {RequestId | null} [arg0]
|
|
1482
|
+
*/
|
|
1483
|
+
set context_id(arg0) {
|
|
1484
|
+
let ptr0 = 0;
|
|
1485
|
+
if (!isLikeNone(arg0)) {
|
|
1486
|
+
_assertClass(arg0, RequestId);
|
|
1487
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1488
|
+
}
|
|
1489
|
+
wasm.__wbg_set_userdecryptionrequest_context_id(this.__wbg_ptr, ptr0);
|
|
1490
|
+
}
|
|
1491
|
+
/**
|
|
1492
|
+
* The epoch number placeholder (zama-ai/kms-internal#2743).
|
|
1493
|
+
* @returns {RequestId | undefined}
|
|
1342
1494
|
*/
|
|
1343
|
-
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1346
|
-
|
|
1495
|
+
get epoch_id() {
|
|
1496
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_epoch_id(this.__wbg_ptr);
|
|
1497
|
+
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* The epoch number placeholder (zama-ai/kms-internal#2743).
|
|
1501
|
+
* @param {RequestId | null} [arg0]
|
|
1502
|
+
*/
|
|
1503
|
+
set epoch_id(arg0) {
|
|
1504
|
+
let ptr0 = 0;
|
|
1505
|
+
if (!isLikeNone(arg0)) {
|
|
1506
|
+
_assertClass(arg0, RequestId);
|
|
1507
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1508
|
+
}
|
|
1509
|
+
wasm.__wbg_set_userdecryptionrequest_epoch_id(this.__wbg_ptr, ptr0);
|
|
1347
1510
|
}
|
|
1348
1511
|
}
|
|
1349
1512
|
|
|
1350
|
-
const
|
|
1513
|
+
const UserDecryptionResponseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1351
1514
|
? { register: () => {}, unregister: () => {} }
|
|
1352
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1353
|
-
|
|
1354
|
-
export class TypedCiphertext {
|
|
1515
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_userdecryptionresponse_free(ptr >>> 0, 1));
|
|
1355
1516
|
|
|
1356
|
-
|
|
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
|
-
}
|
|
1517
|
+
export class UserDecryptionResponse {
|
|
1363
1518
|
|
|
1364
1519
|
static __unwrap(jsValue) {
|
|
1365
|
-
if (!(jsValue instanceof
|
|
1520
|
+
if (!(jsValue instanceof UserDecryptionResponse)) {
|
|
1366
1521
|
return 0;
|
|
1367
1522
|
}
|
|
1368
1523
|
return jsValue.__destroy_into_raw();
|
|
@@ -1371,258 +1526,230 @@ export class TypedCiphertext {
|
|
|
1371
1526
|
__destroy_into_raw() {
|
|
1372
1527
|
const ptr = this.__wbg_ptr;
|
|
1373
1528
|
this.__wbg_ptr = 0;
|
|
1374
|
-
|
|
1529
|
+
UserDecryptionResponseFinalization.unregister(this);
|
|
1375
1530
|
return ptr;
|
|
1376
1531
|
}
|
|
1377
1532
|
|
|
1378
1533
|
free() {
|
|
1379
1534
|
const ptr = this.__destroy_into_raw();
|
|
1380
|
-
wasm.
|
|
1535
|
+
wasm.__wbg_userdecryptionresponse_free(ptr, 0);
|
|
1381
1536
|
}
|
|
1382
1537
|
/**
|
|
1383
|
-
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
1384
1538
|
* @returns {Uint8Array}
|
|
1385
1539
|
*/
|
|
1386
|
-
get
|
|
1387
|
-
const ret = wasm.
|
|
1540
|
+
get signature() {
|
|
1541
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_signature(this.__wbg_ptr);
|
|
1388
1542
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1389
1543
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1390
1544
|
return v1;
|
|
1391
1545
|
}
|
|
1392
1546
|
/**
|
|
1393
|
-
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
1394
1547
|
* @param {Uint8Array} arg0
|
|
1395
1548
|
*/
|
|
1396
|
-
set
|
|
1549
|
+
set signature(arg0) {
|
|
1397
1550
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1398
1551
|
const len0 = WASM_VECTOR_LEN;
|
|
1399
1552
|
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1400
1553
|
}
|
|
1401
1554
|
/**
|
|
1402
|
-
*
|
|
1403
|
-
*
|
|
1404
|
-
*
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
/**
|
|
1411
|
-
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1412
|
-
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1413
|
-
* @param {number} arg0
|
|
1414
|
-
*/
|
|
1415
|
-
set fhe_type(arg0) {
|
|
1416
|
-
wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
|
|
1417
|
-
}
|
|
1418
|
-
/**
|
|
1419
|
-
* The external handle of the ciphertext (the handle used in the copro).
|
|
1555
|
+
* This is the external signature created from the Eip712 domain
|
|
1556
|
+
* on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
|
|
1557
|
+
* struct UserDecryptResponseVerification {
|
|
1558
|
+
* bytes publicKey;
|
|
1559
|
+
* uint256\[\] ctHandles;
|
|
1560
|
+
* bytes userDecryptedShare; // serialization of payload
|
|
1561
|
+
* bytes extraData;
|
|
1562
|
+
* }
|
|
1420
1563
|
* @returns {Uint8Array}
|
|
1421
1564
|
*/
|
|
1422
|
-
get
|
|
1423
|
-
const ret = wasm.
|
|
1565
|
+
get external_signature() {
|
|
1566
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_external_signature(this.__wbg_ptr);
|
|
1424
1567
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1425
1568
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1426
1569
|
return v1;
|
|
1427
1570
|
}
|
|
1428
1571
|
/**
|
|
1429
|
-
*
|
|
1572
|
+
* This is the external signature created from the Eip712 domain
|
|
1573
|
+
* on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
|
|
1574
|
+
* struct UserDecryptResponseVerification {
|
|
1575
|
+
* bytes publicKey;
|
|
1576
|
+
* uint256\[\] ctHandles;
|
|
1577
|
+
* bytes userDecryptedShare; // serialization of payload
|
|
1578
|
+
* bytes extraData;
|
|
1579
|
+
* }
|
|
1430
1580
|
* @param {Uint8Array} arg0
|
|
1431
1581
|
*/
|
|
1432
|
-
set
|
|
1582
|
+
set external_signature(arg0) {
|
|
1433
1583
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1434
1584
|
const len0 = WASM_VECTOR_LEN;
|
|
1435
1585
|
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1436
1586
|
}
|
|
1437
1587
|
/**
|
|
1438
|
-
* The
|
|
1439
|
-
*
|
|
1440
|
-
* @returns {number}
|
|
1588
|
+
* The actual \[UserDecryptionResponsePayload\].
|
|
1589
|
+
* @returns {UserDecryptionResponsePayload | undefined}
|
|
1441
1590
|
*/
|
|
1442
|
-
get
|
|
1443
|
-
const ret = wasm.
|
|
1444
|
-
return ret;
|
|
1591
|
+
get payload() {
|
|
1592
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_payload(this.__wbg_ptr);
|
|
1593
|
+
return ret === 0 ? undefined : UserDecryptionResponsePayload.__wrap(ret);
|
|
1445
1594
|
}
|
|
1446
1595
|
/**
|
|
1447
|
-
* The
|
|
1448
|
-
*
|
|
1449
|
-
* @param {number} arg0
|
|
1596
|
+
* The actual \[UserDecryptionResponsePayload\].
|
|
1597
|
+
* @param {UserDecryptionResponsePayload | null} [arg0]
|
|
1450
1598
|
*/
|
|
1451
|
-
set
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_typedplaintext_free(ptr >>> 0, 1));
|
|
1459
|
-
/**
|
|
1460
|
-
* The typed plaintext type, which is the result of decryption.
|
|
1461
|
-
*/
|
|
1462
|
-
export class TypedPlaintext {
|
|
1463
|
-
|
|
1464
|
-
static __wrap(ptr) {
|
|
1465
|
-
ptr = ptr >>> 0;
|
|
1466
|
-
const obj = Object.create(TypedPlaintext.prototype);
|
|
1467
|
-
obj.__wbg_ptr = ptr;
|
|
1468
|
-
TypedPlaintextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1469
|
-
return obj;
|
|
1470
|
-
}
|
|
1471
|
-
|
|
1472
|
-
__destroy_into_raw() {
|
|
1473
|
-
const ptr = this.__wbg_ptr;
|
|
1474
|
-
this.__wbg_ptr = 0;
|
|
1475
|
-
TypedPlaintextFinalization.unregister(this);
|
|
1476
|
-
return ptr;
|
|
1477
|
-
}
|
|
1478
|
-
|
|
1479
|
-
free() {
|
|
1480
|
-
const ptr = this.__destroy_into_raw();
|
|
1481
|
-
wasm.__wbg_typedplaintext_free(ptr, 0);
|
|
1599
|
+
set payload(arg0) {
|
|
1600
|
+
let ptr0 = 0;
|
|
1601
|
+
if (!isLikeNone(arg0)) {
|
|
1602
|
+
_assertClass(arg0, UserDecryptionResponsePayload);
|
|
1603
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1604
|
+
}
|
|
1605
|
+
wasm.__wbg_set_userdecryptionresponse_payload(this.__wbg_ptr, ptr0);
|
|
1482
1606
|
}
|
|
1483
1607
|
/**
|
|
1484
|
-
*
|
|
1608
|
+
* Extra data used in the EIP712 signature - external_signature.
|
|
1485
1609
|
* @returns {Uint8Array}
|
|
1486
1610
|
*/
|
|
1487
|
-
get
|
|
1488
|
-
const ret = wasm.
|
|
1611
|
+
get extra_data() {
|
|
1612
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_extra_data(this.__wbg_ptr);
|
|
1489
1613
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1490
1614
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1491
1615
|
return v1;
|
|
1492
1616
|
}
|
|
1493
1617
|
/**
|
|
1494
|
-
*
|
|
1618
|
+
* Extra data used in the EIP712 signature - external_signature.
|
|
1495
1619
|
* @param {Uint8Array} arg0
|
|
1496
1620
|
*/
|
|
1497
|
-
set
|
|
1621
|
+
set extra_data(arg0) {
|
|
1498
1622
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1499
1623
|
const len0 = WASM_VECTOR_LEN;
|
|
1500
|
-
wasm.
|
|
1501
|
-
}
|
|
1502
|
-
/**
|
|
1503
|
-
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1504
|
-
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1505
|
-
* @returns {number}
|
|
1506
|
-
*/
|
|
1507
|
-
get fhe_type() {
|
|
1508
|
-
const ret = wasm.__wbg_get_typedplaintext_fhe_type(this.__wbg_ptr);
|
|
1509
|
-
return ret;
|
|
1510
|
-
}
|
|
1511
|
-
/**
|
|
1512
|
-
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1513
|
-
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1514
|
-
* @param {number} arg0
|
|
1515
|
-
*/
|
|
1516
|
-
set fhe_type(arg0) {
|
|
1517
|
-
wasm.__wbg_set_typedplaintext_fhe_type(this.__wbg_ptr, arg0);
|
|
1624
|
+
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
1518
1625
|
}
|
|
1519
1626
|
}
|
|
1520
1627
|
|
|
1521
|
-
const
|
|
1628
|
+
const UserDecryptionResponsePayloadFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1522
1629
|
? { register: () => {}, unregister: () => {} }
|
|
1523
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1630
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_userdecryptionresponsepayload_free(ptr >>> 0, 1));
|
|
1524
1631
|
|
|
1525
|
-
export class
|
|
1632
|
+
export class UserDecryptionResponsePayload {
|
|
1526
1633
|
|
|
1527
1634
|
static __wrap(ptr) {
|
|
1528
1635
|
ptr = ptr >>> 0;
|
|
1529
|
-
const obj = Object.create(
|
|
1636
|
+
const obj = Object.create(UserDecryptionResponsePayload.prototype);
|
|
1530
1637
|
obj.__wbg_ptr = ptr;
|
|
1531
|
-
|
|
1638
|
+
UserDecryptionResponsePayloadFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1532
1639
|
return obj;
|
|
1533
1640
|
}
|
|
1534
1641
|
|
|
1535
|
-
static __unwrap(jsValue) {
|
|
1536
|
-
if (!(jsValue instanceof TypedSigncryptedCiphertext)) {
|
|
1537
|
-
return 0;
|
|
1538
|
-
}
|
|
1539
|
-
return jsValue.__destroy_into_raw();
|
|
1540
|
-
}
|
|
1541
|
-
|
|
1542
1642
|
__destroy_into_raw() {
|
|
1543
1643
|
const ptr = this.__wbg_ptr;
|
|
1544
1644
|
this.__wbg_ptr = 0;
|
|
1545
|
-
|
|
1645
|
+
UserDecryptionResponsePayloadFinalization.unregister(this);
|
|
1546
1646
|
return ptr;
|
|
1547
1647
|
}
|
|
1548
1648
|
|
|
1549
1649
|
free() {
|
|
1550
1650
|
const ptr = this.__destroy_into_raw();
|
|
1551
|
-
wasm.
|
|
1552
|
-
}
|
|
1553
|
-
/**
|
|
1554
|
-
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1555
|
-
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1556
|
-
* @returns {number}
|
|
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);
|
|
1651
|
+
wasm.__wbg_userdecryptionresponsepayload_free(ptr, 0);
|
|
1569
1652
|
}
|
|
1570
1653
|
/**
|
|
1571
|
-
* The
|
|
1572
|
-
*
|
|
1654
|
+
* The server's signature verification key, Encoded using SEC1.
|
|
1655
|
+
* Needed to validate the response, but MUST also be linked to a list of
|
|
1656
|
+
* trusted keys.
|
|
1573
1657
|
* @returns {Uint8Array}
|
|
1574
1658
|
*/
|
|
1575
|
-
get
|
|
1576
|
-
const ret = wasm.
|
|
1659
|
+
get verification_key() {
|
|
1660
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_verification_key(this.__wbg_ptr);
|
|
1577
1661
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1578
1662
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1579
1663
|
return v1;
|
|
1580
1664
|
}
|
|
1581
1665
|
/**
|
|
1582
|
-
* The
|
|
1583
|
-
*
|
|
1666
|
+
* The server's signature verification key, Encoded using SEC1.
|
|
1667
|
+
* Needed to validate the response, but MUST also be linked to a list of
|
|
1668
|
+
* trusted keys.
|
|
1584
1669
|
* @param {Uint8Array} arg0
|
|
1585
1670
|
*/
|
|
1586
|
-
set
|
|
1671
|
+
set verification_key(arg0) {
|
|
1587
1672
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1588
1673
|
const len0 = WASM_VECTOR_LEN;
|
|
1589
1674
|
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1590
1675
|
}
|
|
1591
1676
|
/**
|
|
1592
|
-
*
|
|
1677
|
+
* This is needed to ensure the response corresponds to the request.
|
|
1678
|
+
* It is the digest of UserDecryptionLinker hashed using EIP712
|
|
1679
|
+
* under the given domain in the request.
|
|
1593
1680
|
* @returns {Uint8Array}
|
|
1594
1681
|
*/
|
|
1595
|
-
get
|
|
1596
|
-
const ret = wasm.
|
|
1682
|
+
get digest() {
|
|
1683
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_digest(this.__wbg_ptr);
|
|
1597
1684
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1598
1685
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1599
1686
|
return v1;
|
|
1600
1687
|
}
|
|
1601
1688
|
/**
|
|
1602
|
-
*
|
|
1689
|
+
* This is needed to ensure the response corresponds to the request.
|
|
1690
|
+
* It is the digest of UserDecryptionLinker hashed using EIP712
|
|
1691
|
+
* under the given domain in the request.
|
|
1603
1692
|
* @param {Uint8Array} arg0
|
|
1604
1693
|
*/
|
|
1605
|
-
set
|
|
1694
|
+
set digest(arg0) {
|
|
1606
1695
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1607
1696
|
const len0 = WASM_VECTOR_LEN;
|
|
1608
1697
|
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1609
1698
|
}
|
|
1610
1699
|
/**
|
|
1611
|
-
* The
|
|
1612
|
-
*
|
|
1700
|
+
* The resulting signcrypted ciphertexts, each ciphertext
|
|
1701
|
+
* must be decrypted and then reconstructed with the other shares
|
|
1702
|
+
* to produce the final plaintext.
|
|
1703
|
+
* @returns {TypedSigncryptedCiphertext[]}
|
|
1704
|
+
*/
|
|
1705
|
+
get signcrypted_ciphertexts() {
|
|
1706
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr);
|
|
1707
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1708
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1709
|
+
return v1;
|
|
1710
|
+
}
|
|
1711
|
+
/**
|
|
1712
|
+
* The resulting signcrypted ciphertexts, each ciphertext
|
|
1713
|
+
* must be decrypted and then reconstructed with the other shares
|
|
1714
|
+
* to produce the final plaintext.
|
|
1715
|
+
* @param {TypedSigncryptedCiphertext[]} arg0
|
|
1716
|
+
*/
|
|
1717
|
+
set signcrypted_ciphertexts(arg0) {
|
|
1718
|
+
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1719
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1720
|
+
wasm.__wbg_set_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr, ptr0, len0);
|
|
1721
|
+
}
|
|
1722
|
+
/**
|
|
1723
|
+
* The ID of the MPC party doing the user decryption. Used for polynomial
|
|
1724
|
+
* reconstruction.
|
|
1613
1725
|
* @returns {number}
|
|
1614
1726
|
*/
|
|
1615
|
-
get
|
|
1616
|
-
const ret = wasm.
|
|
1727
|
+
get party_id() {
|
|
1728
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_party_id(this.__wbg_ptr);
|
|
1617
1729
|
return ret >>> 0;
|
|
1618
1730
|
}
|
|
1619
1731
|
/**
|
|
1620
|
-
* The
|
|
1621
|
-
*
|
|
1732
|
+
* The ID of the MPC party doing the user decryption. Used for polynomial
|
|
1733
|
+
* reconstruction.
|
|
1622
1734
|
* @param {number} arg0
|
|
1623
1735
|
*/
|
|
1624
|
-
set
|
|
1625
|
-
wasm.
|
|
1736
|
+
set party_id(arg0) {
|
|
1737
|
+
wasm.__wbg_set_userdecryptionresponsepayload_party_id(this.__wbg_ptr, arg0);
|
|
1738
|
+
}
|
|
1739
|
+
/**
|
|
1740
|
+
* The degree of the sharing scheme used.
|
|
1741
|
+
* @returns {number}
|
|
1742
|
+
*/
|
|
1743
|
+
get degree() {
|
|
1744
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_degree(this.__wbg_ptr);
|
|
1745
|
+
return ret >>> 0;
|
|
1746
|
+
}
|
|
1747
|
+
/**
|
|
1748
|
+
* The degree of the sharing scheme used.
|
|
1749
|
+
* @param {number} arg0
|
|
1750
|
+
*/
|
|
1751
|
+
set degree(arg0) {
|
|
1752
|
+
wasm.__wbg_set_userdecryptionresponsepayload_degree(this.__wbg_ptr, arg0);
|
|
1626
1753
|
}
|
|
1627
1754
|
}
|
|
1628
1755
|
|
|
@@ -1796,14 +1923,18 @@ function __wbg_get_imports() {
|
|
|
1796
1923
|
imports.wbg.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
|
|
1797
1924
|
arg0.randomFillSync(arg1);
|
|
1798
1925
|
}, arguments) };
|
|
1799
|
-
imports.wbg.__wbg_reencryptionresponse_unwrap = function(arg0) {
|
|
1800
|
-
const ret = ReencryptionResponse.__unwrap(arg0);
|
|
1801
|
-
return ret;
|
|
1802
|
-
};
|
|
1803
1926
|
imports.wbg.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
|
|
1804
1927
|
const ret = module.require;
|
|
1805
1928
|
return ret;
|
|
1806
1929
|
}, arguments) };
|
|
1930
|
+
imports.wbg.__wbg_serveridaddr_new = function(arg0) {
|
|
1931
|
+
const ret = ServerIdAddr.__wrap(arg0);
|
|
1932
|
+
return ret;
|
|
1933
|
+
};
|
|
1934
|
+
imports.wbg.__wbg_serveridaddr_unwrap = function(arg0) {
|
|
1935
|
+
const ret = ServerIdAddr.__unwrap(arg0);
|
|
1936
|
+
return ret;
|
|
1937
|
+
};
|
|
1807
1938
|
imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
1808
1939
|
arg0.set(arg1, arg2 >>> 0);
|
|
1809
1940
|
};
|
|
@@ -1854,6 +1985,10 @@ function __wbg_get_imports() {
|
|
|
1854
1985
|
const ret = TypedSigncryptedCiphertext.__unwrap(arg0);
|
|
1855
1986
|
return ret;
|
|
1856
1987
|
};
|
|
1988
|
+
imports.wbg.__wbg_userdecryptionresponse_unwrap = function(arg0) {
|
|
1989
|
+
const ret = UserDecryptionResponse.__unwrap(arg0);
|
|
1990
|
+
return ret;
|
|
1991
|
+
};
|
|
1857
1992
|
imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
|
1858
1993
|
const ret = arg0.value;
|
|
1859
1994
|
return ret;
|