tfhe 0.4.1 → 0.4.2

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 +85 -85
  3. package/tfhe.js +214 -213
  4. package/tfhe_bg.wasm +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tfhe",
3
3
  "description": "TFHE-rs is a fully homomorphic encryption (FHE) library that implements Zama's variant of TFHE.",
4
- "version": "0.4.1",
4
+ "version": "0.4.2",
5
5
  "license": "BSD-3-Clause-Clear",
6
6
  "repository": {
7
7
  "type": "git",
package/tfhe.d.ts CHANGED
@@ -5,6 +5,20 @@
5
5
  export function init_panic_hook(): void;
6
6
  /**
7
7
  */
8
+ export enum BooleanParameterSet {
9
+ Default = 0,
10
+ TfheLib = 1,
11
+ DefaultKsPbs = 2,
12
+ TfheLibKsPbs = 3,
13
+ }
14
+ /**
15
+ */
16
+ export enum BooleanEncryptionKeyChoice {
17
+ Big = 0,
18
+ Small = 1,
19
+ }
20
+ /**
21
+ */
8
22
  export enum ShortintEncryptionKeyChoice {
9
23
  Big = 0,
10
24
  Small = 1,
@@ -150,20 +164,6 @@ export enum ShortintParametersName {
150
164
  }
151
165
  /**
152
166
  */
153
- export enum BooleanParameterSet {
154
- Default = 0,
155
- TfheLib = 1,
156
- DefaultKsPbs = 2,
157
- TfheLibKsPbs = 3,
158
- }
159
- /**
160
- */
161
- export enum BooleanEncryptionKeyChoice {
162
- Big = 0,
163
- Small = 1,
164
- }
165
- /**
166
- */
167
167
  export class Boolean {
168
168
  free(): void;
169
169
  /**
@@ -181,10 +181,10 @@ export class Boolean {
181
181
  * @param {number} pbs_level
182
182
  * @param {number} ks_base_log
183
183
  * @param {number} ks_level
184
- * @param {number} encryption_key_choice
184
+ * @param {BooleanEncryptionKeyChoice} encryption_key_choice
185
185
  * @returns {BooleanParameters}
186
186
  */
187
- static new_parameters(lwe_dimension: number, glwe_dimension: number, polynomial_size: number, lwe_modular_std_dev: number, glwe_modular_std_dev: number, pbs_base_log: number, pbs_level: number, ks_base_log: number, ks_level: number, encryption_key_choice: number): BooleanParameters;
187
+ static new_parameters(lwe_dimension: number, glwe_dimension: number, polynomial_size: number, lwe_modular_std_dev: number, glwe_modular_std_dev: number, pbs_base_log: number, pbs_level: number, ks_base_log: number, ks_level: number, encryption_key_choice: BooleanEncryptionKeyChoice): BooleanParameters;
188
188
  /**
189
189
  * @param {bigint} seed_high_bytes
190
190
  * @param {bigint} seed_low_bytes
@@ -2127,10 +2127,10 @@ export class Shortint {
2127
2127
  * @param {number} message_modulus
2128
2128
  * @param {number} carry_modulus
2129
2129
  * @param {number} modulus_power_of_2_exponent
2130
- * @param {number} encryption_key_choice
2130
+ * @param {ShortintEncryptionKeyChoice} encryption_key_choice
2131
2131
  * @returns {ShortintParameters}
2132
2132
  */
2133
- static new_parameters(lwe_dimension: number, glwe_dimension: number, polynomial_size: number, lwe_modular_std_dev: number, glwe_modular_std_dev: number, pbs_base_log: number, pbs_level: number, ks_base_log: number, ks_level: number, message_modulus: number, carry_modulus: number, modulus_power_of_2_exponent: number, encryption_key_choice: number): ShortintParameters;
2133
+ static new_parameters(lwe_dimension: number, glwe_dimension: number, polynomial_size: number, lwe_modular_std_dev: number, glwe_modular_std_dev: number, pbs_base_log: number, pbs_level: number, ks_base_log: number, ks_level: number, message_modulus: number, carry_modulus: number, modulus_power_of_2_exponent: number, encryption_key_choice: ShortintEncryptionKeyChoice): ShortintParameters;
2134
2134
  /**
2135
2135
  * @param {bigint} seed_high_bytes
2136
2136
  * @param {bigint} seed_low_bytes
@@ -2284,9 +2284,9 @@ export class ShortintCompressedServerKey {
2284
2284
  export class ShortintParameters {
2285
2285
  free(): void;
2286
2286
  /**
2287
- * @param {number} name
2287
+ * @param {ShortintParametersName} name
2288
2288
  */
2289
- constructor(name: number);
2289
+ constructor(name: ShortintParametersName);
2290
2290
  }
2291
2291
  /**
2292
2292
  */
@@ -2462,41 +2462,34 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
2462
2462
 
2463
2463
  export interface InitOutput {
2464
2464
  readonly memory: WebAssembly.Memory;
2465
- readonly __wbg_tfhe_free: (a: number) => void;
2466
- readonly __wbg_shortintciphertext_free: (a: number) => void;
2467
- readonly __wbg_shortintcompressedciphertext_free: (a: number) => void;
2468
- readonly __wbg_shortintclientkey_free: (a: number) => void;
2469
- readonly __wbg_shortintpublickey_free: (a: number) => void;
2470
- readonly __wbg_shortintcompressedpublickey_free: (a: number) => void;
2471
- readonly __wbg_shortintcompressedserverkey_free: (a: number) => void;
2472
- readonly __wbg_shortintparameters_free: (a: number) => void;
2473
- readonly shortintparameters_new: (a: number) => number;
2474
- readonly shortint_get_parameters: (a: number, b: number, c: number) => void;
2475
- readonly shortint_get_parameters_small: (a: number, b: number, c: number) => void;
2476
- readonly shortint_new_parameters: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => number;
2477
- readonly shortint_new_client_key_from_seed_and_parameters: (a: number, b: number, c: number, d: number) => void;
2478
- readonly shortint_new_client_key: (a: number) => number;
2479
- readonly shortint_new_public_key: (a: number) => number;
2480
- readonly shortint_new_compressed_public_key: (a: number) => number;
2481
- readonly shortint_new_compressed_server_key: (a: number) => number;
2482
- readonly shortint_encrypt: (a: number, b: number) => number;
2483
- readonly shortint_encrypt_compressed: (a: number, b: number) => number;
2484
- readonly shortint_decompress_ciphertext: (a: number) => number;
2485
- readonly shortint_encrypt_with_public_key: (a: number, b: number) => number;
2486
- readonly shortint_encrypt_with_compressed_public_key: (a: number, b: number) => number;
2487
- readonly shortint_decrypt: (a: number, b: number) => number;
2488
- readonly shortint_serialize_ciphertext: (a: number, b: number) => void;
2489
- readonly shortint_deserialize_ciphertext: (a: number, b: number, c: number) => void;
2490
- readonly shortint_serialize_compressed_ciphertext: (a: number, b: number) => void;
2491
- readonly shortint_deserialize_compressed_ciphertext: (a: number, b: number, c: number) => void;
2492
- readonly shortint_serialize_client_key: (a: number, b: number) => void;
2493
- readonly shortint_deserialize_client_key: (a: number, b: number, c: number) => void;
2494
- readonly shortint_serialize_public_key: (a: number, b: number) => void;
2495
- readonly shortint_deserialize_public_key: (a: number, b: number, c: number) => void;
2496
- readonly shortint_serialize_compressed_public_key: (a: number, b: number) => void;
2497
- readonly shortint_deserialize_compressed_public_key: (a: number, b: number, c: number) => void;
2498
- readonly shortint_serialize_compressed_server_key: (a: number, b: number) => void;
2499
- readonly shortint_deserialize_compressed_server_key: (a: number, b: number, c: number) => void;
2465
+ readonly __wbg_booleanciphertext_free: (a: number) => void;
2466
+ readonly __wbg_booleancompressedciphertext_free: (a: number) => void;
2467
+ readonly __wbg_booleanclientkey_free: (a: number) => void;
2468
+ readonly __wbg_booleanpublickey_free: (a: number) => void;
2469
+ readonly __wbg_booleancompressedserverkey_free: (a: number) => void;
2470
+ readonly __wbg_booleanparameters_free: (a: number) => void;
2471
+ readonly boolean_get_parameters: (a: number, b: number) => void;
2472
+ 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;
2473
+ readonly boolean_new_client_key_from_seed_and_parameters: (a: number, b: number, c: number) => number;
2474
+ readonly boolean_new_client_key: (a: number) => number;
2475
+ readonly boolean_new_public_key: (a: number) => number;
2476
+ readonly boolean_new_compressed_server_key: (a: number) => number;
2477
+ readonly boolean_encrypt: (a: number, b: number) => number;
2478
+ readonly boolean_encrypt_compressed: (a: number, b: number) => number;
2479
+ readonly boolean_decompress_ciphertext: (a: number) => number;
2480
+ readonly boolean_encrypt_with_public_key: (a: number, b: number) => number;
2481
+ readonly boolean_trivial_encrypt: (a: number, b: number) => number;
2482
+ readonly boolean_decrypt: (a: number, b: number) => number;
2483
+ readonly boolean_serialize_ciphertext: (a: number, b: number) => void;
2484
+ readonly boolean_deserialize_ciphertext: (a: number, b: number, c: number) => void;
2485
+ readonly boolean_serialize_compressed_ciphertext: (a: number, b: number) => void;
2486
+ readonly boolean_deserialize_compressed_ciphertext: (a: number, b: number, c: number) => void;
2487
+ readonly boolean_serialize_client_key: (a: number, b: number) => void;
2488
+ readonly boolean_deserialize_client_key: (a: number, b: number, c: number) => void;
2489
+ readonly boolean_serialize_public_key: (a: number, b: number) => void;
2490
+ readonly boolean_deserialize_public_key: (a: number, b: number, c: number) => void;
2491
+ readonly boolean_serialize_compressed_server_key: (a: number, b: number) => void;
2492
+ readonly boolean_deserialize_compressed_server_key: (a: number, b: number, c: number) => void;
2500
2493
  readonly fheuint128_encrypt_with_client_key: (a: number, b: number, c: number) => void;
2501
2494
  readonly fheuint128_encrypt_with_public_key: (a: number, b: number, c: number) => void;
2502
2495
  readonly fheuint128_encrypt_with_compressed_public_key: (a: number, b: number, c: number) => void;
@@ -2834,6 +2827,7 @@ export interface InitOutput {
2834
2827
  readonly __wbg_fheint16_free: (a: number) => void;
2835
2828
  readonly __wbg_fheint32_free: (a: number) => void;
2836
2829
  readonly __wbg_fheint64_free: (a: number) => void;
2830
+ readonly __wbg_boolean_free: (a: number) => void;
2837
2831
  readonly compressedfheuint256_decompress: (a: number, b: number) => void;
2838
2832
  readonly compressedfheuint128_decompress: (a: number, b: number) => void;
2839
2833
  readonly compressedfheint256_decompress: (a: number, b: number) => void;
@@ -2845,7 +2839,6 @@ export interface InitOutput {
2845
2839
  readonly compressedfheint16_decompress: (a: number, b: number) => void;
2846
2840
  readonly compressedfheint32_decompress: (a: number, b: number) => void;
2847
2841
  readonly compressedfheint64_decompress: (a: number, b: number) => void;
2848
- readonly __wbg_shortint_free: (a: number) => void;
2849
2842
  readonly __wbg_tfheconfig_free: (a: number) => void;
2850
2843
  readonly tfheconfigbuilder_all_disabled: () => number;
2851
2844
  readonly tfheconfigbuilder_enable_default_integers: (a: number) => number;
@@ -2853,34 +2846,40 @@ export interface InitOutput {
2853
2846
  readonly tfheconfigbuilder_enable_custom_integers: (a: number, b: number) => number;
2854
2847
  readonly tfheconfigbuilder_build: (a: number) => number;
2855
2848
  readonly __wbg_tfheconfigbuilder_free: (a: number) => void;
2856
- readonly __wbg_booleanciphertext_free: (a: number) => void;
2857
- readonly __wbg_booleancompressedciphertext_free: (a: number) => void;
2858
- readonly __wbg_booleanclientkey_free: (a: number) => void;
2859
- readonly __wbg_booleanpublickey_free: (a: number) => void;
2860
- readonly __wbg_booleancompressedserverkey_free: (a: number) => void;
2861
- readonly __wbg_booleanparameters_free: (a: number) => void;
2862
- readonly boolean_get_parameters: (a: number, b: number) => void;
2863
- 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;
2864
- readonly boolean_new_client_key_from_seed_and_parameters: (a: number, b: number, c: number) => number;
2865
- readonly boolean_new_client_key: (a: number) => number;
2866
- readonly boolean_new_public_key: (a: number) => number;
2867
- readonly boolean_new_compressed_server_key: (a: number) => number;
2868
- readonly boolean_encrypt: (a: number, b: number) => number;
2869
- readonly boolean_encrypt_compressed: (a: number, b: number) => number;
2870
- readonly boolean_decompress_ciphertext: (a: number) => number;
2871
- readonly boolean_encrypt_with_public_key: (a: number, b: number) => number;
2872
- readonly boolean_trivial_encrypt: (a: number, b: number) => number;
2873
- readonly boolean_decrypt: (a: number, b: number) => number;
2874
- readonly boolean_serialize_ciphertext: (a: number, b: number) => void;
2875
- readonly boolean_deserialize_ciphertext: (a: number, b: number, c: number) => void;
2876
- readonly boolean_serialize_compressed_ciphertext: (a: number, b: number) => void;
2877
- readonly boolean_deserialize_compressed_ciphertext: (a: number, b: number, c: number) => void;
2878
- readonly boolean_serialize_client_key: (a: number, b: number) => void;
2879
- readonly boolean_deserialize_client_key: (a: number, b: number, c: number) => void;
2880
- readonly boolean_serialize_public_key: (a: number, b: number) => void;
2881
- readonly boolean_deserialize_public_key: (a: number, b: number, c: number) => void;
2882
- readonly boolean_serialize_compressed_server_key: (a: number, b: number) => void;
2883
- readonly boolean_deserialize_compressed_server_key: (a: number, b: number, c: number) => void;
2849
+ readonly __wbg_shortintciphertext_free: (a: number) => void;
2850
+ readonly __wbg_shortintcompressedciphertext_free: (a: number) => void;
2851
+ readonly __wbg_shortintclientkey_free: (a: number) => void;
2852
+ readonly __wbg_shortintpublickey_free: (a: number) => void;
2853
+ readonly __wbg_shortintcompressedpublickey_free: (a: number) => void;
2854
+ readonly __wbg_shortintcompressedserverkey_free: (a: number) => void;
2855
+ readonly __wbg_shortintparameters_free: (a: number) => void;
2856
+ readonly shortintparameters_new: (a: number) => number;
2857
+ readonly shortint_get_parameters: (a: number, b: number, c: number) => void;
2858
+ readonly shortint_get_parameters_small: (a: number, b: number, c: number) => void;
2859
+ readonly shortint_new_parameters: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => number;
2860
+ readonly shortint_new_client_key_from_seed_and_parameters: (a: number, b: number, c: number, d: number) => void;
2861
+ readonly shortint_new_client_key: (a: number) => number;
2862
+ readonly shortint_new_public_key: (a: number) => number;
2863
+ readonly shortint_new_compressed_public_key: (a: number) => number;
2864
+ readonly shortint_new_compressed_server_key: (a: number) => number;
2865
+ readonly shortint_encrypt: (a: number, b: number) => number;
2866
+ readonly shortint_encrypt_compressed: (a: number, b: number) => number;
2867
+ readonly shortint_decompress_ciphertext: (a: number) => number;
2868
+ readonly shortint_encrypt_with_public_key: (a: number, b: number) => number;
2869
+ readonly shortint_encrypt_with_compressed_public_key: (a: number, b: number) => number;
2870
+ readonly shortint_decrypt: (a: number, b: number) => number;
2871
+ readonly shortint_serialize_ciphertext: (a: number, b: number) => void;
2872
+ readonly shortint_deserialize_ciphertext: (a: number, b: number, c: number) => void;
2873
+ readonly shortint_serialize_compressed_ciphertext: (a: number, b: number) => void;
2874
+ readonly shortint_deserialize_compressed_ciphertext: (a: number, b: number, c: number) => void;
2875
+ readonly shortint_serialize_client_key: (a: number, b: number) => void;
2876
+ readonly shortint_deserialize_client_key: (a: number, b: number, c: number) => void;
2877
+ readonly shortint_serialize_public_key: (a: number, b: number) => void;
2878
+ readonly shortint_deserialize_public_key: (a: number, b: number, c: number) => void;
2879
+ readonly shortint_serialize_compressed_public_key: (a: number, b: number) => void;
2880
+ readonly shortint_deserialize_compressed_public_key: (a: number, b: number, c: number) => void;
2881
+ readonly shortint_serialize_compressed_server_key: (a: number, b: number) => void;
2882
+ readonly shortint_deserialize_compressed_server_key: (a: number, b: number, c: number) => void;
2884
2883
  readonly init_panic_hook: () => void;
2885
2884
  readonly __wbg_tfheclientkey_free: (a: number) => void;
2886
2885
  readonly tfheclientkey_generate: (a: number, b: number) => void;
@@ -2909,7 +2908,8 @@ export interface InitOutput {
2909
2908
  readonly tfhecompressedcompactpublickey_serialize: (a: number, b: number) => void;
2910
2909
  readonly tfhecompressedcompactpublickey_deserialize: (a: number, b: number, c: number) => void;
2911
2910
  readonly tfhecompressedcompactpublickey_decompress: (a: number, b: number) => void;
2912
- readonly __wbg_boolean_free: (a: number) => void;
2911
+ readonly __wbg_shortint_free: (a: number) => void;
2912
+ readonly __wbg_tfhe_free: (a: number) => void;
2913
2913
  readonly __wbindgen_malloc: (a: number, b: number) => number;
2914
2914
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
2915
2915
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;