tfhe 0.5.0 → 0.5.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.
package/README.md CHANGED
@@ -4,13 +4,17 @@
4
4
  </p>
5
5
  <hr/>
6
6
  <p align="center">
7
- <a href="https://docs.zama.ai/tfhe-rs"> 📒 Read documentation</a> | <a href="https://zama.ai/community"> 💛 Community support</a>
7
+ <a href="https://docs.zama.ai/tfhe-rs"> 📒 Read documentation</a> | <a href="https://zama.ai/community"> 💛 Community support</a> | <a href="https://github.com/zama-ai/awesome-zama"> 📚 FHE resources</a>
8
8
  </p>
9
9
  <p align="center">
10
10
  <!-- Version badge using shields.io -->
11
11
  <a href="https://github.com/zama-ai/tfhe-rs/releases">
12
12
  <img src="https://img.shields.io/github/v/release/zama-ai/tfhe-rs?style=flat-square">
13
13
  </a>
14
+ <!-- Link to tutorials badge using shields.io -->
15
+ <a href="#license">
16
+ <img src="https://img.shields.io/badge/License-BSD--3--Clause--Clear-orange?style=flat-square">
17
+ </a>
14
18
  <!-- Zama Bounty Program -->
15
19
  <a href="https://github.com/zama-ai/bounty-program">
16
20
  <img src="https://img.shields.io/badge/Contribute-Zama%20Bounty%20Program-yellow?style=flat-square">
@@ -138,9 +142,11 @@ libraries.
138
142
 
139
143
  ## Need support?
140
144
  <a target="_blank" href="https://community.zama.ai">
141
- <img src="https://user-images.githubusercontent.com/5758427/231115030-21195b55-2629-4c01-9809-be5059243999.png">
145
+ <img src="https://github.com/zama-ai/tfhe-rs/assets/157474013/33d856dc-f25d-454b-a010-af12bff2aa7d">
142
146
  </a>
143
147
 
148
+
149
+
144
150
  ## Citing TFHE-rs
145
151
 
146
152
  To cite TFHE-rs in academic papers, please use the following entry:
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.5.0",
4
+ "version": "0.5.2",
5
5
  "license": "BSD-3-Clause-Clear",
