Concrete
WebsiteLibrariesProducts & ServicesDevelopersSupport
2.7
2.7
  • Welcome
  • Get Started
    • What is Concrete?
    • Installation
    • Quick start
    • Compatibility
    • Terminology
  • Core features
    • Overview
    • Table lookups (basics)
    • Non-linear operations
    • Advanced features
      • Bit extraction
      • Common tips
      • Extensions
  • Compilation
    • Combining compiled functions
      • With composition
      • With modules
    • Key-related options for faster execution
      • Multi precision
      • Multi parameters
    • Compression
    • Reusing arguments
    • Common errors
  • Execution / Analysis
    • Simulation
    • Debugging and artifact
    • GPU acceleration
    • Other
      • Statistics
      • Progressbar
      • Formatting and drawing
  • Guides
    • Configure
    • Manage keys
    • Deploy
  • Tutorials
    • See all tutorials
    • Part I: Concrete - FHE compiler
    • Part II: The Architecture of Concrete
  • References
    • API
  • Explanations
    • Compiler workflow
    • Compiler internals
      • Table lookups
      • Rounding
      • Truncating
      • Floating points
      • Comparisons
      • Min/Max operations
      • Bitwise operations
      • Direct circuits
      • Tagging
    • Security
    • Frontend fusing
  • Developers
    • Contributing
    • Release note
    • Feature request
    • Bug report
    • Project layout
    • Compiler backend
      • Adding a new backend
    • Optimizer
    • MLIR FHE dialects
      • FHELinalg dialect
      • FHE dialect
      • TFHE dialect
      • Concrete dialect
      • Tracing dialect
      • Runtime dialect
      • SDFG dialect
    • Call FHE circuits from other languages
Powered by GitBook

Libraries

  • TFHE-rs
  • Concrete
  • Concrete ML
  • fhEVM

Developers

  • Blog
  • Documentation
  • Github
  • FHE resources

Company

  • About
  • Introduction to FHE
  • Media
  • Careers
On this page
  • Operation definition
  • TFHE.batched_add_glwe_cst_int (::mlir::concretelang::TFHE::ABatchedAddGLWECstIntOp)
  • TFHE.batched_add_glwe_int_cst (::mlir::concretelang::TFHE::ABatchedAddGLWEIntCstOp)
  • TFHE.batched_add_glwe_int (::mlir::concretelang::TFHE::ABatchedAddGLWEIntOp)
  • TFHE.batched_add_glwe (::mlir::concretelang::TFHE::ABatchedAddGLWEOp)
  • TFHE.add_glwe_int (::mlir::concretelang::TFHE::AddGLWEIntOp)
  • TFHE.add_glwe (::mlir::concretelang::TFHE::AddGLWEOp)
  • TFHE.batched_bootstrap_glwe (::mlir::concretelang::TFHE::BatchedBootstrapGLWEOp)
  • TFHE.batched_keyswitch_glwe (::mlir::concretelang::TFHE::BatchedKeySwitchGLWEOp)
  • TFHE.batched_mapped_bootstrap_glwe (::mlir::concretelang::TFHE::BatchedMappedBootstrapGLWEOp)
  • TFHE.batched_mul_glwe_cst_int (::mlir::concretelang::TFHE::BatchedMulGLWECstIntOp)
  • TFHE.batched_mul_glwe_int_cst (::mlir::concretelang::TFHE::BatchedMulGLWEIntCstOp)
  • TFHE.batched_mul_glwe_int (::mlir::concretelang::TFHE::BatchedMulGLWEIntOp)
  • TFHE.batched_neg_glwe (::mlir::concretelang::TFHE::BatchedNegGLWEOp)
  • TFHE.bootstrap_glwe (::mlir::concretelang::TFHE::BootstrapGLWEOp)
  • TFHE.encode_expand_lut_for_bootstrap (::mlir::concretelang::TFHE::EncodeExpandLutForBootstrapOp)
  • TFHE.encode_lut_for_crt_woppbs (::mlir::concretelang::TFHE::EncodeLutForCrtWopPBSOp)
  • TFHE.encode_plaintext_with_crt (::mlir::concretelang::TFHE::EncodePlaintextWithCrtOp)
  • TFHE.keyswitch_glwe (::mlir::concretelang::TFHE::KeySwitchGLWEOp)
  • TFHE.mul_glwe_int (::mlir::concretelang::TFHE::MulGLWEIntOp)
  • TFHE.neg_glwe (::mlir::concretelang::TFHE::NegGLWEOp)
  • TFHE.sub_int_glwe (::mlir::concretelang::TFHE::SubGLWEIntOp)
  • TFHE.wop_pbs_glwe (::mlir::concretelang::TFHE::WopPBSGLWEOp)
  • TFHE.zero (::mlir::concretelang::TFHE::ZeroGLWEOp)
  • TFHE.zero_tensor (::mlir::concretelang::TFHE::ZeroTensorGLWEOp)
  • Attribute definition
  • GLWEBootstrapKeyAttr
  • GLWEKeyswitchKeyAttr
  • GLWEPackingKeyswitchKeyAttr
  • Type definition
  • GLWECipherTextType

