This document provides basic instructions to configure the Rust toolchain and features for TFHE-rs.
TFHE-rs requires a nightly Rust toolchain to build the C API and utilize advanced SIMD instructions. However, for other uses, a stable toolchain (version 1.73 or later) is sufficient.
Follow the following instructions to install the necessary Rust toolchain:
You can set the toolchain using either of the following methods.
Manually specify the toolchain for each cargo command:
Override the toolchain for the current project:
To verify the default toolchain used by Cargo, execute:
TFHE-rs provides various cargo features to customize the types and features used.
This crate provides 3 kinds of data types. Each kind is enabled by activating the corresponding feature in the TOML line and has multiple types:
While the library generally selects automatically the best instruction sets available by the host, in the case of 'AVX-512', you have to choose it explicitly. This requires to use a nightly toolchain with the feature nightly-avx512
.
Kind | Features | Type (s) |
---|---|---|
Booleans
boolean
Booleans
ShortInts
shortint
Short integers
Integers
integer
Arbitrary-sized integers