tfhe 0.2.5 → 0.3.0
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 +19 -6
- package/package.json +1 -1
- package/tfhe.d.ts +1279 -128
- package/tfhe.js +4142 -327
- package/tfhe_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ use tfhe::boolean::prelude::*;
|
|
|
68
68
|
|
|
69
69
|
fn main() {
|
|
70
70
|
// We generate a set of client/server keys, using the default parameters:
|
|
71
|
-
let (
|
|
71
|
+
let (client_key, server_key) = gen_keys();
|
|
72
72
|
|
|
73
73
|
// We use the client secret key to encrypt two messages:
|
|
74
74
|
let ct_1 = client_key.encrypt(true);
|
|
@@ -95,7 +95,7 @@ use tfhe::shortint::prelude::*;
|
|
|
95
95
|
fn main() {
|
|
96
96
|
// Generate a set of client/server keys
|
|
97
97
|
// with 2 bits of message and 2 bits of carry
|
|
98
|
-
let (client_key, server_key) = gen_keys(
|
|
98
|
+
let (client_key, server_key) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS);
|
|
99
99
|
|
|
100
100
|
let msg1 = 3;
|
|
101
101
|
let msg2 = 2;
|
|
@@ -111,8 +111,8 @@ fn main() {
|
|
|
111
111
|
// f: x -> sum of the bits of x
|
|
112
112
|
let f = |x:u64| x.count_ones() as u64;
|
|
113
113
|
|
|
114
|
-
// Generate the
|
|
115
|
-
let acc = server_key.
|
|
114
|
+
// Generate the lookup table for the function
|
|
115
|
+
let acc = server_key.generate_lookup_table(f);
|
|
116
116
|
|
|
117
117
|
// Compute the function over the ciphertext using the PBS
|
|
118
118
|
let ct_res = server_key.apply_lookup_table(&ct_add, &acc);
|
|
@@ -127,12 +127,12 @@ An example using integer:
|
|
|
127
127
|
|
|
128
128
|
```rust
|
|
129
129
|
use tfhe::integer::gen_keys_radix;
|
|
130
|
-
use tfhe::shortint::parameters::
|
|
130
|
+
use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS;
|
|
131
131
|
|
|
132
132
|
fn main() {
|
|
133
133
|
// We create keys to create 16 bits integers
|
|
134
134
|
// using 8 blocks of 2 bits
|
|
135
|
-
let (cks, sks) = gen_keys_radix(
|
|
135
|
+
let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS, 8);
|
|
136
136
|
|
|
137
137
|
let clear_a = 2382u16;
|
|
138
138
|
let clear_b = 29374u16;
|
|
@@ -167,6 +167,19 @@ libraries.
|
|
|
167
167
|
<img src="https://user-images.githubusercontent.com/5758427/231115030-21195b55-2629-4c01-9809-be5059243999.png">
|
|
168
168
|
</a>
|
|
169
169
|
|
|
170
|
+
## Citing TFHE-rs
|
|
171
|
+
|
|
172
|
+
To cite TFHE-rs in academic papers, please use the following entry:
|
|
173
|
+
|
|
174
|
+
```text
|
|
175
|
+
@Misc{TFHE-rs,
|
|
176
|
+
title={{TFHE-rs: A Pure Rust Implementation of the TFHE Scheme for Boolean and Integer Arithmetics Over Encrypted Data}},
|
|
177
|
+
author={Zama},
|
|
178
|
+
year={2022},
|
|
179
|
+
note={\url{https://github.com/zama-ai/tfhe-rs}},
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
170
183
|
## License
|
|
171
184
|
|
|
172
185
|
This software is distributed under the BSD-3-Clause-Clear license. If you have any questions,
|
package/package.json
CHANGED