Skip to content

Julia bindings for the homomorphic encryption library OpenFHE

License

Notifications You must be signed in to change notification settings

sloede/openfhe-julia

Repository files navigation

OpenFHE-julia

Build Status License: BSD 2-Clause DOI

Julia bindings for the homomorphic encryption library OpenFHE based on CxxWrap.jl. This repository is mainly interesting for those who want to extend the set of OpenFHE features that are available in Julia. If you just want to use OpenFHE in Julia, please have a look at OpenFHE.jl.

Installation

  1. Locally build and install OpenFHE. For example on Linux:

    git clone git@github.com:openfheorg/openfhe-development.git
    cd openfhe-development
    mkdir build && cd build
    cmake .. -DCMAKE_INSTALL_PREFIX=../install \
        -DBUILD_BENCHMARKS=OFF -DBUILD_UNITTESTS=OFF \
        -DLIBINSTALL="$(dirname $(pwd))/install/lib"
    make -j 4
    make install

    Sometimes it might be necessary to explicitly enable the BE2 and BE4 backends by providing -DWITH_BE2=ON -DWITH_BE4=ON to CMake. In case you would like to include the benchmarks and/or unit tests, you can enable them again by removing the respective flag that disables them.

    Note: The argument -DLIBINSTALL=... may be removed once this issue has been resolved upstream.

  2. Locally build and install libcxxwrap-julia. For example on Linux:

    git clone git@github.com:JuliaInterop/libcxxwrap-julia.git
    cd libcxxwrap-julia
    git checkout v0.11.2
    mkdir build && cd build
    cmake .. -DCMAKE_INSTALL_PREFIX=../install
    make -j 4
    make install

    The version tag in the line git checkout <version> should be updated to the latest libcxxwrap-julia version that is compatible with the current release of CxxWrap.jl release (see here for further information).

  3. Clone this repository:

    git clone git@github.com:sloede/openfhe-julia.git
  4. Create a build directory and switch to it. Then call CMake with the CMAKE_PREFIX_PATH set to a colon-separated list of install prefixes for the dependencies, e.g.:

    cd openfhe-julia
    mkdir build && cd build
    prefix_path="$(pwd)/../../libcxxwrap-julia/install/;$(pwd)/../../openfhe-development/install/"
    cmake .. -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_PREFIX_PATH="$prefix_path"
    make -j 4
    make install

Development

Unfortunately, there is not much documentation for developers available at the moment. The little we have can be found in development.md.

Referencing

If you use OpenFHE-julia in your own research, please cite this repository as follows:

@misc{schlottkelakemper2024openfhejulia,
  title={{O}pen{FHE}-julia: {J}ulia bindings for the homomorphic encryption library {O}pen{FHE}},
  author={Schlottke-Lakemper, Michael},
  year={2024},
  howpublished={\url{https://github.com/sloede/openfhe-julia}},
  doi={10.5281/zenodo.10456858}
}

Note that if you only use OpenFHE-julia as part of OpenFHE.jl, it is sufficient to cite OpenFHE.jl.

Authors

OpenFHE-julia was initiated by Michael Schlottke-Lakemper (RWTH Aachen University/High-Performance Computing Center Stuttgart (HLRS), Germany), who is also its principal maintainer.

Further contributions to OpenFHE-julia have been made by the following people:

License and contributing

OpenFHE-julia is available under the BSD 2-Clause license (see LICENSE.md). OpenFHE itself is also available under the BSD 2-Clause license.

Contributions by the community are very welcome! A good start would be to compare the examples folder in OpenFHE.jl (link) and in OpenFHE (link) and to port a missing example file to OpenFHE.jl. In case some OpenFHE functionality is not yet exposed by OpenFHE-julia, it would have to be added there first.