Concrete is built in Rust (💛). Here is how to install it.

Installing Rust

Concrete requires Rust 1.46 or above. Run the following to install the latest Rust version, or refer to the rust website for more options.

curl --tlsv1.2 -sSf | sh

Installing FFTW

Concrete uses the FFTW library for fast FFT calculations. Use the following commands to install it:

On macOS using Homebrew

brew install fftw

On Debian Linux

sudo apt-get update && sudo apt-get install -y libfftw3-dev

From source

To install FFTW from source, follow the steps described in FFTW's website.

Importing Concrete in your project

Create a new Rust project if needed using Cargo:

cargo new play_with_fhe

Then add the Concrete dependency concrete_lib = "0.1.0" to the Cargo.tomlfile. For the code examples in this guide, you will also need to import itertools. Your configuration should look something like:

name = "play_with_fhe"
version = "0.1.0"
authors = ["FHE Curious"]
concrete = "0.1.0"
itertools = "0.9.0"

To use the Concrete library in your code, simply import the concrete root module:

// file:
use concrete::*;
fn main() {
println!("Hello Concrete!");

Then compile and run to test everything works fine:

RUSTFLAGS="-C target-cpu=native" cargo run --release

Next, we will learn about homomorphic encryption and how to use Concrete to execute a program over encrypted data!