Was this helpful?

Export as PDF
  1. Developers
  2. MLIR FHE dialects

TFHE dialect

High Level Fully Homomorphic Encryption dialect A dialect for representation of high level operation on fully homomorphic ciphertext.

Operation definition

TFHE.batched_add_glwe_cst_int (::mlir::concretelang::TFHE::ABatchedAddGLWECstIntOp)

Batched version of AddGLWEIntOp

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand
Description

ciphertext

A GLWE ciphertext

plaintexts

1D tensor of integer values

Results:

Result
Description

result

1D tensor of A GLWE ciphertext values

TFHE.batched_add_glwe_int_cst (::mlir::concretelang::TFHE::ABatchedAddGLWEIntCstOp)

Batched version of AddGLWEIntOp

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand
Description

ciphertexts

1D tensor of A GLWE ciphertext values

plaintext

integer

Results:

Result
Description

result

1D tensor of A GLWE ciphertext values

TFHE.batched_add_glwe_int (::mlir::concretelang::TFHE::ABatchedAddGLWEIntOp)

Batched version of AddGLWEIntOp

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand
Description

ciphertexts

1D tensor of A GLWE ciphertext values

plaintexts

1D tensor of integer values

Results:

Result
Description

result

1D tensor of A GLWE ciphertext values

TFHE.batched_add_glwe (::mlir::concretelang::TFHE::ABatchedAddGLWEOp)

Batched version of AddGLWEOp

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand
Description

ciphertexts_a

1D tensor of A GLWE ciphertext values

ciphertexts_b

1D tensor of A GLWE ciphertext values

Results:

Result
Description

result

1D tensor of A GLWE ciphertext values

TFHE.add_glwe_int (::mlir::concretelang::TFHE::AddGLWEIntOp)

Returns the sum of a clear integer and an lwe ciphertext

Traits: AlwaysSpeculatableImplTrait

Interfaces: BatchableOpInterface, ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand
Description

a

A GLWE ciphertext

b

integer

Results:

Result
Description

«unnamed»

A GLWE ciphertext

TFHE.add_glwe (::mlir::concretelang::TFHE::AddGLWEOp)

Returns the sum of two lwe ciphertexts

Traits: AlwaysSpeculatableImplTrait

Interfaces: BatchableOpInterface, ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand
Description

a

A GLWE ciphertext

b

A GLWE ciphertext

Results:

Result
Description

«unnamed»

A GLWE ciphertext

TFHE.batched_bootstrap_glwe (::mlir::concretelang::TFHE::BatchedBootstrapGLWEOp)

Batched version of KeySwitchGLWEOp

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Attribute
MLIR Type
Description

key

::mlir::concretelang::TFHE::GLWEBootstrapKeyAttr

An attribute representing bootstrap key.

Operands:

Operand
Description

ciphertexts

1D tensor of A GLWE ciphertext values

lookup_table

1D tensor of 64-bit signless integer values

Results:

Result
Description

result

1D tensor of A GLWE ciphertext values

TFHE.batched_keyswitch_glwe (::mlir::concretelang::TFHE::BatchedKeySwitchGLWEOp)

Batched version of KeySwitchGLWEOp

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Attribute
MLIR Type
Description

key

::mlir::concretelang::TFHE::GLWEKeyswitchKeyAttr

An attribute representing keyswitch key.

Operands:

Operand
Description

ciphertexts

1D tensor of A GLWE ciphertext values

Results:

Result
Description

result

1D tensor of A GLWE ciphertext values

TFHE.batched_mapped_bootstrap_glwe (::mlir::concretelang::TFHE::BatchedMappedBootstrapGLWEOp)

Batched version of KeySwitchGLWEOp which also batches the lookup table

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Attribute
MLIR Type
Description

key

::mlir::concretelang::TFHE::GLWEBootstrapKeyAttr

An attribute representing bootstrap key.

Operands:

Operand
Description

ciphertexts

1D tensor of A GLWE ciphertext values

