In Zama’s variant of TFHE, where arithmetic is implemented over the discretized torus, how exactly is numeric encoding and bootstrapping handled under the hood?
Specifically:
- Does the scheme binarize the number, encrypt each bit individually, and apply gate bootstrapping per bit (classic Boolean approach)?
OR
- Does it encrypt a fixed-precision number directly within LWE ciphertexts (after encoding into integers over the torus), and only apply Programmable Bootstrapping (PBS) as needed—where PBS can act both as an operation and, if configured as identity, serve purely to reset noise without logical transformation?
3 Likes
hello @Laser_beam
The library actually has APIs to do both. The boolean API tfhe::boolean
, as the name indicates encrypts boolean values/1 bit and then can bootstrap those, meaning you can build boolean circuits with it.
The shortint API tfhe::shortint
encrypts small integers with e.g. a modulus of 16, meaning it can hold 4 bits of information, the PBS is used to reset the noise and compute non linear operations.
The integer API tfhe::integer
makes use of shortint and builds a radix representation on top of the individual shortint blocks allowing to have arbitrary precision integers.
This is exposed in a more user friendly api called the High Level API, you can find some tutorials here: Core workflow | TFHE-rs and All tutorials | TFHE-rs
Cheers