Crate tfhe

Crate tfhe 

Source
Expand description

Welcome to the TFHE-rs API documentation!

TFHE-rs is a fully homomorphic encryption (FHE) library that implements Zama’s variant of TFHE.

Re-exports§

pub use error::Error;
pub use error::ErrorKind;
pub use crate::integer::server_key::MatchValues;
pub use crate::integer::parameters::CompactCiphertextListConformanceParams;
pub use crate::safe_serialization::DeserializationConfig;
pub use crate::safe_serialization::SerializationConfig;
pub use crate::strings::ciphertext::ClearString;strings
pub use crate::core_crypto::gpu::vec::GpuIndex;gpu
pub use tfhe_hpu_backend;hpu

Modules§

arrayinteger
backward_compatibilityinteger
booleanboolean
Welcome to the TFHE-rs boolean module documentation!
conformance
core_crypto
Welcome to the TFHE-rs core_crypto module documentation!
error
integerinteger
Welcome to the TFHE-rs integer module documentation!
named
preludeinteger
The tfhe prelude. The purpose of this module is to make it easier to have the most commonly needed traits of this crate.
safe_serialization
Serialization utilities with some safety checks
shortintshortint
Welcome to the TFHE-rs shortint module documentation!
stringsstrings
upgradeinteger
xof_key_setinteger
zkzk-pok

Macros§

map_ct_ct
Easily map an Hpu operation to std::ops rust trait

Structs§

