Openfhe

‘openfhe’ Dialect

The openfhe dialect is an exit dialect for generating c++ code against the OpenFHE library API.

See https://github.com/openfheorg/openfhe-development

Openfhe types

CCParamsType

The CCParams required to create CryptoContext.

Syntax: !openfhe.cc_params

CiphertextType

An opaque OpenFHE ciphertext type

Syntax: !openfhe.ciphertext

CryptoContextType

The CryptoContext required to perform homomorphic operations in OpenFHE.

Syntax: !openfhe.crypto_context

DigitDecompositionType

A precomputed digit decomposition for for EvalFastRotation

Syntax: !openfhe.digit_decomp

EvalKeyType

The evaluation key required to keyswitch/relinearize/rotate/automorphism operation in OpenFHE.

Syntax: !openfhe.eval_key

PlaintextType

An opaque OpenFHE plaintext type

Syntax: !openfhe.plaintext

PrivateKeyType

The private key required to decrypt a ciphertext in OpenFHE.

Syntax: !openfhe.private_key

PublicKeyType

The public key required to encrypt plaintext in OpenFHE.

Syntax: !openfhe.public_key

Openfhe ops

openfhe.add_inplace (heir::openfhe::AddInPlaceOp)

In-place addition, modifying lhs.

Syntax:

operation ::= `openfhe.add_inplace` operands attr-dict `:` functional-type(operands, results)

Interfaces: InPlaceOpInterface, InferTypeOpInterface

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
lhsAn opaque OpenFHE ciphertext type
rhsAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.add (heir::openfhe::AddOp)

Addition of two ciphertexts.

Syntax:

operation ::= `openfhe.add` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
lhsAn opaque OpenFHE ciphertext type
rhsAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.add_plain_inplace (heir::openfhe::AddPlainInPlaceOp)

In-place addition of a ciphertext and a plaintext, modifying the ciphertext operand.

Syntax:

operation ::= `openfhe.add_plain_inplace` operands attr-dict `:` functional-type(operands, results)

Interfaces: InPlaceOpInterface, InferTypeOpInterface

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
lhsAn opaque OpenFHE ciphertext type or An opaque OpenFHE plaintext type
rhsAn opaque OpenFHE ciphertext type or An opaque OpenFHE plaintext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.add_plain (heir::openfhe::AddPlainOp)

Addition of a ciphertext and a plaintext.

Syntax:

operation ::= `openfhe.add_plain` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
lhsAn opaque OpenFHE ciphertext type or An opaque OpenFHE plaintext type
rhsAn opaque OpenFHE ciphertext type or An opaque OpenFHE plaintext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.automorph (heir::openfhe::AutomorphOp)

Syntax:

operation ::= `openfhe.automorph` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type
evalKeyThe evaluation key required to keyswitch/relinearize/rotate/automorphism operation in OpenFHE.

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.bootstrap (heir::openfhe::BootstrapOp)

OpenFHE bootstrap operation of a ciphertext. (For CKKS)

Syntax:

operation ::= `openfhe.bootstrap` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.decode_ckks (heir::openfhe::DecodeCKKSOp)

Syntax:

operation ::= `openfhe.decode_ckks` operands attr-dict `:` type($input) `->` type($output)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
inputAn opaque OpenFHE plaintext type

Results:

ResultDescription
outputany type

openfhe.decode (heir::openfhe::DecodeOp)

Syntax:

operation ::= `openfhe.decode` operands attr-dict `:` type($input) `->` type($output)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
inputAn opaque OpenFHE plaintext type

Results:

ResultDescription
outputany type

openfhe.decrypt (heir::openfhe::DecryptOp)

Syntax:

operation ::= `openfhe.decrypt` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type
privateKeyThe private key required to decrypt a ciphertext in OpenFHE.

Results:

ResultDescription
plaintextAn opaque OpenFHE plaintext type

openfhe.encrypt (heir::openfhe::EncryptOp)

Syntax:

operation ::= `openfhe.encrypt` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
plaintextAn opaque OpenFHE plaintext type
encryptionKeyThe public key required to encrypt plaintext in OpenFHE. or The private key required to decrypt a ciphertext in OpenFHE.

Results:

ResultDescription
ciphertextAn opaque OpenFHE ciphertext type

openfhe.fast_rotation (heir::openfhe::FastRotationOp)

Syntax:

operation ::= `openfhe.fast_rotation` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: BatchVectorizableOpInterface, ConditionallySpeculatable, ElementwiseByOperandOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
cyclotomicOrder::mlir::IntegerAttrindex attribute

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
inputAn opaque OpenFHE ciphertext type
indexindex
precomputedDigitDecompA precomputed digit decomposition for for EvalFastRotation

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.fast_rotation_precompute (heir::openfhe::FastRotationPrecomputeOp)

Syntax:

operation ::= `openfhe.fast_rotation_precompute` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
inputAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputA precomputed digit decomposition for for EvalFastRotation

openfhe.gen_bootstrapkey (heir::openfhe::GenBootstrapKeyOp)

Syntax:

operation ::= `openfhe.gen_bootstrapkey` operands attr-dict `:` functional-type(operands, results)

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
privateKeyThe private key required to decrypt a ciphertext in OpenFHE.

openfhe.gen_context (heir::openfhe::GenContextOp)

Syntax:

operation ::= `openfhe.gen_context` operands attr-dict `:` functional-type(operands, results)

Interfaces: InferTypeOpInterface

Attributes:

AttributeMLIR TypeDescription
supportFHE::mlir::BoolAttrbool attribute

Operands:

OperandDescription
paramsThe CCParams required to create CryptoContext.

Results:

ResultDescription
contextThe CryptoContext required to perform homomorphic operations in OpenFHE.

openfhe.gen_mulkey (heir::openfhe::GenMulKeyOp)

Syntax:

operation ::= `openfhe.gen_mulkey` operands attr-dict `:` functional-type(operands, results)

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
privateKeyThe private key required to decrypt a ciphertext in OpenFHE.

openfhe.gen_params (heir::openfhe::GenParamsOp)

Syntax:

operation ::= `openfhe.gen_params` operands attr-dict `:` functional-type(operands, results)

Generates the parameters for the OpenFHE scheme.

mulDepth is the depth of the multiplication circuit, including the bootstrapping depth.

plainMod is the modulus of the plaintext space. If we are using CKKS, this is 0.

insecure is a flag that determines whether the parameters are generated securely or not. In Openfhe, this means setting HEStd_NotSet for security level.

For other flags, see the OpenFHE documentation in https://github.com/openfheorg/openfhe-development/blob/main/src/pke/examples/README.md#description-of-the-cryptocontext-parameters-and-their-restrictions

Interfaces: InferTypeOpInterface

Attributes:

AttributeMLIR TypeDescription
mulDepth::mlir::IntegerAttr64-bit signless integer attribute
plainMod::mlir::IntegerAttr64-bit signless integer attribute
ringDim::mlir::IntegerAttr64-bit signless integer attribute
batchSize::mlir::IntegerAttr64-bit signless integer attribute
firstModSize::mlir::IntegerAttr64-bit signless integer attribute
scalingModSize::mlir::IntegerAttr64-bit signless integer attribute
evalAddCount::mlir::IntegerAttr64-bit signless integer attribute
keySwitchCount::mlir::IntegerAttr64-bit signless integer attribute
digitSize::mlir::IntegerAttr64-bit signless integer attribute
numLargeDigits::mlir::IntegerAttr64-bit signless integer attribute
maxRelinSkDeg::mlir::IntegerAttr64-bit signless integer attribute
insecure::mlir::BoolAttrbool attribute
encryptionTechniqueExtended::mlir::BoolAttrbool attribute
keySwitchingTechniqueBV::mlir::BoolAttrbool attribute
scalingTechniqueFixedManual::mlir::BoolAttrbool attribute

Results:

ResultDescription
paramsThe CCParams required to create CryptoContext.

