This document describes the C bindings to the TFHE-rs high-level primitives for creating Fully Homomorphic Encryption (FHE) programs.
You can build TFHE-rs C API on a Unix x86_64 machine using the following command:
For a Unix aarch64 machine, use the following command:
Locate files in the right path:
In ${REPO\_ROOT}/target/release/
, you can find:
The tfhe.h
header
The static (.a) and dynamic (.so) libtfhe
binaries
In ${REPO\_ROOT}/target/release/deps/
, you can find:
The tfhe-c-api-dynamic-buffer.h
header
The static (.a) and dynamic (.so) libraries
Ensure your build system configures the C or C++ program links against TFHE-rs C API binaries and the dynamic buffer library.
The following is a minimal CMakeLists.txt
configuration example:
TFHE-rs C API
.The following example demonstrates uint128 subtraction using the TFHE-rs C API:
WARNING: this example omits proper memory management in the error case to improve code readability.
Ensure the above CMakeLists.txt
and main.c
files are in the same directory. Use the following commands to execute the example: