node-tkms 0.9.1-rc3 → 0.11.0-rc11
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 +180 -210
- package/kms_lib.js +747 -548
- package/kms_lib_bg.wasm +0 -0
- package/package.json +1 -1
- package/LICENSE +0 -28
package/kms_lib.js
CHANGED
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
let imports = {};
|
|
3
3
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
4
4
|
let wasm;
|
|
5
|
-
const {
|
|
5
|
+
const { TextEncoder, TextDecoder } = require(`util`);
|
|
6
6
|
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
cachedTextDecoder.decode();
|
|
7
|
+
let WASM_VECTOR_LEN = 0;
|
|
10
8
|
|
|
11
9
|
let cachedUint8ArrayMemory0 = null;
|
|
12
10
|
|
|
@@ -17,13 +15,6 @@ function getUint8ArrayMemory0() {
|
|
|
17
15
|
return cachedUint8ArrayMemory0;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
function getStringFromWasm0(ptr, len) {
|
|
21
|
-
ptr = ptr >>> 0;
|
|
22
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
let WASM_VECTOR_LEN = 0;
|
|
26
|
-
|
|
27
18
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
28
19
|
|
|
29
20
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -78,10 +69,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
78
69
|
return ptr;
|
|
79
70
|
}
|
|
80
71
|
|
|
81
|
-
function isLikeNone(x) {
|
|
82
|
-
return x === undefined || x === null;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
72
|
let cachedDataViewMemory0 = null;
|
|
86
73
|
|
|
87
74
|
function getDataViewMemory0() {
|
|
@@ -91,6 +78,34 @@ function getDataViewMemory0() {
|
|
|
91
78
|
return cachedDataViewMemory0;
|
|
92
79
|
}
|
|
93
80
|
|
|
81
|
+
function addToExternrefTable0(obj) {
|
|
82
|
+
const idx = wasm.__externref_table_alloc();
|
|
83
|
+
wasm.__wbindgen_export_4.set(idx, obj);
|
|
84
|
+
return idx;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function handleError(f, args) {
|
|
88
|
+
try {
|
|
89
|
+
return f.apply(this, args);
|
|
90
|
+
} catch (e) {
|
|
91
|
+
const idx = addToExternrefTable0(e);
|
|
92
|
+
wasm.__wbindgen_exn_store(idx);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
97
|
+
|
|
98
|
+
cachedTextDecoder.decode();
|
|
99
|
+
|
|
100
|
+
function getStringFromWasm0(ptr, len) {
|
|
101
|
+
ptr = ptr >>> 0;
|
|
102
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function isLikeNone(x) {
|
|
106
|
+
return x === undefined || x === null;
|
|
107
|
+
}
|
|
108
|
+
|
|
94
109
|
function debugString(val) {
|
|
95
110
|
// primitive types
|
|
96
111
|
const type = typeof val;
|
|
@@ -132,7 +147,7 @@ function debugString(val) {
|
|
|
132
147
|
// Test for built-in
|
|
133
148
|
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
134
149
|
let className;
|
|
135
|
-
if (builtInMatches.length > 1) {
|
|
150
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
136
151
|
className = builtInMatches[1];
|
|
137
152
|
} else {
|
|
138
153
|
// Failed to match the standard '[object ClassName]'
|
|
@@ -160,7 +175,6 @@ function _assertClass(instance, klass) {
|
|
|
160
175
|
if (!(instance instanceof klass)) {
|
|
161
176
|
throw new Error(`expected instance of ${klass.name}`);
|
|
162
177
|
}
|
|
163
|
-
return instance.ptr;
|
|
164
178
|
}
|
|
165
179
|
|
|
166
180
|
function getArrayU8FromWasm0(ptr, len) {
|
|
@@ -187,7 +201,7 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
187
201
|
}
|
|
188
202
|
|
|
189
203
|
function takeFromExternrefTable0(idx) {
|
|
190
|
-
const value = wasm.
|
|
204
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
191
205
|
wasm.__externref_table_dealloc(idx);
|
|
192
206
|
return value;
|
|
193
207
|
}
|
|
@@ -234,17 +248,11 @@ module.exports.u8vec_to_private_sig_key = function(v) {
|
|
|
234
248
|
return PrivateSigKey.__wrap(ret[0]);
|
|
235
249
|
};
|
|
236
250
|
|
|
237
|
-
function addToExternrefTable0(obj) {
|
|
238
|
-
const idx = wasm.__externref_table_alloc();
|
|
239
|
-
wasm.__wbindgen_export_2.set(idx, obj);
|
|
240
|
-
return idx;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
251
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
244
252
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
245
|
-
const mem = getDataViewMemory0();
|
|
246
253
|
for (let i = 0; i < array.length; i++) {
|
|
247
|
-
|
|
254
|
+
const add = addToExternrefTable0(array[i]);
|
|
255
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
248
256
|
}
|
|
249
257
|
WASM_VECTOR_LEN = array.length;
|
|
250
258
|
return ptr;
|
|
@@ -258,19 +266,19 @@ function passArrayJsValueToWasm0(array, malloc) {
|
|
|
258
266
|
* * `client_address_hex` - the client (wallet) address in hex,
|
|
259
267
|
* must be prefixed with "0x".
|
|
260
268
|
*
|
|
261
|
-
* * `
|
|
269
|
+
* * `fhe_parameter` - the parameter choice, which can be either `"test"` or `"default"`.
|
|
262
270
|
* The "default" parameter choice is selected if no matching string is found.
|
|
263
|
-
* @param {
|
|
271
|
+
* @param {string[]} server_addrs
|
|
264
272
|
* @param {string} client_address_hex
|
|
265
|
-
* @param {string}
|
|
273
|
+
* @param {string} fhe_parameter
|
|
266
274
|
* @returns {Client}
|
|
267
275
|
*/
|
|
268
|
-
module.exports.new_client = function(server_addrs, client_address_hex,
|
|
276
|
+
module.exports.new_client = function(server_addrs, client_address_hex, fhe_parameter) {
|
|
269
277
|
const ptr0 = passArrayJsValueToWasm0(server_addrs, wasm.__wbindgen_malloc);
|
|
270
278
|
const len0 = WASM_VECTOR_LEN;
|
|
271
279
|
const ptr1 = passStringToWasm0(client_address_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
272
280
|
const len1 = WASM_VECTOR_LEN;
|
|
273
|
-
const ptr2 = passStringToWasm0(
|
|
281
|
+
const ptr2 = passStringToWasm0(fhe_parameter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
274
282
|
const len2 = WASM_VECTOR_LEN;
|
|
275
283
|
const ret = wasm.new_client(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
276
284
|
if (ret[2]) {
|
|
@@ -284,14 +292,14 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
284
292
|
const mem = getDataViewMemory0();
|
|
285
293
|
const result = [];
|
|
286
294
|
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
287
|
-
result.push(wasm.
|
|
295
|
+
result.push(wasm.__wbindgen_export_4.get(mem.getUint32(i, true)));
|
|
288
296
|
}
|
|
289
297
|
wasm.__externref_drop_slice(ptr, len);
|
|
290
298
|
return result;
|
|
291
299
|
}
|
|
292
300
|
/**
|
|
293
301
|
* @param {Client} client
|
|
294
|
-
* @returns {
|
|
302
|
+
* @returns {string[]}
|
|
295
303
|
*/
|
|
296
304
|
module.exports.get_server_addrs = function(client) {
|
|
297
305
|
_assertClass(client, Client);
|
|
@@ -437,22 +445,23 @@ module.exports.cryptobox_decrypt = function(ct, my_sk, their_pk) {
|
|
|
437
445
|
};
|
|
438
446
|
|
|
439
447
|
/**
|
|
440
|
-
* Process the
|
|
448
|
+
* Process the user_decryption response from JavaScript objects.
|
|
441
449
|
* The returned result is a byte array representing a plaintext of any length,
|
|
442
450
|
* postprocessing is returned to turn it into an integer.
|
|
443
451
|
*
|
|
444
|
-
* * `client` - client that wants to perform
|
|
452
|
+
* * `client` - client that wants to perform user_decryption.
|
|
445
453
|
*
|
|
446
|
-
* * `request` - the initial
|
|
454
|
+
* * `request` - the initial user_decryption request JS object.
|
|
447
455
|
* It can be set to null if `verify` is false.
|
|
448
456
|
* Otherwise the caller needs to give the following JS object.
|
|
449
457
|
* Note that `client_address` and `eip712_verifying_contract` follow EIP-55.
|
|
458
|
+
* The signature field is not needed.
|
|
450
459
|
* ```
|
|
451
460
|
* {
|
|
452
|
-
* signature:
|
|
461
|
+
* signature: undefined,
|
|
453
462
|
* client_address: '0x17853A630aAe15AED549B2B874de08B73C0F59c5',
|
|
454
463
|
* enc_key: '2000000000000000df2fcacb774f03187f3802a27259f45c06d33cefa68d9c53426b15ad531aa822',
|
|
455
|
-
*
|
|
464
|
+
* ciphertext_handles: [ '0748b542afe2353c86cb707e3d21044b0be1fd18efc7cbaa6a415af055bfb358' ]
|
|
456
465
|
* eip712_verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657'
|
|
457
466
|
* }
|
|
458
467
|
* ```
|
|
@@ -501,36 +510,36 @@ module.exports.cryptobox_decrypt = function(ct, my_sk, their_pk) {
|
|
|
501
510
|
* @param {PublicEncKey} enc_pk
|
|
502
511
|
* @param {PrivateEncKey} enc_sk
|
|
503
512
|
* @param {boolean} verify
|
|
504
|
-
* @returns {
|
|
513
|
+
* @returns {TypedPlaintext[]}
|
|
505
514
|
*/
|
|
506
|
-
module.exports.
|
|
515
|
+
module.exports.process_user_decryption_resp_from_js = function(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
|
|
507
516
|
_assertClass(client, Client);
|
|
508
517
|
_assertClass(enc_pk, PublicEncKey);
|
|
509
518
|
_assertClass(enc_sk, PrivateEncKey);
|
|
510
|
-
const ret = wasm.
|
|
519
|
+
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);
|
|
511
520
|
if (ret[3]) {
|
|
512
521
|
throw takeFromExternrefTable0(ret[2]);
|
|
513
522
|
}
|
|
514
|
-
var v1 =
|
|
515
|
-
wasm.__wbindgen_free(ret[0], ret[1] *
|
|
523
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
524
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
516
525
|
return v1;
|
|
517
526
|
};
|
|
518
527
|
|
|
519
528
|
/**
|
|
520
|
-
* Process the
|
|
521
|
-
* Consider using [
|
|
529
|
+
* Process the user_decryption response from Rust objects.
|
|
530
|
+
* Consider using [process_user_decryption_resp_from_js]
|
|
522
531
|
* when using the JS API.
|
|
523
532
|
* The result is a byte array representing a plaintext of any length.
|
|
524
533
|
*
|
|
525
|
-
* * `client` - client that wants to perform
|
|
534
|
+
* * `client` - client that wants to perform user_decryption.
|
|
526
535
|
*
|
|
527
|
-
* * `request` - the initial
|
|
536
|
+
* * `request` - the initial user_decryption request.
|
|
528
537
|
* Must be given if `verify` is true.
|
|
529
538
|
*
|
|
530
539
|
* * `eip712_domain` - the EIP-712 domain.
|
|
531
540
|
* Must be given if `verify` is true.
|
|
532
541
|
*
|
|
533
|
-
* * `agg_resp` - the vector of
|
|
542
|
+
* * `agg_resp` - the vector of user_decryption responses.
|
|
534
543
|
*
|
|
535
544
|
* * `enc_pk` - The ephemeral public key.
|
|
536
545
|
*
|
|
@@ -539,19 +548,19 @@ module.exports.process_reencryption_resp_from_js = function(client, request, eip
|
|
|
539
548
|
* * `verify` - Whether to perform signature verification for the response.
|
|
540
549
|
* It is insecure if `verify = false`!
|
|
541
550
|
* @param {Client} client
|
|
542
|
-
* @param {
|
|
543
|
-
* @param {Eip712DomainMsg | undefined} eip712_domain
|
|
544
|
-
* @param {
|
|
551
|
+
* @param {ParsedUserDecryptionRequest | null | undefined} request
|
|
552
|
+
* @param {Eip712DomainMsg | null | undefined} eip712_domain
|
|
553
|
+
* @param {UserDecryptionResponse[]} agg_resp
|
|
545
554
|
* @param {PublicEncKey} enc_pk
|
|
546
555
|
* @param {PrivateEncKey} enc_sk
|
|
547
556
|
* @param {boolean} verify
|
|
548
|
-
* @returns {
|
|
557
|
+
* @returns {TypedPlaintext[]}
|
|
549
558
|
*/
|
|
550
|
-
module.exports.
|
|
559
|
+
module.exports.process_user_decryption_resp = function(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
|
|
551
560
|
_assertClass(client, Client);
|
|
552
561
|
let ptr0 = 0;
|
|
553
562
|
if (!isLikeNone(request)) {
|
|
554
|
-
_assertClass(request,
|
|
563
|
+
_assertClass(request, ParsedUserDecryptionRequest);
|
|
555
564
|
ptr0 = request.__destroy_into_raw();
|
|
556
565
|
}
|
|
557
566
|
let ptr1 = 0;
|
|
@@ -563,27 +572,34 @@ module.exports.process_reencryption_resp = function(client, request, eip712_doma
|
|
|
563
572
|
const len2 = WASM_VECTOR_LEN;
|
|
564
573
|
_assertClass(enc_pk, PublicEncKey);
|
|
565
574
|
_assertClass(enc_sk, PrivateEncKey);
|
|
566
|
-
const ret = wasm.
|
|
575
|
+
const ret = wasm.process_user_decryption_resp(client.__wbg_ptr, ptr0, ptr1, ptr2, len2, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
|
|
567
576
|
if (ret[3]) {
|
|
568
577
|
throw takeFromExternrefTable0(ret[2]);
|
|
569
578
|
}
|
|
570
|
-
var v4 =
|
|
571
|
-
wasm.__wbindgen_free(ret[0], ret[1] *
|
|
579
|
+
var v4 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
580
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
572
581
|
return v4;
|
|
573
582
|
};
|
|
574
583
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
584
|
+
const CiphertextHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
585
|
+
? { register: () => {}, unregister: () => {} }
|
|
586
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ciphertexthandle_free(ptr >>> 0, 1));
|
|
587
|
+
|
|
588
|
+
class CiphertextHandle {
|
|
589
|
+
|
|
590
|
+
__destroy_into_raw() {
|
|
591
|
+
const ptr = this.__wbg_ptr;
|
|
592
|
+
this.__wbg_ptr = 0;
|
|
593
|
+
CiphertextHandleFinalization.unregister(this);
|
|
594
|
+
return ptr;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
free() {
|
|
598
|
+
const ptr = this.__destroy_into_raw();
|
|
599
|
+
wasm.__wbg_ciphertexthandle_free(ptr, 0);
|
|
581
600
|
}
|
|
582
601
|
}
|
|
583
|
-
|
|
584
|
-
* The plaintext types that can be encrypted in a fhevm ciphertext.
|
|
585
|
-
*/
|
|
586
|
-
module.exports.FheType = Object.freeze({ Ebool:0,"0":"Ebool",Euint4:1,"1":"Euint4",Euint8:2,"2":"Euint8",Euint16:3,"3":"Euint16",Euint32:4,"4":"Euint32",Euint64:5,"5":"Euint64",Euint128:6,"6":"Euint128",Euint160:7,"7":"Euint160",Euint256:8,"8":"Euint256",Euint512:9,"9":"Euint512",Euint1024:10,"10":"Euint1024",Euint2048:11,"11":"Euint2048", });
|
|
602
|
+
module.exports.CiphertextHandle = CiphertextHandle;
|
|
587
603
|
|
|
588
604
|
const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
589
605
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -775,7 +791,7 @@ class Eip712DomainMsg {
|
|
|
775
791
|
return v1;
|
|
776
792
|
}
|
|
777
793
|
/**
|
|
778
|
-
* @param {Uint8Array |
|
|
794
|
+
* @param {Uint8Array | null} [arg0]
|
|
779
795
|
*/
|
|
780
796
|
set salt(arg0) {
|
|
781
797
|
var ptr0 = isLikeNone(arg0) ? 0 : passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
@@ -785,27 +801,27 @@ class Eip712DomainMsg {
|
|
|
785
801
|
}
|
|
786
802
|
module.exports.Eip712DomainMsg = Eip712DomainMsg;
|
|
787
803
|
|
|
788
|
-
const
|
|
804
|
+
const ParsedUserDecryptionRequestFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
789
805
|
? { register: () => {}, unregister: () => {} }
|
|
790
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
806
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_parseduserdecryptionrequest_free(ptr >>> 0, 1));
|
|
791
807
|
/**
|
|
792
808
|
* Validity of this struct is not checked.
|
|
793
809
|
*/
|
|
794
|
-
class
|
|
810
|
+
class ParsedUserDecryptionRequest {
|
|
795
811
|
|
|
796
812
|
__destroy_into_raw() {
|
|
797
813
|
const ptr = this.__wbg_ptr;
|
|
798
814
|
this.__wbg_ptr = 0;
|
|
799
|
-
|
|
815
|
+
ParsedUserDecryptionRequestFinalization.unregister(this);
|
|
800
816
|
return ptr;
|
|
801
817
|
}
|
|
802
818
|
|
|
803
819
|
free() {
|
|
804
820
|
const ptr = this.__destroy_into_raw();
|
|
805
|
-
wasm.
|
|
821
|
+
wasm.__wbg_parseduserdecryptionrequest_free(ptr, 0);
|
|
806
822
|
}
|
|
807
823
|
}
|
|
808
|
-
module.exports.
|
|
824
|
+
module.exports.ParsedUserDecryptionRequest = ParsedUserDecryptionRequest;
|
|
809
825
|
|
|
810
826
|
const PrivateEncKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
811
827
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -919,288 +935,499 @@ class PublicSigKey {
|
|
|
919
935
|
}
|
|
920
936
|
module.exports.PublicSigKey = PublicSigKey;
|
|
921
937
|
|
|
922
|
-
const
|
|
938
|
+
const RequestIdFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
939
|
+
? { register: () => {}, unregister: () => {} }
|
|
940
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_requestid_free(ptr >>> 0, 1));
|
|
941
|
+
/**
|
|
942
|
+
* Simple response to return a 32 Byte / 256 Bit ID, to be used to retrieve the
|
|
943
|
+
* computed result later on. This string does NOT contain a `0x` prefix.
|
|
944
|
+
*/
|
|
945
|
+
class RequestId {
|
|
946
|
+
|
|
947
|
+
static __wrap(ptr) {
|
|
948
|
+
ptr = ptr >>> 0;
|
|
949
|
+
const obj = Object.create(RequestId.prototype);
|
|
950
|
+
obj.__wbg_ptr = ptr;
|
|
951
|
+
RequestIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
952
|
+
return obj;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
__destroy_into_raw() {
|
|
956
|
+
const ptr = this.__wbg_ptr;
|
|
957
|
+
this.__wbg_ptr = 0;
|
|
958
|
+
RequestIdFinalization.unregister(this);
|
|
959
|
+
return ptr;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
free() {
|
|
963
|
+
const ptr = this.__destroy_into_raw();
|
|
964
|
+
wasm.__wbg_requestid_free(ptr, 0);
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* @returns {string}
|
|
968
|
+
*/
|
|
969
|
+
get request_id() {
|
|
970
|
+
let deferred1_0;
|
|
971
|
+
let deferred1_1;
|
|
972
|
+
try {
|
|
973
|
+
const ret = wasm.__wbg_get_requestid_request_id(this.__wbg_ptr);
|
|
974
|
+
deferred1_0 = ret[0];
|
|
975
|
+
deferred1_1 = ret[1];
|
|
976
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
977
|
+
} finally {
|
|
978
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* @param {string} arg0
|
|
983
|
+
*/
|
|
984
|
+
set request_id(arg0) {
|
|
985
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
986
|
+
const len0 = WASM_VECTOR_LEN;
|
|
987
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
module.exports.RequestId = RequestId;
|
|
991
|
+
|
|
992
|
+
const TypedCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
923
993
|
? { register: () => {}, unregister: () => {} }
|
|
924
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
994
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_typedciphertext_free(ptr >>> 0, 1));
|
|
995
|
+
|
|
996
|
+
class TypedCiphertext {
|
|
925
997
|
|
|
926
|
-
|
|
998
|
+
static __wrap(ptr) {
|
|
999
|
+
ptr = ptr >>> 0;
|
|
1000
|
+
const obj = Object.create(TypedCiphertext.prototype);
|
|
1001
|
+
obj.__wbg_ptr = ptr;
|
|
1002
|
+
TypedCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1003
|
+
return obj;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
static __unwrap(jsValue) {
|
|
1007
|
+
if (!(jsValue instanceof TypedCiphertext)) {
|
|
1008
|
+
return 0;
|
|
1009
|
+
}
|
|
1010
|
+
return jsValue.__destroy_into_raw();
|
|
1011
|
+
}
|
|
927
1012
|
|
|
928
1013
|
__destroy_into_raw() {
|
|
929
1014
|
const ptr = this.__wbg_ptr;
|
|
930
1015
|
this.__wbg_ptr = 0;
|
|
931
|
-
|
|
1016
|
+
TypedCiphertextFinalization.unregister(this);
|
|
932
1017
|
return ptr;
|
|
933
1018
|
}
|
|
934
1019
|
|
|
935
1020
|
free() {
|
|
936
1021
|
const ptr = this.__destroy_into_raw();
|
|
937
|
-
wasm.
|
|
1022
|
+
wasm.__wbg_typedciphertext_free(ptr, 0);
|
|
938
1023
|
}
|
|
939
1024
|
/**
|
|
940
|
-
*
|
|
1025
|
+
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
941
1026
|
* @returns {Uint8Array}
|
|
942
1027
|
*/
|
|
943
|
-
get
|
|
944
|
-
const ret = wasm.
|
|
1028
|
+
get ciphertext() {
|
|
1029
|
+
const ret = wasm.__wbg_get_typedciphertext_ciphertext(this.__wbg_ptr);
|
|
945
1030
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
946
1031
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
947
1032
|
return v1;
|
|
948
1033
|
}
|
|
949
1034
|
/**
|
|
950
|
-
*
|
|
1035
|
+
* The actual ciphertext to decrypt, taken directly from fhevm.
|
|
951
1036
|
* @param {Uint8Array} arg0
|
|
952
1037
|
*/
|
|
953
|
-
set
|
|
1038
|
+
set ciphertext(arg0) {
|
|
954
1039
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
955
1040
|
const len0 = WASM_VECTOR_LEN;
|
|
956
1041
|
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
957
1042
|
}
|
|
958
1043
|
/**
|
|
959
|
-
*
|
|
1044
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1045
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1046
|
+
* @returns {number}
|
|
960
1047
|
*/
|
|
961
|
-
get
|
|
962
|
-
const ret = wasm.
|
|
963
|
-
return ret
|
|
1048
|
+
get fhe_type() {
|
|
1049
|
+
const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
|
|
1050
|
+
return ret;
|
|
964
1051
|
}
|
|
965
1052
|
/**
|
|
966
|
-
*
|
|
1053
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1054
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1055
|
+
* @param {number} arg0
|
|
967
1056
|
*/
|
|
968
|
-
set
|
|
969
|
-
|
|
970
|
-
if (!isLikeNone(arg0)) {
|
|
971
|
-
_assertClass(arg0, ReencryptionRequestPayload);
|
|
972
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
973
|
-
}
|
|
974
|
-
wasm.__wbg_set_reencryptionrequest_payload(this.__wbg_ptr, ptr0);
|
|
1057
|
+
set fhe_type(arg0) {
|
|
1058
|
+
wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
|
|
975
1059
|
}
|
|
976
1060
|
/**
|
|
977
|
-
*
|
|
1061
|
+
* The external handle of the ciphertext (the handle used in the copro).
|
|
1062
|
+
* @returns {Uint8Array}
|
|
978
1063
|
*/
|
|
979
|
-
get
|
|
980
|
-
const ret = wasm.
|
|
981
|
-
|
|
1064
|
+
get external_handle() {
|
|
1065
|
+
const ret = wasm.__wbg_get_typedciphertext_external_handle(this.__wbg_ptr);
|
|
1066
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1067
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1068
|
+
return v1;
|
|
982
1069
|
}
|
|
983
1070
|
/**
|
|
984
|
-
*
|
|
1071
|
+
* The external handle of the ciphertext (the handle used in the copro).
|
|
1072
|
+
* @param {Uint8Array} arg0
|
|
985
1073
|
*/
|
|
986
|
-
set
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
991
|
-
}
|
|
992
|
-
wasm.__wbg_set_reencryptionrequest_domain(this.__wbg_ptr, ptr0);
|
|
1074
|
+
set external_handle(arg0) {
|
|
1075
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1076
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1077
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
993
1078
|
}
|
|
994
1079
|
/**
|
|
995
|
-
* The
|
|
996
|
-
*
|
|
997
|
-
* @returns {
|
|
1080
|
+
* The ciphertext format, see CiphertextFormat documentation for details.
|
|
1081
|
+
* CiphertextFormat::default() is used if unspecified.
|
|
1082
|
+
* @returns {number}
|
|
998
1083
|
*/
|
|
999
|
-
get
|
|
1000
|
-
const ret = wasm.
|
|
1001
|
-
return ret
|
|
1084
|
+
get ciphertext_format() {
|
|
1085
|
+
const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
|
|
1086
|
+
return ret;
|
|
1002
1087
|
}
|
|
1003
1088
|
/**
|
|
1004
|
-
* The
|
|
1005
|
-
*
|
|
1006
|
-
* @param {
|
|
1089
|
+
* The ciphertext format, see CiphertextFormat documentation for details.
|
|
1090
|
+
* CiphertextFormat::default() is used if unspecified.
|
|
1091
|
+
* @param {number} arg0
|
|
1007
1092
|
*/
|
|
1008
|
-
set
|
|
1009
|
-
|
|
1010
|
-
if (!isLikeNone(arg0)) {
|
|
1011
|
-
_assertClass(arg0, RequestId);
|
|
1012
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
1013
|
-
}
|
|
1014
|
-
wasm.__wbg_set_reencryptionrequest_request_id(this.__wbg_ptr, ptr0);
|
|
1093
|
+
set ciphertext_format(arg0) {
|
|
1094
|
+
wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
|
|
1015
1095
|
}
|
|
1016
1096
|
}
|
|
1017
|
-
module.exports.
|
|
1097
|
+
module.exports.TypedCiphertext = TypedCiphertext;
|
|
1018
1098
|
|
|
1019
|
-
const
|
|
1099
|
+
const TypedPlaintextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1020
1100
|
? { register: () => {}, unregister: () => {} }
|
|
1021
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1101
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_typedplaintext_free(ptr >>> 0, 1));
|
|
1022
1102
|
|
|
1023
|
-
class
|
|
1103
|
+
class TypedPlaintext {
|
|
1024
1104
|
|
|
1025
1105
|
static __wrap(ptr) {
|
|
1026
1106
|
ptr = ptr >>> 0;
|
|
1027
|
-
const obj = Object.create(
|
|
1107
|
+
const obj = Object.create(TypedPlaintext.prototype);
|
|
1028
1108
|
obj.__wbg_ptr = ptr;
|
|
1029
|
-
|
|
1109
|
+
TypedPlaintextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1030
1110
|
return obj;
|
|
1031
1111
|
}
|
|
1032
1112
|
|
|
1033
1113
|
__destroy_into_raw() {
|
|
1034
1114
|
const ptr = this.__wbg_ptr;
|
|
1035
1115
|
this.__wbg_ptr = 0;
|
|
1036
|
-
|
|
1116
|
+
TypedPlaintextFinalization.unregister(this);
|
|
1037
1117
|
return ptr;
|
|
1038
1118
|
}
|
|
1039
1119
|
|
|
1040
1120
|
free() {
|
|
1041
1121
|
const ptr = this.__destroy_into_raw();
|
|
1042
|
-
wasm.
|
|
1043
|
-
}
|
|
1044
|
-
/**
|
|
1045
|
-
* Version of the request format.
|
|
1046
|
-
* @returns {number}
|
|
1047
|
-
*/
|
|
1048
|
-
get version() {
|
|
1049
|
-
const ret = wasm.__wbg_get_reencryptionrequestpayload_version(this.__wbg_ptr);
|
|
1050
|
-
return ret >>> 0;
|
|
1051
|
-
}
|
|
1052
|
-
/**
|
|
1053
|
-
* Version of the request format.
|
|
1054
|
-
* @param {number} arg0
|
|
1055
|
-
*/
|
|
1056
|
-
set version(arg0) {
|
|
1057
|
-
wasm.__wbg_set_reencryptionrequestpayload_version(this.__wbg_ptr, arg0);
|
|
1058
|
-
}
|
|
1059
|
-
/**
|
|
1060
|
-
* The client's (blockchain wallet) address,
|
|
1061
|
-
* encoded using EIP-55.
|
|
1062
|
-
* @returns {string}
|
|
1063
|
-
*/
|
|
1064
|
-
get client_address() {
|
|
1065
|
-
let deferred1_0;
|
|
1066
|
-
let deferred1_1;
|
|
1067
|
-
try {
|
|
1068
|
-
const ret = wasm.__wbg_get_reencryptionrequestpayload_client_address(this.__wbg_ptr);
|
|
1069
|
-
deferred1_0 = ret[0];
|
|
1070
|
-
deferred1_1 = ret[1];
|
|
1071
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1072
|
-
} finally {
|
|
1073
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
/**
|
|
1077
|
-
* The client's (blockchain wallet) address,
|
|
1078
|
-
* encoded using EIP-55.
|
|
1079
|
-
* @param {string} arg0
|
|
1080
|
-
*/
|
|
1081
|
-
set client_address(arg0) {
|
|
1082
|
-
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1083
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1084
|
-
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1122
|
+
wasm.__wbg_typedplaintext_free(ptr, 0);
|
|
1085
1123
|
}
|
|
1086
1124
|
/**
|
|
1087
|
-
*
|
|
1088
|
-
* Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
|
|
1089
|
-
* Montgomery point.
|
|
1125
|
+
* The actual plaintext in bytes.
|
|
1090
1126
|
* @returns {Uint8Array}
|
|
1091
1127
|
*/
|
|
1092
|
-
get
|
|
1093
|
-
const ret = wasm.
|
|
1128
|
+
get bytes() {
|
|
1129
|
+
const ret = wasm.__wbg_get_typedplaintext_bytes(this.__wbg_ptr);
|
|
1094
1130
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1095
1131
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1096
1132
|
return v1;
|
|
1097
1133
|
}
|
|
1098
1134
|
/**
|
|
1099
|
-
*
|
|
1100
|
-
* Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
|
|
1101
|
-
* Montgomery point.
|
|
1135
|
+
* The actual plaintext in bytes.
|
|
1102
1136
|
* @param {Uint8Array} arg0
|
|
1103
1137
|
*/
|
|
1104
|
-
set
|
|
1138
|
+
set bytes(arg0) {
|
|
1105
1139
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1106
1140
|
const len0 = WASM_VECTOR_LEN;
|
|
1107
|
-
wasm.
|
|
1141
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1108
1142
|
}
|
|
1109
1143
|
/**
|
|
1110
|
-
* The type of plaintext encrypted.
|
|
1144
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1145
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1111
1146
|
* @returns {number}
|
|
1112
1147
|
*/
|
|
1113
1148
|
get fhe_type() {
|
|
1114
|
-
const ret = wasm.
|
|
1149
|
+
const ret = wasm.__wbg_get_typedplaintext_fhe_type(this.__wbg_ptr);
|
|
1115
1150
|
return ret;
|
|
1116
1151
|
}
|
|
1117
1152
|
/**
|
|
1118
|
-
* The type of plaintext encrypted.
|
|
1153
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1154
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1119
1155
|
* @param {number} arg0
|
|
1120
1156
|
*/
|
|
1121
1157
|
set fhe_type(arg0) {
|
|
1122
|
-
wasm.
|
|
1158
|
+
wasm.__wbg_set_typedplaintext_fhe_type(this.__wbg_ptr, arg0);
|
|
1123
1159
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1160
|
+
}
|
|
1161
|
+
module.exports.TypedPlaintext = TypedPlaintext;
|
|
1162
|
+
|
|
1163
|
+
const TypedSigncryptedCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1164
|
+
? { register: () => {}, unregister: () => {} }
|
|
1165
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_typedsigncryptedciphertext_free(ptr >>> 0, 1));
|
|
1166
|
+
|
|
1167
|
+
class TypedSigncryptedCiphertext {
|
|
1168
|
+
|
|
1169
|
+
static __wrap(ptr) {
|
|
1170
|
+
ptr = ptr >>> 0;
|
|
1171
|
+
const obj = Object.create(TypedSigncryptedCiphertext.prototype);
|
|
1172
|
+
obj.__wbg_ptr = ptr;
|
|
1173
|
+
TypedSigncryptedCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1174
|
+
return obj;
|
|
1132
1175
|
}
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
*/
|
|
1138
|
-
set key_id(arg0) {
|
|
1139
|
-
let ptr0 = 0;
|
|
1140
|
-
if (!isLikeNone(arg0)) {
|
|
1141
|
-
_assertClass(arg0, RequestId);
|
|
1142
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
1176
|
+
|
|
1177
|
+
static __unwrap(jsValue) {
|
|
1178
|
+
if (!(jsValue instanceof TypedSigncryptedCiphertext)) {
|
|
1179
|
+
return 0;
|
|
1143
1180
|
}
|
|
1144
|
-
|
|
1181
|
+
return jsValue.__destroy_into_raw();
|
|
1145
1182
|
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1183
|
+
|
|
1184
|
+
__destroy_into_raw() {
|
|
1185
|
+
const ptr = this.__wbg_ptr;
|
|
1186
|
+
this.__wbg_ptr = 0;
|
|
1187
|
+
TypedSigncryptedCiphertextFinalization.unregister(this);
|
|
1188
|
+
return ptr;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
free() {
|
|
1192
|
+
const ptr = this.__destroy_into_raw();
|
|
1193
|
+
wasm.__wbg_typedsigncryptedciphertext_free(ptr, 0);
|
|
1194
|
+
}
|
|
1195
|
+
/**
|
|
1196
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1197
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1198
|
+
* @returns {number}
|
|
1152
1199
|
*/
|
|
1153
|
-
get
|
|
1154
|
-
const ret = wasm.
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1200
|
+
get fhe_type() {
|
|
1201
|
+
const ret = wasm.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr);
|
|
1202
|
+
return ret;
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* The type of plaintext encrypted. The type should match FheType from tfhe-rs:
|
|
1206
|
+
* <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
|
|
1207
|
+
* @param {number} arg0
|
|
1208
|
+
*/
|
|
1209
|
+
set fhe_type(arg0) {
|
|
1210
|
+
wasm.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr, arg0);
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* The signcrypted payload, using a hybrid encryption approach in
|
|
1214
|
+
* sign-then-encrypt.
|
|
1215
|
+
* @returns {Uint8Array}
|
|
1216
|
+
*/
|
|
1217
|
+
get signcrypted_ciphertext() {
|
|
1218
|
+
const ret = wasm.__wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext(this.__wbg_ptr);
|
|
1219
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1220
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1221
|
+
return v1;
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* The signcrypted payload, using a hybrid encryption approach in
|
|
1225
|
+
* sign-then-encrypt.
|
|
1226
|
+
* @param {Uint8Array} arg0
|
|
1227
|
+
*/
|
|
1228
|
+
set signcrypted_ciphertext(arg0) {
|
|
1229
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1230
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1231
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1232
|
+
}
|
|
1233
|
+
/**
|
|
1234
|
+
* The external handles that were originally in the request.
|
|
1235
|
+
* @returns {Uint8Array}
|
|
1236
|
+
*/
|
|
1237
|
+
get external_handle() {
|
|
1238
|
+
const ret = wasm.__wbg_get_typedsigncryptedciphertext_external_handle(this.__wbg_ptr);
|
|
1239
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1240
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1241
|
+
return v1;
|
|
1242
|
+
}
|
|
1243
|
+
/**
|
|
1244
|
+
* The external handles that were originally in the request.
|
|
1245
|
+
* @param {Uint8Array} arg0
|
|
1246
|
+
*/
|
|
1247
|
+
set external_handle(arg0) {
|
|
1248
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1249
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1250
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* The packing factor determines whether the decrypted plaintext
|
|
1254
|
+
* has a different way of packing compared to what is specified in the plaintext modulus.
|
|
1255
|
+
* @returns {number}
|
|
1256
|
+
*/
|
|
1257
|
+
get packing_factor() {
|
|
1258
|
+
const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
|
|
1259
|
+
return ret >>> 0;
|
|
1260
|
+
}
|
|
1261
|
+
/**
|
|
1262
|
+
* The packing factor determines whether the decrypted plaintext
|
|
1263
|
+
* has a different way of packing compared to what is specified in the plaintext modulus.
|
|
1264
|
+
* @param {number} arg0
|
|
1265
|
+
*/
|
|
1266
|
+
set packing_factor(arg0) {
|
|
1267
|
+
wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
module.exports.TypedSigncryptedCiphertext = TypedSigncryptedCiphertext;
|
|
1271
|
+
|
|
1272
|
+
const UserDecryptionRequestFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1273
|
+
? { register: () => {}, unregister: () => {} }
|
|
1274
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_userdecryptionrequest_free(ptr >>> 0, 1));
|
|
1275
|
+
|
|
1276
|
+
class UserDecryptionRequest {
|
|
1277
|
+
|
|
1278
|
+
__destroy_into_raw() {
|
|
1279
|
+
const ptr = this.__wbg_ptr;
|
|
1280
|
+
this.__wbg_ptr = 0;
|
|
1281
|
+
UserDecryptionRequestFinalization.unregister(this);
|
|
1282
|
+
return ptr;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
free() {
|
|
1286
|
+
const ptr = this.__destroy_into_raw();
|
|
1287
|
+
wasm.__wbg_userdecryptionrequest_free(ptr, 0);
|
|
1288
|
+
}
|
|
1289
|
+
/**
|
|
1290
|
+
* The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
|
|
1291
|
+
* prefix. Future queries for the result must use this request ID.
|
|
1292
|
+
* @returns {RequestId | undefined}
|
|
1293
|
+
*/
|
|
1294
|
+
get request_id() {
|
|
1295
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_request_id(this.__wbg_ptr);
|
|
1296
|
+
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
|
|
1300
|
+
* prefix. Future queries for the result must use this request ID.
|
|
1301
|
+
* @param {RequestId | null} [arg0]
|
|
1302
|
+
*/
|
|
1303
|
+
set request_id(arg0) {
|
|
1304
|
+
let ptr0 = 0;
|
|
1305
|
+
if (!isLikeNone(arg0)) {
|
|
1306
|
+
_assertClass(arg0, RequestId);
|
|
1307
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1159
1308
|
}
|
|
1309
|
+
wasm.__wbg_set_userdecryptionrequest_request_id(this.__wbg_ptr, ptr0);
|
|
1310
|
+
}
|
|
1311
|
+
/**
|
|
1312
|
+
* The list of ciphertexts to decrypt for the user.
|
|
1313
|
+
* @returns {TypedCiphertext[]}
|
|
1314
|
+
*/
|
|
1315
|
+
get typed_ciphertexts() {
|
|
1316
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_typed_ciphertexts(this.__wbg_ptr);
|
|
1317
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1318
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1160
1319
|
return v1;
|
|
1161
1320
|
}
|
|
1162
1321
|
/**
|
|
1163
|
-
* The
|
|
1164
|
-
*
|
|
1165
|
-
* it is the responsibility of the gateway to fetch the
|
|
1166
|
-
* ciphertext for the given digest below.
|
|
1167
|
-
* @param {Uint8Array | undefined} [arg0]
|
|
1322
|
+
* The list of ciphertexts to decrypt for the user.
|
|
1323
|
+
* @param {TypedCiphertext[]} arg0
|
|
1168
1324
|
*/
|
|
1169
|
-
set
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
wasm.
|
|
1325
|
+
set typed_ciphertexts(arg0) {
|
|
1326
|
+
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1327
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1328
|
+
wasm.__wbg_set_userdecryptionrequest_typed_ciphertexts(this.__wbg_ptr, ptr0, len0);
|
|
1329
|
+
}
|
|
1330
|
+
/**
|
|
1331
|
+
* The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
|
|
1332
|
+
* used for key generation
|
|
1333
|
+
* @returns {RequestId | undefined}
|
|
1334
|
+
*/
|
|
1335
|
+
get key_id() {
|
|
1336
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_key_id(this.__wbg_ptr);
|
|
1337
|
+
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
1338
|
+
}
|
|
1339
|
+
/**
|
|
1340
|
+
* The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
|
|
1341
|
+
* used for key generation
|
|
1342
|
+
* @param {RequestId | null} [arg0]
|
|
1343
|
+
*/
|
|
1344
|
+
set key_id(arg0) {
|
|
1345
|
+
let ptr0 = 0;
|
|
1346
|
+
if (!isLikeNone(arg0)) {
|
|
1347
|
+
_assertClass(arg0, RequestId);
|
|
1348
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1349
|
+
}
|
|
1350
|
+
wasm.__wbg_set_userdecryptionrequest_key_id(this.__wbg_ptr, ptr0);
|
|
1351
|
+
}
|
|
1352
|
+
/**
|
|
1353
|
+
* The client's (blockchain wallet) address,
|
|
1354
|
+
* encoded using EIP-55.
|
|
1355
|
+
* @returns {string}
|
|
1356
|
+
*/
|
|
1357
|
+
get client_address() {
|
|
1358
|
+
let deferred1_0;
|
|
1359
|
+
let deferred1_1;
|
|
1360
|
+
try {
|
|
1361
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_client_address(this.__wbg_ptr);
|
|
1362
|
+
deferred1_0 = ret[0];
|
|
1363
|
+
deferred1_1 = ret[1];
|
|
1364
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1365
|
+
} finally {
|
|
1366
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
/**
|
|
1370
|
+
* The client's (blockchain wallet) address,
|
|
1371
|
+
* encoded using EIP-55.
|
|
1372
|
+
* @param {string} arg0
|
|
1373
|
+
*/
|
|
1374
|
+
set client_address(arg0) {
|
|
1375
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1376
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1377
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1173
1378
|
}
|
|
1174
1379
|
/**
|
|
1175
|
-
*
|
|
1380
|
+
* Encoding of the user's public encryption key for this request.
|
|
1381
|
+
* Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
|
|
1382
|
+
* Montgomery point.
|
|
1176
1383
|
* @returns {Uint8Array}
|
|
1177
1384
|
*/
|
|
1178
|
-
get
|
|
1179
|
-
const ret = wasm.
|
|
1385
|
+
get enc_key() {
|
|
1386
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_enc_key(this.__wbg_ptr);
|
|
1180
1387
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1181
1388
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1182
1389
|
return v1;
|
|
1183
1390
|
}
|
|
1184
1391
|
/**
|
|
1185
|
-
*
|
|
1392
|
+
* Encoding of the user's public encryption key for this request.
|
|
1393
|
+
* Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
|
|
1394
|
+
* Montgomery point.
|
|
1186
1395
|
* @param {Uint8Array} arg0
|
|
1187
1396
|
*/
|
|
1188
|
-
set
|
|
1397
|
+
set enc_key(arg0) {
|
|
1189
1398
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1190
1399
|
const len0 = WASM_VECTOR_LEN;
|
|
1191
1400
|
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
1192
1401
|
}
|
|
1402
|
+
/**
|
|
1403
|
+
* @returns {Eip712DomainMsg | undefined}
|
|
1404
|
+
*/
|
|
1405
|
+
get domain() {
|
|
1406
|
+
const ret = wasm.__wbg_get_userdecryptionrequest_domain(this.__wbg_ptr);
|
|
1407
|
+
return ret === 0 ? undefined : Eip712DomainMsg.__wrap(ret);
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* @param {Eip712DomainMsg | null} [arg0]
|
|
1411
|
+
*/
|
|
1412
|
+
set domain(arg0) {
|
|
1413
|
+
let ptr0 = 0;
|
|
1414
|
+
if (!isLikeNone(arg0)) {
|
|
1415
|
+
_assertClass(arg0, Eip712DomainMsg);
|
|
1416
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1417
|
+
}
|
|
1418
|
+
wasm.__wbg_set_userdecryptionrequest_domain(this.__wbg_ptr, ptr0);
|
|
1419
|
+
}
|
|
1193
1420
|
}
|
|
1194
|
-
module.exports.
|
|
1421
|
+
module.exports.UserDecryptionRequest = UserDecryptionRequest;
|
|
1195
1422
|
|
|
1196
|
-
const
|
|
1423
|
+
const UserDecryptionResponseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1197
1424
|
? { register: () => {}, unregister: () => {} }
|
|
1198
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1425
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_userdecryptionresponse_free(ptr >>> 0, 1));
|
|
1199
1426
|
|
|
1200
|
-
class
|
|
1427
|
+
class UserDecryptionResponse {
|
|
1201
1428
|
|
|
1202
1429
|
static __unwrap(jsValue) {
|
|
1203
|
-
if (!(jsValue instanceof
|
|
1430
|
+
if (!(jsValue instanceof UserDecryptionResponse)) {
|
|
1204
1431
|
return 0;
|
|
1205
1432
|
}
|
|
1206
1433
|
return jsValue.__destroy_into_raw();
|
|
@@ -1209,19 +1436,19 @@ class ReencryptionResponse {
|
|
|
1209
1436
|
__destroy_into_raw() {
|
|
1210
1437
|
const ptr = this.__wbg_ptr;
|
|
1211
1438
|
this.__wbg_ptr = 0;
|
|
1212
|
-
|
|
1439
|
+
UserDecryptionResponseFinalization.unregister(this);
|
|
1213
1440
|
return ptr;
|
|
1214
1441
|
}
|
|
1215
1442
|
|
|
1216
1443
|
free() {
|
|
1217
1444
|
const ptr = this.__destroy_into_raw();
|
|
1218
|
-
wasm.
|
|
1445
|
+
wasm.__wbg_userdecryptionresponse_free(ptr, 0);
|
|
1219
1446
|
}
|
|
1220
1447
|
/**
|
|
1221
1448
|
* @returns {Uint8Array}
|
|
1222
1449
|
*/
|
|
1223
1450
|
get signature() {
|
|
1224
|
-
const ret = wasm.
|
|
1451
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_signature(this.__wbg_ptr);
|
|
1225
1452
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1226
1453
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1227
1454
|
return v1;
|
|
@@ -1235,84 +1462,98 @@ class ReencryptionResponse {
|
|
|
1235
1462
|
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1236
1463
|
}
|
|
1237
1464
|
/**
|
|
1238
|
-
*
|
|
1239
|
-
*
|
|
1465
|
+
* This is the external signature created from the Eip712 domain
|
|
1466
|
+
* on the structure, where userDecryptedShare is bincode::serialize(&payload)
|
|
1467
|
+
* struct UserDecryptResponseVerification {
|
|
1468
|
+
* bytes publicKey;
|
|
1469
|
+
* uint256\[\] ctHandles;
|
|
1470
|
+
* bytes userDecryptedShare;
|
|
1471
|
+
* }
|
|
1472
|
+
* @returns {Uint8Array}
|
|
1473
|
+
*/
|
|
1474
|
+
get external_signature() {
|
|
1475
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_external_signature(this.__wbg_ptr);
|
|
1476
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1477
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1478
|
+
return v1;
|
|
1479
|
+
}
|
|
1480
|
+
/**
|
|
1481
|
+
* This is the external signature created from the Eip712 domain
|
|
1482
|
+
* on the structure, where userDecryptedShare is bincode::serialize(&payload)
|
|
1483
|
+
* struct UserDecryptResponseVerification {
|
|
1484
|
+
* bytes publicKey;
|
|
1485
|
+
* uint256\[\] ctHandles;
|
|
1486
|
+
* bytes userDecryptedShare;
|
|
1487
|
+
* }
|
|
1488
|
+
* @param {Uint8Array} arg0
|
|
1489
|
+
*/
|
|
1490
|
+
set external_signature(arg0) {
|
|
1491
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1492
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1493
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1494
|
+
}
|
|
1495
|
+
/**
|
|
1496
|
+
* The actual \[UserDecryptionResponsePayload\].
|
|
1497
|
+
* @returns {UserDecryptionResponsePayload | undefined}
|
|
1240
1498
|
*/
|
|
1241
1499
|
get payload() {
|
|
1242
|
-
const ret = wasm.
|
|
1243
|
-
return ret === 0 ? undefined :
|
|
1500
|
+
const ret = wasm.__wbg_get_userdecryptionresponse_payload(this.__wbg_ptr);
|
|
1501
|
+
return ret === 0 ? undefined : UserDecryptionResponsePayload.__wrap(ret);
|
|
1244
1502
|
}
|
|
1245
1503
|
/**
|
|
1246
|
-
*
|
|
1247
|
-
* @param {
|
|
1504
|
+
* The actual \[UserDecryptionResponsePayload\].
|
|
1505
|
+
* @param {UserDecryptionResponsePayload | null} [arg0]
|
|
1248
1506
|
*/
|
|
1249
1507
|
set payload(arg0) {
|
|
1250
1508
|
let ptr0 = 0;
|
|
1251
1509
|
if (!isLikeNone(arg0)) {
|
|
1252
|
-
_assertClass(arg0,
|
|
1510
|
+
_assertClass(arg0, UserDecryptionResponsePayload);
|
|
1253
1511
|
ptr0 = arg0.__destroy_into_raw();
|
|
1254
1512
|
}
|
|
1255
|
-
wasm.
|
|
1513
|
+
wasm.__wbg_set_userdecryptionresponse_payload(this.__wbg_ptr, ptr0);
|
|
1256
1514
|
}
|
|
1257
1515
|
}
|
|
1258
|
-
module.exports.
|
|
1516
|
+
module.exports.UserDecryptionResponse = UserDecryptionResponse;
|
|
1259
1517
|
|
|
1260
|
-
const
|
|
1518
|
+
const UserDecryptionResponsePayloadFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1261
1519
|
? { register: () => {}, unregister: () => {} }
|
|
1262
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1520
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_userdecryptionresponsepayload_free(ptr >>> 0, 1));
|
|
1263
1521
|
|
|
1264
|
-
class
|
|
1522
|
+
class UserDecryptionResponsePayload {
|
|
1265
1523
|
|
|
1266
1524
|
static __wrap(ptr) {
|
|
1267
1525
|
ptr = ptr >>> 0;
|
|
1268
|
-
const obj = Object.create(
|
|
1526
|
+
const obj = Object.create(UserDecryptionResponsePayload.prototype);
|
|
1269
1527
|
obj.__wbg_ptr = ptr;
|
|
1270
|
-
|
|
1528
|
+
UserDecryptionResponsePayloadFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1271
1529
|
return obj;
|
|
1272
1530
|
}
|
|
1273
1531
|
|
|
1274
1532
|
__destroy_into_raw() {
|
|
1275
1533
|
const ptr = this.__wbg_ptr;
|
|
1276
1534
|
this.__wbg_ptr = 0;
|
|
1277
|
-
|
|
1535
|
+
UserDecryptionResponsePayloadFinalization.unregister(this);
|
|
1278
1536
|
return ptr;
|
|
1279
1537
|
}
|
|
1280
1538
|
|
|
1281
1539
|
free() {
|
|
1282
1540
|
const ptr = this.__destroy_into_raw();
|
|
1283
|
-
wasm.
|
|
1284
|
-
}
|
|
1285
|
-
/**
|
|
1286
|
-
* Version of the response format.
|
|
1287
|
-
* @returns {number}
|
|
1288
|
-
*/
|
|
1289
|
-
get version() {
|
|
1290
|
-
const ret = wasm.__wbg_get_reencryptionresponsepayload_version(this.__wbg_ptr);
|
|
1291
|
-
return ret >>> 0;
|
|
1292
|
-
}
|
|
1293
|
-
/**
|
|
1294
|
-
* Version of the response format.
|
|
1295
|
-
* @param {number} arg0
|
|
1296
|
-
*/
|
|
1297
|
-
set version(arg0) {
|
|
1298
|
-
wasm.__wbg_set_reencryptionresponsepayload_version(this.__wbg_ptr, arg0);
|
|
1541
|
+
wasm.__wbg_userdecryptionresponsepayload_free(ptr, 0);
|
|
1299
1542
|
}
|
|
1300
1543
|
/**
|
|
1301
|
-
* The server's signature verification key.
|
|
1302
|
-
* Encoded using SEC1.
|
|
1544
|
+
* The server's signature verification key, Encoded using SEC1.
|
|
1303
1545
|
* Needed to validate the response, but MUST also be linked to a list of
|
|
1304
1546
|
* trusted keys.
|
|
1305
1547
|
* @returns {Uint8Array}
|
|
1306
1548
|
*/
|
|
1307
1549
|
get verification_key() {
|
|
1308
|
-
const ret = wasm.
|
|
1550
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_verification_key(this.__wbg_ptr);
|
|
1309
1551
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1310
1552
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1311
1553
|
return v1;
|
|
1312
1554
|
}
|
|
1313
1555
|
/**
|
|
1314
|
-
* The server's signature verification key.
|
|
1315
|
-
* Encoded using SEC1.
|
|
1556
|
+
* The server's signature verification key, Encoded using SEC1.
|
|
1316
1557
|
* Needed to validate the response, but MUST also be linked to a list of
|
|
1317
1558
|
* trusted keys.
|
|
1318
1559
|
* @param {Uint8Array} arg0
|
|
@@ -1323,21 +1564,21 @@ class ReencryptionResponsePayload {
|
|
|
1323
1564
|
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1324
1565
|
}
|
|
1325
1566
|
/**
|
|
1326
|
-
* The concatenation of two digests:
|
|
1327
|
-
* (eip712_signing_hash(pk, domain) || ciphertext digest).
|
|
1328
1567
|
* This is needed to ensure the response corresponds to the request.
|
|
1568
|
+
* It is the digest of UserDecryptionLinker hashed using EIP712
|
|
1569
|
+
* under the given domain in the request.
|
|
1329
1570
|
* @returns {Uint8Array}
|
|
1330
1571
|
*/
|
|
1331
1572
|
get digest() {
|
|
1332
|
-
const ret = wasm.
|
|
1573
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_digest(this.__wbg_ptr);
|
|
1333
1574
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1334
1575
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1335
1576
|
return v1;
|
|
1336
1577
|
}
|
|
1337
1578
|
/**
|
|
1338
|
-
* The concatenation of two digests:
|
|
1339
|
-
* (eip712_signing_hash(pk, domain) || ciphertext digest).
|
|
1340
1579
|
* This is needed to ensure the response corresponds to the request.
|
|
1580
|
+
* It is the digest of UserDecryptionLinker hashed using EIP712
|
|
1581
|
+
* under the given domain in the request.
|
|
1341
1582
|
* @param {Uint8Array} arg0
|
|
1342
1583
|
*/
|
|
1343
1584
|
set digest(arg0) {
|
|
@@ -1346,64 +1587,51 @@ class ReencryptionResponsePayload {
|
|
|
1346
1587
|
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1347
1588
|
}
|
|
1348
1589
|
/**
|
|
1349
|
-
* The
|
|
1350
|
-
*
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
const ret = wasm.__wbg_get_reencryptionresponsepayload_fhe_type(this.__wbg_ptr);
|
|
1354
|
-
return ret;
|
|
1355
|
-
}
|
|
1356
|
-
/**
|
|
1357
|
-
* The type of plaintext encrypted.
|
|
1358
|
-
* @param {number} arg0
|
|
1359
|
-
*/
|
|
1360
|
-
set fhe_type(arg0) {
|
|
1361
|
-
wasm.__wbg_set_reencryptionresponsepayload_fhe_type(this.__wbg_ptr, arg0);
|
|
1362
|
-
}
|
|
1363
|
-
/**
|
|
1364
|
-
* The signcrypted payload, using a hybrid encryption approach in
|
|
1365
|
-
* sign-then-encrypt.
|
|
1366
|
-
* @returns {Uint8Array}
|
|
1590
|
+
* The resulting signcrypted ciphertexts, each ciphertext
|
|
1591
|
+
* must be decrypted and then reconstructed with the other shares
|
|
1592
|
+
* to produce the final plaintext.
|
|
1593
|
+
* @returns {TypedSigncryptedCiphertext[]}
|
|
1367
1594
|
*/
|
|
1368
|
-
get
|
|
1369
|
-
const ret = wasm.
|
|
1370
|
-
var v1 =
|
|
1371
|
-
wasm.__wbindgen_free(ret[0], ret[1] *
|
|
1595
|
+
get signcrypted_ciphertexts() {
|
|
1596
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr);
|
|
1597
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1598
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1372
1599
|
return v1;
|
|
1373
1600
|
}
|
|
1374
1601
|
/**
|
|
1375
|
-
* The signcrypted
|
|
1376
|
-
*
|
|
1377
|
-
*
|
|
1602
|
+
* The resulting signcrypted ciphertexts, each ciphertext
|
|
1603
|
+
* must be decrypted and then reconstructed with the other shares
|
|
1604
|
+
* to produce the final plaintext.
|
|
1605
|
+
* @param {TypedSigncryptedCiphertext[]} arg0
|
|
1378
1606
|
*/
|
|
1379
|
-
set
|
|
1380
|
-
const ptr0 =
|
|
1607
|
+
set signcrypted_ciphertexts(arg0) {
|
|
1608
|
+
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1381
1609
|
const len0 = WASM_VECTOR_LEN;
|
|
1382
|
-
wasm.
|
|
1610
|
+
wasm.__wbg_set_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr, ptr0, len0);
|
|
1383
1611
|
}
|
|
1384
1612
|
/**
|
|
1385
|
-
* The ID of the MPC party doing the
|
|
1613
|
+
* The ID of the MPC party doing the user decryption. Used for polynomial
|
|
1386
1614
|
* reconstruction.
|
|
1387
1615
|
* @returns {number}
|
|
1388
1616
|
*/
|
|
1389
1617
|
get party_id() {
|
|
1390
|
-
const ret = wasm.
|
|
1618
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_party_id(this.__wbg_ptr);
|
|
1391
1619
|
return ret >>> 0;
|
|
1392
1620
|
}
|
|
1393
1621
|
/**
|
|
1394
|
-
* The ID of the MPC party doing the
|
|
1622
|
+
* The ID of the MPC party doing the user decryption. Used for polynomial
|
|
1395
1623
|
* reconstruction.
|
|
1396
1624
|
* @param {number} arg0
|
|
1397
1625
|
*/
|
|
1398
1626
|
set party_id(arg0) {
|
|
1399
|
-
wasm.
|
|
1627
|
+
wasm.__wbg_set_userdecryptionresponsepayload_party_id(this.__wbg_ptr, arg0);
|
|
1400
1628
|
}
|
|
1401
1629
|
/**
|
|
1402
1630
|
* The degree of the sharing scheme used.
|
|
1403
1631
|
* @returns {number}
|
|
1404
1632
|
*/
|
|
1405
1633
|
get degree() {
|
|
1406
|
-
const ret = wasm.
|
|
1634
|
+
const ret = wasm.__wbg_get_userdecryptionresponsepayload_degree(this.__wbg_ptr);
|
|
1407
1635
|
return ret >>> 0;
|
|
1408
1636
|
}
|
|
1409
1637
|
/**
|
|
@@ -1411,386 +1639,357 @@ class ReencryptionResponsePayload {
|
|
|
1411
1639
|
* @param {number} arg0
|
|
1412
1640
|
*/
|
|
1413
1641
|
set degree(arg0) {
|
|
1414
|
-
wasm.
|
|
1642
|
+
wasm.__wbg_set_userdecryptionresponsepayload_degree(this.__wbg_ptr, arg0);
|
|
1415
1643
|
}
|
|
1416
1644
|
}
|
|
1417
|
-
module.exports.
|
|
1645
|
+
module.exports.UserDecryptionResponsePayload = UserDecryptionResponsePayload;
|
|
1418
1646
|
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
*
|
|
1425
|
-
|
|
1426
|
-
class RequestId {
|
|
1647
|
+
module.exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
1648
|
+
const ret = String(arg1);
|
|
1649
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1650
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1651
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1652
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1653
|
+
};
|
|
1427
1654
|
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
RequestIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1433
|
-
return obj;
|
|
1434
|
-
}
|
|
1655
|
+
module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
1656
|
+
const ret = arg0.buffer;
|
|
1657
|
+
return ret;
|
|
1658
|
+
};
|
|
1435
1659
|
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
return ptr;
|
|
1441
|
-
}
|
|
1660
|
+
module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
1661
|
+
const ret = arg0.call(arg1);
|
|
1662
|
+
return ret;
|
|
1663
|
+
}, arguments) };
|
|
1442
1664
|
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
/**
|
|
1448
|
-
* @returns {string}
|
|
1449
|
-
*/
|
|
1450
|
-
get request_id() {
|
|
1451
|
-
let deferred1_0;
|
|
1452
|
-
let deferred1_1;
|
|
1453
|
-
try {
|
|
1454
|
-
const ret = wasm.__wbg_get_requestid_request_id(this.__wbg_ptr);
|
|
1455
|
-
deferred1_0 = ret[0];
|
|
1456
|
-
deferred1_1 = ret[1];
|
|
1457
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1458
|
-
} finally {
|
|
1459
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
/**
|
|
1463
|
-
* @param {string} arg0
|
|
1464
|
-
*/
|
|
1465
|
-
set request_id(arg0) {
|
|
1466
|
-
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1467
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1468
|
-
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1471
|
-
module.exports.RequestId = RequestId;
|
|
1665
|
+
module.exports.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1666
|
+
const ret = arg0.call(arg1, arg2);
|
|
1667
|
+
return ret;
|
|
1668
|
+
}, arguments) };
|
|
1472
1669
|
|
|
1473
|
-
module.exports.
|
|
1474
|
-
const ret =
|
|
1670
|
+
module.exports.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
|
|
1671
|
+
const ret = arg0.crypto;
|
|
1475
1672
|
return ret;
|
|
1476
1673
|
};
|
|
1477
1674
|
|
|
1478
|
-
module.exports.
|
|
1479
|
-
const
|
|
1480
|
-
|
|
1481
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1482
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1483
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1484
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1675
|
+
module.exports.__wbg_done_769e5ede4b31c67b = function(arg0) {
|
|
1676
|
+
const ret = arg0.done;
|
|
1677
|
+
return ret;
|
|
1485
1678
|
};
|
|
1486
1679
|
|
|
1487
|
-
module.exports.
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1680
|
+
module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
1681
|
+
let deferred0_0;
|
|
1682
|
+
let deferred0_1;
|
|
1683
|
+
try {
|
|
1684
|
+
deferred0_0 = arg0;
|
|
1685
|
+
deferred0_1 = arg1;
|
|
1686
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
1687
|
+
} finally {
|
|
1688
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1689
|
+
}
|
|
1491
1690
|
};
|
|
1492
1691
|
|
|
1493
|
-
module.exports.
|
|
1494
|
-
|
|
1692
|
+
module.exports.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
|
|
1693
|
+
arg0.getRandomValues(arg1);
|
|
1694
|
+
}, arguments) };
|
|
1695
|
+
|
|
1696
|
+
module.exports.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
|
|
1697
|
+
const ret = Reflect.get(arg0, arg1);
|
|
1495
1698
|
return ret;
|
|
1496
|
-
};
|
|
1699
|
+
}, arguments) };
|
|
1497
1700
|
|
|
1498
|
-
module.exports.
|
|
1499
|
-
const ret = arg0
|
|
1701
|
+
module.exports.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
|
|
1702
|
+
const ret = arg0[arg1 >>> 0];
|
|
1500
1703
|
return ret;
|
|
1501
1704
|
};
|
|
1502
1705
|
|
|
1503
|
-
module.exports.
|
|
1504
|
-
const ret = arg0
|
|
1706
|
+
module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
|
|
1707
|
+
const ret = arg0[arg1];
|
|
1505
1708
|
return ret;
|
|
1506
1709
|
};
|
|
1507
1710
|
|
|
1508
|
-
module.exports.
|
|
1509
|
-
|
|
1711
|
+
module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
|
|
1712
|
+
let result;
|
|
1713
|
+
try {
|
|
1714
|
+
result = arg0 instanceof ArrayBuffer;
|
|
1715
|
+
} catch (_) {
|
|
1716
|
+
result = false;
|
|
1717
|
+
}
|
|
1718
|
+
const ret = result;
|
|
1510
1719
|
return ret;
|
|
1511
1720
|
};
|
|
1512
1721
|
|
|
1513
|
-
module.exports.
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1722
|
+
module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
|
|
1723
|
+
let result;
|
|
1724
|
+
try {
|
|
1725
|
+
result = arg0 instanceof Uint8Array;
|
|
1726
|
+
} catch (_) {
|
|
1727
|
+
result = false;
|
|
1728
|
+
}
|
|
1729
|
+
const ret = result;
|
|
1730
|
+
return ret;
|
|
1518
1731
|
};
|
|
1519
1732
|
|
|
1520
|
-
module.exports.
|
|
1521
|
-
const ret = arg0
|
|
1733
|
+
module.exports.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
|
|
1734
|
+
const ret = Array.isArray(arg0);
|
|
1522
1735
|
return ret;
|
|
1523
1736
|
};
|
|
1524
1737
|
|
|
1525
|
-
module.exports.
|
|
1526
|
-
const
|
|
1527
|
-
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
1738
|
+
module.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
|
|
1739
|
+
const ret = Number.isSafeInteger(arg0);
|
|
1528
1740
|
return ret;
|
|
1529
1741
|
};
|
|
1530
1742
|
|
|
1531
|
-
module.exports.
|
|
1532
|
-
const ret =
|
|
1743
|
+
module.exports.__wbg_iterator_9a24c88df860dc65 = function() {
|
|
1744
|
+
const ret = Symbol.iterator;
|
|
1533
1745
|
return ret;
|
|
1534
1746
|
};
|
|
1535
1747
|
|
|
1536
|
-
module.exports.
|
|
1537
|
-
const ret =
|
|
1538
|
-
|
|
1539
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1540
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1541
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1748
|
+
module.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
1749
|
+
const ret = arg0.length;
|
|
1750
|
+
return ret;
|
|
1542
1751
|
};
|
|
1543
1752
|
|
|
1544
|
-
module.exports.
|
|
1545
|
-
const ret =
|
|
1753
|
+
module.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
|
|
1754
|
+
const ret = arg0.length;
|
|
1546
1755
|
return ret;
|
|
1547
1756
|
};
|
|
1548
1757
|
|
|
1549
|
-
module.exports.
|
|
1550
|
-
const ret = arg0
|
|
1758
|
+
module.exports.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
|
|
1759
|
+
const ret = arg0.msCrypto;
|
|
1551
1760
|
return ret;
|
|
1552
1761
|
};
|
|
1553
1762
|
|
|
1554
|
-
module.exports.
|
|
1763
|
+
module.exports.__wbg_new_8a6f238a6ece86ea = function() {
|
|
1555
1764
|
const ret = new Error();
|
|
1556
1765
|
return ret;
|
|
1557
1766
|
};
|
|
1558
1767
|
|
|
1559
|
-
module.exports.
|
|
1560
|
-
const ret =
|
|
1561
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1562
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1563
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1564
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1565
|
-
};
|
|
1566
|
-
|
|
1567
|
-
module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
1568
|
-
let deferred0_0;
|
|
1569
|
-
let deferred0_1;
|
|
1570
|
-
try {
|
|
1571
|
-
deferred0_0 = arg0;
|
|
1572
|
-
deferred0_1 = arg1;
|
|
1573
|
-
console.error(getStringFromWasm0(arg0, arg1));
|
|
1574
|
-
} finally {
|
|
1575
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1576
|
-
}
|
|
1577
|
-
};
|
|
1578
|
-
|
|
1579
|
-
module.exports.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
|
|
1580
|
-
const ret = arg0.crypto;
|
|
1768
|
+
module.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
1769
|
+
const ret = new Uint8Array(arg0);
|
|
1581
1770
|
return ret;
|
|
1582
1771
|
};
|
|
1583
1772
|
|
|
1584
|
-
module.exports.
|
|
1585
|
-
const ret = arg0
|
|
1773
|
+
module.exports.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
1774
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
1586
1775
|
return ret;
|
|
1587
1776
|
};
|
|
1588
1777
|
|
|
1589
|
-
module.exports.
|
|
1590
|
-
const ret = arg0
|
|
1778
|
+
module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
|
|
1779
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
1591
1780
|
return ret;
|
|
1592
1781
|
};
|
|
1593
1782
|
|
|
1594
|
-
module.exports.
|
|
1595
|
-
const ret = arg0
|
|
1783
|
+
module.exports.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
|
|
1784
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
1596
1785
|
return ret;
|
|
1597
1786
|
};
|
|
1598
1787
|
|
|
1599
|
-
module.exports.
|
|
1600
|
-
const ret =
|
|
1788
|
+
module.exports.__wbg_next_25feadfc0913fea9 = function(arg0) {
|
|
1789
|
+
const ret = arg0.next;
|
|
1601
1790
|
return ret;
|
|
1602
1791
|
};
|
|
1603
1792
|
|
|
1604
|
-
module.exports.
|
|
1605
|
-
const ret =
|
|
1793
|
+
module.exports.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
|
|
1794
|
+
const ret = arg0.next();
|
|
1606
1795
|
return ret;
|
|
1607
1796
|
}, arguments) };
|
|
1608
1797
|
|
|
1609
|
-
module.exports.
|
|
1610
|
-
const ret =
|
|
1798
|
+
module.exports.__wbg_node_02999533c4ea02e3 = function(arg0) {
|
|
1799
|
+
const ret = arg0.node;
|
|
1611
1800
|
return ret;
|
|
1612
1801
|
};
|
|
1613
1802
|
|
|
1614
|
-
module.exports.
|
|
1615
|
-
const ret = arg0.
|
|
1803
|
+
module.exports.__wbg_process_5c1d670bc53614b8 = function(arg0) {
|
|
1804
|
+
const ret = arg0.process;
|
|
1616
1805
|
return ret;
|
|
1617
1806
|
};
|
|
1618
1807
|
|
|
1619
|
-
module.exports.
|
|
1808
|
+
module.exports.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
|
|
1620
1809
|
arg0.randomFillSync(arg1);
|
|
1621
1810
|
}, arguments) };
|
|
1622
1811
|
|
|
1623
|
-
module.exports.
|
|
1624
|
-
|
|
1812
|
+
module.exports.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
|
|
1813
|
+
const ret = module.require;
|
|
1814
|
+
return ret;
|
|
1625
1815
|
}, arguments) };
|
|
1626
1816
|
|
|
1627
|
-
module.exports.
|
|
1628
|
-
|
|
1629
|
-
return ret;
|
|
1817
|
+
module.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
1818
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
1630
1819
|
};
|
|
1631
1820
|
|
|
1632
|
-
module.exports.
|
|
1633
|
-
const ret =
|
|
1634
|
-
|
|
1821
|
+
module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
1822
|
+
const ret = arg1.stack;
|
|
1823
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1824
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1825
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1826
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1635
1827
|
};
|
|
1636
1828
|
|
|
1637
|
-
module.exports.
|
|
1638
|
-
const ret =
|
|
1639
|
-
return ret;
|
|
1829
|
+
module.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
|
1830
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1831
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1640
1832
|
};
|
|
1641
1833
|
|
|
1642
|
-
module.exports.
|
|
1643
|
-
const ret =
|
|
1644
|
-
return ret;
|
|
1834
|
+
module.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
|
1835
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1836
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1645
1837
|
};
|
|
1646
1838
|
|
|
1647
|
-
module.exports.
|
|
1648
|
-
const ret =
|
|
1649
|
-
return ret;
|
|
1650
|
-
}
|
|
1839
|
+
module.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
|
1840
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1841
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1842
|
+
};
|
|
1651
1843
|
|
|
1652
|
-
module.exports.
|
|
1653
|
-
const ret =
|
|
1654
|
-
return ret;
|
|
1844
|
+
module.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
|
1845
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1846
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1655
1847
|
};
|
|
1656
1848
|
|
|
1657
|
-
module.exports.
|
|
1658
|
-
const ret = arg0.
|
|
1849
|
+
module.exports.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
|
|
1850
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1659
1851
|
return ret;
|
|
1660
1852
|
};
|
|
1661
1853
|
|
|
1662
|
-
module.exports.
|
|
1663
|
-
const ret =
|
|
1854
|
+
module.exports.__wbg_typedciphertext_new = function(arg0) {
|
|
1855
|
+
const ret = TypedCiphertext.__wrap(arg0);
|
|
1664
1856
|
return ret;
|
|
1665
1857
|
};
|
|
1666
1858
|
|
|
1667
|
-
module.exports.
|
|
1668
|
-
const ret =
|
|
1859
|
+
module.exports.__wbg_typedciphertext_unwrap = function(arg0) {
|
|
1860
|
+
const ret = TypedCiphertext.__unwrap(arg0);
|
|
1669
1861
|
return ret;
|
|
1670
|
-
}
|
|
1862
|
+
};
|
|
1671
1863
|
|
|
1672
|
-
module.exports.
|
|
1673
|
-
const ret =
|
|
1864
|
+
module.exports.__wbg_typedplaintext_new = function(arg0) {
|
|
1865
|
+
const ret = TypedPlaintext.__wrap(arg0);
|
|
1674
1866
|
return ret;
|
|
1675
|
-
}
|
|
1867
|
+
};
|
|
1676
1868
|
|
|
1677
|
-
module.exports.
|
|
1678
|
-
const ret =
|
|
1869
|
+
module.exports.__wbg_typedsigncryptedciphertext_new = function(arg0) {
|
|
1870
|
+
const ret = TypedSigncryptedCiphertext.__wrap(arg0);
|
|
1679
1871
|
return ret;
|
|
1680
|
-
}
|
|
1872
|
+
};
|
|
1681
1873
|
|
|
1682
|
-
module.exports.
|
|
1683
|
-
const ret =
|
|
1874
|
+
module.exports.__wbg_typedsigncryptedciphertext_unwrap = function(arg0) {
|
|
1875
|
+
const ret = TypedSigncryptedCiphertext.__unwrap(arg0);
|
|
1684
1876
|
return ret;
|
|
1685
|
-
}
|
|
1877
|
+
};
|
|
1686
1878
|
|
|
1687
|
-
module.exports.
|
|
1688
|
-
const ret =
|
|
1879
|
+
module.exports.__wbg_userdecryptionresponse_unwrap = function(arg0) {
|
|
1880
|
+
const ret = UserDecryptionResponse.__unwrap(arg0);
|
|
1689
1881
|
return ret;
|
|
1690
|
-
}
|
|
1882
|
+
};
|
|
1691
1883
|
|
|
1692
|
-
module.exports.
|
|
1693
|
-
const ret =
|
|
1884
|
+
module.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
|
1885
|
+
const ret = arg0.value;
|
|
1694
1886
|
return ret;
|
|
1695
|
-
}
|
|
1887
|
+
};
|
|
1696
1888
|
|
|
1697
|
-
module.exports.
|
|
1698
|
-
const ret =
|
|
1889
|
+
module.exports.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
|
|
1890
|
+
const ret = arg0.versions;
|
|
1699
1891
|
return ret;
|
|
1700
1892
|
};
|
|
1701
1893
|
|
|
1702
|
-
module.exports.
|
|
1703
|
-
|
|
1704
|
-
try {
|
|
1705
|
-
result = arg0 instanceof ArrayBuffer;
|
|
1706
|
-
} catch (_) {
|
|
1707
|
-
result = false;
|
|
1708
|
-
}
|
|
1709
|
-
const ret = result;
|
|
1894
|
+
module.exports.__wbindgen_as_number = function(arg0) {
|
|
1895
|
+
const ret = +arg0;
|
|
1710
1896
|
return ret;
|
|
1711
1897
|
};
|
|
1712
1898
|
|
|
1713
|
-
module.exports.
|
|
1714
|
-
const
|
|
1899
|
+
module.exports.__wbindgen_boolean_get = function(arg0) {
|
|
1900
|
+
const v = arg0;
|
|
1901
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
1715
1902
|
return ret;
|
|
1716
|
-
}
|
|
1903
|
+
};
|
|
1717
1904
|
|
|
1718
|
-
module.exports.
|
|
1719
|
-
const ret =
|
|
1905
|
+
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
|
1906
|
+
const ret = debugString(arg1);
|
|
1907
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1908
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1909
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1910
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1911
|
+
};
|
|
1912
|
+
|
|
1913
|
+
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
1914
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1720
1915
|
return ret;
|
|
1721
1916
|
};
|
|
1722
1917
|
|
|
1723
|
-
module.exports.
|
|
1724
|
-
const ret = arg0
|
|
1918
|
+
module.exports.__wbindgen_in = function(arg0, arg1) {
|
|
1919
|
+
const ret = arg0 in arg1;
|
|
1725
1920
|
return ret;
|
|
1726
1921
|
};
|
|
1727
1922
|
|
|
1728
|
-
module.exports.
|
|
1729
|
-
const
|
|
1923
|
+
module.exports.__wbindgen_init_externref_table = function() {
|
|
1924
|
+
const table = wasm.__wbindgen_export_4;
|
|
1925
|
+
const offset = table.grow(4);
|
|
1926
|
+
table.set(0, undefined);
|
|
1927
|
+
table.set(offset + 0, undefined);
|
|
1928
|
+
table.set(offset + 1, null);
|
|
1929
|
+
table.set(offset + 2, true);
|
|
1930
|
+
table.set(offset + 3, false);
|
|
1931
|
+
;
|
|
1932
|
+
};
|
|
1933
|
+
|
|
1934
|
+
module.exports.__wbindgen_is_function = function(arg0) {
|
|
1935
|
+
const ret = typeof(arg0) === 'function';
|
|
1730
1936
|
return ret;
|
|
1731
1937
|
};
|
|
1732
1938
|
|
|
1733
|
-
module.exports.
|
|
1734
|
-
const ret =
|
|
1939
|
+
module.exports.__wbindgen_is_null = function(arg0) {
|
|
1940
|
+
const ret = arg0 === null;
|
|
1735
1941
|
return ret;
|
|
1736
1942
|
};
|
|
1737
1943
|
|
|
1738
|
-
module.exports.
|
|
1739
|
-
|
|
1944
|
+
module.exports.__wbindgen_is_object = function(arg0) {
|
|
1945
|
+
const val = arg0;
|
|
1946
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
1947
|
+
return ret;
|
|
1740
1948
|
};
|
|
1741
1949
|
|
|
1742
|
-
module.exports.
|
|
1743
|
-
const ret = arg0
|
|
1950
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
|
1951
|
+
const ret = typeof(arg0) === 'string';
|
|
1744
1952
|
return ret;
|
|
1745
1953
|
};
|
|
1746
1954
|
|
|
1747
|
-
module.exports.
|
|
1748
|
-
|
|
1749
|
-
try {
|
|
1750
|
-
result = arg0 instanceof Uint8Array;
|
|
1751
|
-
} catch (_) {
|
|
1752
|
-
result = false;
|
|
1753
|
-
}
|
|
1754
|
-
const ret = result;
|
|
1955
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
1956
|
+
const ret = arg0 === undefined;
|
|
1755
1957
|
return ret;
|
|
1756
1958
|
};
|
|
1757
1959
|
|
|
1758
|
-
module.exports.
|
|
1759
|
-
const ret =
|
|
1960
|
+
module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
1961
|
+
const ret = arg0 == arg1;
|
|
1760
1962
|
return ret;
|
|
1761
1963
|
};
|
|
1762
1964
|
|
|
1763
|
-
module.exports.
|
|
1764
|
-
const ret =
|
|
1965
|
+
module.exports.__wbindgen_memory = function() {
|
|
1966
|
+
const ret = wasm.memory;
|
|
1765
1967
|
return ret;
|
|
1766
1968
|
};
|
|
1767
1969
|
|
|
1768
|
-
module.exports.
|
|
1769
|
-
const
|
|
1770
|
-
const
|
|
1771
|
-
|
|
1772
|
-
getDataViewMemory0().setInt32(arg0 + 4 *
|
|
1773
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1970
|
+
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
1971
|
+
const obj = arg1;
|
|
1972
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1973
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
1974
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1774
1975
|
};
|
|
1775
1976
|
|
|
1776
|
-
module.exports.
|
|
1777
|
-
|
|
1977
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
1978
|
+
const obj = arg1;
|
|
1979
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1980
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1981
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1982
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1983
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1778
1984
|
};
|
|
1779
1985
|
|
|
1780
|
-
module.exports.
|
|
1781
|
-
const ret =
|
|
1986
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
1987
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1782
1988
|
return ret;
|
|
1783
1989
|
};
|
|
1784
1990
|
|
|
1785
|
-
module.exports.
|
|
1786
|
-
|
|
1787
|
-
const offset = table.grow(4);
|
|
1788
|
-
table.set(0, undefined);
|
|
1789
|
-
table.set(offset + 0, undefined);
|
|
1790
|
-
table.set(offset + 1, null);
|
|
1791
|
-
table.set(offset + 2, true);
|
|
1792
|
-
table.set(offset + 3, false);
|
|
1793
|
-
;
|
|
1991
|
+
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
1992
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1794
1993
|
};
|
|
1795
1994
|
|
|
1796
1995
|
const path = require('path').join(__dirname, 'kms_lib_bg.wasm');
|