@fhevm/sdk 0.14.0-13 → 0.14.0-14

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.
@@ -1,1503 +0,0 @@
1
- /* @ts-self-types="./tfhe.d.ts" */
2
- import { startWorkers, getTfheWorkers, terminateWorkers, setWorkerUrlConfig } from './startWorkers.js';
3
-
4
- export class CompactCiphertextList {
5
- static __wrap(ptr) {
6
- const obj = Object.create(CompactCiphertextList.prototype);
7
- obj.__wbg_ptr = ptr;
8
- CompactCiphertextListFinalization.register(obj, obj.__wbg_ptr, obj);
9
- return obj;
10
- }
11
- __destroy_into_raw() {
12
- const ptr = this.__wbg_ptr;
13
- this.__wbg_ptr = 0;
14
- CompactCiphertextListFinalization.unregister(this);
15
- return ptr;
16
- }
17
- free() {
18
- const ptr = this.__destroy_into_raw();
19
- wasm.__wbg_compactciphertextlist_free(ptr, 0);
20
- }
21
- /**
22
- * @param {TfheCompactPublicKey} public_key
23
- * @returns {CompactCiphertextListBuilder}
24
- */
25
- static builder(public_key) {
26
- _assertClass(public_key, TfheCompactPublicKey);
27
- const ret = wasm.compactciphertextlist_builder(public_key.__wbg_ptr);
28
- if (ret[2]) {
29
- throw takeFromExternrefTable0(ret[1]);
30
- }
31
- return CompactCiphertextListBuilder.__wrap(ret[0]);
32
- }
33
- /**
34
- * @param {CompactCiphertextList} other
35
- * @returns {boolean}
36
- */
37
- eq(other) {
38
- _assertClass(other, CompactCiphertextList);
39
- const ret = wasm.compactciphertextlist_eq(this.__wbg_ptr, other.__wbg_ptr);
40
- return ret !== 0;
41
- }
42
- }
43
- if (Symbol.dispose) CompactCiphertextList.prototype[Symbol.dispose] = CompactCiphertextList.prototype.free;
44
-
45
- export class CompactCiphertextListBuilder {
46
- static __wrap(ptr) {
47
- const obj = Object.create(CompactCiphertextListBuilder.prototype);
48
- obj.__wbg_ptr = ptr;
49
- CompactCiphertextListBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
50
- return obj;
51
- }
52
- __destroy_into_raw() {
53
- const ptr = this.__wbg_ptr;
54
- this.__wbg_ptr = 0;
55
- CompactCiphertextListBuilderFinalization.unregister(this);
56
- return ptr;
57
- }
58
- free() {
59
- const ptr = this.__destroy_into_raw();
60
- wasm.__wbg_compactciphertextlistbuilder_free(ptr, 0);
61
- }
62
- /**
63
- * @returns {CompactCiphertextList}
64
- */
65
- build() {
66
- const ret = wasm.compactciphertextlistbuilder_build(this.__wbg_ptr);
67
- if (ret[2]) {
68
- throw takeFromExternrefTable0(ret[1]);
69
- }
70
- return CompactCiphertextList.__wrap(ret[0]);
71
- }
72
- /**
73
- * @returns {CompactCiphertextList}
74
- */
75
- build_packed() {
76
- const ret = wasm.compactciphertextlistbuilder_build_packed(this.__wbg_ptr);
77
- if (ret[2]) {
78
- throw takeFromExternrefTable0(ret[1]);
79
- }
80
- return CompactCiphertextList.__wrap(ret[0]);
81
- }
82
- /**
83
- * @param {Uint8Array} seed
84
- * @returns {CompactCiphertextList}
85
- */
86
- build_packed_seeded(seed) {
87
- const ptr0 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
88
- const len0 = WASM_VECTOR_LEN;
89
- const ret = wasm.compactciphertextlistbuilder_build_packed_seeded(this.__wbg_ptr, ptr0, len0);
90
- if (ret[2]) {
91
- throw takeFromExternrefTable0(ret[1]);
92
- }
93
- return CompactCiphertextList.__wrap(ret[0]);
94
- }
95
- /**
96
- * @param {CompactPkeCrs} crs
97
- * @param {Uint8Array} metadata
98
- * @param {ZkComputeLoad} compute_load
99
- * @returns {ProvenCompactCiphertextList}
100
- */
101
- build_with_proof_packed(crs, metadata, compute_load) {
102
- _assertClass(crs, CompactPkeCrs);
103
- const ptr0 = passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
104
- const len0 = WASM_VECTOR_LEN;
105
- const ret = wasm.compactciphertextlistbuilder_build_with_proof_packed(this.__wbg_ptr, crs.__wbg_ptr, ptr0, len0, compute_load);
106
- if (ret[2]) {
107
- throw takeFromExternrefTable0(ret[1]);
108
- }
109
- return ProvenCompactCiphertextList.__wrap(ret[0]);
110
- }
111
- /**
112
- * @param {CompactPkeCrs} crs
113
- * @param {Uint8Array} metadata
114
- * @param {ZkComputeLoad} compute_load
115
- * @param {Uint8Array} seed
116
- * @returns {ProvenCompactCiphertextList}
117
- */
118
- build_with_proof_packed_seeded(crs, metadata, compute_load, seed) {
119
- _assertClass(crs, CompactPkeCrs);
120
- const ptr0 = passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
121
- const len0 = WASM_VECTOR_LEN;
122
- const ptr1 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
123
- const len1 = WASM_VECTOR_LEN;
124
- const ret = wasm.compactciphertextlistbuilder_build_with_proof_packed_seeded(this.__wbg_ptr, crs.__wbg_ptr, ptr0, len0, compute_load, ptr1, len1);
125
- if (ret[2]) {
126
- throw takeFromExternrefTable0(ret[1]);
127
- }
128
- return ProvenCompactCiphertextList.__wrap(ret[0]);
129
- }
130
- /**
131
- * @param {boolean} value
132
- */
133
- push_boolean(value) {
134
- const ret = wasm.compactciphertextlistbuilder_push_boolean(this.__wbg_ptr, value);
135
- if (ret[1]) {
136
- throw takeFromExternrefTable0(ret[0]);
137
- }
138
- }
139
- /**
140
- * @param {number} value
141
- */
142
- push_i10(value) {
143
- const ret = wasm.compactciphertextlistbuilder_push_i10(this.__wbg_ptr, value);
144
- if (ret[1]) {
145
- throw takeFromExternrefTable0(ret[0]);
146
- }
147
- }
148
- /**
149
- * @param {any} value
150
- */
151
- push_i1024(value) {
152
- const ret = wasm.compactciphertextlistbuilder_push_i1024(this.__wbg_ptr, value);
153
- if (ret[1]) {
154
- throw takeFromExternrefTable0(ret[0]);
155
- }
156
- }
157
- /**
158
- * @param {number} value
159
- */
160
- push_i12(value) {
161
- const ret = wasm.compactciphertextlistbuilder_push_i12(this.__wbg_ptr, value);
162
- if (ret[1]) {
163
- throw takeFromExternrefTable0(ret[0]);
164
- }
165
- }
166
- /**
167
- * @param {any} value
168
- */
169
- push_i128(value) {
170
- const ret = wasm.compactciphertextlistbuilder_push_i128(this.__wbg_ptr, value);
171
- if (ret[1]) {
172
- throw takeFromExternrefTable0(ret[0]);
173
- }
174
- }
175
- /**
176
- * @param {number} value
177
- */
178
- push_i14(value) {
179
- const ret = wasm.compactciphertextlistbuilder_push_i14(this.__wbg_ptr, value);
180
- if (ret[1]) {
181
- throw takeFromExternrefTable0(ret[0]);
182
- }
183
- }
184
- /**
185
- * @param {number} value
186
- */
187
- push_i16(value) {
188
- const ret = wasm.compactciphertextlistbuilder_push_i16(this.__wbg_ptr, value);
189
- if (ret[1]) {
190
- throw takeFromExternrefTable0(ret[0]);
191
- }
192
- }
193
- /**
194
- * @param {any} value
195
- */
196
- push_i160(value) {
197
- const ret = wasm.compactciphertextlistbuilder_push_i160(this.__wbg_ptr, value);
198
- if (ret[1]) {
199
- throw takeFromExternrefTable0(ret[0]);
200
- }
201
- }
202
- /**
203
- * @param {number} value
204
- */
205
- push_i2(value) {
206
- const ret = wasm.compactciphertextlistbuilder_push_i2(this.__wbg_ptr, value);
207
- if (ret[1]) {
208
- throw takeFromExternrefTable0(ret[0]);
209
- }
210
- }
211
- /**
212
- * @param {any} value
213
- */
214
- push_i2048(value) {
215
- const ret = wasm.compactciphertextlistbuilder_push_i2048(this.__wbg_ptr, value);
216
- if (ret[1]) {
217
- throw takeFromExternrefTable0(ret[0]);
218
- }
219
- }
220
- /**
221
- * @param {any} value
222
- */
223
- push_i256(value) {
224
- const ret = wasm.compactciphertextlistbuilder_push_i256(this.__wbg_ptr, value);
225
- if (ret[1]) {
226
- throw takeFromExternrefTable0(ret[0]);
227
- }
228
- }
229
- /**
230
- * @param {number} value
231
- */
232
- push_i32(value) {
233
- const ret = wasm.compactciphertextlistbuilder_push_i32(this.__wbg_ptr, value);
234
- if (ret[1]) {
235
- throw takeFromExternrefTable0(ret[0]);
236
- }
237
- }
238
- /**
239
- * @param {number} value
240
- */
241
- push_i4(value) {
242
- const ret = wasm.compactciphertextlistbuilder_push_i4(this.__wbg_ptr, value);
243
- if (ret[1]) {
244
- throw takeFromExternrefTable0(ret[0]);
245
- }
246
- }
247
- /**
248
- * @param {any} value
249
- */
250
- push_i512(value) {
251
- const ret = wasm.compactciphertextlistbuilder_push_i512(this.__wbg_ptr, value);
252
- if (ret[1]) {
253
- throw takeFromExternrefTable0(ret[0]);
254
- }
255
- }
256
- /**
257
- * @param {number} value
258
- */
259
- push_i6(value) {
260
- const ret = wasm.compactciphertextlistbuilder_push_i6(this.__wbg_ptr, value);
261
- if (ret[1]) {
262
- throw takeFromExternrefTable0(ret[0]);
263
- }
264
- }
265
- /**
266
- * @param {bigint} value
267
- */
268
- push_i64(value) {
269
- const ret = wasm.compactciphertextlistbuilder_push_i64(this.__wbg_ptr, value);
270
- if (ret[1]) {
271
- throw takeFromExternrefTable0(ret[0]);
272
- }
273
- }
274
- /**
275
- * @param {number} value
276
- */
277
- push_i8(value) {
278
- const ret = wasm.compactciphertextlistbuilder_push_i8(this.__wbg_ptr, value);
279
- if (ret[1]) {
280
- throw takeFromExternrefTable0(ret[0]);
281
- }
282
- }
283
- /**
284
- * @param {number} value
285
- */
286
- push_u10(value) {
287
- const ret = wasm.compactciphertextlistbuilder_push_u10(this.__wbg_ptr, value);
288
- if (ret[1]) {
289
- throw takeFromExternrefTable0(ret[0]);
290
- }
291
- }
292
- /**
293
- * @param {any} value
294
- */
295
- push_u1024(value) {
296
- const ret = wasm.compactciphertextlistbuilder_push_u1024(this.__wbg_ptr, value);
297
- if (ret[1]) {
298
- throw takeFromExternrefTable0(ret[0]);
299
- }
300
- }
301
- /**
302
- * @param {number} value
303
- */
304
- push_u12(value) {
305
- const ret = wasm.compactciphertextlistbuilder_push_u12(this.__wbg_ptr, value);
306
- if (ret[1]) {
307
- throw takeFromExternrefTable0(ret[0]);
308
- }
309
- }
310
- /**
311
- * @param {any} value
312
- */
313
- push_u128(value) {
314
- const ret = wasm.compactciphertextlistbuilder_push_u128(this.__wbg_ptr, value);
315
- if (ret[1]) {
316
- throw takeFromExternrefTable0(ret[0]);
317
- }
318
- }
319
- /**
320
- * @param {number} value
321
- */
322
- push_u14(value) {
323
- const ret = wasm.compactciphertextlistbuilder_push_u14(this.__wbg_ptr, value);
324
- if (ret[1]) {
325
- throw takeFromExternrefTable0(ret[0]);
326
- }
327
- }
328
- /**
329
- * @param {number} value
330
- */
331
- push_u16(value) {
332
- const ret = wasm.compactciphertextlistbuilder_push_u16(this.__wbg_ptr, value);
333
- if (ret[1]) {
334
- throw takeFromExternrefTable0(ret[0]);
335
- }
336
- }
337
- /**
338
- * @param {any} value
339
- */
340
- push_u160(value) {
341
- const ret = wasm.compactciphertextlistbuilder_push_u160(this.__wbg_ptr, value);
342
- if (ret[1]) {
343
- throw takeFromExternrefTable0(ret[0]);
344
- }
345
- }
346
- /**
347
- * @param {number} value
348
- */
349
- push_u2(value) {
350
- const ret = wasm.compactciphertextlistbuilder_push_u2(this.__wbg_ptr, value);
351
- if (ret[1]) {
352
- throw takeFromExternrefTable0(ret[0]);
353
- }
354
- }
355
- /**
356
- * @param {any} value
357
- */
358
- push_u2048(value) {
359
- const ret = wasm.compactciphertextlistbuilder_push_u2048(this.__wbg_ptr, value);
360
- if (ret[1]) {
361
- throw takeFromExternrefTable0(ret[0]);
362
- }
363
- }
364
- /**
365
- * @param {any} value
366
- */
367
- push_u256(value) {
368
- const ret = wasm.compactciphertextlistbuilder_push_u256(this.__wbg_ptr, value);
369
- if (ret[1]) {
370
- throw takeFromExternrefTable0(ret[0]);
371
- }
372
- }
373
- /**
374
- * @param {number} value
375
- */
376
- push_u32(value) {
377
- const ret = wasm.compactciphertextlistbuilder_push_u32(this.__wbg_ptr, value);
378
- if (ret[1]) {
379
- throw takeFromExternrefTable0(ret[0]);
380
- }
381
- }
382
- /**
383
- * @param {number} value
384
- */
385
- push_u4(value) {
386
- const ret = wasm.compactciphertextlistbuilder_push_u4(this.__wbg_ptr, value);
387
- if (ret[1]) {
388
- throw takeFromExternrefTable0(ret[0]);
389
- }
390
- }
391
- /**
392
- * @param {any} value
393
- */
394
- push_u512(value) {
395
- const ret = wasm.compactciphertextlistbuilder_push_u512(this.__wbg_ptr, value);
396
- if (ret[1]) {
397
- throw takeFromExternrefTable0(ret[0]);
398
- }
399
- }
400
- /**
401
- * @param {number} value
402
- */
403
- push_u6(value) {
404
- const ret = wasm.compactciphertextlistbuilder_push_u6(this.__wbg_ptr, value);
405
- if (ret[1]) {
406
- throw takeFromExternrefTable0(ret[0]);
407
- }
408
- }
409
- /**
410
- * @param {bigint} value
411
- */
412
- push_u64(value) {
413
- const ret = wasm.compactciphertextlistbuilder_push_u64(this.__wbg_ptr, value);
414
- if (ret[1]) {
415
- throw takeFromExternrefTable0(ret[0]);
416
- }
417
- }
418
- /**
419
- * @param {number} value
420
- */
421
- push_u8(value) {
422
- const ret = wasm.compactciphertextlistbuilder_push_u8(this.__wbg_ptr, value);
423
- if (ret[1]) {
424
- throw takeFromExternrefTable0(ret[0]);
425
- }
426
- }
427
- }
428
- if (Symbol.dispose) CompactCiphertextListBuilder.prototype[Symbol.dispose] = CompactCiphertextListBuilder.prototype.free;
429
-
430
- export class CompactCiphertextListExpander {
431
- __destroy_into_raw() {
432
- const ptr = this.__wbg_ptr;
433
- this.__wbg_ptr = 0;
434
- CompactCiphertextListExpanderFinalization.unregister(this);
435
- return ptr;
436
- }
437
- free() {
438
- const ptr = this.__destroy_into_raw();
439
- wasm.__wbg_compactciphertextlistexpander_free(ptr, 0);
440
- }
441
- }
442
- if (Symbol.dispose) CompactCiphertextListExpander.prototype[Symbol.dispose] = CompactCiphertextListExpander.prototype.free;
443
-
444
- export class CompactPkeCrs {
445
- static __wrap(ptr) {
446
- const obj = Object.create(CompactPkeCrs.prototype);
447
- obj.__wbg_ptr = ptr;
448
- CompactPkeCrsFinalization.register(obj, obj.__wbg_ptr, obj);
449
- return obj;
450
- }
451
- __destroy_into_raw() {
452
- const ptr = this.__wbg_ptr;
453
- this.__wbg_ptr = 0;
454
- CompactPkeCrsFinalization.unregister(this);
455
- return ptr;
456
- }
457
- free() {
458
- const ptr = this.__destroy_into_raw();
459
- wasm.__wbg_compactpkecrs_free(ptr, 0);
460
- }
461
- /**
462
- * @param {TfheConfig} config
463
- * @param {number} max_num_bits
464
- * @returns {CompactPkeCrs}
465
- */
466
- static from_config(config, max_num_bits) {
467
- _assertClass(config, TfheConfig);
468
- const ret = wasm.compactpkecrs_from_config(config.__wbg_ptr, max_num_bits);
469
- if (ret[2]) {
470
- throw takeFromExternrefTable0(ret[1]);
471
- }
472
- return CompactPkeCrs.__wrap(ret[0]);
473
- }
474
- /**
475
- * @param {Uint8Array} buffer
476
- * @param {bigint} serialized_size_limit
477
- * @returns {CompactPkeCrs}
478
- */
479
- static safe_deserialize(buffer, serialized_size_limit) {
480
- const ptr0 = passArray8ToWasm0(buffer, wasm.__wbindgen_malloc);
481
- const len0 = WASM_VECTOR_LEN;
482
- const ret = wasm.compactpkecrs_safe_deserialize(ptr0, len0, serialized_size_limit);
483
- if (ret[2]) {
484
- throw takeFromExternrefTable0(ret[1]);
485
- }
486
- return CompactPkeCrs.__wrap(ret[0]);
487
- }
488
- /**
489
- * @param {Uint8Array} buffer
490
- * @param {bigint} serialized_size_limit
491
- * @returns {CompactPkeCrs}
492
- */
493
- static safe_deserialize_from_public_params(buffer, serialized_size_limit) {
494
- const ptr0 = passArray8ToWasm0(buffer, wasm.__wbindgen_malloc);
495
- const len0 = WASM_VECTOR_LEN;
496
- const ret = wasm.compactpkecrs_safe_deserialize_from_public_params(ptr0, len0, serialized_size_limit);
497
- if (ret[2]) {
498
- throw takeFromExternrefTable0(ret[1]);
499
- }
500
- return CompactPkeCrs.__wrap(ret[0]);
501
- }
502
- /**
503
- * @param {bigint} serialized_size_limit
504
- * @returns {Uint8Array}
505
- */
506
- safe_serialize(serialized_size_limit) {
507
- const ret = wasm.compactpkecrs_safe_serialize(this.__wbg_ptr, serialized_size_limit);
508
- if (ret[3]) {
509
- throw takeFromExternrefTable0(ret[2]);
510
- }
511
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
512
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
513
- return v1;
514
- }
515
- }
516
- if (Symbol.dispose) CompactPkeCrs.prototype[Symbol.dispose] = CompactPkeCrs.prototype.free;
517
-
518
- /**
519
- * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83}
520
- */
521
- export const FheTypes = Object.freeze({
522
- Bool: 0, "0": "Bool",
523
- Uint4: 1, "1": "Uint4",
524
- Uint8: 2, "2": "Uint8",
525
- Uint16: 3, "3": "Uint16",
526
- Uint32: 4, "4": "Uint32",
527
- Uint64: 5, "5": "Uint64",
528
- Uint128: 6, "6": "Uint128",
529
- Uint160: 7, "7": "Uint160",
530
- Uint256: 8, "8": "Uint256",
531
- Uint512: 9, "9": "Uint512",
532
- Uint1024: 10, "10": "Uint1024",
533
- Uint2048: 11, "11": "Uint2048",
534
- Uint2: 12, "12": "Uint2",
535
- Uint6: 13, "13": "Uint6",
536
- Uint10: 14, "14": "Uint10",
537
- Uint12: 15, "15": "Uint12",
538
- Uint14: 16, "16": "Uint14",
539
- Int2: 17, "17": "Int2",
540
- Int4: 18, "18": "Int4",
541
- Int6: 19, "19": "Int6",
542
- Int8: 20, "20": "Int8",
543
- Int10: 21, "21": "Int10",
544
- Int12: 22, "22": "Int12",
545
- Int14: 23, "23": "Int14",
546
- Int16: 24, "24": "Int16",
547
- Int32: 25, "25": "Int32",
548
- Int64: 26, "26": "Int64",
549
- Int128: 27, "27": "Int128",
550
- Int160: 28, "28": "Int160",
551
- Int256: 29, "29": "Int256",
552
- AsciiString: 30, "30": "AsciiString",
553
- Int512: 31, "31": "Int512",
554
- Int1024: 32, "32": "Int1024",
555
- Int2048: 33, "33": "Int2048",
556
- Uint24: 34, "34": "Uint24",
557
- Uint40: 35, "35": "Uint40",
558
- Uint48: 36, "36": "Uint48",
559
- Uint56: 37, "37": "Uint56",
560
- Uint72: 38, "38": "Uint72",
561
- Uint80: 39, "39": "Uint80",
562
- Uint88: 40, "40": "Uint88",
563
- Uint96: 41, "41": "Uint96",
564
- Uint104: 42, "42": "Uint104",
565
- Uint112: 43, "43": "Uint112",
566
- Uint120: 44, "44": "Uint120",
567
- Uint136: 45, "45": "Uint136",
568
- Uint144: 46, "46": "Uint144",
569
- Uint152: 47, "47": "Uint152",
570
- Uint168: 48, "48": "Uint168",
571
- Uint176: 49, "49": "Uint176",
572
- Uint184: 50, "50": "Uint184",
573
- Uint192: 51, "51": "Uint192",
574
- Uint200: 52, "52": "Uint200",
575
- Uint208: 53, "53": "Uint208",
576
- Uint216: 54, "54": "Uint216",
577
- Uint224: 55, "55": "Uint224",
578
- Uint232: 56, "56": "Uint232",
579
- Uint240: 57, "57": "Uint240",
580
- Uint248: 58, "58": "Uint248",
581
- Int24: 59, "59": "Int24",
582
- Int40: 60, "60": "Int40",
583
- Int48: 61, "61": "Int48",
584
- Int56: 62, "62": "Int56",
585
- Int72: 63, "63": "Int72",
586
- Int80: 64, "64": "Int80",
587
- Int88: 65, "65": "Int88",
588
- Int96: 66, "66": "Int96",
589
- Int104: 67, "67": "Int104",
590
- Int112: 68, "68": "Int112",
591
- Int120: 69, "69": "Int120",
592
- Int136: 70, "70": "Int136",
593
- Int144: 71, "71": "Int144",
594
- Int152: 72, "72": "Int152",
595
- Int168: 73, "73": "Int168",
596
- Int176: 74, "74": "Int176",
597
- Int184: 75, "75": "Int184",
598
- Int192: 76, "76": "Int192",
599
- Int200: 77, "77": "Int200",
600
- Int208: 78, "78": "Int208",
601
- Int216: 79, "79": "Int216",
602
- Int224: 80, "80": "Int224",
603
- Int232: 81, "81": "Int232",
604
- Int240: 82, "82": "Int240",
605
- Int248: 83, "83": "Int248",
606
- });
607
-
608
- export class ProvenCompactCiphertextList {
609
- static __wrap(ptr) {
610
- const obj = Object.create(ProvenCompactCiphertextList.prototype);
611
- obj.__wbg_ptr = ptr;
612
- ProvenCompactCiphertextListFinalization.register(obj, obj.__wbg_ptr, obj);
613
- return obj;
614
- }
615
- __destroy_into_raw() {
616
- const ptr = this.__wbg_ptr;
617
- this.__wbg_ptr = 0;
618
- ProvenCompactCiphertextListFinalization.unregister(this);
619
- return ptr;
620
- }
621
- free() {
622
- const ptr = this.__destroy_into_raw();
623
- wasm.__wbg_provencompactciphertextlist_free(ptr, 0);
624
- }
625
- /**
626
- * @param {TfheCompactPublicKey} public_key
627
- * @returns {CompactCiphertextListBuilder}
628
- */
629
- static builder(public_key) {
630
- _assertClass(public_key, TfheCompactPublicKey);
631
- const ret = wasm.provencompactciphertextlist_builder(public_key.__wbg_ptr);
632
- if (ret[2]) {
633
- throw takeFromExternrefTable0(ret[1]);
634
- }
635
- return CompactCiphertextListBuilder.__wrap(ret[0]);
636
- }
637
- /**
638
- * @param {ProvenCompactCiphertextList} other
639
- * @returns {boolean}
640
- */
641
- eq(other) {
642
- _assertClass(other, ProvenCompactCiphertextList);
643
- const ret = wasm.provencompactciphertextlist_eq(this.__wbg_ptr, other.__wbg_ptr);
644
- return ret !== 0;
645
- }
646
- /**
647
- * @param {number} index
648
- * @returns {FheTypes | undefined}
649
- */
650
- get_kind_of(index) {
651
- const ret = wasm.provencompactciphertextlist_get_kind_of(this.__wbg_ptr, index);
652
- return ret === 84 ? undefined : ret;
653
- }
654
- /**
655
- * @returns {boolean}
656
- */
657
- is_empty() {
658
- const ret = wasm.provencompactciphertextlist_is_empty(this.__wbg_ptr);
659
- return ret !== 0;
660
- }
661
- /**
662
- * @returns {number}
663
- */
664
- len() {
665
- const ret = wasm.provencompactciphertextlist_len(this.__wbg_ptr);
666
- return ret >>> 0;
667
- }
668
- /**
669
- * @param {Uint8Array} buffer
670
- * @param {bigint} serialized_size_limit
671
- * @returns {ProvenCompactCiphertextList}
672
- */
673
- static safe_deserialize(buffer, serialized_size_limit) {
674
- const ptr0 = passArray8ToWasm0(buffer, wasm.__wbindgen_malloc);
675
- const len0 = WASM_VECTOR_LEN;
676
- const ret = wasm.provencompactciphertextlist_safe_deserialize(ptr0, len0, serialized_size_limit);
677
- if (ret[2]) {
678
- throw takeFromExternrefTable0(ret[1]);
679
- }
680
- return ProvenCompactCiphertextList.__wrap(ret[0]);
681
- }
682
- /**
683
- * @param {bigint} serialized_size_limit
684
- * @returns {Uint8Array}
685
- */
686
- safe_serialize(serialized_size_limit) {
687
- const ret = wasm.provencompactciphertextlist_safe_serialize(this.__wbg_ptr, serialized_size_limit);
688
- if (ret[3]) {
689
- throw takeFromExternrefTable0(ret[2]);
690
- }
691
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
692
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
693
- return v1;
694
- }
695
- }
696
- if (Symbol.dispose) ProvenCompactCiphertextList.prototype[Symbol.dispose] = ProvenCompactCiphertextList.prototype.free;
697
-
698
- export class TfheClientKey {
699
- static __wrap(ptr) {
700
- const obj = Object.create(TfheClientKey.prototype);
701
- obj.__wbg_ptr = ptr;
702
- TfheClientKeyFinalization.register(obj, obj.__wbg_ptr, obj);
703
- return obj;
704
- }
705
- __destroy_into_raw() {
706
- const ptr = this.__wbg_ptr;
707
- this.__wbg_ptr = 0;
708
- TfheClientKeyFinalization.unregister(this);
709
- return ptr;
710
- }
711
- free() {
712
- const ptr = this.__destroy_into_raw();
713
- wasm.__wbg_tfheclientkey_free(ptr, 0);
714
- }
715
- /**
716
- * @param {TfheConfig} config
717
- * @returns {TfheClientKey}
718
- */
719
- static generate(config) {
720
- _assertClass(config, TfheConfig);
721
- const ret = wasm.tfheclientkey_generate(config.__wbg_ptr);
722
- if (ret[2]) {
723
- throw takeFromExternrefTable0(ret[1]);
724
- }
725
- return TfheClientKey.__wrap(ret[0]);
726
- }
727
- /**
728
- * @param {TfheConfig} config
729
- * @param {any} seed
730
- * @returns {TfheClientKey}
731
- */
732
- static generate_with_seed(config, seed) {
733
- _assertClass(config, TfheConfig);
734
- const ret = wasm.tfheclientkey_generate_with_seed(config.__wbg_ptr, seed);
735
- if (ret[2]) {
736
- throw takeFromExternrefTable0(ret[1]);
737
- }
738
- return TfheClientKey.__wrap(ret[0]);
739
- }
740
- /**
741
- * @param {Uint8Array} buffer
742
- * @param {bigint} serialized_size_limit
743
- * @returns {TfheClientKey}
744
- */
745
- static safe_deserialize(buffer, serialized_size_limit) {
746
- const ptr0 = passArray8ToWasm0(buffer, wasm.__wbindgen_malloc);
747
- const len0 = WASM_VECTOR_LEN;
748
- const ret = wasm.tfheclientkey_safe_deserialize(ptr0, len0, serialized_size_limit);
749
- if (ret[2]) {
750
- throw takeFromExternrefTable0(ret[1]);
751
- }
752
- return TfheClientKey.__wrap(ret[0]);
753
- }
754
- /**
755
- * @param {bigint} serialized_size_limit
756
- * @returns {Uint8Array}
757
- */
758
- safe_serialize(serialized_size_limit) {
759
- const ret = wasm.tfheclientkey_safe_serialize(this.__wbg_ptr, serialized_size_limit);
760
- if (ret[3]) {
761
- throw takeFromExternrefTable0(ret[2]);
762
- }
763
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
764
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
765
- return v1;
766
- }
767
- }
768
- if (Symbol.dispose) TfheClientKey.prototype[Symbol.dispose] = TfheClientKey.prototype.free;
769
-
770
- export class TfheCompactPublicKey {
771
- static __wrap(ptr) {
772
- const obj = Object.create(TfheCompactPublicKey.prototype);
773
- obj.__wbg_ptr = ptr;
774
- TfheCompactPublicKeyFinalization.register(obj, obj.__wbg_ptr, obj);
775
- return obj;
776
- }
777
- __destroy_into_raw() {
778
- const ptr = this.__wbg_ptr;
779
- this.__wbg_ptr = 0;
780
- TfheCompactPublicKeyFinalization.unregister(this);
781
- return ptr;
782
- }
783
- free() {
784
- const ptr = this.__destroy_into_raw();
785
- wasm.__wbg_tfhecompactpublickey_free(ptr, 0);
786
- }
787
- /**
788
- * @param {TfheClientKey} client_key
789
- * @returns {TfheCompactPublicKey}
790
- */
791
- static new(client_key) {
792
- _assertClass(client_key, TfheClientKey);
793
- const ret = wasm.tfhecompactpublickey_new(client_key.__wbg_ptr);
794
- if (ret[2]) {
795
- throw takeFromExternrefTable0(ret[1]);
796
- }
797
- return TfheCompactPublicKey.__wrap(ret[0]);
798
- }
799
- /**
800
- * @param {Uint8Array} buffer
801
- * @param {bigint} serialized_size_limit
802
- * @returns {TfheCompactPublicKey}
803
- */
804
- static safe_deserialize(buffer, serialized_size_limit) {
805
- const ptr0 = passArray8ToWasm0(buffer, wasm.__wbindgen_malloc);
806
- const len0 = WASM_VECTOR_LEN;
807
- const ret = wasm.tfhecompactpublickey_safe_deserialize(ptr0, len0, serialized_size_limit);
808
- if (ret[2]) {
809
- throw takeFromExternrefTable0(ret[1]);
810
- }
811
- return TfheCompactPublicKey.__wrap(ret[0]);
812
- }
813
- /**
814
- * @param {bigint} serialized_size_limit
815
- * @returns {Uint8Array}
816
- */
817
- safe_serialize(serialized_size_limit) {
818
- const ret = wasm.tfhecompactpublickey_safe_serialize(this.__wbg_ptr, serialized_size_limit);
819
- if (ret[3]) {
820
- throw takeFromExternrefTable0(ret[2]);
821
- }
822
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
823
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
824
- return v1;
825
- }
826
- }
827
- if (Symbol.dispose) TfheCompactPublicKey.prototype[Symbol.dispose] = TfheCompactPublicKey.prototype.free;
828
-
829
- export class TfheConfig {
830
- static __wrap(ptr) {
831
- const obj = Object.create(TfheConfig.prototype);
832
- obj.__wbg_ptr = ptr;
833
- TfheConfigFinalization.register(obj, obj.__wbg_ptr, obj);
834
- return obj;
835
- }
836
- __destroy_into_raw() {
837
- const ptr = this.__wbg_ptr;
838
- this.__wbg_ptr = 0;
839
- TfheConfigFinalization.unregister(this);
840
- return ptr;
841
- }
842
- free() {
843
- const ptr = this.__destroy_into_raw();
844
- wasm.__wbg_tfheconfig_free(ptr, 0);
845
- }
846
- /**
847
- * @returns {TfheConfig}
848
- */
849
- static default() {
850
- const ret = wasm.tfheconfig_default();
851
- return TfheConfig.__wrap(ret);
852
- }
853
- }
854
- if (Symbol.dispose) TfheConfig.prototype[Symbol.dispose] = TfheConfig.prototype.free;
855
-
856
- /**
857
- * @enum {0 | 1}
858
- */
859
- export const ZkComputeLoad = Object.freeze({
860
- Proof: 0, "0": "Proof",
861
- Verify: 1, "1": "Verify",
862
- });
863
-
864
- /**
865
- * @param {number} num_threads
866
- * @returns {Promise<any>}
867
- */
868
- export function initThreadPool(num_threads) {
869
- const ret = wasm.initThreadPool(num_threads);
870
- return ret;
871
- }
872
-
873
- export function init_panic_hook() {
874
- wasm.init_panic_hook();
875
- }
876
-
877
- export class wbg_rayon_PoolBuilder {
878
- static __wrap(ptr) {
879
- const obj = Object.create(wbg_rayon_PoolBuilder.prototype);
880
- obj.__wbg_ptr = ptr;
881
- wbg_rayon_PoolBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
882
- return obj;
883
- }
884
- __destroy_into_raw() {
885
- const ptr = this.__wbg_ptr;
886
- this.__wbg_ptr = 0;
887
- wbg_rayon_PoolBuilderFinalization.unregister(this);
888
- return ptr;
889
- }
890
- free() {
891
- const ptr = this.__destroy_into_raw();
892
- wasm.__wbg_wbg_rayon_poolbuilder_free(ptr, 0);
893
- }
894
- build() {
895
- wasm.wbg_rayon_poolbuilder_build(this.__wbg_ptr);
896
- }
897
- /**
898
- * @returns {number}
899
- */
900
- numThreads() {
901
- const ret = wasm.wbg_rayon_poolbuilder_numThreads(this.__wbg_ptr);
902
- return ret >>> 0;
903
- }
904
- /**
905
- * @returns {number}
906
- */
907
- receiver() {
908
- const ret = wasm.wbg_rayon_poolbuilder_receiver(this.__wbg_ptr);
909
- return ret >>> 0;
910
- }
911
- }
912
- if (Symbol.dispose) wbg_rayon_PoolBuilder.prototype[Symbol.dispose] = wbg_rayon_PoolBuilder.prototype.free;
913
-
914
- /**
915
- * @param {number} receiver
916
- */
917
- export function wbg_rayon_start_worker(receiver) {
918
- wasm.wbg_rayon_start_worker(receiver);
919
- }
920
- function __wbg_get_imports(memory) {
921
- const import0 = {
922
- __proto__: null,
923
- __wbg_BigInt_52ff8391297da194: function() { return handleError(function (arg0) {
924
- const ret = BigInt(arg0);
925
- return ret;
926
- }, arguments); },
927
- __wbg_BigInt_ae200e93cacbd2b3: function(arg0) {
928
- const ret = BigInt(arg0);
929
- return ret;
930
- },
931
- __wbg_Error_3639a60ed15f87e7: function(arg0, arg1) {
932
- const ret = Error(getStringFromWasm0(arg0, arg1));
933
- return ret;
934
- },
935
- __wbg___wbindgen_bigint_get_as_i64_3af6d4ca77193a4b: function(arg0, arg1) {
936
- const v = arg1;
937
- const ret = typeof(v) === 'bigint' ? v : undefined;
938
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
939
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
940
- },
941
- __wbg___wbindgen_bit_and_bfedece2bb657f4b: function(arg0, arg1) {
942
- const ret = arg0 & arg1;
943
- return ret;
944
- },
945
- __wbg___wbindgen_debug_string_07cb72cfcc952e2b: function(arg0, arg1) {
946
- const ret = debugString(arg1);
947
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
948
- const len1 = WASM_VECTOR_LEN;
949
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
950
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
951
- },
952
- __wbg___wbindgen_is_function_2f0fd7ceb86e64c5: function(arg0) {
953
- const ret = typeof(arg0) === 'function';
954
- return ret;
955
- },
956
- __wbg___wbindgen_is_object_5b22ff2418063a9c: function(arg0) {
957
- const val = arg0;
958
- const ret = typeof(val) === 'object' && val !== null;
959
- return ret;
960
- },
961
- __wbg___wbindgen_is_string_eddc07a3efad52e6: function(arg0) {
962
- const ret = typeof(arg0) === 'string';
963
- return ret;
964
- },
965
- __wbg___wbindgen_is_undefined_244a92c34d3b6ec0: function(arg0) {
966
- const ret = arg0 === undefined;
967
- return ret;
968
- },
969
- __wbg___wbindgen_jsval_eq_403eaa3610500a25: function(arg0, arg1) {
970
- const ret = arg0 === arg1;
971
- return ret;
972
- },
973
- __wbg___wbindgen_lt_c483cc694de67c3e: function(arg0, arg1) {
974
- const ret = arg0 < arg1;
975
- return ret;
976
- },
977
- __wbg___wbindgen_memory_c2356dd1a089dfbd: function() {
978
- const ret = wasm.memory;
979
- return ret;
980
- },
981
- __wbg___wbindgen_module_df704393dfd1853c: function() {
982
- const ret = wasmModule;
983
- return ret;
984
- },
985
- __wbg___wbindgen_neg_9b4d71823e3bc513: function(arg0) {
986
- const ret = -arg0;
987
- return ret;
988
- },
989
- __wbg___wbindgen_shr_d8f8268f18c7a1c3: function(arg0, arg1) {
990
- const ret = arg0 >> arg1;
991
- return ret;
992
- },
993
- __wbg___wbindgen_string_get_965592073e5d848c: function(arg0, arg1) {
994
- const obj = arg1;
995
- const ret = typeof(obj) === 'string' ? obj : undefined;
996
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
997
- var len1 = WASM_VECTOR_LEN;
998
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
999
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1000
- },
1001
- __wbg___wbindgen_throw_9c75d47bf9e7731e: function(arg0, arg1) {
1002
- throw new Error(getStringFromWasm0(arg0, arg1));
1003
- },
1004
- __wbg_call_a41d6421b30a32c5: function() { return handleError(function (arg0, arg1, arg2) {
1005
- const ret = arg0.call(arg1, arg2);
1006
- return ret;
1007
- }, arguments); },
1008
- __wbg_crypto_38df2bab126b63dc: function(arg0) {
1009
- const ret = arg0.crypto;
1010
- return ret;
1011
- },
1012
- __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
1013
- let deferred0_0;
1014
- let deferred0_1;
1015
- try {
1016
- deferred0_0 = arg0;
1017
- deferred0_1 = arg1;
1018
- console.error(getStringFromWasm0(arg0, arg1));
1019
- } finally {
1020
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1021
- }
1022
- },
1023
- __wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
1024
- arg0.getRandomValues(arg1);
1025
- }, arguments); },
1026
- __wbg_instanceof_Window_4153c1818a1c0c0b: function(arg0) {
1027
- let result;
1028
- try {
1029
- result = arg0 instanceof Window;
1030
- } catch (_) {
1031
- result = false;
1032
- }
1033
- const ret = result;
1034
- return ret;
1035
- },
1036
- __wbg_length_ba3c032602efe310: function(arg0) {
1037
- const ret = arg0.length;
1038
- return ret;
1039
- },
1040
- __wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
1041
- const ret = arg0.msCrypto;
1042
- return ret;
1043
- },
1044
- __wbg_new_227d7c05414eb861: function() {
1045
- const ret = new Error();
1046
- return ret;
1047
- },
1048
- __wbg_new_with_length_9011f5da794bf5d9: function(arg0) {
1049
- const ret = new Uint8Array(arg0 >>> 0);
1050
- return ret;
1051
- },
1052
- __wbg_node_84ea875411254db1: function(arg0) {
1053
- const ret = arg0.node;
1054
- return ret;
1055
- },
1056
- __wbg_process_44c7a14e11e9f69e: function(arg0) {
1057
- const ret = arg0.process;
1058
- return ret;
1059
- },
1060
- __wbg_prototypesetcall_fd4050e806e1d519: function(arg0, arg1, arg2) {
1061
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1062
- },
1063
- __wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
1064
- arg0.randomFillSync(arg1);
1065
- }, arguments); },
1066
- __wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
1067
- const ret = module.require;
1068
- return ret;
1069
- }, arguments); },
1070
- __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
1071
- const ret = arg1.stack;
1072
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1073
- const len1 = WASM_VECTOR_LEN;
1074
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1075
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1076
- },
1077
- __wbg_startWorkers_8b582d57e92bd2d4: function(arg0, arg1, arg2) {
1078
- const ret = startWorkers(arg0, arg1, wbg_rayon_PoolBuilder.__wrap(arg2));
1079
- return ret;
1080
- },
1081
- __wbg_static_accessor_GLOBAL_THIS_1c7f1bd6c6941fdb: function() {
1082
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
1083
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1084
- },
1085
- __wbg_static_accessor_GLOBAL_e039bc914f83e74e: function() {
1086
- const ret = typeof global === 'undefined' ? null : global;
1087
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1088
- },
1089
- __wbg_static_accessor_SELF_8bf8c48c28420ad5: function() {
1090
- const ret = typeof self === 'undefined' ? null : self;
1091
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1092
- },
1093
- __wbg_static_accessor_WINDOW_6aeee9b51652ee0f: function() {
1094
- const ret = typeof window === 'undefined' ? null : window;
1095
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1096
- },
1097
- __wbg_subarray_fbe3cef290e1fa43: function(arg0, arg1, arg2) {
1098
- const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1099
- return ret;
1100
- },
1101
- __wbg_toString_15656af8d8e71f16: function(arg0, arg1, arg2) {
1102
- const ret = arg1.toString(arg2);
1103
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1104
- const len1 = WASM_VECTOR_LEN;
1105
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1106
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1107
- },
1108
- __wbg_toString_8d874489bad7e5a2: function(arg0) {
1109
- const ret = arg0.toString();
1110
- return ret;
1111
- },
1112
- __wbg_versions_276b2795b1c6a219: function(arg0) {
1113
- const ret = arg0.versions;
1114
- return ret;
1115
- },
1116
- __wbindgen_cast_0000000000000001: function(arg0) {
1117
- // Cast intrinsic for `F64 -> Externref`.
1118
- const ret = arg0;
1119
- return ret;
1120
- },
1121
- __wbindgen_cast_0000000000000002: function(arg0) {
1122
- // Cast intrinsic for `I64 -> Externref`.
1123
- const ret = arg0;
1124
- return ret;
1125
- },
1126
- __wbindgen_cast_0000000000000003: function(arg0, arg1) {
1127
- // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1128
- const ret = getArrayU8FromWasm0(arg0, arg1);
1129
- return ret;
1130
- },
1131
- __wbindgen_cast_0000000000000004: function(arg0, arg1) {
1132
- // Cast intrinsic for `Ref(String) -> Externref`.
1133
- const ret = getStringFromWasm0(arg0, arg1);
1134
- return ret;
1135
- },
1136
- __wbindgen_cast_0000000000000005: function(arg0) {
1137
- // Cast intrinsic for `U64 -> Externref`.
1138
- const ret = BigInt.asUintN(64, arg0);
1139
- return ret;
1140
- },
1141
- __wbindgen_init_externref_table: function() {
1142
- const table = wasm.__wbindgen_externrefs;
1143
- const offset = table.grow(4);
1144
- table.set(0, undefined);
1145
- table.set(offset + 0, undefined);
1146
- table.set(offset + 1, null);
1147
- table.set(offset + 2, true);
1148
- table.set(offset + 3, false);
1149
- },
1150
- memory: memory || new WebAssembly.Memory({initial:19,maximum:16384,shared:true}),
1151
- };
1152
- return {
1153
- __proto__: null,
1154
- "./tfhe_bg.js": import0,
1155
- };
1156
- }
1157
-
1158
- const CompactCiphertextListFinalization = (typeof FinalizationRegistry === 'undefined')
1159
- ? { register: () => {}, unregister: () => {} }
1160
- : new FinalizationRegistry(ptr => wasm.__wbg_compactciphertextlist_free(ptr, 1));
1161
- const CompactCiphertextListBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
1162
- ? { register: () => {}, unregister: () => {} }
1163
- : new FinalizationRegistry(ptr => wasm.__wbg_compactciphertextlistbuilder_free(ptr, 1));
1164
- const CompactCiphertextListExpanderFinalization = (typeof FinalizationRegistry === 'undefined')
1165
- ? { register: () => {}, unregister: () => {} }
1166
- : new FinalizationRegistry(ptr => wasm.__wbg_compactciphertextlistexpander_free(ptr, 1));
1167
- const CompactPkeCrsFinalization = (typeof FinalizationRegistry === 'undefined')
1168
- ? { register: () => {}, unregister: () => {} }
1169
- : new FinalizationRegistry(ptr => wasm.__wbg_compactpkecrs_free(ptr, 1));
1170
- const ProvenCompactCiphertextListFinalization = (typeof FinalizationRegistry === 'undefined')
1171
- ? { register: () => {}, unregister: () => {} }
1172
- : new FinalizationRegistry(ptr => wasm.__wbg_provencompactciphertextlist_free(ptr, 1));
1173
- const TfheClientKeyFinalization = (typeof FinalizationRegistry === 'undefined')
1174
- ? { register: () => {}, unregister: () => {} }
1175
- : new FinalizationRegistry(ptr => wasm.__wbg_tfheclientkey_free(ptr, 1));
1176
- const TfheCompactPublicKeyFinalization = (typeof FinalizationRegistry === 'undefined')
1177
- ? { register: () => {}, unregister: () => {} }
1178
- : new FinalizationRegistry(ptr => wasm.__wbg_tfhecompactpublickey_free(ptr, 1));
1179
- const TfheConfigFinalization = (typeof FinalizationRegistry === 'undefined')
1180
- ? { register: () => {}, unregister: () => {} }
1181
- : new FinalizationRegistry(ptr => wasm.__wbg_tfheconfig_free(ptr, 1));
1182
- const wbg_rayon_PoolBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
1183
- ? { register: () => {}, unregister: () => {} }
1184
- : new FinalizationRegistry(ptr => wasm.__wbg_wbg_rayon_poolbuilder_free(ptr, 1));
1185
-
1186
- function addToExternrefTable0(obj) {
1187
- const idx = wasm.__externref_table_alloc();
1188
- wasm.__wbindgen_externrefs.set(idx, obj);
1189
- return idx;
1190
- }
1191
-
1192
- function _assertClass(instance, klass) {
1193
- if (!(instance instanceof klass)) {
1194
- throw new Error(`expected instance of ${klass.name}`);
1195
- }
1196
- }
1197
-
1198
- function debugString(val) {
1199
- // primitive types
1200
- const type = typeof val;
1201
- if (type == 'number' || type == 'boolean' || val == null) {
1202
- return `${val}`;
1203
- }
1204
- if (type == 'string') {
1205
- return `"${val}"`;
1206
- }
1207
- if (type == 'symbol') {
1208
- const description = val.description;
1209
- if (description == null) {
1210
- return 'Symbol';
1211
- } else {
1212
- return `Symbol(${description})`;
1213
- }
1214
- }
1215
- if (type == 'function') {
1216
- const name = val.name;
1217
- if (typeof name == 'string' && name.length > 0) {
1218
- return `Function(${name})`;
1219
- } else {
1220
- return 'Function';
1221
- }
1222
- }
1223
- // objects
1224
- if (Array.isArray(val)) {
1225
- const length = val.length;
1226
- let debug = '[';
1227
- if (length > 0) {
1228
- debug += debugString(val[0]);
1229
- }
1230
- for(let i = 1; i < length; i++) {
1231
- debug += ', ' + debugString(val[i]);
1232
- }
1233
- debug += ']';
1234
- return debug;
1235
- }
1236
- // Test for built-in
1237
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1238
- let className;
1239
- if (builtInMatches && builtInMatches.length > 1) {
1240
- className = builtInMatches[1];
1241
- } else {
1242
- // Failed to match the standard '[object ClassName]'
1243
- return toString.call(val);
1244
- }
1245
- if (className == 'Object') {
1246
- // we're a user defined class or Object
1247
- // JSON.stringify avoids problems with cycles, and is generally much
1248
- // easier than looping through ownProperties of `val`.
1249
- try {
1250
- return 'Object(' + JSON.stringify(val) + ')';
1251
- } catch (_) {
1252
- return 'Object';
1253
- }
1254
- }
1255
- // errors
1256
- if (val instanceof Error) {
1257
- return `${val.name}: ${val.message}\n${val.stack}`;
1258
- }
1259
- // TODO we could test for more things here, like `Set`s and `Map`s.
1260
- return className;
1261
- }
1262
-
1263
- function getArrayU8FromWasm0(ptr, len) {
1264
- ptr = ptr >>> 0;
1265
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1266
- }
1267
-
1268
- let cachedDataViewMemory0 = null;
1269
- function getDataViewMemory0() {
1270
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
1271
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1272
- }
1273
- return cachedDataViewMemory0;
1274
- }
1275
-
1276
- function getStringFromWasm0(ptr, len) {
1277
- return decodeText(ptr >>> 0, len);
1278
- }
1279
-
1280
- let cachedUint8ArrayMemory0 = null;
1281
- function getUint8ArrayMemory0() {
1282
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.buffer !== wasm.memory.buffer) {
1283
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1284
- }
1285
- return cachedUint8ArrayMemory0;
1286
- }
1287
-
1288
- function handleError(f, args) {
1289
- try {
1290
- return f.apply(this, args);
1291
- } catch (e) {
1292
- const idx = addToExternrefTable0(e);
1293
- wasm.__wbindgen_exn_store(idx);
1294
- }
1295
- }
1296
-
1297
- function isLikeNone(x) {
1298
- return x === undefined || x === null;
1299
- }
1300
-
1301
- function passArray8ToWasm0(arg, malloc) {
1302
- const ptr = malloc(arg.length * 1, 1) >>> 0;
1303
- getUint8ArrayMemory0().set(arg, ptr / 1);
1304
- WASM_VECTOR_LEN = arg.length;
1305
- return ptr;
1306
- }
1307
-
1308
- function passStringToWasm0(arg, malloc, realloc) {
1309
- if (realloc === undefined) {
1310
- const buf = cachedTextEncoder.encode(arg);
1311
- const ptr = malloc(buf.length, 1) >>> 0;
1312
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1313
- WASM_VECTOR_LEN = buf.length;
1314
- return ptr;
1315
- }
1316
-
1317
- let len = arg.length;
1318
- let ptr = malloc(len, 1) >>> 0;
1319
-
1320
- const mem = getUint8ArrayMemory0();
1321
-
1322
- let offset = 0;
1323
-
1324
- for (; offset < len; offset++) {
1325
- const code = arg.charCodeAt(offset);
1326
- if (code > 0x7F) break;
1327
- mem[ptr + offset] = code;
1328
- }
1329
- if (offset !== len) {
1330
- if (offset !== 0) {
1331
- arg = arg.slice(offset);
1332
- }
1333
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1334
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1335
- const ret = cachedTextEncoder.encodeInto(arg, view);
1336
-
1337
- offset += ret.written;
1338
- ptr = realloc(ptr, len, offset, 1) >>> 0;
1339
- }
1340
-
1341
- WASM_VECTOR_LEN = offset;
1342
- return ptr;
1343
- }
1344
-
1345
- function takeFromExternrefTable0(idx) {
1346
- const value = wasm.__wbindgen_externrefs.get(idx);
1347
- wasm.__externref_table_dealloc(idx);
1348
- return value;
1349
- }
1350
-
1351
- let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : undefined);
1352
- if (cachedTextDecoder) cachedTextDecoder.decode();
1353
-
1354
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
1355
- let numBytesDecoded = 0;
1356
- function decodeText(ptr, len) {
1357
- numBytesDecoded += len;
1358
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1359
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1360
- cachedTextDecoder.decode();
1361
- numBytesDecoded = len;
1362
- }
1363
- return cachedTextDecoder.decode(getUint8ArrayMemory0().slice(ptr, ptr + len));
1364
- }
1365
-
1366
- const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder() : undefined);
1367
-
1368
- if (cachedTextEncoder) {
1369
- cachedTextEncoder.encodeInto = function (arg, view) {
1370
- const buf = cachedTextEncoder.encode(arg);
1371
- view.set(buf);
1372
- return {
1373
- read: arg.length,
1374
- written: buf.length
1375
- };
1376
- };
1377
- }
1378
-
1379
- let WASM_VECTOR_LEN = 0;
1380
-
1381
- let wasmModule, wasmInstance, wasm;
1382
- function __wbg_finalize_init(instance, module, thread_stack_size) {
1383
- wasmInstance = instance;
1384
- wasm = instance.exports;
1385
- wasmModule = module;
1386
- cachedDataViewMemory0 = null;
1387
- cachedUint8ArrayMemory0 = null;
1388
- if (typeof thread_stack_size !== 'undefined' && (typeof thread_stack_size !== 'number' || thread_stack_size === 0 || thread_stack_size % 65536 !== 0)) {
1389
- throw new Error('invalid stack size');
1390
- }
1391
-
1392
- wasm.__wbindgen_start(thread_stack_size);
1393
- return wasm;
1394
- }
1395
-
1396
- async function __wbg_load(module, imports) {
1397
- if (typeof Response === 'function' && module instanceof Response) {
1398
- if (typeof WebAssembly.instantiateStreaming === 'function') {
1399
- try {
1400
- return await WebAssembly.instantiateStreaming(module, imports);
1401
- } catch (e) {
1402
- const validResponse = module.ok && expectedResponseType(module.type);
1403
-
1404
- if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1405
- console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
1406
-
1407
- } else { throw e; }
1408
- }
1409
- }
1410
-
1411
- const bytes = await module.arrayBuffer();
1412
- return await WebAssembly.instantiate(bytes, imports);
1413
- } else {
1414
- const instance = await WebAssembly.instantiate(module, imports);
1415
-
1416
- if (instance instanceof WebAssembly.Instance) {
1417
- return { instance, module };
1418
- } else {
1419
- return instance;
1420
- }
1421
- }
1422
-
1423
- function expectedResponseType(type) {
1424
- switch (type) {
1425
- case 'basic': case 'cors': case 'default': return true;
1426
- }
1427
- return false;
1428
- }
1429
- }
1430
-
1431
- function initSync(module, memory) {
1432
- if (wasm !== undefined) return wasm;
1433
-
1434
- let thread_stack_size
1435
- if (module !== undefined) {
1436
- if (Object.getPrototypeOf(module) === Object.prototype) {
1437
- ({module, memory, thread_stack_size} = module)
1438
- } else {
1439
- console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1440
- }
1441
- }
1442
-
1443
- const imports = __wbg_get_imports(memory);
1444
- if (!(module instanceof WebAssembly.Module)) {
1445
- module = new WebAssembly.Module(module);
1446
- }
1447
- const instance = new WebAssembly.Instance(module, imports);
1448
- return __wbg_finalize_init(instance, module, thread_stack_size);
1449
- }
1450
-
1451
- async function __wbg_init(module_or_path, memory) {
1452
- if (wasm !== undefined) return wasm;
1453
-
1454
- let thread_stack_size
1455
- if (module_or_path !== undefined) {
1456
- if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1457
- ({module_or_path, memory, thread_stack_size} = module_or_path)
1458
- } else {
1459
- console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1460
- }
1461
- }
1462
-
1463
- // if (module_or_path === undefined) {
1464
- // module_or_path = new URL('tfhe_bg.wasm', import.meta.url);
1465
- // }
1466
- const imports = __wbg_get_imports(memory);
1467
-
1468
- // if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1469
- // module_or_path = fetch(module_or_path);
1470
- // }
1471
-
1472
- const { instance, module } = await __wbg_load(await module_or_path, imports);
1473
-
1474
- return __wbg_finalize_init(instance, module, thread_stack_size);
1475
- }
1476
-
1477
- function getWasmInfo() {
1478
- const memory = wasm?.memory;
1479
- return {
1480
- name: 'tfhe',
1481
- version: "1.6.0-dev",
1482
- downloadFiles: [
1483
- {
1484
- filename: "tfhe_bg.wasm",
1485
- sha256: "c75b046a99f7e96fd4a14ab44162a51c363685a2c6f6af4249ee0ed5467a4a37",
1486
- },
1487
- {
1488
- filename: "tfhe-worker.mjs",
1489
- sha256: "2c2ef02437e5b7a41f4c5c1defa0a24dcfae737037a59a145a972bb4191571b8",
1490
- }
1491
- ],
1492
- memory:
1493
- memory === undefined
1494
- ? undefined
1495
- : {
1496
- byteLength: memory.buffer.byteLength,
1497
- pages: memory.buffer.byteLength / 65536,
1498
- },
1499
- };
1500
- }
1501
-
1502
- export { initSync, getTfheWorkers, terminateWorkers, setWorkerUrlConfig, getWasmInfo, __wbg_init as initAsync };
1503
- export default __wbg_init;