openfhe.gen_rotkey (heir::openfhe::GenRotKeyOp)

Syntax:

operation ::= `openfhe.gen_rotkey` operands attr-dict `:` functional-type(operands, results)

Attributes:

AttributeMLIR TypeDescription
indices::mlir::DenseI64ArrayAttri64 dense array attribute

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
privateKeyThe private key required to decrypt a ciphertext in OpenFHE.

openfhe.key_switch_inplace (heir::openfhe::KeySwitchInPlaceOp)

In-place key switch of a ciphertext.

Syntax:

operation ::= `openfhe.key_switch_inplace` operands attr-dict `:` functional-type(operands, results)

Interfaces: InPlaceOpInterface, InferTypeOpInterface

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type
evalKeyThe evaluation key required to keyswitch/relinearize/rotate/automorphism operation in OpenFHE.

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.key_switch (heir::openfhe::KeySwitchOp)

Key switch a ciphertext.

Syntax:

operation ::= `openfhe.key_switch` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type
evalKeyThe evaluation key required to keyswitch/relinearize/rotate/automorphism operation in OpenFHE.

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.level_reduce_inplace (heir::openfhe::LevelReduceInPlaceOp)

In-place level reduction of a ciphertext.

Syntax:

operation ::= `openfhe.level_reduce_inplace` operands attr-dict `:` functional-type(operands, results)

Interfaces: InPlaceOpInterface, InferTypeOpInterface

Attributes:

AttributeMLIR TypeDescription
levelToDrop::mlir::IntegerAttr64-bit signless integer attribute

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.level_reduce (heir::openfhe::LevelReduceOp)

Reduce the level of a ciphertext.

Syntax:

operation ::= `openfhe.level_reduce` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
levelToDrop::mlir::IntegerAttr64-bit signless integer attribute

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.make_ckks_packed_plaintext (heir::openfhe::MakeCKKSPackedPlaintextOp)

Syntax:

operation ::= `openfhe.make_ckks_packed_plaintext` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
valueranked tensor of floating-point or integer values

Results:

ResultDescription
plaintextAn opaque OpenFHE plaintext type

openfhe.make_packed_plaintext (heir::openfhe::MakePackedPlaintextOp)

Syntax:

operation ::= `openfhe.make_packed_plaintext` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
valueranked tensor of integer values

Results:

ResultDescription
plaintextAn opaque OpenFHE plaintext type

openfhe.mod_reduce_inplace (heir::openfhe::ModReduceInPlaceOp)

In-place mod_reduce of a ciphertext. (used only for BGV/CKKS)

Syntax:

operation ::= `openfhe.mod_reduce_inplace` operands attr-dict `:` functional-type(operands, results)

Interfaces: InPlaceOpInterface, InferTypeOpInterface

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.mod_reduce (heir::openfhe::ModReduceOp)

Mod_reduce of a ciphertext. (used only for BGV/CKKS)

Syntax:

operation ::= `openfhe.mod_reduce` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.mul_const_inplace (heir::openfhe::MulConstInPlaceOp)

In-place multiplication of a ciphertext and a constant, modifying the ciphertext.

Syntax:

operation ::= `openfhe.mul_const_inplace` operands attr-dict `:` functional-type(operands, results)

Interfaces: InPlaceOpInterface, InferTypeOpInterface

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type
constant64-bit signless integer

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.mul_const (heir::openfhe::MulConstOp)

Multiplication of a ciphertext and a constant.

Syntax:

operation ::= `openfhe.mul_const` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type
constant64-bit signless integer

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.mul_no_relin (heir::openfhe::MulNoRelinOp)

Multiplication of two ciphertexts without relinearization.

Syntax:

operation ::= `openfhe.mul_no_relin` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, IncreasesMulDepthOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
lhsAn opaque OpenFHE ciphertext type
rhsAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.mul (heir::openfhe::MulOp)

Multiplication of two ciphertexts with relinearization.

Syntax:

