Preliminary knowledge

To effectively use our compiler, we assume some basic knowledge of cryptography along with C and Rust.

Cryptography

  • Plaintext vs. ciphertext: Plaintext refers to unencrypted data (i.e. data in the clear) whereas ciphertext refers to encrypted data.
  • Public key vs. private key: In public key cryptography, there are two types of keys. The public key (aka the encryption key) can be shared with others. Using the public key, people can send encrypted messages. The private key (aka the decryption key) should not be shared. Whoever holds the private key can decrypt the messages addressed to them (which are encrypted under the corresponding public key). Usually, each person has their own public/private key pair.
  • “Homomorphic”: We use this term to denote computations performed directly on encrypted data. For example, if we say “homomorphic addition,” we are referring to addition of ciphertexts. What’s magical about FHE is that computations performed over the ciphertexts corresponds to computations performed over the plaintexts.

FHE computing model

In FHE, we assume there are a few different parties. We have the data owner with a public-private key pair and we have a separate computing party who has access to powerful hardware. The computing party is responsible for performing the computations over the encrypted data and sending the encrypted result back to the data owner. At no point in time can the computing party see the data in the clear.

Thus, in addition to to the public and private key, we have a special key that we call the “compute key.”

The compute key will be used by whoever is performing the FHE computation over the encrypted data. If you’ve worked with other FHE libraries, this is sometimes called the server key or evaluation key.

In theory, we could group this together with the public key, as the compute key only enables computation and not decryption. We have chosen not to do this as the compute key is orders of magnitude larger than the public key.

C, Rust, and programming

As FHE programs are currently written in C, you should be familiar with C basics like pointers, integer types, and casting rules. You should also be familiar with basic C programming patterns such as output parameters.

As our processor is written in Rust, you will also need to be familiar with basic Rust constructs to interact with and test the programs themselves.