Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork67
Microsoft SEAL 4.X For Python
License
Huelse/SEAL-Python
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
MicrosoftSEAL 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.
Recommend: Clang++ (>= 10.0) or GNU G++ (>= 9.4), CMake (>= 3.16)
# Optionalsudo apt-get install git build-essential cmake python3 python3-dev python3-pip# Get the repository or download from the releasesgit clone https://github.com/Huelse/SEAL-Python.gitcd SEAL-Python# Install dependenciespip3 install numpy pybind11# Init the SEAL and pybind11git submodule update --init --recursive# Get the newest repositories (dev only)# git submodule update --remote# Build the SEAL lib without the msgsl zlib and zstandard compressioncd SEALcmake -S. -B build -DSEAL_USE_MSGSL=OFF -DSEAL_USE_ZLIB=OFF -DSEAL_USE_ZSTD=OFFcmake --build buildcd ..# Run the setup.py, the dynamic library will be generated in the current directorypython3 setup.py build_ext -i# Testcp seal.*.so examplescd examplespython3 4_bgv_basics.py
Build examples:
-DSEAL_BUILD_EXAMPLES=ONVisual Studio 2019 or newer is required. x64 support only! And use thex64 Native Tools Command Prompt for VS command prompt to configure and build the Microsoft SEAL library. It's usually can be found in your Start Menu.
# Run in "x64 Native Tools Command Prompt for VS" command promptcmake -S. -B build -G Ninja -DSEAL_USE_MSGSL=OFF -DSEAL_USE_ZLIB=OFFcmake --build build# Buildpip install numpy pybind11python setup.py build_ext -i# Testcp seal.*.pyd examplescd examplespython 4_bgv_basics.py
Microsoft SEAL officialdocs.
requires:Docker
To build source code into a docker image (from this directory):
docker build -t huelse/seal -f Dockerfile.To use the image by running it as an interactive container:
docker run -it huelse/seal
See more in
examples/7_serialization.py, here is a simple example:cipher.save('cipher')load_cipher=Ciphertext()load_cipher.load(context,'cipher')# work if the context is valid.
Supported classes:
EncryptionParameters, Ciphertext, Plaintext, SecretKey, PublicKey, RelinKeys, GaloisKeysThere are a lot of changes in the latest SEAL lib, we try to make the API in python can be used easier, but it may remain some problems unknown, if any problems or bugs, reportissues.
Email:topmaxz@protonmail.com
ImportError: undefined symbol
Build a shared SEAL library
cmake . -DBUILD_SHARED_LIBS=ON, and get thelibseal.so,then change the path in
setup.py, and rebuild.ImportError: libseal.so... cannot find
a.
sudo ln -s /path/to/libseal.so /usr/libb. add
/usr/local/libor theSEAL/native/libto/etc/ld.so.confand refresh itsudo ldconfigc. build in cmake.
BuildError:
C++17 at least
x86_64 is required, which
x86_32is not supported
ModuleNotFoundError: No module named 'seal'
The
.soor.pydfile must be in the current directory, or you haveinstallit already.Windows Error LNK2001, RuntimeLibrary and MT_StaticRelease mismatch
Only
x64is supported, Choosex64 Native Tools Command Prompt for VS.Warning about building the dynamic library with static library in MacOS, etc.
Build a shared SEAL library by adding a CMake option
-DBUILD_SHARED_LIBS=ONEdit
extra_objectsin setup.py to*.dylibor else.
Professor:Dr. Chen
About
Microsoft SEAL 4.X For Python
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Contributors7
Uh oh!
There was an error while loading.Please reload this page.