What is Concrete?
concreteis a Rust crate (library) meant to abstract away the details of Fully Homomorphic Encryption (FHE) to enable non-cryptographers to build applications that use FHE.
FHE is a powerful cryptographic tool, which allows computation to be performed directly on encrypted data without needing to decrypt it first.
Concrete Library implements Zama’s variant of Fully Homomorphic Encryption over the Torus (TFHE). TFHE is based on Learning With Errors (LWE), a well studied cryptographic primitive believed to be secure even against quantum computers.
In cryptography, a raw value is called a message (also sometimes called a cleartext), an encoded message is called a plaintext and an encrypted plaintext is called a ciphertext.
The idea of homomorphic encryption is that you can compute on ciphertexts while not knowing messages encrypted in them. A scheme is said to be fully homomorphic, meaning any program can be evaluated with it, if at least two of the following operations are supported (
is a plaintext and
is the corresponding ciphertext):
- homomorphic univariate function evaluation:
- homomorphic addition:
- homomorphic multiplication:
Zama's variant of TFHE is fully homomorphic and deals with fixed-precision numbers as messages. It implements homomorphic addition and function evaluation via Programmable Bootstrapping. You can read more about Zama's TFHE variant in the preliminary whitepaper.
Using FHE in a Rust program with Concrete consists in:
- generating a client key and a server key using secure parameters:
- client key encrypts/decrypts data and must be kept secret
- server key is used to perform operations on encrypted data and could be public (also called evaluation key)
- encrypting plaintexts using the client key to produce ciphertexts
- operating homomorphically on ciphertexts with the server key
- decrypting the resulting ciphertexts into plaintexts using the client key
This crate provides different types which are the counterparts of native Rust types (such as
u16) in the FHE domain.
concretecrate, our goal is to let any developer without any prior cryptographic knowledge to build his own FHE application. To reach that goal, some of the complexity is hidden from the user.
Aside from the advanced customization options offered directly by
concrete, an advanced user could also have a look at the underlying libraries.
In its current state,
concretecrate is built on top of 3 primitive crate types: respectively,
concrete-booleanfor boolean type,
concrete-shortintfor the integers from 2 to 7 bits, and
concrete-intfor the integer from 4 to 16 bits. Cryptographic operations will be handled by
We have summarized the relation between all
concretecrates with the following diagram: