mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
This pass calculates the squared Minimal Arithmetic Noise Padding (MANP) for each operation of a function and stores the result in an integer attribute named "sqMANP". This metric is identical to the squared 2-norm of the constant vector of an equivalent dot product between a vector of encrypted integers resulting directly from an encryption and a vector of plaintext constants. The pass supports the following operations: - HLFHE.dot_eint_int - HLFHE.zero - HLFHE.add_eint_int - HLFHE.add_eint - HLFHE.sub_int_eint - HLFHE.mul_eint_int - HLFHE.apply_lookup_table If any other operation is encountered, the pass conservatively fails. The pass further makes the optimistic assumption that all values passed to a function are either the direct result of an encryption of a noise-refreshing operation.
Building the compiler
Generate the compiler build system, in the build directory
cmake -B build . -DLLVM_DIR=$LLVM_PROJECT/build/lib/cmake/llvm -DMLIR_DIR=$LLVM_PROJECT/build/lib/cmake/mlir
Build the compiler
make -C build/ zamacompiler
Run the compiler
./build/src/zamacompiler