ClientKey
Key of the client
CompactCiphertextList
CompactCiphertextListBuilder
CompactCiphertextListExpander
CompactPublicKey
A more compact public key
CompressedCiphertextList
CompressedCiphertextListBuilder
CompressedCompactPublicKey
Compressed variant of CompactPublicKey
CompressedFheBool
Compressed FheBool
CompressedFheInt
Compressed FheInt
CompressedFheUint
Compressed FheUint
CompressedKVStore
Compressed KVStore
CompressedPublicKey
Compressed classical public key.
CompressedServerKey
Compressed ServerKey
CompressedSquashedNoiseCiphertextList
Compressed ciphertext list for squashed noise ciphertext
CompressedSquashedNoiseCiphertextListBuilder
Builder to create CompressedSquashedNoiseCiphertextList
Config
The config type
ConfigBuilder
The builder to create your config
CudaServerKeygpu
CustomMultiGpuIndexesgpu
FheAsciiStringstrings
FheBool
The FHE boolean data type.
FheBoolConformanceParams
FheBoolId
FheInt
A Generic FHE signed integer
FheInt2Id
Id for the FheInt2 data type.
FheInt4Id
Id for the FheInt4 data type.
FheInt6Id
Id for the FheInt6 data type.
FheInt8Id
Id for the FheInt8 data type.
FheInt10Id
Id for the FheInt10 data type.
FheInt12Id
Id for the FheInt12 data type.
FheInt14Id
Id for the FheInt14 data type.
FheInt16Id
Id for the FheInt16 data type.
FheInt24Id
Id for the FheInt24 data type.
FheInt32Id
Id for the FheInt32 data type.
FheInt40Id
Id for the FheInt40 data type.
FheInt48Id
Id for the FheInt48 data type.
FheInt56Id
Id for the FheInt56 data type.
FheInt64Id
Id for the FheInt64 data type.
FheInt72Id
Id for the FheInt72 data type.
FheInt80Id
Id for the FheInt80 data type.
FheInt88Id
Id for the FheInt88 data type.
FheInt96Id
Id for the FheInt96 data type.
FheInt104Id
Id for the FheInt104 data type.
FheInt112Id
Id for the FheInt112 data type.
FheInt120Id
Id for the FheInt120 data type.
FheInt128Id
Id for the FheInt128 data type.
FheInt136Id
Id for the FheInt136 data type.
FheInt144Id
Id for the FheInt144 data type.
FheInt152Id
Id for the FheInt152 data type.
FheInt160Id
Id for the FheInt160 data type.
FheInt168Id
Id for the FheInt168 data type.
FheInt176Id
Id for the FheInt176 data type.
FheInt184Id
Id for the FheInt184 data type.
FheInt192Id
Id for the FheInt192 data type.
FheInt200Id
Id for the FheInt200 data type.
FheInt208Id
Id for the FheInt208 data type.
FheInt216Id
Id for the FheInt216 data type.
FheInt224Id
Id for the FheInt224 data type.
FheInt232Id
Id for the FheInt232 data type.
FheInt240Id
Id for the FheInt240 data type.
FheInt248Id
Id for the FheInt248 data type.
FheInt256Id
Id for the FheInt256 data type.
FheInt512Id
Id for the FheInt512 data type.
FheInt1024Id
Id for the FheInt1024 data type.
FheInt2048Id
Id for the FheInt2048 data type.
FheUint
A Generic FHE unsigned integer
FheUint2Id
Id for the FheUint2 data type.
FheUint4Id
Id for the FheUint4 data type.
FheUint6Id
Id for the FheUint6 data type.
FheUint8Id
Id for the FheUint8 data type.
FheUint10Id
Id for the FheUint10 data type.
FheUint12Id
Id for the FheUint12 data type.
FheUint14Id
Id for the FheUint14 data type.
FheUint16Id
Id for the FheUint16 data type.
FheUint24Id
Id for the FheUint24 data type.
FheUint32Id
Id for the FheUint32 data type.
FheUint40Id
Id for the FheUint40 data type.
FheUint48Id
Id for the FheUint48 data type.
FheUint56Id
Id for the FheUint56 data type.
FheUint64Id
Id for the FheUint64 data type.
FheUint72Id
Id for the FheUint72 data type.
FheUint80Id
Id for the FheUint80 data type.
FheUint88Id
Id for the FheUint88 data type.
FheUint96Id
Id for the FheUint96 data type.
FheUint104Id
Id for the FheUint104 data type.
FheUint112Id
Id for the FheUint112 data type.
FheUint120Id
Id for the FheUint120 data type.
FheUint128Id
Id for the FheUint128 data type.
FheUint136Id
Id for the FheUint136 data type.
FheUint144Id
Id for the FheUint144 data type.
FheUint152Id
Id for the FheUint152 data type.
FheUint160Id
Id for the FheUint160 data type.
FheUint168Id
Id for the FheUint168 data type.
FheUint176Id
Id for the FheUint176 data type.
FheUint184Id
Id for the FheUint184 data type.
FheUint192Id
Id for the FheUint192 data type.
FheUint200Id
Id for the FheUint200 data type.
FheUint208Id
Id for the FheUint208 data type.
FheUint216Id
Id for the FheUint216 data type.
FheUint224Id
Id for the FheUint224 data type.
FheUint232Id
Id for the FheUint232 data type.
FheUint240Id
Id for the FheUint240 data type.
FheUint248Id
Id for the FheUint248 data type.
FheUint256Id
Id for the FheUint256 data type.
FheUint512Id
Id for the FheUint512 data type.
FheUint1024Id
Id for the FheUint1024 data type.
FheUint2048Id
Id for the FheUint2048 data type.
KVStore
The KVStore is a specialized encrypted HashMap
KeySwitchingKey
ProvenCompactCiphertextListzk-pok
PublicKey
Classical public key.
ReRandomizationContext
The context in which the ciphertexts to re-randomized will be used.
ReRandomizationMetadata
Metadata linked to a ciphertext that will be used when updating the ReRandomizationContext
ReRandomizationSeedGen
A generator that can be used to obtain seeds needed to re-randomize individual ciphertexts.
Seed
A seed value, used to initialize a generator.
ServerKey
Key of the server
SquashedNoiseFheBool
SquashedNoiseFheInt
SquashedNoiseFheUint
Tag
Tag
XofSeed
A Seed as described in the Threshold (Fully) Homomorphic Encryption

Enums§

CompressedReRandomizationKeySwitchingKey
CudaGpuChoicegpu
Deviceinteger
Devices supported by tfhe-rs
EncryptableStringstrings
FheStringIsEmptystrings
FheStringLenstrings
FheTypesinteger
ReRandomizationKeySwitchingKey

Traits§

FheId
FheIntId
FheIntegerType
FheUintId
HlCompactable
HlCompressible
HlExpandable
HlSquashedNoiseCompressible
HlSquashedNoiseExpandable
IntegerId
Trait to mark ID type for integers
Unversionize
This trait means that we can convert from a versioned enum into the target type.
Versionize
This trait means that the type can be converted into a versioned equivalent type.

Functions§

generate_keys
Generates keys using the provided config.
set_server_key
The function used to initialize internal keys.
unset_server_key
with_server_key_as_context

Type Aliases§

