TfheRustBool
’tfhe_rust_bool’ Dialect
The tfhe_rust_bool dialect is an exit dialect for generating rust code against the tfhe-rs library API,
using the boolean parameter set.
See https://github.com/zama-ai/tfhe-rs
TfheRustBool attributes
TfheRustBoolGatesAttr
An Attribute containing an array of strings to store bool gates
Syntax:
#tfhe_rust_bool.tfhe_rust_bool_gates<
::llvm::ArrayRef<::mlir::heir::tfhe_rust_bool::TfheRustBoolGateEnumAttr> # gates
>
This attributes stores a list of integer identifiers for Boolean gates.
Uses following mapping: AND_GATE = 0; NAND_GATE = 1; OR_GATE = 2; NOR_GATE = 3; XOR_GATE = 4; XNOR_GATE = 5; NOT_GATE = 6;
Parameters:
| Parameter | C++ type | Description |
|---|---|---|
| gates | ::llvm::ArrayRef<::mlir::heir::tfhe_rust_bool::TfheRustBoolGateEnumAttr> |
TfheRustBool types
EncryptedBoolType
An encrypted Boolean corresponding to tfhe-rs’s FHEBool type
Syntax: !tfhe_rust_bool.eb
PackedServerKeyType
The Belfort packed API boolean server key.
Syntax: !tfhe_rust_bool.server_key_enum
ServerKeyType
The boolean server key required to perform homomorphic operations.
Syntax: !tfhe_rust_bool.server_key
TfheRustBool ops
tfhe_rust_bool.create_trivial (heir::tfhe_rust_bool::CreateTrivialOp)
Syntax:
operation ::= `tfhe_rust_bool.create_trivial` operands attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
serverKey | tfhe rust bool server key |
value | 1-bit signless integer |
Results:
| Result | Description |
|---|---|
output | An encrypted Boolean corresponding to tfhe-rs’s FHEBool type |
tfhe_rust_bool.and (heir::tfhe_rust_bool::AndOp)
Logical AND of two TFHE-rs Bool ciphertexts.
Syntax:
operation ::= `tfhe_rust_bool.and` operands attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait, Commutative, Elementwise, Scalarizable, Tensorizable, Vectorizable
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
serverKey | The boolean server key required to perform homomorphic operations. or The Belfort packed API boolean server key. |
lhs | eb-like |
rhs | eb-like |
Results:
| Result | Description |
|---|---|
output | eb-like |
tfhe_rust_bool.mux (heir::tfhe_rust_bool::MuxOp)
Syntax:
operation ::= `tfhe_rust_bool.mux` operands attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
serverKey | The boolean server key required to perform homomorphic operations. or The Belfort packed API boolean server key. |
cnd | An encrypted Boolean corresponding to tfhe-rs’s FHEBool type |
lhs | An encrypted Boolean corresponding to tfhe-rs’s FHEBool type |
rhs | An encrypted Boolean corresponding to tfhe-rs’s FHEBool type |
Results:
| Result | Description |
|---|---|
output | An encrypted Boolean corresponding to tfhe-rs’s FHEBool type |
tfhe_rust_bool.nand (heir::tfhe_rust_bool::NandOp)
Logical NAND of two TFHE-rs Bool ciphertexts.
Syntax:
operation ::= `tfhe_rust_bool.nand` operands attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait, Commutative, Elementwise, Scalarizable, Tensorizable, Vectorizable
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
serverKey | The boolean server key required to perform homomorphic operations. or The Belfort packed API boolean server key. |
lhs | eb-like |
rhs | eb-like |
Results:
| Result | Description |
|---|---|
output | eb-like |
tfhe_rust_bool.nor (heir::tfhe_rust_bool::NorOp)
Logical NOR of two TFHE-rs Bool ciphertexts.
Syntax:
operation ::= `tfhe_rust_bool.nor` operands attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait, Commutative, Elementwise, Scalarizable, Tensorizable, Vectorizable
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
serverKey | The boolean server key required to perform homomorphic operations. or The Belfort packed API boolean server key. |
lhs | eb-like |
rhs | eb-like |
Results:
| Result | Description |
|---|---|
output | eb-like |
tfhe_rust_bool.not (heir::tfhe_rust_bool::NotOp)
Syntax:
operation ::= `tfhe_rust_bool.not` operands attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
serverKey | The boolean server key required to perform homomorphic operations. or The Belfort packed API boolean server key. |
input | eb-like |
Results:
| Result | Description |
|---|---|
output | eb-like |
tfhe_rust_bool.or (heir::tfhe_rust_bool::OrOp)
Logical OR of two TFHE-rs Bool ciphertexts.
Syntax:
operation ::= `tfhe_rust_bool.or` operands attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait, Commutative, Elementwise, Scalarizable, Tensorizable, Vectorizable
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
serverKey | The boolean server key required to perform homomorphic operations. or The Belfort packed API boolean server key. |
lhs | eb-like |
rhs | eb-like |
Results:
| Result | Description |
|---|---|
output | eb-like |
tfhe_rust_bool.gates_packed (heir::tfhe_rust_bool::PackedOp)
Syntax:
operation ::= `tfhe_rust_bool.gates_packed` operands attr-dict `:` functional-type(operands, results)
Operation to where different Boolean gates are executed pairwise between elements of two ciphertext arrays.
For example,
%0 = tfhe_rust_bool.packed_gates %a, %b {gates = #tfhe_rust_bool.tfhe_rust_bool_gates<0 : i32, 4 : i32>} :
(!tfhe_rust_bool.server_key,
tensor<2x!tfhe_rust_bool.eb>,
tensor<2x!tfhe_rust_bool.eb>) -> tensor<2x!tfhe_rust_bool.eb>
applies an “and” gate to the first elements of %a and %b and an xor gate to the second elements.
Mapping is defined in the BooleanGates.td file.
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
gates | ::mlir::heir::tfhe_rust_bool::TfheRustBoolGatesAttr | An Attribute containing an array of strings to store bool gates |
Operands:
| Operand | Description |
|---|---|
serverKey | The boolean server key required to perform homomorphic operations. or The Belfort packed API boolean server key. |
lhs | eb-like |
rhs | eb-like |
Results:
| Result | Description |
|---|---|
output | eb-like |
tfhe_rust_bool.xnor (heir::tfhe_rust_bool::XnorOp)
Logical XNOR of two TFHE-rs Bool ciphertexts.
Syntax:
operation ::= `tfhe_rust_bool.xnor` operands attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait, Commutative, Elementwise, Scalarizable, Tensorizable, Vectorizable
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
serverKey | The boolean server key required to perform homomorphic operations. or The Belfort packed API boolean server key. |
lhs | eb-like |
rhs | eb-like |
Results:
| Result | Description |
|---|---|
output | eb-like |
tfhe_rust_bool.xor (heir::tfhe_rust_bool::XorOp)
Logical XOR of two TFHE-rs Bool ciphertexts.
Syntax:
operation ::= `tfhe_rust_bool.xor` operands attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait, Commutative, Elementwise, Scalarizable, Tensorizable, Vectorizable
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
serverKey | The boolean server key required to perform homomorphic operations. or The Belfort packed API boolean server key. |
lhs | eb-like |
rhs | eb-like |
Results:
| Result | Description |
|---|---|
output | eb-like |
TfheRustBool additional definitions
TfheRustBoolGateEnum
An enum attribute representing a TFHE-rs boolean gate using u8 int
Cases:
| Symbol | Value | String |
|---|---|---|
| AND | 0 | AND |
| NAND | 1 | NAND |
| OR | 2 | OR |
| NOR | 3 | NOR |
| XOR | 4 | XOR |
| XNOR | 5 | XNOR |
| NOT | 6 | NOT |