Operations

This document outlines the GPU operations supported in TFHE-rs.

The GPU backend includes the following operations for both signed and unsigned encrypted integers:

name

symbol

Enc/Enc

Enc/ Int

Neg

-

✔️

N/A

Add

+

✔️

✔️

Sub

-

✔️

✔️

Mul

*

✔️

✔️

Div

/

✔️

✔️

Rem

%

✔️

✔️

Not

!

✔️

N/A

BitAnd

&

✔️

✔️

BitOr

|

✔️

✔️

BitXor

^

✔️

✔️

Shr

>>

✔️

✔️

Shl

<<

✔️

✔️

Rotate right

rotate_right

✔️

✔️

Rotate left

rotate_left

✔️

✔️

Min

min

✔️

✔️

Max

max

✔️

✔️

Greater than

gt

✔️

✔️

Greater or equal than

ge

✔️

✔️

Lower than

lt

✔️

✔️

Lower or equal than

le

✔️

✔️

Equal

eq

✔️

✔️

Not Equal

ne

✔️

✔️

Cast (into dest type)

cast_into

✔️

N/A

Cast (from src type)

cast_from

✔️

N/A

Ternary operator

select

✔️

✖️

Integer logarithm

ilog2

✔️

N/A

Count trailing/leading zeros/ones

count_leading_zeros

✔️

N/A

Oblivious Pseudo Random Generation

oprf

✔️

N/A

All operations follow the same syntax as the one described in here.

Last updated

Was this helpful?