lookup_table

2D tensor of 64-bit signless integer values

Results:

Result
Description

result

1D tensor of A GLWE ciphertext values

TFHE.batched_mul_glwe_cst_int (::mlir::concretelang::TFHE::BatchedMulGLWECstIntOp)

Batched version of MulGLWECstIntOp

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand
Description

ciphertext

A GLWE ciphertext

cleartexts

1D tensor of integer values

Results:

Result
Description

result

1D tensor of A GLWE ciphertext values

TFHE.batched_mul_glwe_int_cst (::mlir::concretelang::TFHE::BatchedMulGLWEIntCstOp)

Batched version of MulGLWEIntCstOp

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand
Description

ciphertexts

1D tensor of A GLWE ciphertext values

cleartext

integer

Results:

Result
Description

result

1D tensor of A GLWE ciphertext values

TFHE.batched_mul_glwe_int (::mlir::concretelang::TFHE::BatchedMulGLWEIntOp)

Batched version of MulGLWEIntOp

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand
Description

ciphertexts

1D tensor of A GLWE ciphertext values

cleartexts

1D tensor of integer values

Results:

Result
Description

result

1D tensor of A GLWE ciphertext values

TFHE.batched_neg_glwe (::mlir::concretelang::TFHE::BatchedNegGLWEOp)

Batched version of NegGLWEOp

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand
Description

ciphertexts

1D tensor of A GLWE ciphertext values

Results:

Result
Description

result

1D tensor of A GLWE ciphertext values

TFHE.bootstrap_glwe (::mlir::concretelang::TFHE::BootstrapGLWEOp)

Programmable bootstraping of a GLWE ciphertext with a lookup table

Traits: AlwaysSpeculatableImplTrait

Interfaces: BatchableOpInterface, ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Attribute
MLIR Type
Description

key

::mlir::concretelang::TFHE::GLWEBootstrapKeyAttr

An attribute representing bootstrap key.

Operands:

Operand
Description

ciphertext

A GLWE ciphertext

lookup_table

1D tensor of 64-bit signless integer values

Results:

Result
Description

result

A GLWE ciphertext

TFHE.encode_expand_lut_for_bootstrap (::mlir::concretelang::TFHE::EncodeExpandLutForBootstrapOp)

Encode and expand a lookup table so that it can be used for a bootstrap.

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Attribute
MLIR Type
Description

polySize

::mlir::IntegerAttr

32-bit signless integer attribute

outputBits

::mlir::IntegerAttr

32-bit signless integer attribute

isSigned

::mlir::BoolAttr

bool attribute

Operands:

Operand
Description

input_lookup_table

1D tensor of 64-bit signless integer values

Results:

Result
Description

result

1D tensor of 64-bit signless integer values

TFHE.encode_lut_for_crt_woppbs (::mlir::concretelang::TFHE::EncodeLutForCrtWopPBSOp)

Encode and expand a lookup table so that it can be used for a wop pbs.

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Attribute
MLIR Type
Description

crtDecomposition

::mlir::ArrayAttr

64-bit integer array attribute

crtBits

::mlir::ArrayAttr

64-bit integer array attribute

modulusProduct

::mlir::IntegerAttr

32-bit signless integer attribute

isSigned

::mlir::BoolAttr

bool attribute

Operands:

Operand
Description

input_lookup_table

1D tensor of 64-bit signless integer values

Results:

Result
Description

result

2D tensor of 64-bit signless integer values

TFHE.encode_plaintext_with_crt (::mlir::concretelang::TFHE::EncodePlaintextWithCrtOp)

Encodes a plaintext by decomposing it on a crt basis.

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Attribute
MLIR Type
Description

mods

::mlir::ArrayAttr

64-bit integer array attribute

modsProd

::mlir::IntegerAttr

64-bit signless integer attribute

Operands:

Operand
Description

input

64-bit signless integer

Results:

Result
Description

result

1D tensor of 64-bit signless integer values

TFHE.keyswitch_glwe (::mlir::concretelang::TFHE::KeySwitchGLWEOp)

Change the encryption parameters of a glwe ciphertext by applying a keyswitch

Traits: AlwaysSpeculatableImplTrait

Interfaces: BatchableOpInterface, ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Attribute
MLIR Type
Description

key

::mlir::concretelang::TFHE::GLWEKeyswitchKeyAttr

An attribute representing keyswitch key.

Operands:

Operand
Description

ciphertext

A GLWE ciphertext

Results:

Result
Description

result

A GLWE ciphertext

