Concrete Boolean

This library makes it possible to execute boolean gates over encrypted bits. It allows to execute a boolean circuit on an untrusted server because both circuit inputs and outputs are kept private. Data are indeed encrypted on the client side, before being sent to the server. On the server side every computation is performed on ciphertexts. The server however has to know the boolean circuit to be evaluated. At the end of the computation, the server returns the encryption of the result to the user.

Quick Example

The following piece of code shows how to generate keys and run a swall Boolean circuit homomorphically.

```rust extern crate concreteboolean; use concreteboolean::gen_keys;

// We generate a set of client/server keys, using the default parameters: let (clientkey, serverkey) = gen_keys();

// We use the client secret key to encrypt two messages: let ct1 = clientkey.encrypt(true); let ct2 = clientkey.encrypt(false);

// We use the server public key to execute a boolean circuit: // if ((NOT ct2) NAND (ct1 AND ct2)) then (NOT ct2) else (ct1 AND ct2) let ct3 = serverkey.not(&ct2); let ct4 = serverkey.and(&ct1, &ct2); let ct5 = serverkey.nand(&ct3, &ct4); let ct6 = serverkey.mux(&ct5, &ct3, &ct4);

// We use the client key to decrypt the output of the circuit: let output = clientkey.decrypt(&ct6); assert_eq!(output, true); ```

License

This software is distributed under the BSD-3-Clause-Clear license. If you have any questions, please contact us at hello@zama.ai.