1 Introduction
See the previous blog:
- Guide to fully homomorphic encryption based on [Discretized] Torus (1)
- Guide to fully homomorphic encryption based on [Discretized] Torus (2)
- TFHE - fully homomorphic encryption code analysis based on [Discretized] Torus
For open source code, see:
TFHE-rs is:
- TFHE (Fully Homomorphic Encryption over Torus) implemented in pure Rust.
- Supports Boolean operations and integer operations on encrypted data.
- Based on Learning With Errors (LWE) cryptographic primitives - resistant to quantum computers.
- Rust API, C API and client-side WASM API are provided.
- It is fully homomorphic and can handle messages with fixed precision numbers.
- Implemented Programmable Bootstrapping.
2. Key cryptographic concepts
In cryptography:
- The raw value is called message, or cleartext (original text).
- The encoded message is called plaintext.
- The encrypted plaintext is called ciphertext.
The core idea of homomorphic encryption is to calculate the ciphertext without knowing the message in the ciphertext. If a scheme is fully homomorphic, it means that it can be used for plain text xxCiphertexte [ x ] e[x] of xe [ x ] does the following operations:
- 1) Homomorphic single-variable function evaluation: f ( E [ x ] ) = E [ f ( x ) ] f(E[x])=E[f(x)]f(E[x])=E[f(x)]
- 2) Same addition: E [ x ] + E [ y ] = E [ x + y ] E[x]+E[y]=E[x+y]E [ x ]+Hey ] _ _=And [ x+y]
- 3) The same method: E [ x ] * E [ y ] = E [ x * y ] E[x]*E[y]=E[x*y]E [ x ]∗Hey ] _ _=And [ x∗y]
3. TFHE-rs function
The basic functional process of TFHE-rs is:
- 1) Use security parameters to generate client key and server key.
- Client key: used to encrypt and decrypt data. The client key must be kept secret.
- server key: used to perform operations on ciphertext. The server key can be made public. Server key is also called evaluation key.
- 2) Use client key to encrypt plain text.
- 3) Use server key to perform homomorphic operations on ciphertext.
- 4) Use the client key to decrypt the result ciphertext to obtain the result plaintext.
References
[1] What is TFHE-rs?
FHE Series Blog
- Technical Exploration: Verifying FHE in RISC Zero - From Hiding to Proving: ZK Path of FHE Verification (1)
- Guide to fully homomorphic encryption based on [Discretized] Torus (1)
- Guide to fully homomorphic encryption based on [Discretized] Torus (2)
- TFHE - fully homomorphic encryption code analysis based on [Discretized] Torus
- Technology Exploration: Verifying FHE in RISC Zero—DevOps for RISC Zero Applications (2)
- Introduction to FHE