Skip to content

Commit

Permalink
docs(frontend): massive modifications in the documentation
Browse files Browse the repository at this point in the history
part 4
  • Loading branch information
bcm-at-zama committed Jul 25, 2024
1 parent d8e36c3 commit cabe4e8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 31 deletions.
2 changes: 1 addition & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
31 changes: 3 additions & 28 deletions docs/core-features/fhe_basics.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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)
19 changes: 17 additions & 2 deletions docs/guides/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<!--pytest-codeblocks:skip-->
```python
Expand Down

0 comments on commit cabe4e8

Please sign in to comment.