Files
tfhe-rs/tfhe/docs/getting_started/operations.md
2022-11-10 19:03:08 +01:00

1.8 KiB

Supported Operations

Boolean

The list of supported operations by the homomorphic booleans is:

Operation Name type
not Unary
and Binary
or Binary
xor Binary
nor Binary
xnor Binary
cmux Ternary

A walk-through using homomorphic Booleans can be found here.

ShortInt

In TFHE-rs, the shortints represent short unsigned integers encoded over 8 bits maximum. A complete homomorphic arithmetic is provided, along with the possibility to compute univariate and bi-variate functions. Some operations are only available for integers up to 4 bits. More technical details can be found here.

The list of supported operations is:

Operation name Type
Negation Unary
Addition Binary
Subtraction Binary
Multiplication Binary
Division* Binary
Modular reduction Binary
Comparisons Binary
Left/Right Shift Binary
And Binary
Or Binary
Xor Binary
Exact Function Evaluation Unary/Binary

{% hint style="info" %} * The division operation implements a subtlety: since data is encrypted, it might be possible to compute a division by 0. In this case, the division is tweaked so that dividing by 0 returns 0. {% endhint %}

A walk-through example can be found here and more examples and explanations can be found here