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

✔️

✖️

Last updated

Was this helpful?