6
6
  "repository": {
7
7
  "type": "git",
package/tfhe.d.ts CHANGED
@@ -5,11 +5,9 @@
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,
8
+ export enum ShortintEncryptionKeyChoice {
9
+ Big = 0,
10
+ Small = 1,
13
11
  }
14
12
  /**
15
13
  */
@@ -19,9 +17,11 @@ export enum BooleanEncryptionKeyChoice {
19
17
  }
20
18
  /**
21
19
  */
22
- export enum ShortintEncryptionKeyChoice {
23
- Big = 0,
24
- Small = 1,
20
+ export enum BooleanParameterSet {
21
+ Default = 0,
22
+ TfheLib = 1,
23
+ DefaultKsPbs = 2,
24
+ TfheLibKsPbs = 3,
25
25
  }
26
26
  /**
27
27
  */
@@ -4704,15 +4704,69 @@ export interface InitOutput {
4704
4704
  readonly shortint_serialize_compressed_server_key: (a: number, b: number) => void;
4705
4705
  readonly shortint_deserialize_compressed_server_key: (a: number, b: number, c: number) => void;
4706
4706
  readonly __wbg_shortint_free: (a: number) => void;
4707
- readonly __wbg_tfhe_free: (a: number) => void;
4708
4707
  readonly __wbg_shortintparameters_free: (a: number) => void;
4708
+ readonly __wbg_booleanciphertext_free: (a: number) => void;
4709
+ readonly __wbg_booleancompressedciphertext_free: (a: number) => void;
4710
+ readonly __wbg_booleanclientkey_free: (a: number) => void;
4711
+ readonly __wbg_booleanpublickey_free: (a: number) => void;
4712
+ readonly __wbg_booleancompressedserverkey_free: (a: number) => void;
4713
+ readonly __wbg_booleanparameters_free: (a: number) => void;
4714
+ readonly boolean_get_parameters: (a: number, b: number) => void;
4715
+ 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;
4716
+ readonly boolean_new_client_key_from_seed_and_parameters: (a: number, b: number, c: number) => number;
4717
+ readonly boolean_new_client_key: (a: number) => number;
4718
+ readonly boolean_new_public_key: (a: number) => number;
4719
+ readonly boolean_new_compressed_server_key: (a: number) => number;
4720
+ readonly boolean_encrypt: (a: number, b: number) => number;
4721
+ readonly boolean_encrypt_compressed: (a: number, b: number) => number;
4722
+ readonly boolean_decompress_ciphertext: (a: number) => number;
4723
+ readonly boolean_encrypt_with_public_key: (a: number, b: number) => number;
4724
+ readonly boolean_trivial_encrypt: (a: number) => number;
4725
+ readonly boolean_decrypt: (a: number, b: number) => number;
4726
+ readonly boolean_serialize_ciphertext: (a: number, b: number) => void;
4727
+ readonly boolean_deserialize_ciphertext: (a: number, b: number, c: number) => void;
4728
+ readonly boolean_serialize_compressed_ciphertext: (a: number, b: number) => void;
4729
+ readonly boolean_deserialize_compressed_ciphertext: (a: number, b: number, c: number) => void;
4730
+ readonly boolean_serialize_client_key: (a: number, b: number) => void;
4731
+ readonly boolean_deserialize_client_key: (a: number, b: number, c: number) => void;
4732
+ readonly boolean_serialize_public_key: (a: number, b: number) => void;
4733
+ readonly boolean_deserialize_public_key: (a: number, b: number, c: number) => void;
4734
+ readonly boolean_serialize_compressed_server_key: (a: number, b: number) => void;
4735
+ readonly boolean_deserialize_compressed_server_key: (a: number, b: number, c: number) => void;
4736
+ readonly init_panic_hook: () => void;
4737
+ readonly __wbg_tfheclientkey_free: (a: number) => void;
4738
+ readonly tfheclientkey_generate: (a: number, b: number) => void;
4739
+ readonly tfheclientkey_generate_with_seed: (a: number, b: number, c: number) => void;
4740
+ readonly tfheclientkey_serialize: (a: number, b: number) => void;
4741
+ readonly tfheclientkey_deserialize: (a: number, b: number, c: number) => void;
4742
+ readonly __wbg_tfhecompressedserverkey_free: (a: number) => void;
4743
+ readonly tfhecompressedserverkey_new: (a: number, b: number) => void;
4744
+ readonly tfhecompressedserverkey_serialize: (a: number, b: number) => void;
4745
+ readonly tfhecompressedserverkey_deserialize: (a: number, b: number, c: number) => void;
4746
+ readonly tfhepublickey_new: (a: number, b: number) => void;
4747
+ readonly tfhepublickey_serialize: (a: number, b: number) => void;
4748
+ readonly tfhepublickey_deserialize: (a: number, b: number, c: number) => void;
4749
+ readonly tfhecompressedpublickey_new: (a: number, b: number) => void;
4750
+ readonly tfhecompressedpublickey_decompress: (a: number, b: number) => void;
4751
+ readonly tfhecompressedpublickey_serialize: (a: number, b: number) => void;
4752
+ readonly tfhecompressedpublickey_deserialize: (a: number, b: number, c: number) => void;
4753
+ readonly __wbg_tfhecompactpublickey_free: (a: number) => void;
4754
+ readonly tfhecompactpublickey_new: (a: number, b: number) => void;
4755
+ readonly tfhecompactpublickey_serialize: (a: number, b: number) => void;
4756
+ readonly tfhecompactpublickey_deserialize: (a: number, b: number, c: number) => void;
4757
+ readonly __wbg_tfhecompressedcompactpublickey_free: (a: number) => void;
4758
+ readonly tfhecompressedcompactpublickey_new: (a: number, b: number) => void;
4759
+ readonly tfhecompressedcompactpublickey_serialize: (a: number, b: number) => void;
4760
+ readonly tfhecompressedcompactpublickey_deserialize: (a: number, b: number, c: number) => void;
4761
+ readonly tfhecompressedcompactpublickey_decompress: (a: number, b: number) => void;
4762
+ readonly __wbg_tfhepublickey_free: (a: number) => void;
4763
+ readonly __wbg_tfhecompressedpublickey_free: (a: number) => void;
4764
+ readonly __wbg_boolean_free: (a: number) => void;
4709
4765
  readonly __wbg_tfheconfig_free: (a: number) => void;
4710
4766
  readonly tfheconfigbuilder_default: () => number;
4711
4767
  readonly tfheconfigbuilder_default_with_small_encryption: () => number;
4712
4768
  readonly tfheconfigbuilder_use_custom_parameters: (a: number, b: number) => number;
4713
4769
  readonly tfheconfigbuilder_build: (a: number) => number;
4714
- readonly tfheconfigbuilder_default_with_big_encryption: () => number;
4715
- readonly __wbg_tfheconfigbuilder_free: (a: number) => void;
4716
4770
  readonly fheuint160_encrypt_with_client_key: (a: number, b: number, c: number) => void;
4717
4771
  readonly fheuint160_encrypt_with_public_key: (a: number, b: number, c: number) => void;
4718
4772
  readonly fheuint160_encrypt_with_compressed_public_key: (a: number, b: number, c: number) => void;
@@ -4977,6 +5031,7 @@ export interface InitOutput {
4977
5031
  readonly compressedfheuint10_safe_serialize: (a: number, b: number, c: number) => void;
4978
5032
  readonly compressedfheuint10_safe_deserialize: (a: number, b: number, c: number, d: number) => void;
4979
5033
  readonly compactfheuint10_encrypt_with_compact_public_key: (a: number, b: number, c: number) => void;
5034
+ readonly compactfheuint10_expand: (a: number, b: number) => void;
4980
5035
  readonly compactfheuint10_serialize: (a: number, b: number) => void;
4981
5036
  readonly compactfheuint10_deserialize: (a: number, b: number, c: number) => void;
4982
5037
  readonly compactfheuint10_safe_serialize: (a: number, b: number, c: number) => void;
@@ -5328,6 +5383,12 @@ export interface InitOutput {
5328
5383
  readonly compactfheint32list_encrypt_with_compact_public_key: (a: number, b: number, c: number, d: number) => void;
5329
5384
  readonly compactfheint64list_encrypt_with_compact_public_key: (a: number, b: number, c: number, d: number) => void;
5330
5385
  readonly compactfheboollist_encrypt_with_compact_public_key: (a: number, b: number, c: number, d: number) => void;
5386
+ readonly fheuint4_decrypt: (a: number, b: number, c: number) => void;
5387
+ readonly fheuint6_decrypt: (a: number, b: number, c: number) => void;
5388
+ readonly fheuint8_decrypt: (a: number, b: number, c: number) => void;
5389
+ readonly fheuint12_decrypt: (a: number, b: number, c: number) => void;
5390
+ readonly fheuint14_decrypt: (a: number, b: number, c: number) => void;
5391
+ readonly fheuint16_decrypt: (a: number, b: number, c: number) => void;
5331
5392
  readonly __wbg_compactfheuint160list_free: (a: number) => void;
5332
5393
  readonly __wbg_compactfheuint160_free: (a: number) => void;
5333
5394
  readonly __wbg_compactfheuint128list_free: (a: number) => void;
@@ -5387,6 +5448,8 @@ export interface InitOutput {
5387
5448
  readonly fheint12_decrypt: (a: number, b: number, c: number) => void;
5388
5449
  readonly fheint14_decrypt: (a: number, b: number, c: number) => void;
5389
5450
  readonly fheint16_decrypt: (a: number, b: number, c: number) => void;
5451
+ readonly fheuint256_decrypt: (a: number, b: number, c: number) => void;
5452
+ readonly fheint256_decrypt: (a: number, b: number, c: number) => void;
5390
5453
  readonly __wbg_fheuint160_free: (a: number) => void;
5391
5454
  readonly __wbg_fheuint256_free: (a: number) => void;
5392
5455
  readonly __wbg_fheuint128_free: (a: number) => void;
@@ -5412,39 +5475,6 @@ export interface InitOutput {
5412
5475
  readonly __wbg_fheint16_free: (a: number) => void;
5413
5476
  readonly __wbg_fheint32_free: (a: number) => void;
5414
5477
  readonly __wbg_fheint64_free: (a: number) => void;
5415
- readonly fheuint256_decrypt: (a: number, b: number, c: number) => void;
5416
- readonly fheint256_decrypt: (a: number, b: number, c: number) => void;
5417
- readonly fheuint4_decrypt: (a: number, b: number, c: number) => void;
5418
- readonly fheuint6_decrypt: (a: number, b: number, c: number) => void;
5419
- readonly fheuint8_decrypt: (a: number, b: number, c: number) => void;
5420
- readonly fheuint12_decrypt: (a: number, b: number, c: number) => void;
5421
- readonly fheuint14_decrypt: (a: number, b: number, c: number) => void;
5422
- readonly fheuint16_decrypt: (a: number, b: number, c: number) => void;
5423
- readonly __wbg_compressedfheuint160_free: (a: number) => void;
5424
- readonly __wbg_compressedfheuint256_free: (a: number) => void;
5425
- readonly __wbg_compressedfheuint128_free: (a: number) => void;
5426
- readonly __wbg_compressedfheint160_free: (a: number) => void;
5427
- readonly __wbg_compressedfheint256_free: (a: number) => void;
5428
- readonly __wbg_compressedfheuint2_free: (a: number) => void;
5429
- readonly __wbg_compressedfheuint4_free: (a: number) => void;
5430
- readonly __wbg_compressedfheuint6_free: (a: number) => void;
5431
- readonly __wbg_compressedfheuint8_free: (a: number) => void;
5432
- readonly __wbg_compressedfheuint10_free: (a: number) => void;
5433
- readonly __wbg_compressedfheuint12_free: (a: number) => void;
5434
- readonly __wbg_compressedfheuint14_free: (a: number) => void;
5435
- readonly __wbg_compressedfheuint16_free: (a: number) => void;
5436
- readonly __wbg_compressedfheuint32_free: (a: number) => void;
5437
- readonly __wbg_compressedfheuint64_free: (a: number) => void;
5438
- readonly __wbg_compressedfheint2_free: (a: number) => void;
5439
- readonly __wbg_compressedfheint4_free: (a: number) => void;
5440
- readonly __wbg_compressedfheint6_free: (a: number) => void;
5441
- readonly __wbg_compressedfheint8_free: (a: number) => void;
5442
- readonly __wbg_compressedfheint128_free: (a: number) => void;
5443
- readonly __wbg_compressedfheint12_free: (a: number) => void;
5444
- readonly __wbg_compressedfheint14_free: (a: number) => void;
5445
- readonly __wbg_compressedfheint16_free: (a: number) => void;
5446
- readonly __wbg_compressedfheint32_free: (a: number) => void;
5447
- readonly __wbg_compressedfheint64_free: (a: number) => void;
5448
5478
  readonly compressedfheuint160_decompress: (a: number, b: number) => void;
5449
5479
  readonly compressedfheuint256_decompress: (a: number, b: number) => void;
5450
5480
  readonly compressedfheuint2_decompress: (a: number, b: number) => void;
@@ -5471,14 +5501,13 @@ export interface InitOutput {
5471
5501
  readonly compressedfheint64_decompress: (a: number, b: number) => void;
5472
5502
  readonly compactfheuint160_expand: (a: number, b: number) => void;
5473
5503
  readonly compactfheuint256_expand: (a: number, b: number) => void;
5474
- readonly compactfheuint128_expand: (a: number, b: number) => void;
5475
5504
  readonly compactfheint160_expand: (a: number, b: number) => void;
5476
5505
  readonly compactfheint256_expand: (a: number, b: number) => void;
5477
5506
  readonly compactfheuint2_expand: (a: number, b: number) => void;
5478
5507
  readonly compactfheuint4_expand: (a: number, b: number) => void;
5479
5508
  readonly compactfheuint6_expand: (a: number, b: number) => void;
5480
5509
  readonly compactfheuint8_expand: (a: number, b: number) => void;
5481
- readonly compactfheuint10_expand: (a: number, b: number) => void;
5510
+ readonly compactfheuint128_expand: (a: number, b: number) => void;
5482
5511
  readonly compactfheuint12_expand: (a: number, b: number) => void;
5483
5512
  readonly compactfheuint14_expand: (a: number, b: number) => void;
5484
5513
  readonly compactfheuint16_expand: (a: number, b: number) => void;
@@ -5494,63 +5523,34 @@ export interface InitOutput {
5494
5523
  readonly compactfheint16_expand: (a: number, b: number) => void;
5495
5524
  readonly compactfheint32_expand: (a: number, b: number) => void;
5496
5525
  readonly compactfheint64_expand: (a: number, b: number) => void;
5497
- readonly init_panic_hook: () => void;
5498
- readonly __wbg_tfheclientkey_free: (a: number) => void;
5499
- readonly tfheclientkey_generate: (a: number, b: number) => void;
5500
- readonly tfheclientkey_generate_with_seed: (a: number, b: number, c: number) => void;
5501
- readonly tfheclientkey_serialize: (a: number, b: number) => void;
5502
- readonly tfheclientkey_deserialize: (a: number, b: number, c: number) => void;
5503
- readonly __wbg_tfhecompressedserverkey_free: (a: number) => void;
5504
- readonly tfhecompressedserverkey_new: (a: number, b: number) => void;
5505
- readonly tfhecompressedserverkey_serialize: (a: number, b: number) => void;
5506
- readonly tfhecompressedserverkey_deserialize: (a: number, b: number, c: number) => void;
5507
- readonly tfhepublickey_new: (a: number, b: number) => void;
5508
- readonly tfhepublickey_serialize: (a: number, b: number) => void;
5509
- readonly tfhepublickey_deserialize: (a: number, b: number, c: number) => void;
5510
- readonly tfhecompressedpublickey_new: (a: number, b: number) => void;
5511
- readonly tfhecompressedpublickey_decompress: (a: number, b: number) => void;
5512
- readonly tfhecompressedpublickey_serialize: (a: number, b: number) => void;
5513
- readonly tfhecompressedpublickey_deserialize: (a: number, b: number, c: number) => void;
5514
- readonly __wbg_tfhecompactpublickey_free: (a: number) => void;
5515
- readonly tfhecompactpublickey_new: (a: number, b: number) => void;
5516
- readonly tfhecompactpublickey_serialize: (a: number, b: number) => void;
5517
- readonly tfhecompactpublickey_deserialize: (a: number, b: number, c: number) => void;
5518
- readonly __wbg_tfhecompressedcompactpublickey_free: (a: number) => void;
5519
- readonly tfhecompressedcompactpublickey_new: (a: number, b: number) => void;
5520
- readonly tfhecompressedcompactpublickey_serialize: (a: number, b: number) => void;
5521
- readonly tfhecompressedcompactpublickey_deserialize: (a: number, b: number, c: number) => void;
5522
- readonly tfhecompressedcompactpublickey_decompress: (a: number, b: number) => void;
5523
- readonly __wbg_tfhepublickey_free: (a: number) => void;
5524
- readonly __wbg_tfhecompressedpublickey_free: (a: number) => void;
5525
- readonly __wbg_booleanciphertext_free: (a: number) => void;
5526
- readonly __wbg_booleancompressedciphertext_free: (a: number) => void;
5527
- readonly __wbg_booleanclientkey_free: (a: number) => void;
5528
- readonly __wbg_booleanpublickey_free: (a: number) => void;
5529
- readonly __wbg_booleancompressedserverkey_free: (a: number) => void;
5530
- readonly __wbg_booleanparameters_free: (a: number) => void;
5531
- readonly boolean_get_parameters: (a: number, b: number) => void;
5532
- 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;
5533
- readonly boolean_new_client_key_from_seed_and_parameters: (a: number, b: number, c: number) => number;
5534
- readonly boolean_new_client_key: (a: number) => number;
5535
- readonly boolean_new_public_key: (a: number) => number;
5536
- readonly boolean_new_compressed_server_key: (a: number) => number;
5537
- readonly boolean_encrypt: (a: number, b: number) => number;
5538
- readonly boolean_encrypt_compressed: (a: number, b: number) => number;
5539
- readonly boolean_decompress_ciphertext: (a: number) => number;
5540
- readonly boolean_encrypt_with_public_key: (a: number, b: number) => number;
5541
- readonly boolean_trivial_encrypt: (a: number) => number;
5542
- readonly boolean_decrypt: (a: number, b: number) => number;
5543
- readonly boolean_serialize_ciphertext: (a: number, b: number) => void;
5544
- readonly boolean_deserialize_ciphertext: (a: number, b: number, c: number) => void;
5545
- readonly boolean_serialize_compressed_ciphertext: (a: number, b: number) => void;
5546
- readonly boolean_deserialize_compressed_ciphertext: (a: number, b: number, c: number) => void;
5547
- readonly boolean_serialize_client_key: (a: number, b: number) => void;
5548
- readonly boolean_deserialize_client_key: (a: number, b: number, c: number) => void;
5549
- readonly boolean_serialize_public_key: (a: number, b: number) => void;
5550
- readonly boolean_deserialize_public_key: (a: number, b: number, c: number) => void;
5551
- readonly boolean_serialize_compressed_server_key: (a: number, b: number) => void;
5552
- readonly boolean_deserialize_compressed_server_key: (a: number, b: number, c: number) => void;
5553
- readonly __wbg_boolean_free: (a: number) => void;
5526
+ readonly __wbg_compressedfheuint160_free: (a: number) => void;
5527
+ readonly __wbg_compressedfheuint256_free: (a: number) => void;
5528
+ readonly __wbg_compressedfheuint128_free: (a: number) => void;
5529
+ readonly __wbg_compressedfheint160_free: (a: number) => void;
5530
+ readonly __wbg_compressedfheint256_free: (a: number) => void;
5531
+ readonly __wbg_compressedfheuint2_free: (a: number) => void;
5532
+ readonly __wbg_compressedfheuint4_free: (a: number) => void;
5533
+ readonly __wbg_compressedfheuint6_free: (a: number) => void;
5534
+ readonly __wbg_compressedfheuint8_free: (a: number) => void;
5535
+ readonly __wbg_compressedfheuint10_free: (a: number) => void;
5536
+ readonly __wbg_compressedfheuint12_free: (a: number) => void;
5537
+ readonly __wbg_compressedfheuint14_free: (a: number) => void;
5538
+ readonly __wbg_compressedfheuint16_free: (a: number) => void;
5539
+ readonly __wbg_compressedfheuint32_free: (a: number) => void;
5540
+ readonly __wbg_compressedfheuint64_free: (a: number) => void;
5541
+ readonly __wbg_compressedfheint2_free: (a: number) => void;
5542
+ readonly __wbg_compressedfheint4_free: (a: number) => void;
5543
+ readonly __wbg_compressedfheint6_free: (a: number) => void;
5544
+ readonly __wbg_compressedfheint8_free: (a: number) => void;
5545
+ readonly __wbg_compressedfheint128_free: (a: number) => void;
5546
+ readonly __wbg_compressedfheint12_free: (a: number) => void;
5547
+ readonly __wbg_compressedfheint14_free: (a: number) => void;
5548
+ readonly __wbg_compressedfheint16_free: (a: number) => void;
5549
+ readonly __wbg_compressedfheint32_free: (a: number) => void;
5550
+ readonly __wbg_compressedfheint64_free: (a: number) => void;
5551
+ readonly tfheconfigbuilder_default_with_big_encryption: () => number;
5552
+ readonly __wbg_tfheconfigbuilder_free: (a: number) => void;
5553
+ readonly __wbg_tfhe_free: (a: number) => void;
5554
5554
  readonly __wbindgen_malloc: (a: number, b: number) => number;
5555
5555
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
5556
5556
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;