Skip to content

Commit 7dbbbbf

Browse files
yuxizamaIceTDrinker
authored andcommitted
chore(docs): improve nagivation
1 parent e295bf2 commit 7dbbbbf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+605
-535
lines changed

tfhe/docs/README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,27 @@ layout:
2222

2323
Learn the basics of TFHE-rs, set it up, and make it run with ease.
2424

25-
<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><strong>What is TFHE-rs?</strong></td><td>Understand TFHE-rs library and basic cryptographic concepts</td><td><a href="getting_started/readme.md">getting_started.md</a></td><td><a href=".gitbook/assets/start1.png">start1.png</a></td></tr><tr><td><strong>Installation</strong></td><td>Follow the step by step guide to import TFHE-rs in your project</td><td><a href="getting_started/installation.md">installation.md</a></td><td><a href=".gitbook/assets/start2.png">start2.png</a></td></tr><tr><td><strong>Quick start</strong></td><td>See a full example of using TFHE-rs to compute on encrypted data</td><td><a href="getting_started/quick_start.md">quick_start.md</a></td><td><a href=".gitbook/assets/start3.png">start3.png</a></td></tr></tbody></table>
25+
<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><strong>What is TFHE-rs?</strong></td><td>Understand TFHE-rs library and basic cryptographic concepts</td><td><a href="getting_started/">getting_started</a></td><td><a href=".gitbook/assets/start1.png">start1.png</a></td></tr><tr><td><strong>Installation</strong></td><td>Follow the step by step guide to import TFHE-rs in your project</td><td><a href="getting_started/installation.md">installation.md</a></td><td><a href=".gitbook/assets/start2.png">start2.png</a></td></tr><tr><td><strong>Quick start</strong></td><td>See a full example of using TFHE-rs to compute on encrypted data</td><td><a href="getting_started/quick_start.md">quick_start.md</a></td><td><a href=".gitbook/assets/start3.png">start3.png</a></td></tr></tbody></table>
2626

2727
## Build with TFHE-rs
2828

2929
Start building with TFHE-rs by exploring its core features, discovering essential guides, and learning more with user-friendly tutorials.
3030

31-
<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><strong>Fundamentals</strong></td><td>Explore the core features.</td><td><ul><li><a href="fundamentals/configure-and-generate-keys.md">Configure</a></li><li><a href="fundamentals/encrypt-data.md">Encrypt data</a></li></ul></td><td><a href=".gitbook/assets/build1.png">build1.png</a></td></tr><tr><td><strong>Guides</strong></td><td>Deploy your project.</td><td><ul><li><a href="guides/run_on_gpu.md">Run on GPU</a></li><li><a href="guides/rust_configuration.md">Configure Rust</a></li></ul></td><td><a href=".gitbook/assets/build2.png">build2.png</a></td></tr><tr><td><strong>Tutorials</strong></td><td>Learn more with tutorials.</td><td><ul><li><a href="tutorials/see-all-tutorials.md#start-here">Start here</a></li><li><a href="tutorials/see-all-tutorials.md#go-further">Go further</a></li></ul></td><td><a href=".gitbook/assets/build3.png">build3.png</a></td></tr></tbody></table>
31+
<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><strong>FHE Computations</strong></td><td>Run FHE computation on encrypted data.</td><td><ul><li><a href="fhe-computation/types/">Types </a></li><li><a href="fhe-computation/operations/">Operations</a></li></ul></td><td><a href=".gitbook/assets/build1.png">build1.png</a></td></tr><tr><td><strong>Configuration</strong></td><td>Advanced configuration for better performance.</td><td><ul><li><a href="configuration/rust_configuration.md">Advanced Rust </a></li><li><a href="configuration/run_on_gpu.md">GPU acceleration</a></li></ul></td><td><a href=".gitbook/assets/build2.png">build2.png</a></td></tr><tr><td><strong>Integration</strong></td><td>Use TFHE-rs in different contexts or platforms..</td><td><ul><li><a href="integration/c_api.md">C API</a></li><li><a href="integration/js_on_wasm_api.md">JS on WASM API</a></li></ul></td><td><a href=".gitbook/assets/build3.png">build3.png</a></td></tr></tbody></table>
3232

3333
## Explore more
3434

3535
Access to additional resources and join the Zama community.
3636

