Zama uses TFHE, which allows any operation (eg comparisons) with unlimited depth.
So if you only need add/mul, BFV, BGV and CKKS are good options. For anything else, you better use TFHE
137 karma · joined April 22, 2012
Zama uses TFHE, which allows any operation (eg comparisons) with unlimited depth.
So if you only need add/mul, BFV, BGV and CKKS are good options. For anything else, you better use TFHE
In the meantime if you want a good introduction to the FHE scheme we use behind the scene, you can take a look here: https://www.zama.ai/post/tfhe-deep-dive-part-1
- With boolean circuits you need to run dozens of boolean gates, which means a lot of underlying crypto ops. Works but expensive.
- with arithmetic circuits, you would approximate it using polynomials. Works but not with high precision.
- with functional circuits, you encore the function as a single “bootstrapping” operation. Works in a single crypto op.
Performance / precision tradeoffs will be very different in these 3 cases
When it comes to FHE, there are 3 underlying paradigms you can target with compilers:
1. boolean circuits, where you represent your program as encrypted boolean gates. The advantage is that it's as generic as it gets, the drawback is that it's slow. TFHE is great for that, and it's what is shown here.
2. arithmetic circuits, where you represent your program as a combination of encrypted additions and multiplications. This goes much faster, but you are quickly limited in terms of usecases because you can only do a certain number of arithmetic operations. CKKS/SEAL targets that: https://www.microsoft.com/en-us/research/project/microsoft-s...
3. functional circuits, where you represent your program as a combination of homomorphic functions. Advantage is that you can do very complex things like deep neural network, the drawback being that you have limitations of the bits of precision for the computations. Concrete targets that: https://zama.ai/concrete/
There are basically 2 strategies:
- do fast operations, with a limit on how many you can do. This is called Leveled Homomorphic Encryption, with CKKS being the most popular scheme. Microsoft open sourced a lib called Seal for it.
- do unlimited operations, but with extra overhead. This is called Fully Homomorphic Encryption, with TFHE being the fastest implementation. My company Zama has open sourced an library in Rust called Concrete.
Reminds me a lot of deep learning in 2010, just before it took off!
- homomorphic encryption is much much faster now, so the latency argument against won’t hold much longer
- with multi-key FHE, you could replace MPC, without the integration complexity and increased bandwidth cost
- Trusted Execution Environments are not about protecting user data (that’s the purpose of FHE) but rather about protecting the software itself from people having access to the physical machine. An example would be running a sensitive ML model in the cloud: you would want to use FHE to process the user data encrypted, inside an TEE that would protect your model from the cloud vendor.
Fwiw, bootstrapping is actually what makes FHE slow, not the actual addition/multiplication etc
There are tools to measure the security level of FHE schemes: https://bitbucket.org/malb/lwe-estimator/
In the former (eg Cingulata), you convert a program into a boolean circuit, and evaluate each gate homomorphically. While this is general purpose, it also means you decompose functions that could be done in one instruction into multiple binary operations (so very slow). That’s usually what people refer to when they say FHE is slow.
The other approach consists of operating directly on encrypted integers or reals, and finding ways to do more complex computations (like a square function) in one step. While this is obviously much faster, it is also limited to whatever operations is supported by the scheme. This is what people refer to when they say FHE can only do certain things.
For years, the tradeoff has basically been slow and general purpose, or fast and limited. But there are new scheme being worked on that will be published soon that enable to go way beyond what’s currently done, such as doing efficient deep learning over encrypted data and other complex numerical processing.
Lots is coming out of labs and will be on the market within 2 years!
I am a co-founder at Snips. This is a new product we are working on, which is due for next year
You can read more about it here https://medium.com/snips-ai/snips-air-a-private-by-design-op...
We will be publishing our whitepaper in the coming weeks, and are welcoming any feedback!
Cheers