Google has open-sourced a general-purpose transpiler able to convert high-level code to be used with Fully Homomorphic Encryption (FHE).
While FHE is attracting a lot of interest from several companies, including IBM and Microsoft, here Google is attempting a novel approach by creating a transpiler to transform a program written in a high-level language and working with non-encrypted data into an FHE-ready version.
Google’s transpiler will enable developers to write code for any type of basic computation such as simple string processing or math, and run it on encrypted data.
Google's transpiler has two major components. On the one hand, it uses Google's open-source XLS SDK to leverage its compilation pipeline and convert higher-level language operations into lower-level boolean operations as required by FHE.
XLS implements a High Level Synthesis (HLS) toolchain which produces synthesizable designs from flexible, high-level descriptions of functionality. It is fully Open Source: Apache 2 licensed and developed via GitHub. XLS is used inside of Google for generating feed-forward pipelines from "building block" routines / libraries that can be easily retargeted, reused, and composed in a latency-insensitive manner.
On the other hand, it uses Google's TFHE fully homomorphic encryption library to go from the intermediate representation provided by XLS to an HFE computation.
TFHE is a C/C++ library which implements a very fast gate-by-gate bootstrapping [...]. The library allows to evaluate an arbitrary boolean circuit composed of binary gates, over encrypted data, without revealing any information on the data.
This modular design has a number of advantages, according to Google. First, a number of different high-level languages are supported out-of-the-box thanks to XLS. At the moment, XLS supports C++ and DSLX a DSL that mimics Rust. Likewise, the output FHE-ready code can be in any language with an FHE library that exposes logical gates as part of its API.
It should be noted that XLS does not fully support all C++ features. In particular, variable-length arrays, while-loops and for-loops with a variable end condition, and floating point data are not supported. Additionally, both XLS and TFHE are still in an experimental stage and bound to change significantly.
Homomorphic Encryption is an approach to secure computation that does not require decrypting your data in order to process them. Instead, homomorphic encryption enables processing ciphertexts with the guarantee that encrypted results match those that would be produced by first decrypting input data, processing them, and finally encrypting them. Among its applications, FHE could be used to train machine learning models on sensitive data, says Google.