From cabe4e8fe213e2ccf7b252c6d6300e31eb6c3e16 Mon Sep 17 00:00:00 2001 From: Benoit Chevallier-Mames Date: Wed, 24 Jul 2024 16:33:12 +0200 Subject: [PATCH] docs(frontend): massive modifications in the documentation part 4 --- docs/SUMMARY.md | 2 +- docs/core-features/fhe_basics.md | 31 +++---------------------------- docs/guides/deploy.md | 19 +++++++++++++++++-- 3 files changed, 21 insertions(+), 31 deletions(-) diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 066394a58c..bb5512a3f5 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -12,7 +12,6 @@ ## Operations -* [Overview](core-features/fhe_basics.md) * [Table Lookups basics](core-features/table_lookups.md) * [Non-linear operations](core-features/non_linear_operations.md) * Other operations @@ -72,6 +71,7 @@ * [Bitwise operations](core-features/bitwise.md) * [Direct circuits](compilation/direct_circuits.md) * [Tagging](core-features/tagging.md) +* [Cryptography basics](core-features/fhe_basics.md) * [Security](explanations/security.md) * [Frontend fusing](explanations/fusing.md) diff --git a/docs/core-features/fhe_basics.md b/docs/core-features/fhe_basics.md index a940006b36..3f20a5d0e6 100644 --- a/docs/core-features/fhe_basics.md +++ b/docs/core-features/fhe_basics.md @@ -1,4 +1,6 @@ -# Overview +# Cryptography basics + +In this section, we remind a bit about what Fully Homomorphic Encryption (FHE) is. Much more complete resources are available on [this webpage](https://github.com/zama-ai/awesome-zama) or [fhe.org](https://fhe.org/resources/). ## Operations on encrypted values @@ -77,30 +79,3 @@ The only thing you should keep in mind is that it adds a constraint on the input Second takeaway is that PBS are the most costly operations in FHE, the less PBS in your circuit the faster it will run. It is an interesting metrics to optimize (you will see that Concrete could give you the number of PBS used in your circuit). Note also that PBS cost varies with the input variable precision (a circuit with 8 bit PBS will run faster than one with 16 bits PBS). - -## Development Workflow - -Allowing computation on encrypted data is particularly interesting in the client/server model, especially when the client data are sensitive and the server not trusted. You could split the workflow in two main steps: development and deployment. - -### Development - -During development, you will turn your program into its FHE equivalent. Concrete automates this task with the compilation process but you can make this process even easier by reducing the precision required, reducing the number of PBSs or allowing more parallelization in your code (e.g. working on bit chunks instead of high bit-width variables). - -Once happy with the code, the development process is over and you will create the compiler artifact that will be used during deployment. - -### Deployment - -A typical Concrete deployment will host on a server the compilation artifact: Client specifications required by the compiled circuits and the fhe executable itself. Client will ask for the circuit requirements, generate keys accordingly, then it will send an encrypted payload and receive an encrypted result. - -```mermaid -sequenceDiagram - Client->>Server: Client specifications? - Server-->>Client: Client specifications - Client->>Client: Private + Evaluation Keys Generation - Client->>Server: Encrypted(data) + Evaluation Key - Server->>Server: Compiled library execution - Server-->>Client: Encrypted(result) - Client->>Client: Decrypt(result) -``` - -For more information on deployment, see [Howto - Deploy](../guides/deploy.md) diff --git a/docs/guides/deploy.md b/docs/guides/deploy.md index 7349560c63..7f6f787cb8 100644 --- a/docs/guides/deploy.md +++ b/docs/guides/deploy.md @@ -2,9 +2,24 @@ After developing your circuit, you may want to deploy it. However, sharing the details of your circuit with every client might not be desirable. As well as this, you might want to perform the computation on dedicated servers. In this case, you can use the `Client` and `Server` features of **Concrete**. -## Development of the circuit +### Deployment -You can develop your circuit using the techniques discussed in previous chapters. Here is a simple example: +A typical Concrete deployment will host on a server the compilation artifact: Client specifications required by the compiled circuits and the fhe executable itself. Client will ask for the circuit requirements, generate keys accordingly, then it will send an encrypted payload and receive an encrypted result. + +```mermaid +sequenceDiagram + Client->>Server: Client specifications? + Server-->>Client: Client specifications + Client->>Client: Private + Evaluation Keys Generation + Client->>Server: Encrypted(data) + Evaluation Key + Server->>Server: Compiled library execution + Server-->>Client: Encrypted(result) + Client->>Client: Decrypt(result) +``` + +## Starting from an example + +You can develop your circuit using the techniques discussed in previous chapters. Let's take the following example to describe deployment: ```python