37+
### Tutorials
38+
39+
Explore step-by-step guides that walk you through real-world uses of TFHE-rs.&#x20;
40+
41+
* [Homomorphic parity bit](tutorials/parity_bit.md): Learn how to implement a parity bit calculation over encrypted data
42+
* [Homomorphic case changing on ASCII string](tutorials/ascii_fhe_string.md): See how to process string data securely by changing cases while keeping the data encrypted.
43+
* [SHA256 with Boolean API](tutorials/sha256_bool.md): Delve into a more complex example: implementing the SHA256 hash function entirely on encrypted boolean values.
44+
* [All tutorials](tutorials/see-all-tutorials.md): A complete list of all available tutorials in one place.tutorials: A complete list of all available tutorials in one place.
45+
3746
### References & Explanations
3847

3948
Take a deep dive into TFHE-rs, exploring APIs from the highest to the lowest level of abstraction and accessing additional resources for in-depth explanations.
@@ -56,8 +65,8 @@ Collaborate with us to advance the FHE spaces and drive innovation together.
5665

5766
* [Contribute to TFHE-rs](dev/contributing.md)
5867
* [Check the latest release note](https://github.com/zama-ai/tfhe-rs/releases)
59-
* [Request a feature](https://github.com/zama-ai/tfhe-rs/issues/new?assignees=\&labels=feature\_request\&projects=\&template=feature\_request.md\&title=)
60-
* [Report a bug](https://github.com/zama-ai/tfhe-rs/issues/new?assignees=\&labels=triage\_required\&projects=\&template=bug\_report.md\&title=)
68+
* [Request a feature](https://github.com/zama-ai/tfhe-rs/issues/new?assignees=\&labels=feature_request\&projects=\&template=feature_request.md\&title=)
69+
* [Report a bug](https://github.com/zama-ai/tfhe-rs/issues/new?assignees=\&labels=triage_required\&projects=\&template=bug_report.md\&title=)
6170

6271
***
6372

tfhe/docs/SUMMARY.md

Lines changed: 59 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,73 @@
44

55
## Get Started
66

7-
* [What is TFHE-rs?](getting\_started/readme.md)
8-
* [Installation](getting\_started/installation.md)
9-
* [Quick start](getting\_started/quick\_start.md)
10-
* [Types & Operations](getting\_started/operations.md)
11-
* [Benchmarks](getting\_started/benchmarks/summary.md)
12-
* [CPU Benchmarks](getting\_started/benchmarks/cpu\_benchmarks.md)
13-
* [GPU Benchmarks](getting\_started/benchmarks/gpu\_benchmarks.md)
7+
* [What is TFHE-rs?](getting_started/readme.md)
8+
* [Installation](getting_started/installation.md)
9+
* [Quick start](getting_started/quick_start.md)
10+
* [Benchmarks](getting_started/benchmarks/summary.md)
11+
* [CPU Benchmarks](getting_started/benchmarks/cpu_benchmarks.md)
12+
* [GPU Benchmarks](getting_started/benchmarks/gpu_benchmarks.md)
1413
* [Zero-knowledge proof benchmarks](getting_started/benchmarks/zk_proof_benchmarks.md)
15-
* [Security and cryptography](getting\_started/security\_and\_cryptography.md)
16-
17-
## Fundamentals
18-
19-
* [Configuration and key generation](fundamentals/configure-and-generate-keys.md)
20-
* [Server key](fundamentals/set-the-server-key.md)
21-
* [Encryption](fundamentals/encrypt-data.md)
22-
* [Computation on encrypted data](fundamentals/compute.md)
23-
* [Decryption](fundamentals/decrypt-data.md)
24-
* [Encrypted pseudo random values](fundamentals/encrypted-prf.md)
25-
* [Serialization/deserialization](fundamentals/serialization.md)
26-
* [Compressing ciphertexts/keys](fundamentals/compress.md)
27-
* [Debugging](fundamentals/debug.md)
28-
29-
## Guides
30-
31-
* [Rust configuration](guides/rust\_configuration.md)
32-
* [GPU acceleration](guides/run\_on\_gpu.md)
33-
* [Overflow detection](guides/overflow\_operations.md)
34-
* [Data versioning](guides/data\_versioning.md)
35-
* [Public key encryption](guides/public\_key.md)
36-
* [Zero-knowledge proofs](guides/zk-pok.md)
37-
* [Generic trait bounds](guides/trait\_bounds.md)
38-
* [Parallelized PBS](guides/parallelized\_pbs.md)
39-
* [High-level API in C](guides/c\_api.md)
40-
* [JS on WASM API](guides/js\_on\_wasm\_api.md)
41-
* [Multi-threading with Rayon crate](guides/rayon\_crate.md)
42-
* [Trivial ciphertexts](guides/trivial\_ciphertext.md)
43-
* [PBS statistics](guides/pbs-stats.md)
44-
* [Array](guides/array.md)
45-
* [Strings](guides/strings.md)
14+
* [Security and cryptography](getting_started/security_and_cryptography.md)
15+
16+
## FHE Computation
17+
18+
* [Types](fhe-computation/types/README.md)
19+
* [Integer](fhe-computation/types/integer.md)
20+
* [Strings](fhe-computation/types/strings.md)
21+
* [Array](fhe-computation/types/array.md)
22+
* [Operations](fhe-computation/operations/README.md)
23+
* [Arithmetic operations](fhe-computation/operations/arithmetic-operations.md)
24+
* [Bitwise operations](fhe-computation/operations/bitwise-operations.md)
25+
* [Comparison operations](fhe-computation/operations/comparison-operations.md)
26+
* [Min/Max operations](fhe-computation/operations/min-max-operations.md)
27+
* [Ternary conditional operations](fhe-computation/operations/ternary-conditional-operations.md)
28+
* [Casting operations](fhe-computation/operations/casting-operations.md)
29+
* [Boolean Operations](fhe-computation/operations/boolean-operations.md)
30+
* [Core workflow](fhe-computation/compute/README.md)
31+
* [Configuration and key generation](fhe-computation/compute/configure-and-generate-keys.md)
32+
* [Server key](fhe-computation/compute/set-the-server-key.md)
33+
* [Encryption](fhe-computation/compute/encrypt-data.md)
34+
* [Decryption](fhe-computation/compute/decrypt-data.md)
35+
* [Data handling](fhe-computation/data-handling/README.md)
36+
* [Compressing ciphertexts/keys](fhe-computation/data-handling/compress.md)
37+
* [Serialization/deserialization](fhe-computation/data-handling/serialization.md)
38+
* [Data versioning](fhe-computation/data-handling/data_versioning.md)
39+
* [Advanced features](fhe-computation/advanced-features/README.md)
40+
* [Encrypted pseudo random values](fhe-computation/advanced-features/encrypted-prf.md)
41+
* [Overflow detection](fhe-computation/advanced-features/overflow_operations.md)
42+
* [Public key encryption](fhe-computation/advanced-features/public_key.md)
43+
* [Trivial ciphertexts](fhe-computation/advanced-features/trivial_ciphertext.md)
44+
* [Zero-knowledge proofs](fhe-computation/advanced-features/zk-pok.md)
45+
* [Multi-threading with Rayon crate](fhe-computation/advanced-features/rayon_crate.md)
46+
* [Tooling](fhe-computation/tooling/README.md)
47+
* [PBS statistics](fhe-computation/tooling/pbs-stats.md)
48+
* [Generic trait bounds](fhe-computation/tooling/trait_bounds.md)
49+
* [Debugging](fhe-computation/tooling/debug.md)
50+
51+
## Configuration
52+
53+
* [Advanced Rust setup](configuration/rust_configuration.md)
54+
* [GPU acceleration](configuration/run_on_gpu.md)
55+
* [Parallelized PBS](configuration/parallelized_pbs.md)
56+
57+
## Integration
58+
59+
* [JS on WASM API](integration/js_on_wasm_api.md)
60+
* [High-level API in C](integration/c_api.md)
4661

4762
## Tutorials
4863

64+
* [Homomorphic parity bit](tutorials/parity_bit.md)
65+
* [Homomorphic case changing on Ascii string](tutorials/ascii_fhe_string.md)
66+
* [SHA256 with Boolean API](tutorials/sha256_bool.md)
4967
* [All tutorials](tutorials/see-all-tutorials.md)
50-
* [Homomorphic parity bit](tutorials/parity\_bit.md)
51-
* [Homomorphic case changing on Ascii string](tutorials/ascii\_fhe\_string.md)
52-
* [SHA256 with Boolean API](tutorials/sha256\_bool.md)
5368

5469
## References
5570

5671
* [API references](https://docs.rs/tfhe/latest/tfhe/)
5772
* [Fine-grained APIs](references/fine-grained-apis/README.md)
58-
* [Quick start](references/fine-grained-apis/quick\_start.md)
73+
* [Quick start](references/fine-grained-apis/quick_start.md)
5974
* [Boolean](references/fine-grained-apis/boolean/README.md)
6075
* [Operations](references/fine-grained-apis/boolean/operations.md)
6176
* [Cryptographic parameters](references/fine-grained-apis/boolean/parameters.md)
@@ -80,5 +95,5 @@
8095

8196
* [Contributing](dev/contributing.md)
8297
* [Release note](https://github.com/zama-ai/tfhe-rs/releases)
83-
* [Feature request](https://github.com/zama-ai/tfhe-rs/issues/new?assignees=\&labels=feature\_request\&projects=\&template=feature\_request.md\&title=)
84-
* [Bug report](https://github.com/zama-ai/tfhe-rs/issues/new?assignees=\&labels=triage\_required\&projects=\&template=bug\_report.md\&title=)
98+
* [Feature request](https://github.com/zama-ai/tfhe-rs/issues/new?assignees=\&labels=feature_request\&projects=\&template=feature_request.md\&title=)
99+
* [Bug report](https://github.com/zama-ai/tfhe-rs/issues/new?assignees=\&labels=triage_required\&projects=\&template=bug_report.md\&title=)

tfhe/docs/guides/parallelized_pbs.md renamed to tfhe/docs/configuration/parallelized_pbs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Parallelized PBS
22

3-
This document describes the implementation and benefits of parallelized [Programmable Bootstrapping](../getting\_started/security\_and\_cryptography.md) (PBS) in **TFHE-rs**, including code examples for using multi-bit PBS parameters and ensuring deterministic execution.
3+
This document describes the implementation and benefits of parallelized [Programmable Bootstrapping](../getting_started/security_and_cryptography.md) (PBS) in **TFHE-rs**, including code examples for using multi-bit PBS parameters and ensuring deterministic execution.
44

55
## Parallelized Programmable Bootstrapping
66

tfhe/docs/guides/run_on_gpu.md renamed to tfhe/docs/configuration/run_on_gpu.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ This guide explains how to update your existing program to leverage GPU accelera
1111
* [gcc](https://gcc.gnu.org/) >= 8.0 - check this [page](https://gist.github.com/ax3l/9489132) for more details about nvcc/gcc compatible versions
1212
* [cmake](https://cmake.org/) >= 3.24
1313
* libclang, to match Rust bingen [requirements](https://rust-lang.github.io/rust-bindgen/requirements.html) >= 9.0
14-
* Rust version - check this [page](rust\_configuration.md)
14+
* Rust version - check this [page](rust_configuration.md)
1515

1616
## Importing to your project
1717

1818
To use the **TFHE-rs** GPU backend in your project, add the following dependency in your `Cargo.toml`.
1919

20-
2120
```toml
2221
tfhe = { version = "1.0.0", features = ["boolean", "shortint", "integer", "gpu"] }
2322
```
@@ -31,7 +30,7 @@ For optimal performance when using **TFHE-rs**, run your code in release mode wi
3130
**TFHE-rs** GPU backend is supported on Linux (x86, aarch64).
3231

3332
| OS | x86 | aarch64 |
34-
|---------|-------------|---------------|
33+
| ------- | ----------- | ------------- |
3534
| Linux | Supported | Supported\* |
3635
| macOS | Unsupported | Unsupported\* |
3736
| Windows | Unsupported | Unsupported |
@@ -40,7 +39,7 @@ For optimal performance when using **TFHE-rs**, run your code in release mode wi
4039

4140
### Configuring and creating keys.
4241

43-
Comparing to the [CPU example](../getting\_started/quick\_start.md), GPU set up differs in the key creation, as detailed [here](run\_on\_gpu.md#Setting-the-keys)
42+
Comparing to the [CPU example](../getting_started/quick_start.md), GPU set up differs in the key creation, as detailed [here](./run_on_gpu.md#setting-the-keys)
4443

4544
Here is a full example (combining the client and server parts):
4645

@@ -77,9 +76,7 @@ fn main() {
7776
}
7877
```
7978

80-
Beware that when the GPU feature is activated, when calling: `let config = ConfigBuilder::default().build();`,
81-
the cryptographic parameters differ from the CPU ones, used when the GPU feature is not activated.
82-
Indeed, TFHE-rs uses dedicated parameters for the GPU in order to achieve better performance.
79+
Beware that when the GPU feature is activated, when calling: `let config = ConfigBuilder::default().build();`, the cryptographic parameters differ from the CPU ones, used when the GPU feature is not activated. Indeed, TFHE-rs uses dedicated parameters for the GPU in order to achieve better performance.
8380

8481
### Setting the keys
8582

@@ -103,7 +100,7 @@ On the client-side, the method to encrypt the data is exactly the same than the
103100

104101
The server first need to set up its keys with `set_server_key(gpu_key)`.
105102

106-
Then, homomorphic computations are performed using the same approach as the [CPU operations](../getting\_started/operations.md).
103+
Then, homomorphic computations are performed using the same approach as the [CPU operations](../fhe-computation/operations/README.md).
107104

108105
```Rust
109106
//Server-side
@@ -131,7 +128,7 @@ Finally, the client decrypts the results using:
131128
The GPU backend includes the following operations for both signed and unsigned encrypted integers:
132129

133130
| name | symbol | `Enc`/`Enc` | `Enc`/ `Int` |
134-
|-----------------------|----------------|----------------------------|----------------------------|
131+
| --------------------- | -------------- | -------------------------- | -------------------------- |
135132
| Neg | `-` | :heavy\_check\_mark: | N/A |
136133
| Add | `+` | :heavy\_check\_mark: | :heavy\_check\_mark: |
137134
| Sub | `-` | :heavy\_check\_mark: | :heavy\_check\_mark: |
@@ -157,31 +154,32 @@ The GPU backend includes the following operations for both signed and unsigned e
157154
| Cast (from src type) | `cast_from` | :heavy\_multiplication\_x: | N/A |
158155
| Ternary operator | `select` | :heavy\_check\_mark: | :heavy\_multiplication\_x: |
159156

160-
161157
{% hint style="info" %}
162-
All operations follow the same syntax than the one described in [here](../getting\_started/operations.md).
158+
All operations follow the same syntax than the one described in [here](../fhe-computation/operations/README.md).
163159
{% endhint %}
164160

165161
## Multi-GPU support
166162

167163
TFHE-rs supports platforms with multiple GPUs. There is **nothing to change in the code to execute on such platforms**. To keep the API as user-friendly as possible, the configuration is automatically set, i.e., the user has no fine-grained control over the number of GPUs to be used.
168164

169-
## Benchmark
165+
## Benchmark
166+
170167
Please refer to the [GPU benchmarks](../getting_started/benchmarks/gpu_benchmarks.md) for detailed performance benchmark results.
171168

172169
## Warning
170+
173171
When measuring GPU times on your own on Linux, set the environment variable `CUDA_MODULE_LOADING=EAGER` to avoid CUDA API overheads during the first kernel execution.
174172

175173
## Compressing ciphertexts after some homomorphic computation on the GPU
176174

177-
You can compress ciphertexts using the GPU, even after computations, just like on the [CPU](../fundamentals/compress.md#compression-ciphertexts-after-some-homomorphic-computation).
175+
You can compress ciphertexts using the GPU, even after computations, just like on the [CPU](../fhe-computation/data-handling/compress.md#compression-ciphertexts-after-some-homomorphic-computation).
176+
177+
The way to do it is very similar to how it's done on the CPU. The following example shows how to compress and decompress a list containing 4 messages:
178178

179-
The way to do it is very similar to how it's done on the CPU.
180-
The following example shows how to compress and decompress a list containing 4 messages:
181-
- One 32-bits integer
182-
- One 64-bit integer
183-
- One Boolean
184-
- One 2-bit integer
179+
* One 32-bits integer
180+
* One 64-bit integer
181+
* One Boolean
182+
* One 2-bit integer
185183

186184
```rust
187185
use tfhe::prelude::*;
@@ -246,7 +244,8 @@ fn main() {
246244

247245
## Array types
248246

249-
It is possible to use array types on GPU, just as [on CPU](array.md). Here is an example showing how to do it:
247+
It is possible to use array types on GPU, just as [on CPU](../fhe-computation/types/array.md). Here is an example showing how to do it:
248+
250249
```rust
251250
use tfhe::{ConfigBuilder, set_server_key, ClearArray, ClientKey, CompressedServerKey};
252251
use tfhe::array::GpuFheUint32Array;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Advanced features

0 commit comments

Comments
 (0)