Parmesan
Parallel ARithMEticS on tfhe ENcrypted data
Parmesan implements selected parallel algorithms for multi-digit arithmetics over TFHE ciphertexts. Namely:
- addition/subtraction,
- scalar multiplication (i.e., multiplication by a known integer),
- multiplication,
- squaring,
- signum,
- maximum of two numbers,
- rounding, and
- evaluation of a simple neural network.
Disclaimer: Parmesan is currently an experimental library, which serves as a proof-of-concept for parallelizable arithmetics over encrypted data. Hence neither correct functionality nor any level of code quality is guaranteed.
The Short Story
In the standard integer representation, parallel addition is not possible due to the carry, which can propagate all the way from the LSB to the MSB.
However, using, e.g., an alphabet {-1,0,1} for base-2 integer representation, a parallel addition algorithm does exist.
Other operations like (scalar) multiplication and squaring benefit from the fast addition, too.
The Long Story
See our full paper (also at eprint).
Use parmesan
Add a dependency to your Cargo.toml file in your Rust project.
[]
= { = "^0.0.20-alpha", = ["measure"] }
= "^2.0.0"
For the best performance, compile with
$ RUSTFLAGS="-C target-cpu=native" cargo build --release
Example
use Error;
use Colorize;
use params;
use *;
use ParmesanUserovo;
use ParmesanCloudovo;
use ParmArithmetics;
License
Parmesan is licensed under AGPLv3.
Acknowledgments
Partially supported by EURECOM.