tfhe 1.4.2 → 1.4.3

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.
Files changed (4) hide show
  1. package/package.json +1 -1
  2. package/tfhe.d.ts +36 -36
  3. package/tfhe.js +181 -186
  4. package/tfhe_bg.wasm +0 -0
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "tfhe",
3
3
  "type": "module",
4
4
  "description": "TFHE-rs is a fully homomorphic encryption (FHE) library that implements Zama's variant of TFHE.",
5
- "version": "1.4.2",
5
+ "version": "1.4.3",
6
6
  "license": "BSD-3-Clause-Clear",
7
7
  "repository": {
8
8
  "type": "git",
package/tfhe.d.ts CHANGED
@@ -4,8 +4,8 @@ export function init_panic_hook(): void;
4
4
  export function set_server_key(server_key: TfheServerKey): void;
5
5
  export function shortint_pke_params_name(param: ShortintCompactPublicKeyEncryptionParametersName): string;
6
6
  export function shortint_params_name(param: ShortintParametersName): string;
7
- export function wbg_rayon_start_worker(receiver: number): void;
8
7
  export function initThreadPool(num_threads: number): Promise<any>;
8
+ export function wbg_rayon_start_worker(receiver: number): void;
9
9
  export enum BooleanEncryptionKeyChoice {
10
10
  Big = 0,
11
11
  Small = 1,
@@ -3041,14 +3041,6 @@ export class wbg_rayon_PoolBuilder {
3041
3041
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
3042
3042
 
3043
3043
  export interface InitOutput {
3044
- readonly __wbg_boolean_free: (a: number, b: number) => void;
3045
- readonly __wbg_booleanciphertext_free: (a: number, b: number) => void;
3046
- readonly __wbg_booleanclientkey_free: (a: number, b: number) => void;
3047
- readonly __wbg_booleancompressedciphertext_free: (a: number, b: number) => void;
3048
- readonly __wbg_booleancompressedserverkey_free: (a: number, b: number) => void;
3049
- readonly __wbg_booleannoisedistribution_free: (a: number, b: number) => void;
3050
- readonly __wbg_booleanparameters_free: (a: number, b: number) => void;
3051
- readonly __wbg_booleanpublickey_free: (a: number, b: number) => void;
3052
3044
  readonly __wbg_compactciphertextlist_free: (a: number, b: number) => void;
3053
3045
  readonly __wbg_compactciphertextlistbuilder_free: (a: number, b: number) => void;
3054
3046
  readonly __wbg_compactciphertextlistexpander_free: (a: number, b: number) => void;
@@ -3239,30 +3231,6 @@ export interface InitOutput {
3239
3231
  readonly __wbg_tfheconfigbuilder_free: (a: number, b: number) => void;
3240
3232
  readonly __wbg_tfhepublickey_free: (a: number, b: number) => void;
3241
3233
  readonly __wbg_tfheserverkey_free: (a: number, b: number) => void;
3242
- readonly boolean_decompress_ciphertext: (a: number) => number;
3243
- readonly boolean_decrypt: (a: number, b: number) => number;
3244
- readonly boolean_deserialize_ciphertext: (a: number, b: number) => [number, number, number];
3245
- readonly boolean_deserialize_client_key: (a: number, b: number) => [number, number, number];
3246
- readonly boolean_deserialize_compressed_ciphertext: (a: number, b: number) => [number, number, number];
3247
- readonly boolean_deserialize_compressed_server_key: (a: number, b: number) => [number, number, number];
3248
- readonly boolean_deserialize_public_key: (a: number, b: number) => [number, number, number];
3249
- readonly boolean_encrypt: (a: number, b: number) => number;
3250
- readonly boolean_encrypt_compressed: (a: number, b: number) => number;
3251
- readonly boolean_encrypt_with_public_key: (a: number, b: number) => number;
3252
- readonly boolean_get_parameters: (a: number) => [number, number, number];
3253
- readonly boolean_new_client_key: (a: number) => number;
3254
- readonly boolean_new_client_key_from_seed_and_parameters: (a: bigint, b: bigint, c: number) => number;
3255
- readonly boolean_new_compressed_server_key: (a: number) => number;
3256
- readonly boolean_new_gaussian_from_std_dev: (a: number) => number;
3257
- readonly boolean_new_parameters: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
3258
- readonly boolean_new_public_key: (a: number) => number;
3259
- readonly boolean_serialize_ciphertext: (a: number) => [number, number, number, number];
3260
- readonly boolean_serialize_client_key: (a: number) => [number, number, number, number];
3261
- readonly boolean_serialize_compressed_ciphertext: (a: number) => [number, number, number, number];
3262
- readonly boolean_serialize_compressed_server_key: (a: number) => [number, number, number, number];
3263
- readonly boolean_serialize_public_key: (a: number) => [number, number, number, number];
3264
- readonly boolean_trivial_encrypt: (a: number) => number;
3265
- readonly boolean_try_new_t_uniform: (a: number) => [number, number, number];
3266
3234
  readonly compactciphertextlist_builder: (a: number) => [number, number, number];
3267
3235
  readonly compactciphertextlist_deserialize: (a: number, b: number) => [number, number, number];
3268
3236
  readonly compactciphertextlist_expand: (a: number) => [number, number, number];
@@ -4639,6 +4607,7 @@ export interface InitOutput {
4639
4607
  readonly shortint_new_client_key_from_seed_and_parameters: (a: bigint, b: bigint, c: number) => number;
4640
4608
  readonly shortint_new_compressed_public_key: (a: number) => number;
4641
4609
  readonly shortint_new_compressed_server_key: (a: number) => number;
4610
+ readonly shortint_new_gaussian_from_std_dev: (a: number) => number;
4642
4611
  readonly shortint_new_parameters: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: bigint, k: bigint, l: bigint, m: number, n: number, o: number) => number;
4643
4612
  readonly shortint_new_public_key: (a: number) => number;
4644
4613
  readonly shortint_params_name: (a: number) => [number, number];
@@ -4717,11 +4686,42 @@ export interface InitOutput {
4717
4686
  readonly tfhepublickey_safe_serialize: (a: number, b: bigint) => [number, number, number, number];
4718
4687
  readonly tfhepublickey_serialize: (a: number) => [number, number, number, number];
4719
4688
  readonly tfheserverkey_new: (a: number) => [number, number, number];
4720
- readonly shortint_new_gaussian_from_std_dev: (a: number) => number;
4721
4689
  readonly provencompactciphertextlist_len: (a: number) => number;
4722
4690
  readonly shortintparameters_lwe_noise_distribution: (a: number) => number;
4723
4691
  readonly provencompactciphertextlist_is_empty: (a: number) => number;
4692
+ readonly __wbg_boolean_free: (a: number, b: number) => void;
4693
+ readonly __wbg_booleanciphertext_free: (a: number, b: number) => void;
4694
+ readonly __wbg_booleanclientkey_free: (a: number, b: number) => void;
4695
+ readonly __wbg_booleancompressedciphertext_free: (a: number, b: number) => void;
4696
+ readonly __wbg_booleancompressedserverkey_free: (a: number, b: number) => void;
4697
+ readonly __wbg_booleannoisedistribution_free: (a: number, b: number) => void;
4698
+ readonly __wbg_booleanparameters_free: (a: number, b: number) => void;
4699
+ readonly __wbg_booleanpublickey_free: (a: number, b: number) => void;
4724
4700
  readonly __wbg_tfhe_free: (a: number, b: number) => void;
4701
+ readonly boolean_decompress_ciphertext: (a: number) => number;
4702
+ readonly boolean_decrypt: (a: number, b: number) => number;
4703
+ readonly boolean_deserialize_ciphertext: (a: number, b: number) => [number, number, number];
4704
+ readonly boolean_deserialize_client_key: (a: number, b: number) => [number, number, number];
4705
+ readonly boolean_deserialize_compressed_ciphertext: (a: number, b: number) => [number, number, number];
4706
+ readonly boolean_deserialize_compressed_server_key: (a: number, b: number) => [number, number, number];
4707
+ readonly boolean_deserialize_public_key: (a: number, b: number) => [number, number, number];
4708
+ readonly boolean_encrypt: (a: number, b: number) => number;
4709
+ readonly boolean_encrypt_compressed: (a: number, b: number) => number;
4710
+ readonly boolean_encrypt_with_public_key: (a: number, b: number) => number;
4711
+ readonly boolean_get_parameters: (a: number) => [number, number, number];
4712
+ readonly boolean_new_client_key: (a: number) => number;
4713
+ readonly boolean_new_client_key_from_seed_and_parameters: (a: bigint, b: bigint, c: number) => number;
4714
+ readonly boolean_new_compressed_server_key: (a: number) => number;
4715
+ readonly boolean_new_gaussian_from_std_dev: (a: number) => number;
4716
+ readonly boolean_new_parameters: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
4717
+ readonly boolean_new_public_key: (a: number) => number;
4718
+ readonly boolean_serialize_ciphertext: (a: number) => [number, number, number, number];
4719
+ readonly boolean_serialize_client_key: (a: number) => [number, number, number, number];
4720
+ readonly boolean_serialize_compressed_ciphertext: (a: number) => [number, number, number, number];
4721
+ readonly boolean_serialize_compressed_server_key: (a: number) => [number, number, number, number];
4722
+ readonly boolean_serialize_public_key: (a: number) => [number, number, number, number];
4723
+ readonly boolean_trivial_encrypt: (a: number) => number;
4724
+ readonly boolean_try_new_t_uniform: (a: number) => [number, number, number];
4725
4725
  readonly __wbg_wbg_rayon_poolbuilder_free: (a: number, b: number) => void;
4726
4726
  readonly wbg_rayon_poolbuilder_build: (a: number) => void;
4727
4727
  readonly wbg_rayon_poolbuilder_numThreads: (a: number) => number;
@@ -4730,11 +4730,11 @@ export interface InitOutput {
4730
4730
  readonly initThreadPool: (a: number) => any;
4731
4731
  readonly __wbindgen_exn_store: (a: number) => void;
4732
4732
  readonly __externref_table_alloc: () => number;
4733
- readonly __wbindgen_export_2: WebAssembly.Table;
4733
+ readonly __wbindgen_externrefs: WebAssembly.Table;
4734
4734
  readonly memory: WebAssembly.Memory;
4735
- readonly __wbindgen_free: (a: number, b: number, c: number) => void;
4736
4735
  readonly __wbindgen_malloc: (a: number, b: number) => number;
4737
4736
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
4737
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
4738
4738
  readonly __externref_table_dealloc: (a: number) => void;
4739
4739
  readonly __wbindgen_thread_destroy: (a?: number, b?: number, c?: number) => void;
4740
4740
  readonly __wbindgen_start: (a: number) => void;
package/tfhe.js CHANGED
@@ -4,7 +4,7 @@ let wasm;
4
4
 
5
5
  function addToExternrefTable0(obj) {
6
6
  const idx = wasm.__externref_table_alloc();
7
- wasm.__wbindgen_export_2.set(idx, obj);
7
+ wasm.__wbindgen_externrefs.set(idx, obj);
8
8
  return idx;
9
9
  }
10
10
 
@@ -26,9 +26,9 @@ function getUint8ArrayMemory0() {
26
26
  return cachedUint8ArrayMemory0;
27
27
  }
28
28
 
29
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
29
+ let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : undefined);
30
30
 
31
- cachedTextDecoder.decode();
31
+ if (cachedTextDecoder) cachedTextDecoder.decode();
32
32
 
33
33
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
34
34
  let numBytesDecoded = 0;
@@ -47,61 +47,8 @@ function getStringFromWasm0(ptr, len) {
47
47
  return decodeText(ptr, len);
48
48
  }
49
49
 
50
- function getArrayU8FromWasm0(ptr, len) {
51
- ptr = ptr >>> 0;
52
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
53
- }
54
-
55
- let WASM_VECTOR_LEN = 0;
56
-
57
- const cachedTextEncoder = new TextEncoder();
58
-
59
- cachedTextEncoder.encodeInto = function (arg, view) {
60
- const buf = cachedTextEncoder.encode(arg);
61
- view.set(buf);
62
- return {
63
- read: arg.length,
64
- written: buf.length
65
- };
66
- }
67
-
68
- function passStringToWasm0(arg, malloc, realloc) {
69
-
70
- if (realloc === undefined) {
71
- const buf = cachedTextEncoder.encode(arg);
72
- const ptr = malloc(buf.length, 1) >>> 0;
73
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
74
- WASM_VECTOR_LEN = buf.length;
75
- return ptr;
76
- }
77
-
78
- let len = arg.length;
79
- let ptr = malloc(len, 1) >>> 0;
80
-
81
- const mem = getUint8ArrayMemory0();
82
-
83
- let offset = 0;
84
-
85
- for (; offset < len; offset++) {
86
- const code = arg.charCodeAt(offset);
87
- if (code > 0x7F) break;
88
- mem[ptr + offset] = code;
89
- }
90
-
91
- if (offset !== len) {
92
- if (offset !== 0) {
93
- arg = arg.slice(offset);
94
- }
95
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
96
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
97
- const ret = cachedTextEncoder.encodeInto(arg, view);
98
-
99
- offset += ret.written;
100
- ptr = realloc(ptr, len, offset, 1) >>> 0;
101
- }
102
-
103
- WASM_VECTOR_LEN = offset;
104
- return ptr;
50
+ function isLikeNone(x) {
51
+ return x === undefined || x === null;
105
52
  }
106
53
 
107
54
  let cachedDataViewMemory0 = null;
@@ -113,10 +60,6 @@ function getDataViewMemory0() {
113
60
  return cachedDataViewMemory0;
114
61
  }
115
62
 
116
- function isLikeNone(x) {
117
- return x === undefined || x === null;
118
- }
119
-
120
63
  function debugString(val) {
121
64
  // primitive types
122
65
  const type = typeof val;
@@ -182,6 +125,65 @@ function debugString(val) {
182
125
  return className;
183
126
  }
184
127
 
128
+ let WASM_VECTOR_LEN = 0;
129
+
130
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder() : undefined);
131
+
132
+ if (cachedTextEncoder) {
133
+ cachedTextEncoder.encodeInto = function (arg, view) {
134
+ const buf = cachedTextEncoder.encode(arg);
135
+ view.set(buf);
136
+ return {
137
+ read: arg.length,
138
+ written: buf.length
139
+ };
140
+ }
141
+ }
142
+
143
+ function passStringToWasm0(arg, malloc, realloc) {
144
+
145
+ if (realloc === undefined) {
146
+ const buf = cachedTextEncoder.encode(arg);
147
+ const ptr = malloc(buf.length, 1) >>> 0;
148
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
149
+ WASM_VECTOR_LEN = buf.length;
150
+ return ptr;
151
+ }
152
+
153
+ let len = arg.length;
154
+ let ptr = malloc(len, 1) >>> 0;
155
+
156
+ const mem = getUint8ArrayMemory0();
157
+
158
+ let offset = 0;
159
+
160
+ for (; offset < len; offset++) {
161
+ const code = arg.charCodeAt(offset);
162
+ if (code > 0x7F) break;
163
+ mem[ptr + offset] = code;
164
+ }
165
+
166
+ if (offset !== len) {
167
+ if (offset !== 0) {
168
+ arg = arg.slice(offset);
169
+ }
170
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
171
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
172
+ const ret = cachedTextEncoder.encodeInto(arg, view);
173
+
174
+ offset += ret.written;
175
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
176
+ }
177
+
178
+ WASM_VECTOR_LEN = offset;
179
+ return ptr;
180
+ }
181
+
182
+ function getArrayU8FromWasm0(ptr, len) {
183
+ ptr = ptr >>> 0;
184
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
185
+ }
186
+
185
187
  function passArray8ToWasm0(arg, malloc) {
186
188
  const ptr = malloc(arg.length * 1, 1) >>> 0;
187
189
  getUint8ArrayMemory0().set(arg, ptr / 1);
@@ -190,7 +192,7 @@ function passArray8ToWasm0(arg, malloc) {
190
192
  }
191
193
 
192
194
  function takeFromExternrefTable0(idx) {
193
- const value = wasm.__wbindgen_export_2.get(idx);
195
+ const value = wasm.__wbindgen_externrefs.get(idx);
194
196
  wasm.__externref_table_dealloc(idx);
195
197
  return value;
196
198
  }
@@ -250,13 +252,6 @@ export function shortint_params_name(param) {
250
252
  }
251
253
  }
252
254
 
253
- /**
254
- * @param {number} receiver
255
- */
256
- export function wbg_rayon_start_worker(receiver) {
257
- wasm.wbg_rayon_start_worker(receiver);
258
- }
259
-
260
255
  /**
261
256
  * @param {number} num_threads
262
257
  * @returns {Promise<any>}
@@ -266,6 +261,13 @@ export function initThreadPool(num_threads) {
266
261
  return ret;
267
262
  }
268
263
 
264
+ /**
265
+ * @param {number} receiver
266
+ */
267
+ export function wbg_rayon_start_worker(receiver) {
268
+ wasm.wbg_rayon_start_worker(receiver);
269
+ }
270
+
269
271
  /**
270
272
  * @enum {0 | 1}
271
273
  */
@@ -23124,7 +23126,7 @@ export class Shortint {
23124
23126
  * @returns {ShortintNoiseDistribution}
23125
23127
  */
23126
23128
  static new_gaussian_from_std_dev(std_dev) {
23127
- const ret = wasm.boolean_new_gaussian_from_std_dev(std_dev);
23129
+ const ret = wasm.shortint_new_gaussian_from_std_dev(std_dev);
23128
23130
  return ShortintNoiseDistribution.__wrap(ret);
23129
23131
  }
23130
23132
  /**
@@ -24557,29 +24559,106 @@ async function __wbg_load(module, imports) {
24557
24559
  }
24558
24560
  }
24559
24561
 
24560
- function __wbg_get_imports() {
24562
+ function __wbg_get_imports(memory) {
24561
24563
  const imports = {};
24562
24564
  imports.wbg = {};
24563
- imports.wbg.__wbg_BigInt_40a77d45cca49470 = function() { return handleError(function (arg0) {
24565
+ imports.wbg.__wbg_BigInt_77ad2fe9a1c378c1 = function(arg0) {
24564
24566
  const ret = BigInt(arg0);
24565
24567
  return ret;
24566
- }, arguments) };
24567
- imports.wbg.__wbg_BigInt_6adbfd8eb0f7ec07 = function(arg0) {
24568
+ };
24569
+ imports.wbg.__wbg_BigInt_7bf8b8b2f99c431a = function() { return handleError(function (arg0) {
24568
24570
  const ret = BigInt(arg0);
24569
24571
  return ret;
24570
- };
24571
- imports.wbg.__wbg_Error_e17e777aac105295 = function(arg0, arg1) {
24572
+ }, arguments) };
24573
+ imports.wbg.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
24572
24574
  const ret = Error(getStringFromWasm0(arg0, arg1));
24573
24575
  return ret;
24574
24576
  };
24575
- imports.wbg.__wbg_call_13410aac570ffff7 = function() { return handleError(function (arg0, arg1) {
24576
- const ret = arg0.call(arg1);
24577
+ imports.wbg.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
24578
+ const v = arg1;
24579
+ const ret = typeof(v) === 'bigint' ? v : undefined;
24580
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
24581
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
24582
+ };
24583
+ imports.wbg.__wbg___wbindgen_bit_and_130be7a4d3dadf5a = function(arg0, arg1) {
24584
+ const ret = arg0 & arg1;
24577
24585
  return ret;
24578
- }, arguments) };
24579
- imports.wbg.__wbg_call_a5400b25a865cfd8 = function() { return handleError(function (arg0, arg1, arg2) {
24586
+ };
24587
+ imports.wbg.__wbg___wbindgen_bit_or_192256c6741bc9fd = function(arg0, arg1) {
24588
+ const ret = arg0 | arg1;
24589
+ return ret;
24590
+ };
24591
+ imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
24592
+ const ret = debugString(arg1);
24593
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
24594
+ const len1 = WASM_VECTOR_LEN;
24595
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
24596
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
24597
+ };
24598
+ imports.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
24599
+ const ret = typeof(arg0) === 'function';
24600
+ return ret;
24601
+ };
24602
+ imports.wbg.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
24603
+ const val = arg0;
24604
+ const ret = typeof(val) === 'object' && val !== null;
24605
+ return ret;
24606
+ };
24607
+ imports.wbg.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
24608
+ const ret = typeof(arg0) === 'string';
24609
+ return ret;
24610
+ };
24611
+ imports.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
24612
+ const ret = arg0 === undefined;
24613
+ return ret;
24614
+ };
24615
+ imports.wbg.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
24616
+ const ret = arg0 === arg1;
24617
+ return ret;
24618
+ };
24619
+ imports.wbg.__wbg___wbindgen_lt_6594d884e1c6a1ab = function(arg0, arg1) {
24620
+ const ret = arg0 < arg1;
24621
+ return ret;
24622
+ };
24623
+ imports.wbg.__wbg___wbindgen_memory_27faa6e0e73716bd = function() {
24624
+ const ret = wasm.memory;
24625
+ return ret;
24626
+ };
24627
+ imports.wbg.__wbg___wbindgen_module_66f1f22805762dd9 = function() {
24628
+ const ret = __wbg_init.__wbindgen_wasm_module;
24629
+ return ret;
24630
+ };
24631
+ imports.wbg.__wbg___wbindgen_neg_9b61844910d27670 = function(arg0) {
24632
+ const ret = -arg0;
24633
+ return ret;
24634
+ };
24635
+ imports.wbg.__wbg___wbindgen_shl_19b223a8b6c02064 = function(arg0, arg1) {
24636
+ const ret = arg0 << arg1;
24637
+ return ret;
24638
+ };
24639
+ imports.wbg.__wbg___wbindgen_shr_5fb5dd3acf2615de = function(arg0, arg1) {
24640
+ const ret = arg0 >> arg1;
24641
+ return ret;
24642
+ };
24643
+ imports.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
24644
+ const obj = arg1;
24645
+ const ret = typeof(obj) === 'string' ? obj : undefined;
24646
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
24647
+ var len1 = WASM_VECTOR_LEN;
24648
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
24649
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
24650
+ };
24651
+ imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
24652
+ throw new Error(getStringFromWasm0(arg0, arg1));
24653
+ };
24654
+ imports.wbg.__wbg_call_525440f72fbfc0ea = function() { return handleError(function (arg0, arg1, arg2) {
24580
24655
  const ret = arg0.call(arg1, arg2);
24581
24656
  return ret;
24582
24657
  }, arguments) };
24658
+ imports.wbg.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {
24659
+ const ret = arg0.call(arg1);
24660
+ return ret;
24661
+ }, arguments) };
24583
24662
  imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
24584
24663
  const ret = arg0.crypto;
24585
24664
  return ret;
@@ -24598,11 +24677,11 @@ function __wbg_get_imports() {
24598
24677
  imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
24599
24678
  arg0.getRandomValues(arg1);
24600
24679
  }, arguments) };
24601
- imports.wbg.__wbg_getTime_6bb3f64e0f18f817 = function(arg0) {
24680
+ imports.wbg.__wbg_getTime_14776bfb48a1bff9 = function(arg0) {
24602
24681
  const ret = arg0.getTime();
24603
24682
  return ret;
24604
24683
  };
24605
- imports.wbg.__wbg_instanceof_Window_12d20d558ef92592 = function(arg0) {
24684
+ imports.wbg.__wbg_instanceof_Window_4846dbb3de56c84c = function(arg0) {
24606
24685
  let result;
24607
24686
  try {
24608
24687
  result = arg0 instanceof Window;
@@ -24612,7 +24691,7 @@ function __wbg_get_imports() {
24612
24691
  const ret = result;
24613
24692
  return ret;
24614
24693
  };
24615
- imports.wbg.__wbg_length_6bb7e81f9d7713e4 = function(arg0) {
24694
+ imports.wbg.__wbg_length_69bca3cb64fc8748 = function(arg0) {
24616
24695
  const ret = arg0.length;
24617
24696
  return ret;
24618
24697
  };
@@ -24620,7 +24699,7 @@ function __wbg_get_imports() {
24620
24699
  const ret = arg0.msCrypto;
24621
24700
  return ret;
24622
24701
  };
24623
- imports.wbg.__wbg_new0_b0a0a38c201e6df5 = function() {
24702
+ imports.wbg.__wbg_new_0_f9740686d739025c = function() {
24624
24703
  const ret = new Date();
24625
24704
  return ret;
24626
24705
  };
@@ -24628,11 +24707,11 @@ function __wbg_get_imports() {
24628
24707
  const ret = new Error();
24629
24708
  return ret;
24630
24709
  };
24631
- imports.wbg.__wbg_newnoargs_254190557c45b4ec = function(arg0, arg1) {
24710
+ imports.wbg.__wbg_new_no_args_ee98eee5275000a4 = function(arg0, arg1) {
24632
24711
  const ret = new Function(getStringFromWasm0(arg0, arg1));
24633
24712
  return ret;
24634
24713
  };
24635
- imports.wbg.__wbg_newwithlength_a167dcc7aaa3ba77 = function(arg0) {
24714
+ imports.wbg.__wbg_new_with_length_01aa0dc35aa13543 = function(arg0) {
24636
24715
  const ret = new Uint8Array(arg0 >>> 0);
24637
24716
  return ret;
24638
24717
  };
@@ -24644,7 +24723,7 @@ function __wbg_get_imports() {
24644
24723
  const ret = arg0.process;
24645
24724
  return ret;
24646
24725
  };
24647
- imports.wbg.__wbg_prototypesetcall_3d4a26c1ed734349 = function(arg0, arg1, arg2) {
24726
+ imports.wbg.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
24648
24727
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
24649
24728
  };
24650
24729
  imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
@@ -24665,118 +24744,41 @@ function __wbg_get_imports() {
24665
24744
  const ret = startWorkers(arg0, arg1, wbg_rayon_PoolBuilder.__wrap(arg2));
24666
24745
  return ret;
24667
24746
  };
24668
- imports.wbg.__wbg_static_accessor_GLOBAL_8921f820c2ce3f12 = function() {
24747
+ imports.wbg.__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e = function() {
24669
24748
  const ret = typeof global === 'undefined' ? null : global;
24670
24749
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
24671
24750
  };
24672
- imports.wbg.__wbg_static_accessor_GLOBAL_THIS_f0a4409105898184 = function() {
24751
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac = function() {
24673
24752
  const ret = typeof globalThis === 'undefined' ? null : globalThis;
24674
24753
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
24675
24754
  };
24676
- imports.wbg.__wbg_static_accessor_SELF_995b214ae681ff99 = function() {
24755
+ imports.wbg.__wbg_static_accessor_SELF_6fdf4b64710cc91b = function() {
24677
24756
  const ret = typeof self === 'undefined' ? null : self;
24678
24757
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
24679
24758
  };
24680
- imports.wbg.__wbg_static_accessor_WINDOW_cde3890479c675ea = function() {
24759
+ imports.wbg.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2 = function() {
24681
24760
  const ret = typeof window === 'undefined' ? null : window;
24682
24761
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
24683
24762
  };
24684
- imports.wbg.__wbg_subarray_70fd07feefe14294 = function(arg0, arg1, arg2) {
24763
+ imports.wbg.__wbg_subarray_480600f3d6a9f26c = function(arg0, arg1, arg2) {
24685
24764
  const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
24686
24765
  return ret;
24687
24766
  };
24688
- imports.wbg.__wbg_toString_1f1286a7a97689fe = function(arg0, arg1, arg2) {
24689
- const ret = arg1.toString(arg2);
24690
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
24691
- const len1 = WASM_VECTOR_LEN;
24692
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
24693
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
24694
- };
24695
- imports.wbg.__wbg_toString_d8f537919ef401d6 = function(arg0) {
24767
+ imports.wbg.__wbg_toString_8eec07f6f4c057e4 = function(arg0) {
24696
24768
  const ret = arg0.toString();
24697
24769
  return ret;
24698
24770
  };
24699
- imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
24700
- const ret = arg0.versions;
24701
- return ret;
24702
- };
24703
- imports.wbg.__wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1 = function(arg0, arg1) {
24704
- const v = arg1;
24705
- const ret = typeof(v) === 'bigint' ? v : undefined;
24706
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
24707
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
24708
- };
24709
- imports.wbg.__wbg_wbindgenbitand_24bfc92ff26d44cb = function(arg0, arg1) {
24710
- const ret = arg0 & arg1;
24711
- return ret;
24712
- };
24713
- imports.wbg.__wbg_wbindgenbitor_87169f71f306a104 = function(arg0, arg1) {
24714
- const ret = arg0 | arg1;
24715
- return ret;
24716
- };
24717
- imports.wbg.__wbg_wbindgendebugstring_99ef257a3ddda34d = function(arg0, arg1) {
24718
- const ret = debugString(arg1);
24771
+ imports.wbg.__wbg_toString_b4979eaf8b235b54 = function(arg0, arg1, arg2) {
24772
+ const ret = arg1.toString(arg2);
24719
24773
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
24720
24774
  const len1 = WASM_VECTOR_LEN;
24721
24775
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
24722
24776
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
24723
24777
  };
24724
- imports.wbg.__wbg_wbindgenisfunction_8cee7dce3725ae74 = function(arg0) {
24725
- const ret = typeof(arg0) === 'function';
24726
- return ret;
24727
- };
24728
- imports.wbg.__wbg_wbindgenisobject_307a53c6bd97fbf8 = function(arg0) {
24729
- const val = arg0;
24730
- const ret = typeof(val) === 'object' && val !== null;
24731
- return ret;
24732
- };
24733
- imports.wbg.__wbg_wbindgenisstring_d4fa939789f003b0 = function(arg0) {
24734
- const ret = typeof(arg0) === 'string';
24735
- return ret;
24736
- };
24737
- imports.wbg.__wbg_wbindgenisundefined_c4b71d073b92f3c5 = function(arg0) {
24738
- const ret = arg0 === undefined;
24739
- return ret;
24740
- };
24741
- imports.wbg.__wbg_wbindgenjsvaleq_e6f2ad59ccae1b58 = function(arg0, arg1) {
24742
- const ret = arg0 === arg1;
24743
- return ret;
24744
- };
24745
- imports.wbg.__wbg_wbindgenlt_544155a2b3097bd5 = function(arg0, arg1) {
24746
- const ret = arg0 < arg1;
24747
- return ret;
24748
- };
24749
- imports.wbg.__wbg_wbindgenmemory_d84da70f7c42d172 = function() {
24750
- const ret = wasm.memory;
24751
- return ret;
24752
- };
24753
- imports.wbg.__wbg_wbindgenmodule_7e59019f6366ff9c = function() {
24754
- const ret = __wbg_init.__wbindgen_wasm_module;
24755
- return ret;
24756
- };
24757
- imports.wbg.__wbg_wbindgenneg_3577d8a6fd6fd98b = function(arg0) {
24758
- const ret = -arg0;
24759
- return ret;
24760
- };
24761
- imports.wbg.__wbg_wbindgenshl_54c6fe049ff902f0 = function(arg0, arg1) {
24762
- const ret = arg0 << arg1;
24763
- return ret;
24764
- };
24765
- imports.wbg.__wbg_wbindgenshr_7d2aae6044c0dab1 = function(arg0, arg1) {
24766
- const ret = arg0 >> arg1;
24778
+ imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
24779
+ const ret = arg0.versions;
24767
24780
  return ret;
24768
24781
  };
24769
- imports.wbg.__wbg_wbindgenstringget_0f16a6ddddef376f = function(arg0, arg1) {
24770
- const obj = arg1;
24771
- const ret = typeof(obj) === 'string' ? obj : undefined;
24772
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
24773
- var len1 = WASM_VECTOR_LEN;
24774
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
24775
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
24776
- };
24777
- imports.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function(arg0, arg1) {
24778
- throw new Error(getStringFromWasm0(arg0, arg1));
24779
- };
24780
24782
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
24781
24783
  // Cast intrinsic for `Ref(String) -> Externref`.
24782
24784
  const ret = getStringFromWasm0(arg0, arg1);
@@ -24813,7 +24815,7 @@ function __wbg_get_imports() {
24813
24815
  return ret;
24814
24816
  };
24815
24817
  imports.wbg.__wbindgen_init_externref_table = function() {
24816
- const table = wasm.__wbindgen_export_2;
24818
+ const table = wasm.__wbindgen_externrefs;
24817
24819
  const offset = table.grow(4);
24818
24820
  table.set(0, undefined);
24819
24821
  table.set(offset + 0, undefined);
@@ -24822,14 +24824,11 @@ function __wbg_get_imports() {
24822
24824
  table.set(offset + 3, false);
24823
24825
  ;
24824
24826
  };
24827
+ imports.wbg.memory = memory || new WebAssembly.Memory({initial:21,maximum:16384,shared:true});
24825
24828
 
24826
24829
  return imports;
24827
24830
  }
24828
24831
 
24829
- function __wbg_init_memory(imports, memory) {
24830
- imports.wbg.memory = memory || new WebAssembly.Memory({initial:21,maximum:16384,shared:true});
24831
- }
24832
-
24833
24832
  function __wbg_finalize_init(instance, module, thread_stack_size) {
24834
24833
  wasm = instance.exports;
24835
24834
  __wbg_init.__wbindgen_wasm_module = module;
@@ -24853,9 +24852,7 @@ function initSync(module, memory) {
24853
24852
  }
24854
24853
  }
24855
24854
 
24856
- const imports = __wbg_get_imports();
24857
-
24858
- __wbg_init_memory(imports, memory);
24855
+ const imports = __wbg_get_imports(memory);
24859
24856
 
24860
24857
  if (!(module instanceof WebAssembly.Module)) {
24861
24858
  module = new WebAssembly.Module(module);
@@ -24881,14 +24878,12 @@ async function __wbg_init(module_or_path, memory) {
24881
24878
  if (typeof module_or_path === 'undefined') {
24882
24879
  module_or_path = new URL('tfhe_bg.wasm', import.meta.url);
24883
24880
  }
24884
- const imports = __wbg_get_imports();
24881
+ const imports = __wbg_get_imports(memory);
24885
24882
 
24886
24883
  if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
24887
24884
  module_or_path = fetch(module_or_path);
24888
24885
  }
24889
24886
 
24890
- __wbg_init_memory(imports, memory);
24891
-
24892
24887
  const { instance, module } = await __wbg_load(await module_or_path, imports);
24893
24888
 
24894
24889
  return __wbg_finalize_init(instance, module, thread_stack_size);
package/tfhe_bg.wasm CHANGED
Binary file