ClearArray
CompressedFheInt2
A compressed signed integer type with 2 bits
CompressedFheInt4
A compressed signed integer type with 4 bits
CompressedFheInt6
A compressed signed integer type with 6 bits
CompressedFheInt8
A compressed signed integer type with 8 bits
CompressedFheInt10
A compressed signed integer type with 10 bits
CompressedFheInt12
A compressed signed integer type with 12 bits
CompressedFheInt14
A compressed signed integer type with 14 bits
CompressedFheInt16
A compressed signed integer type with 16 bits
CompressedFheInt24
A compressed signed integer type with 24 bits
CompressedFheInt32
A compressed signed integer type with 32 bits
CompressedFheInt40
A compressed signed integer type with 40 bits
CompressedFheInt48
A compressed signed integer type with 48 bits
CompressedFheInt56
A compressed signed integer type with 56 bits
CompressedFheInt64
A compressed signed integer type with 64 bits
CompressedFheInt72
A compressed signed integer type with 72 bits
CompressedFheInt80
A compressed signed integer type with 80 bits
CompressedFheInt88
A compressed signed integer type with 88 bits
CompressedFheInt96
A compressed signed integer type with 96 bits
CompressedFheInt104
A compressed signed integer type with 104 bits
CompressedFheInt112
A compressed signed integer type with 112 bits
CompressedFheInt120
A compressed signed integer type with 120 bits
CompressedFheInt128
A compressed signed integer type with 128 bits
CompressedFheInt136
A compressed signed integer type with 136 bits
CompressedFheInt144
A compressed signed integer type with 144 bits
CompressedFheInt152
A compressed signed integer type with 152 bits
CompressedFheInt160
A compressed signed integer type with 160 bits
CompressedFheInt168
A compressed signed integer type with 168 bits
CompressedFheInt176
A compressed signed integer type with 176 bits
CompressedFheInt184
A compressed signed integer type with 184 bits
CompressedFheInt192
A compressed signed integer type with 192 bits
CompressedFheInt200
A compressed signed integer type with 200 bits
CompressedFheInt208
A compressed signed integer type with 208 bits
CompressedFheInt216
A compressed signed integer type with 216 bits
CompressedFheInt224
A compressed signed integer type with 224 bits
CompressedFheInt232
A compressed signed integer type with 232 bits
CompressedFheInt240
A compressed signed integer type with 240 bits
CompressedFheInt248
A compressed signed integer type with 248 bits
CompressedFheInt256
A compressed signed integer type with 256 bits
CompressedFheInt512
A compressed signed integer type with 512 bits
CompressedFheInt1024
A compressed signed integer type with 1024 bits
CompressedFheInt2048
A compressed signed integer type with 2048 bits
CompressedFheUint2
CompressedFheUint4
CompressedFheUint6
CompressedFheUint8
CompressedFheUint10
CompressedFheUint12
CompressedFheUint14
CompressedFheUint16
CompressedFheUint24
CompressedFheUint32
CompressedFheUint40
CompressedFheUint48
CompressedFheUint56
CompressedFheUint64
CompressedFheUint72
CompressedFheUint80
CompressedFheUint88
CompressedFheUint96
CompressedFheUint104
CompressedFheUint112
CompressedFheUint120
CompressedFheUint128
CompressedFheUint136
CompressedFheUint144
CompressedFheUint152
CompressedFheUint160
CompressedFheUint168
CompressedFheUint176
CompressedFheUint184
CompressedFheUint192
CompressedFheUint200
CompressedFheUint208
CompressedFheUint216
CompressedFheUint224
CompressedFheUint232
CompressedFheUint240
CompressedFheUint248
CompressedFheUint256
CompressedFheUint512
CompressedFheUint1024
CompressedFheUint2048
CpuFheBoolArray
CpuFheBoolSlice
CpuFheBoolSliceMut
CpuFheInt2Array
CpuFheInt2Slice
CpuFheInt2SliceMut
CpuFheInt4Array
CpuFheInt4Slice
CpuFheInt4SliceMut
CpuFheInt8Array
CpuFheInt8Slice
CpuFheInt8SliceMut
CpuFheInt16Array
CpuFheInt16Slice
CpuFheInt16SliceMut
CpuFheInt32Array
CpuFheInt32Slice
CpuFheInt32SliceMut
CpuFheInt64Array
CpuFheInt64Slice
CpuFheInt64SliceMut
CpuFheInt128Array
CpuFheInt128Slice
CpuFheInt128SliceMut
CpuFheInt256Array
CpuFheInt256Slice
CpuFheInt256SliceMut
CpuFheIntArray
CpuFheIntSlice
CpuFheIntSliceMut
CpuFheUint2Array
CpuFheUint2Slice
CpuFheUint2SliceMut
CpuFheUint4Array
CpuFheUint4Slice
CpuFheUint4SliceMut
CpuFheUint8Array
CpuFheUint8Slice
CpuFheUint8SliceMut
CpuFheUint16Array
CpuFheUint16Slice
CpuFheUint16SliceMut
CpuFheUint32Array
CpuFheUint32Slice
CpuFheUint32SliceMut
CpuFheUint64Array
CpuFheUint64Slice
CpuFheUint64SliceMut
CpuFheUint128Array
CpuFheUint128Slice
CpuFheUint128SliceMut
CpuFheUint256Array
CpuFheUint256Slice
CpuFheUint256SliceMut
CpuFheUintArray
CpuFheUintSlice
CpuFheUintSliceMut
FheBoolArray
FheBoolSlice
FheBoolSliceMut
FheInt2
A signed integer type with 2 bits
FheInt4
A signed integer type with 4 bits
FheInt6
A signed integer type with 6 bits
FheInt8
A signed integer type with 8 bits
FheInt2Array
FheInt2ConformanceParams
FheInt2Slice
FheInt2SliceMut
FheInt4Array
FheInt4ConformanceParams
FheInt4Slice
FheInt4SliceMut
FheInt6ConformanceParams
FheInt8Array
FheInt8ConformanceParams
FheInt8Slice
FheInt8SliceMut
FheInt10
A signed integer type with 10 bits
FheInt12
A signed integer type with 12 bits
FheInt14
A signed integer type with 14 bits
FheInt16
A signed integer type with 16 bits
FheInt24
A signed integer type with 24 bits
FheInt32
A signed integer type with 32 bits
FheInt40
A signed integer type with 40 bits
FheInt48
A signed integer type with 48 bits
FheInt56
A signed integer type with 56 bits
FheInt64
A signed integer type with 64 bits
FheInt72
A signed integer type with 72 bits
FheInt80
A signed integer type with 80 bits
FheInt88
A signed integer type with 88 bits
FheInt96
A signed integer type with 96 bits
FheInt10ConformanceParams
FheInt12ConformanceParams
FheInt14ConformanceParams
FheInt16Array
FheInt16ConformanceParams
FheInt16Slice
FheInt16SliceMut
FheInt24ConformanceParams
FheInt32Array
FheInt32ConformanceParams
FheInt32Slice
FheInt32SliceMut
FheInt40ConformanceParams
FheInt48ConformanceParams
FheInt56ConformanceParams
FheInt64Array
FheInt64ConformanceParams
FheInt64Slice
FheInt64SliceMut
FheInt72ConformanceParams
FheInt80ConformanceParams
FheInt88ConformanceParams
FheInt96ConformanceParams
FheInt104
A signed integer type with 104 bits
FheInt112
A signed integer type with 112 bits
FheInt120
A signed integer type with 120 bits
FheInt128
A signed integer type with 128 bits
FheInt136
A signed integer type with 136 bits
FheInt144
A signed integer type with 144 bits
FheInt152
A signed integer type with 152 bits
FheInt160
A signed integer type with 160 bits
FheInt168
A signed integer type with 168 bits
FheInt176
A signed integer type with 176 bits
FheInt184
A signed integer type with 184 bits
FheInt192
A signed integer type with 192 bits
FheInt200
A signed integer type with 200 bits
FheInt208
A signed integer type with 208 bits
FheInt216
A signed integer type with 216 bits
FheInt224
A signed integer type with 224 bits
FheInt232
A signed integer type with 232 bits
FheInt240
A signed integer type with 240 bits
FheInt248
A signed integer type with 248 bits
FheInt256
A signed integer type with 256 bits
FheInt512
A signed integer type with 512 bits
FheInt104ConformanceParams
FheInt112ConformanceParams
FheInt120ConformanceParams
FheInt128Array
FheInt128ConformanceParams
FheInt128Slice
FheInt128SliceMut
FheInt136ConformanceParams
FheInt144ConformanceParams
FheInt152ConformanceParams
FheInt160ConformanceParams
FheInt168ConformanceParams
FheInt176ConformanceParams
FheInt184ConformanceParams
FheInt192ConformanceParams
FheInt200ConformanceParams
FheInt208ConformanceParams
FheInt216ConformanceParams
FheInt224ConformanceParams
FheInt232ConformanceParams
FheInt240ConformanceParams
FheInt248ConformanceParams
FheInt256Array
FheInt256ConformanceParams
FheInt256Slice
FheInt256SliceMut
FheInt512ConformanceParams
FheInt1024
A signed integer type with 1024 bits
FheInt2048
A signed integer type with 2048 bits
FheInt1024ConformanceParams
FheInt2048ConformanceParams
FheIntArray
FheIntSlice
FheIntSliceMut
FheUint2
An unsigned integer type with 2 bits
FheUint4
An unsigned integer type with 4 bits
FheUint6
An unsigned integer type with 6 bits
FheUint8
An unsigned integer type with 8 bits
FheUint2Array
FheUint2ConformanceParams
FheUint2Slice
FheUint2SliceMut
FheUint4Array
FheUint4ConformanceParams
FheUint4Slice
FheUint4SliceMut
FheUint6ConformanceParams
FheUint8Array
FheUint8ConformanceParams
FheUint8Slice
FheUint8SliceMut
FheUint10
An unsigned integer type with 10 bits
FheUint12
An unsigned integer type with 12 bits
FheUint14
An unsigned integer type with 14 bits
FheUint16
An unsigned integer type with 16 bits
FheUint24
An unsigned integer type with 24 bits
FheUint32
An unsigned integer type with 32 bits
FheUint40
An unsigned integer type with 40 bits
FheUint48
An unsigned integer type with 48 bits
FheUint56
An unsigned integer type with 56 bits
FheUint64
An unsigned integer type with 64 bits
FheUint72
An unsigned integer type with 72 bits
FheUint80
An unsigned integer type with 80 bits
FheUint88
An unsigned integer type with 88 bits
FheUint96
An unsigned integer type with 96 bits
FheUint10ConformanceParams
FheUint12ConformanceParams
FheUint14ConformanceParams
FheUint16Array
FheUint16ConformanceParams
FheUint16Slice
FheUint16SliceMut
FheUint24ConformanceParams
FheUint32Array
FheUint32ConformanceParams
FheUint32Slice
FheUint32SliceMut
FheUint40ConformanceParams
FheUint48ConformanceParams
FheUint56ConformanceParams
FheUint64Array
FheUint64ConformanceParams
FheUint64Slice
FheUint64SliceMut
FheUint72ConformanceParams
FheUint80ConformanceParams
FheUint88ConformanceParams
FheUint96ConformanceParams
FheUint104
An unsigned integer type with 104 bits
FheUint112
An unsigned integer type with 112 bits
FheUint120
An unsigned integer type with 120 bits
FheUint128
An unsigned integer type with 128 bits
FheUint136
An unsigned integer type with 136 bits
FheUint144
An unsigned integer type with 144 bits
FheUint152
An unsigned integer type with 152 bits
FheUint160
An unsigned integer type with 160 bits
FheUint168
An unsigned integer type with 168 bits
FheUint176
An unsigned integer type with 176 bits
FheUint184
An unsigned integer type with 184 bits
FheUint192
An unsigned integer type with 192 bits
FheUint200
An unsigned integer type with 200 bits
FheUint208
An unsigned integer type with 208 bits
FheUint216
An unsigned integer type with 216 bits
FheUint224
An unsigned integer type with 224 bits
FheUint232
An unsigned integer type with 232 bits
FheUint240
An unsigned integer type with 240 bits
FheUint248
An unsigned integer type with 248 bits
FheUint256
An unsigned integer type with 256 bits
FheUint512
An unsigned integer type with 512 bits
FheUint104ConformanceParams
FheUint112ConformanceParams
FheUint120ConformanceParams
FheUint128Array
FheUint128ConformanceParams
FheUint128Slice
FheUint128SliceMut
FheUint136ConformanceParams
FheUint144ConformanceParams
FheUint152ConformanceParams
FheUint160ConformanceParams
FheUint168ConformanceParams
FheUint176ConformanceParams
FheUint184ConformanceParams
FheUint192ConformanceParams
FheUint200ConformanceParams
FheUint208ConformanceParams
FheUint216ConformanceParams
FheUint224ConformanceParams
FheUint232ConformanceParams
FheUint240ConformanceParams
FheUint248ConformanceParams
FheUint256Array
FheUint256ConformanceParams
FheUint256Slice
FheUint256SliceMut
FheUint512ConformanceParams
FheUint1024
An unsigned integer type with 1024 bits
FheUint2048
An unsigned integer type with 2048 bits
FheUint1024ConformanceParams
FheUint2048ConformanceParams
FheUintArray
FheUintSlice
FheUintSliceMut
Result

Derive Macros§

Versionize
This derives the Versionize and Unversionize trait for the target type.