TFHE.mul_glwe_int (::mlir::concretelang::TFHE::MulGLWEIntOp)

Returns the product of a clear integer and an lwe ciphertext

Traits: AlwaysSpeculatableImplTrait

Interfaces: BatchableOpInterface, ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand
Description

a

A GLWE ciphertext

b

integer

Results:

Result
Description

«unnamed»

A GLWE ciphertext

TFHE.neg_glwe (::mlir::concretelang::TFHE::NegGLWEOp)

Negates a glwe ciphertext

Traits: AlwaysSpeculatableImplTrait

Interfaces: BatchableOpInterface, ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand
Description

a

A GLWE ciphertext

Results:

Result
Description

«unnamed»

A GLWE ciphertext

TFHE.sub_int_glwe (::mlir::concretelang::TFHE::SubGLWEIntOp)

Substracts an integer and a GLWE ciphertext

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand
Description

a

integer

b

A GLWE ciphertext

Results:

Result
Description

«unnamed»

A GLWE ciphertext

TFHE.wop_pbs_glwe (::mlir::concretelang::TFHE::WopPBSGLWEOp)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Attribute
MLIR Type
Description

ksk

::mlir::concretelang::TFHE::GLWEKeyswitchKeyAttr

An attribute representing keyswitch key.

bsk

::mlir::concretelang::TFHE::GLWEBootstrapKeyAttr

An attribute representing bootstrap key.

pksk

::mlir::concretelang::TFHE::GLWEPackingKeyswitchKeyAttr

An attribute representing Wop Pbs key.

crtDecomposition

::mlir::ArrayAttr

64-bit integer array attribute

cbsLevels

::mlir::IntegerAttr

32-bit signless integer attribute

cbsBaseLog

::mlir::IntegerAttr

32-bit signless integer attribute

Operands:

Operand
Description

ciphertexts

lookupTable

2D tensor of 64-bit signless integer values

Results:

Result
Description

result

TFHE.zero (::mlir::concretelang::TFHE::ZeroGLWEOp)

Returns a trivial encryption of 0

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Results:

Result
Description

out

A GLWE ciphertext

TFHE.zero_tensor (::mlir::concretelang::TFHE::ZeroTensorGLWEOp)

Returns a tensor containing trivial encryptions of 0

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Results:

Result
Description

tensor

Attribute definition

GLWEBootstrapKeyAttr

An attribute representing bootstrap key.

Syntax:

#TFHE.bsk<
  mlir::concretelang::TFHE::GLWESecretKey,   # inputKey
  mlir::concretelang::TFHE::GLWESecretKey,   # outputKey
  int,   # polySize
  int,   # glweDim
  int,   # levels
  int,   # baseLog
  int   # index
>

Parameters:

Parameter
C++ type
Description

inputKey

mlir::concretelang::TFHE::GLWESecretKey

outputKey

mlir::concretelang::TFHE::GLWESecretKey

polySize

int

glweDim

int

levels

int

baseLog

int

index

int

GLWEKeyswitchKeyAttr

An attribute representing keyswitch key.

Syntax:

#TFHE.ksk<
  mlir::concretelang::TFHE::GLWESecretKey,   # inputKey
  mlir::concretelang::TFHE::GLWESecretKey,   # outputKey
  int,   # levels
  int,   # baseLog
  int   # index
>

Parameters:

Parameter
C++ type
Description

inputKey

mlir::concretelang::TFHE::GLWESecretKey

outputKey

mlir::concretelang::TFHE::GLWESecretKey

levels

int

baseLog

int

index

int

GLWEPackingKeyswitchKeyAttr

An attribute representing Wop Pbs key.

Syntax:

#TFHE.pksk<
  mlir::concretelang::TFHE::GLWESecretKey,   # inputKey
  mlir::concretelang::TFHE::GLWESecretKey,   # outputKey
  int,   # outputPolySize
  int,   # innerLweDim
  int,   # glweDim
  int,   # levels
  int,   # baseLog
  int   # index
>

Parameters:

Parameter
C++ type
Description

inputKey

mlir::concretelang::TFHE::GLWESecretKey

outputKey

mlir::concretelang::TFHE::GLWESecretKey

outputPolySize

int

innerLweDim

int

glweDim

int

levels

int

baseLog

int

index

int

Type definition

GLWECipherTextType

A GLWE ciphertext

An GLWE cipher text

Parameters:

Parameter
C++ type
Description

key

mlir::concretelang::TFHE::GLWESecretKey

PreviousFHE dialectNextConcrete dialect

Last updated 10 months ago

Was this helpful?