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§
- array
integer
- backward_
compatibility integer
- boolean
boolean
- Welcome to the TFHE-rs
boolean
module documentation! - conformance
- core_
crypto - Welcome to the TFHE-rs
core_crypto
module documentation! - error
- integer
integer
- Welcome to the TFHE-rs
integer
module documentation! - named
- prelude
integer
- 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
- shortint
shortint
- Welcome to the TFHE-rs
shortint
module documentation! - strings
strings
- upgrade
integer
- xof_
key_ set integer
- zk
zk-pok
Macros§
- map_
ct_ ct - Easily map an Hpu operation to std::ops rust trait
Structs§
- Client
Key - Key of the client
- Compact
Ciphertext List - Compact
Ciphertext List Builder - Compact
Ciphertext List Expander - Compact
Public Key - A more compact public key
- Compressed
Ciphertext List - Compressed
Ciphertext List Builder - Compressed
Compact Public Key - Compressed variant of CompactPublicKey
- Compressed
FheBool - Compressed FheBool
- Compressed
FheInt - Compressed FheInt
- Compressed
FheUint - Compressed FheUint
- CompressedKV
Store - Compressed KVStore
- Compressed
Public Key - Compressed classical public key.
- Compressed
Server Key - Compressed ServerKey
- Compressed
Squashed Noise Ciphertext List - Compressed ciphertext list for squashed noise ciphertext
- Compressed
Squashed Noise Ciphertext List Builder - Builder to create CompressedSquashedNoiseCiphertextList
- Config
- The config type
- Config
Builder - The builder to create your config
- Cuda
Server Key gpu
- Custom
Multi GpuIndexes gpu
- FheAscii
String strings
- FheBool
- The FHE boolean data type.
- FheBool
Conformance Params - FheBool
Id - FheInt
- A Generic FHE signed integer
- FheInt2
Id - Id for the FheInt2 data type.
- FheInt4
Id - Id for the FheInt4 data type.
- FheInt6
Id - Id for the FheInt6 data type.
- FheInt8
Id - Id for the FheInt8 data type.
- FheInt10
Id - Id for the FheInt10 data type.
- FheInt12
Id - Id for the FheInt12 data type.
- FheInt14
Id - Id for the FheInt14 data type.
- FheInt16
Id - Id for the FheInt16 data type.
- FheInt24
Id - Id for the FheInt24 data type.
- FheInt32
Id - Id for the FheInt32 data type.
- FheInt40
Id - Id for the FheInt40 data type.
- FheInt48
Id - Id for the FheInt48 data type.
- FheInt56
Id - Id for the FheInt56 data type.
- FheInt64
Id - Id for the FheInt64 data type.
- FheInt72
Id - Id for the FheInt72 data type.
- FheInt80
Id - Id for the FheInt80 data type.
- FheInt88
Id - Id for the FheInt88 data type.
- FheInt96
Id - Id for the FheInt96 data type.
- FheInt104
Id - Id for the FheInt104 data type.
- FheInt112
Id - Id for the FheInt112 data type.
- FheInt120
Id - Id for the FheInt120 data type.
- FheInt128
Id - Id for the FheInt128 data type.
- FheInt136
Id - Id for the FheInt136 data type.
- FheInt144
Id - Id for the FheInt144 data type.
- FheInt152
Id - Id for the FheInt152 data type.
- FheInt160
Id - Id for the FheInt160 data type.
- FheInt168
Id - Id for the FheInt168 data type.
- FheInt176
Id - Id for the FheInt176 data type.
- FheInt184
Id - Id for the FheInt184 data type.
- FheInt192
Id - Id for the FheInt192 data type.
- FheInt200
Id - Id for the FheInt200 data type.
- FheInt208
Id - Id for the FheInt208 data type.
- FheInt216
Id - Id for the FheInt216 data type.
- FheInt224
Id - Id for the FheInt224 data type.
- FheInt232
Id - Id for the FheInt232 data type.
- FheInt240
Id - Id for the FheInt240 data type.
- FheInt248
Id - Id for the FheInt248 data type.
- FheInt256
Id - Id for the FheInt256 data type.
- FheInt512
Id - Id for the FheInt512 data type.
- FheInt1024
Id - Id for the FheInt1024 data type.
- FheInt2048
Id - Id for the FheInt2048 data type.
- FheUint
- A Generic FHE unsigned integer
- FheUint2
Id - Id for the FheUint2 data type.
- FheUint4
Id - Id for the FheUint4 data type.
- FheUint6
Id - Id for the FheUint6 data type.
- FheUint8
Id - Id for the FheUint8 data type.
- FheUint10
Id - Id for the FheUint10 data type.
- FheUint12
Id - Id for the FheUint12 data type.
- FheUint14
Id - Id for the FheUint14 data type.
- FheUint16
Id - Id for the FheUint16 data type.
- FheUint24
Id - Id for the FheUint24 data type.
- FheUint32
Id - Id for the FheUint32 data type.
- FheUint40
Id - Id for the FheUint40 data type.
- FheUint48
Id - Id for the FheUint48 data type.
- FheUint56
Id - Id for the FheUint56 data type.
- FheUint64
Id - Id for the FheUint64 data type.
- FheUint72
Id - Id for the FheUint72 data type.
- FheUint80
Id - Id for the FheUint80 data type.
- FheUint88
Id - Id for the FheUint88 data type.
- FheUint96
Id - Id for the FheUint96 data type.
- FheUint104
Id - Id for the FheUint104 data type.
- FheUint112
Id - Id for the FheUint112 data type.
- FheUint120
Id - Id for the FheUint120 data type.
- FheUint128
Id - Id for the FheUint128 data type.
- FheUint136
Id - Id for the FheUint136 data type.
- FheUint144
Id - Id for the FheUint144 data type.
- FheUint152
Id - Id for the FheUint152 data type.
- FheUint160
Id - Id for the FheUint160 data type.
- FheUint168
Id - Id for the FheUint168 data type.
- FheUint176
Id - Id for the FheUint176 data type.
- FheUint184
Id - Id for the FheUint184 data type.
- FheUint192
Id - Id for the FheUint192 data type.
- FheUint200
Id - Id for the FheUint200 data type.
- FheUint208
Id - Id for the FheUint208 data type.
- FheUint216
Id - Id for the FheUint216 data type.
- FheUint224
Id - Id for the FheUint224 data type.
- FheUint232
Id - Id for the FheUint232 data type.
- FheUint240
Id - Id for the FheUint240 data type.
- FheUint248
Id - Id for the FheUint248 data type.
- FheUint256
Id - Id for the FheUint256 data type.
- FheUint512
Id - Id for the FheUint512 data type.
- FheUint1024
Id - Id for the FheUint1024 data type.
- FheUint2048
Id - Id for the FheUint2048 data type.
- KVStore
- The KVStore is a specialized encrypted HashMap
- KeySwitching
Key - Proven
Compact Ciphertext List zk-pok
- Public
Key - Classical public key.
- ReRandomization
Context - The context in which the ciphertexts to re-randomized will be used.
- ReRandomization
Metadata - Metadata linked to a ciphertext that will be used when updating the
ReRandomizationContext
- ReRandomization
Seed Gen - A generator that can be used to obtain seeds needed to re-randomize individual ciphertexts.
- Seed
- A seed value, used to initialize a generator.
- Server
Key - Key of the server
- Squashed
Noise FheBool - Squashed
Noise FheInt - Squashed
Noise FheUint - Tag
- Tag
- XofSeed
- A Seed as described in the Threshold (Fully) Homomorphic Encryption
Enums§
- Compressed
ReRandomization KeySwitching Key - Cuda
GpuChoice gpu
- Device
integer
- Devices supported by tfhe-rs
- Encryptable
String strings
- FheString
IsEmpty strings
- FheString
Len strings
- FheTypes
integer
- ReRandomization
KeySwitching Key
Traits§
- FheId
- FheInt
Id - FheInteger
Type - FheUint
Id - HlCompactable
- HlCompressible
- HlExpandable
- HlSquashed
Noise Compressible - HlSquashed
Noise Expandable - Integer
Id - 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§
- Clear
Array - Compressed
FheInt2 - A compressed signed integer type with 2 bits
- Compressed
FheInt4 - A compressed signed integer type with 4 bits
- Compressed
FheInt6 - A compressed signed integer type with 6 bits
- Compressed
FheInt8 - A compressed signed integer type with 8 bits
- Compressed
FheInt10 - A compressed signed integer type with 10 bits
- Compressed
FheInt12 - A compressed signed integer type with 12 bits
- Compressed
FheInt14 - A compressed signed integer type with 14 bits
- Compressed
FheInt16 - A compressed signed integer type with 16 bits
- Compressed
FheInt24 - A compressed signed integer type with 24 bits
- Compressed
FheInt32 - A compressed signed integer type with 32 bits
- Compressed
FheInt40 - A compressed signed integer type with 40 bits
- Compressed
FheInt48 - A compressed signed integer type with 48 bits
- Compressed
FheInt56 - A compressed signed integer type with 56 bits
- Compressed
FheInt64 - A compressed signed integer type with 64 bits
- Compressed
FheInt72 - A compressed signed integer type with 72 bits
- Compressed
FheInt80 - A compressed signed integer type with 80 bits
- Compressed
FheInt88 - A compressed signed integer type with 88 bits
- Compressed
FheInt96 - A compressed signed integer type with 96 bits
- Compressed
FheInt104 - A compressed signed integer type with 104 bits
- Compressed
FheInt112 - A compressed signed integer type with 112 bits
- Compressed
FheInt120 - A compressed signed integer type with 120 bits
- Compressed
FheInt128 - A compressed signed integer type with 128 bits
- Compressed
FheInt136 - A compressed signed integer type with 136 bits
- Compressed
FheInt144 - A compressed signed integer type with 144 bits
- Compressed
FheInt152 - A compressed signed integer type with 152 bits
- Compressed
FheInt160 - A compressed signed integer type with 160 bits
- Compressed
FheInt168 - A compressed signed integer type with 168 bits
- Compressed
FheInt176 - A compressed signed integer type with 176 bits
- Compressed
FheInt184 - A compressed signed integer type with 184 bits
- Compressed
FheInt192 - A compressed signed integer type with 192 bits
- Compressed
FheInt200 - A compressed signed integer type with 200 bits
- Compressed
FheInt208 - A compressed signed integer type with 208 bits
- Compressed
FheInt216 - A compressed signed integer type with 216 bits
- Compressed
FheInt224 - A compressed signed integer type with 224 bits
- Compressed
FheInt232 - A compressed signed integer type with 232 bits
- Compressed
FheInt240 - A compressed signed integer type with 240 bits
- Compressed
FheInt248 - A compressed signed integer type with 248 bits
- Compressed
FheInt256 - A compressed signed integer type with 256 bits
- Compressed
FheInt512 - A compressed signed integer type with 512 bits
- Compressed
FheInt1024 - A compressed signed integer type with 1024 bits
- Compressed
FheInt2048 - A compressed signed integer type with 2048 bits
- Compressed
FheUint2 - Compressed
FheUint4 - Compressed
FheUint6 - Compressed
FheUint8 - Compressed
FheUint10 - Compressed
FheUint12 - Compressed
FheUint14 - Compressed
FheUint16 - Compressed
FheUint24 - Compressed
FheUint32 - Compressed
FheUint40 - Compressed
FheUint48 - Compressed
FheUint56 - Compressed
FheUint64 - Compressed
FheUint72 - Compressed
FheUint80 - Compressed
FheUint88 - Compressed
FheUint96 - Compressed
FheUint104 - Compressed
FheUint112 - Compressed
FheUint120 - Compressed
FheUint128 - Compressed
FheUint136 - Compressed
FheUint144 - Compressed
FheUint152 - Compressed
FheUint160 - Compressed
FheUint168 - Compressed
FheUint176 - Compressed
FheUint184 - Compressed
FheUint192 - Compressed
FheUint200 - Compressed
FheUint208 - Compressed
FheUint216 - Compressed
FheUint224 - Compressed
FheUint232 - Compressed
FheUint240 - Compressed
FheUint248 - Compressed
FheUint256 - Compressed
FheUint512 - Compressed
FheUint1024 - Compressed
FheUint2048 - CpuFhe
Bool Array - CpuFhe
Bool Slice - CpuFhe
Bool Slice Mut - CpuFhe
Int2 Array - CpuFhe
Int2 Slice - CpuFhe
Int2 Slice Mut - CpuFhe
Int4 Array - CpuFhe
Int4 Slice - CpuFhe
Int4 Slice Mut - CpuFhe
Int8 Array - CpuFhe
Int8 Slice - CpuFhe
Int8 Slice Mut - CpuFhe
Int16 Array - CpuFhe
Int16 Slice - CpuFhe
Int16 Slice Mut - CpuFhe
Int32 Array - CpuFhe
Int32 Slice - CpuFhe
Int32 Slice Mut - CpuFhe
Int64 Array - CpuFhe
Int64 Slice - CpuFhe
Int64 Slice Mut - CpuFhe
Int128 Array - CpuFhe
Int128 Slice - CpuFhe
Int128 Slice Mut - CpuFhe
Int256 Array - CpuFhe
Int256 Slice - CpuFhe
Int256 Slice Mut - CpuFhe
IntArray - CpuFhe
IntSlice - CpuFhe
IntSlice Mut - CpuFhe
Uint2 Array - CpuFhe
Uint2 Slice - CpuFhe
Uint2 Slice Mut - CpuFhe
Uint4 Array - CpuFhe
Uint4 Slice - CpuFhe
Uint4 Slice Mut - CpuFhe
Uint8 Array - CpuFhe
Uint8 Slice - CpuFhe
Uint8 Slice Mut - CpuFhe
Uint16 Array - CpuFhe
Uint16 Slice - CpuFhe
Uint16 Slice Mut - CpuFhe
Uint32 Array - CpuFhe
Uint32 Slice - CpuFhe
Uint32 Slice Mut - CpuFhe
Uint64 Array - CpuFhe
Uint64 Slice - CpuFhe
Uint64 Slice Mut - CpuFhe
Uint128 Array - CpuFhe
Uint128 Slice - CpuFhe
Uint128 Slice Mut - CpuFhe
Uint256 Array - CpuFhe
Uint256 Slice - CpuFhe
Uint256 Slice Mut - CpuFhe
Uint Array - CpuFhe
Uint Slice - CpuFhe
Uint Slice Mut - FheBool
Array - FheBool
Slice - FheBool
Slice Mut - 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
- FheInt2
Array - FheInt2
Conformance Params - FheInt2
Slice - FheInt2
Slice Mut - FheInt4
Array - FheInt4
Conformance Params - FheInt4
Slice - FheInt4
Slice Mut - FheInt6
Conformance Params - FheInt8
Array - FheInt8
Conformance Params - FheInt8
Slice - FheInt8
Slice Mut - 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
- FheInt10
Conformance Params - FheInt12
Conformance Params - FheInt14
Conformance Params - FheInt16
Array - FheInt16
Conformance Params - FheInt16
Slice - FheInt16
Slice Mut - FheInt24
Conformance Params - FheInt32
Array - FheInt32
Conformance Params - FheInt32
Slice - FheInt32
Slice Mut - FheInt40
Conformance Params - FheInt48
Conformance Params - FheInt56
Conformance Params - FheInt64
Array - FheInt64
Conformance Params - FheInt64
Slice - FheInt64
Slice Mut - FheInt72
Conformance Params - FheInt80
Conformance Params - FheInt88
Conformance Params - FheInt96
Conformance Params - 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
- FheInt104
Conformance Params - FheInt112
Conformance Params - FheInt120
Conformance Params - FheInt128
Array - FheInt128
Conformance Params - FheInt128
Slice - FheInt128
Slice Mut - FheInt136
Conformance Params - FheInt144
Conformance Params - FheInt152
Conformance Params - FheInt160
Conformance Params - FheInt168
Conformance Params - FheInt176
Conformance Params - FheInt184
Conformance Params - FheInt192
Conformance Params - FheInt200
Conformance Params - FheInt208
Conformance Params - FheInt216
Conformance Params - FheInt224
Conformance Params - FheInt232
Conformance Params - FheInt240
Conformance Params - FheInt248
Conformance Params - FheInt256
Array - FheInt256
Conformance Params - FheInt256
Slice - FheInt256
Slice Mut - FheInt512
Conformance Params - FheInt1024
- A signed integer type with 1024 bits
- FheInt2048
- A signed integer type with 2048 bits
- FheInt1024
Conformance Params - FheInt2048
Conformance Params - FheInt
Array - FheInt
Slice - FheInt
Slice Mut - 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
- FheUint2
Array - FheUint2
Conformance Params - FheUint2
Slice - FheUint2
Slice Mut - FheUint4
Array - FheUint4
Conformance Params - FheUint4
Slice - FheUint4
Slice Mut - FheUint6
Conformance Params - FheUint8
Array - FheUint8
Conformance Params - FheUint8
Slice - FheUint8
Slice Mut - 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
- FheUint10
Conformance Params - FheUint12
Conformance Params - FheUint14
Conformance Params - FheUint16
Array - FheUint16
Conformance Params - FheUint16
Slice - FheUint16
Slice Mut - FheUint24
Conformance Params - FheUint32
Array - FheUint32
Conformance Params - FheUint32
Slice - FheUint32
Slice Mut - FheUint40
Conformance Params - FheUint48
Conformance Params - FheUint56
Conformance Params - FheUint64
Array - FheUint64
Conformance Params - FheUint64
Slice - FheUint64
Slice Mut - FheUint72
Conformance Params - FheUint80
Conformance Params - FheUint88
Conformance Params - FheUint96
Conformance Params - 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
- FheUint104
Conformance Params - FheUint112
Conformance Params - FheUint120
Conformance Params - FheUint128
Array - FheUint128
Conformance Params - FheUint128
Slice - FheUint128
Slice Mut - FheUint136
Conformance Params - FheUint144
Conformance Params - FheUint152
Conformance Params - FheUint160
Conformance Params - FheUint168
Conformance Params - FheUint176
Conformance Params - FheUint184
Conformance Params - FheUint192
Conformance Params - FheUint200
Conformance Params - FheUint208
Conformance Params - FheUint216
Conformance Params - FheUint224
Conformance Params - FheUint232
Conformance Params - FheUint240
Conformance Params - FheUint248
Conformance Params - FheUint256
Array - FheUint256
Conformance Params - FheUint256
Slice - FheUint256
Slice Mut - FheUint512
Conformance Params - FheUint1024
- An unsigned integer type with 1024 bits
- FheUint2048
- An unsigned integer type with 2048 bits
- FheUint1024
Conformance Params - FheUint2048
Conformance Params - FheUint
Array - FheUint
Slice - FheUint
Slice Mut - Result
Derive Macros§
- Versionize
- This derives the
Versionize
andUnversionize
trait for the target type.