operation ::= `openfhe.mul` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, IncreasesMulDepthOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
lhsAn opaque OpenFHE ciphertext type
rhsAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.mul_plain (heir::openfhe::MulPlainOp)

Multiplication of a ciphertext and a plaintext.

Syntax:

operation ::= `openfhe.mul_plain` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, IncreasesMulDepthOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
lhsAn opaque OpenFHE ciphertext type or An opaque OpenFHE plaintext type
rhsAn opaque OpenFHE ciphertext type or An opaque OpenFHE plaintext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.negate_inplace (heir::openfhe::NegateInPlaceOp)

In-place negation of a ciphertext.

Syntax:

operation ::= `openfhe.negate_inplace` operands attr-dict `:` functional-type(operands, results)

Interfaces: InPlaceOpInterface, InferTypeOpInterface

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.negate (heir::openfhe::NegateOp)

Negation of a ciphertext.

Syntax:

operation ::= `openfhe.negate` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.relin_inplace (heir::openfhe::RelinInPlaceOp)

In-place relinearization of a ciphertext.

Syntax:

operation ::= `openfhe.relin_inplace` operands attr-dict `:` functional-type(operands, results)

Interfaces: InPlaceOpInterface, InferTypeOpInterface

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.relin (heir::openfhe::RelinOp)

Relinearization of a ciphertext.

Syntax:

operation ::= `openfhe.relin` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.rot (heir::openfhe::RotOp)

Syntax:

operation ::= `openfhe.rot` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
index::mlir::IntegerAttrAn Attribute containing a integer value

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.setup_bootstrap (heir::openfhe::SetupBootstrapOp)

Syntax:

operation ::= `openfhe.setup_bootstrap` operands attr-dict `:` functional-type(operands, results)

Attributes:

AttributeMLIR TypeDescription
levelBudgetEncode::mlir::IntegerAttrAn Attribute containing a integer value
levelBudgetDecode::mlir::IntegerAttrAn Attribute containing a integer value

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.

openfhe.square_inplace (heir::openfhe::SquareInPlaceOp)

In-place square of a ciphertext.

Syntax:

operation ::= `openfhe.square_inplace` operands attr-dict `:` functional-type(operands, results)

Interfaces: InPlaceOpInterface, InferTypeOpInterface

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.square (heir::openfhe::SquareOp)

Square of a ciphertext.

Syntax:

operation ::= `openfhe.square` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
ciphertextAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.sub_inplace (heir::openfhe::SubInPlaceOp)

In-place subtraction, modifying lhs.

Syntax:

operation ::= `openfhe.sub_inplace` operands attr-dict `:` functional-type(operands, results)

Interfaces: InPlaceOpInterface, InferTypeOpInterface

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
lhsAn opaque OpenFHE ciphertext type
rhsAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.sub (heir::openfhe::SubOp)

Subtraction of two ciphertexts.

Syntax:

operation ::= `openfhe.sub` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
lhsAn opaque OpenFHE ciphertext type
rhsAn opaque OpenFHE ciphertext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.sub_plain_inplace (heir::openfhe::SubPlainInPlaceOp)

In-place subtraction of a ciphertext and a plaintext, modifying the ciphertext operand.

Syntax:

operation ::= `openfhe.sub_plain_inplace` operands attr-dict `:` functional-type(operands, results)

Interfaces: InPlaceOpInterface, InferTypeOpInterface

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
lhsAn opaque OpenFHE ciphertext type or An opaque OpenFHE plaintext type
rhsAn opaque OpenFHE ciphertext type or An opaque OpenFHE plaintext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type

openfhe.sub_plain (heir::openfhe::SubPlainOp)

Subtraction of a ciphertext and a plaintext.

Syntax:

operation ::= `openfhe.sub_plain` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
cryptoContextThe CryptoContext required to perform homomorphic operations in OpenFHE.
lhsAn opaque OpenFHE ciphertext type or An opaque OpenFHE plaintext type
rhsAn opaque OpenFHE ciphertext type or An opaque OpenFHE plaintext type

Results:

ResultDescription
outputAn opaque OpenFHE ciphertext type