Huelse / SEAL-Python

Microsoft SEAL 4.X For Python
MIT License
324 stars 65 forks source link
encryption he homomorphic-encryption microsoft-seal pyseal python-bindings seal seal-python

Microsoft SEAL For Python

Microsoft SEAL is an easy-to-use open-source (MIT licensed) homomorphic encryption library developed by the Cryptography Research group at Microsoft.

pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code.

This is a python binding for the Microsoft SEAL library.

Contents

Build

Note

FAQ

  1. ImportError: undefined symbol

    Build a shared SEAL library cmake . -DBUILD_SHARED_LIBS=ON, and get the libseal.so,

    then change the path in setup.py, and rebuild.

  2. ImportError: libseal.so... cannot find

    a. sudo ln -s /path/to/libseal.so /usr/lib

    b. add /usr/local/lib or the SEAL/native/lib to /etc/ld.so.conf and refresh it sudo ldconfig

    c. build in cmake.

  3. BuildError:

    1. C++17 at least

    2. x86_64 is required, which x86_32 is not supported

  4. ModuleNotFoundError: No module named 'seal'

    The .so or .pyd file must be in the current directory, or you have install it already.

  5. Windows Error LNK2001, RuntimeLibrary and MT_StaticRelease mismatch

    Only x64 is supported, Choose x64 Native Tools Command Prompt for VS.

  6. Warning about building the dynamic library with static library in MacOS, etc.

    1. Build a shared SEAL library by adding a CMake option -DBUILD_SHARED_LIBS=ON

    2. Edit extra_objects in setup.py to *.dylib or else.

Contributing