TFHE-rs v0.11: Strings, Faster Zero Knowledge Proof, Encrypted Arrays on GPU
TFHE-rs v0.11 brings several major improvements and new features. This release introduces significantly enhanced performance for Zero Knowledge Proof and a new module for encrypted strings usable in the High Level API via the [.c-inline-code]FheAsciiString[.c-inline-code] type. Besides, default cryptographic parameters now follow a tweaked uniform (TUniform) noise distribution instead of a Gaussian one. GPU performance has also been improved: the 64-bit addition is 30% faster compared to v0.8. Finally, it is now possible to perform computations on arrays of ciphertexts easily on GPU.
Zero Knowledge Proof v2
The new Zero Knowledge proof construction is now faster both for generating and verifying a proof, as detailed in the benchmark table below.
You can follow along the documentation guide to use Zero Knowledge Proofs in the High-Level API.
FHE strings
One of the highlights of this release is the FHE strings module, based on an open source contribution from user JoseSK999 during the Zama Bounty Program Season 5. It is also available in the High-Level API via the [.c-inline-code]FheAsciiString[.c-inline-code] type. FHE strings support the same APIs as Rust’s str type. You can find the guide on FHE strings and how to use them in the documentation.
Here is a preview of what you can do with the new primitive with the integer and strings features enabled:
We expect most string processing to consist mostly of comparison and contains operation, here are the current benchmarks on an hpc7a.96xlarge AWS machine:
Computing over encrypted arrays on GPU
TFHE-rs v0.11 introduces n-dimensional arrays (or tensors) for encrypted data on GPU. The supported operations are the same as on CPU, including the comparison between vectors and the search in a vector of encrypted data.
The following example displays how to use array types on GPU: it shows how to extract submatrices of size 2x2 from two 4x4 matrices, perform addition, and then add a clear matrix to the previous results. You can find more details on how to use homomorphic arrays in the documentation.
Improved GPU performance
This version brings performance improvements to the GPU backend. The 64-bit addition is 30% faster than v0.8. The Figure 1 below shows the current performance on CPU & GPU for the 64-bit addition and multiplication.
The optimal number of GPUs per operation varies depending on the operation itself and the integer precision specified by the user. Comprehensive arrays of benchmark results for both single and multiple GPUs across all specified precisions are available in the documentation.
Additional features and improvements
TFHE-rs v0.11 introduces several other features or improvements, including:
- New GPU operations: Support for absolute value and division on homomorphic signed integers.
- Faster CPU operations: Encrypted shifts/rotations on the CPU are now 28% faster.
- Parameter updates: All default cryptographic parameters have been updated to use a new noise distribution, called TUniform. The main advantage of this distribution is to be bounded, whereas the usual Gaussian one is not. In some practical cases, this can simplify the use of homomorphic computation. The mathematical definition can be found in this documentation.
- Code stability: This release is focused on improving the overall code stability. The complete list of novelties is available in the release note.
The next release of TFHE-rs will continue to improve performance, features and stability! Stay tuned for the upcoming update!
Additional links
- Star the TFHE-rs Github repository to endorse our work.
- Review the TFHE-rs documentation.
- Get support on our community channels.
- Participate in the Zama Bounty Program to get rewards in cash!