mirror of
https://github.com/luxfhe/torus.git
synced 2026-10-30 17:07:26 +00:00
The MLIR dialect, its conversion passes (TFHEToConcrete, ConcreteToCAPI, ConcreteToLLVM), the optimizer component, the compiler binary, the Rust crate and the program_info parameter file all still carried the upstream project's name. They now carry this one's. Two things deliberately keep the word, because in them it is not the name. mlir::OpTrait CRTP parameters mean "the derived type", so they are spelled Derived and OpTy — LLVM's other conventional spelling for the same idiom. concreteShape is a capnp field: renaming it would change the serialized protocol, and the prose describing it is ordinary English. This also repairs references the earlier partial rename left dangling: Security.cpp included concrete/curves.gen.h and the directory is torus/, torus-cpu.h included concrete-num_complex.h, the Torus dialect CMakeLists named ConcreteOps.td, and compiler/setup.py asked find_namespace_packages for a "concrete" package that no longer exists — so it built without the package it ships.
Torus optimizer
Torus Optimizer is a Rust library that find the best cryptographic parameters for a given TFHE homomorphic circuit. The goal if to minimize computation time under security and error constraints. Its main client is Torus Compiler. It is implemented in Rust and offers a C++ API. It also provides a CLI tool to provide parameters for simplified circuits.
Prerequisite
- Have a rust toolchain installed (the last stable version is supported) https://www.rust-lang.org/tools/install
Build
Torus Optimizer and its C++ interface are built automatically by Torus Compiler.
To build Torus Optimizer manually, run:
cargo build --release
Test
To run the tests, run:
cargo test --release
CLI tool Usage
Running ./optimizer prints a table of cryptographic parameters for different precisions and log2(norm2).
The tools accepts different options that can be recalled by:
./optimizer --help