mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-09 06:38:06 -05:00
2.5 KiB
2.5 KiB
Operations
This document gives a high-level overview of various operations on encrypted integers supported by TFHE-rs.
TFHE-rs supports various operations on encrypted integers (Enc) of any size between 1 and 256 bits. These operations can also work between encrypted integers and clear integers (Int).
| name | symbol | Enc/Enc |
Enc/ Int |
|---|---|---|---|
| Neg | - |
✔️ | ✔️ |
| Add | + |
✔️ | ✔️ |
| Sub | - |
✔️ | ✔️ |
| Mul | * |
✔️ | ✔️ |
| Div | / |
✔️ | ✔️ |
| Rem | % |
✔️ | ✔️ |
| Not | ! |
✔️ | ✔️ |
| BitAnd | & |
✔️ | ✔️ |
| BitOr | | |
✔️ | ✔️ |
| BitXor | ^ |
✔️ | ✔️ |
| Shr | >> |
✔️ | ✔️ |
| Shl | << |
✔️ | ✔️ |
| Min | min |
✔️ | ✔️ |
| Max | max |
✔️ | ✔️ |
| Greater than | gt |
✔️ | ✔️ |
| Greater or equal than | ge |
✔️ | ✔️ |
| Less than | lt |
✔️ | ✔️ |
| Less or equal than | le |
✔️ | ✔️ |
| Equal | eq |
✔️ | ✔️ |
| Cast (into dest type) | cast_into |
✔️ | ✖️ |
| Cast (from src type) | cast_from |
✔️ | ✖️ |
| Ternary operator | select |
✔️ | ✖️ |