From 691373b36de367a8805ed6b5370e790bd62e3319 Mon Sep 17 00:00:00 2001 From: Bogdan Cebere Date: Fri, 18 Mar 2022 09:31:34 +0200 Subject: [PATCH] SEAL 4.0 (#381) * master -> main * SEAL 4.0 * linting * update tests --- cmake/seal.cmake | 2 +- setup.py | 2 +- tenseal/deps.bzl | 6 +++--- tenseal/sealapi/sealapi_modulus.cpp | 3 ++- tenseal/version.py | 2 +- tests/python/sealapi/test_sanity.py | 4 ++-- third_party/seal.BUILD | 8 ++++---- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/cmake/seal.cmake b/cmake/seal.cmake index ba925c61..a0936542 100644 --- a/cmake/seal.cmake +++ b/cmake/seal.cmake @@ -7,7 +7,7 @@ set(SEAL_USE_INTEL_HEXL OFF) FetchContent_Declare( com_microsoft_seal GIT_REPOSITORY https://github.com/microsoft/SEAL - GIT_TAG v3.7.2 #v3.7.2 + GIT_TAG v4.0.0 #v4.0.0 ) FetchContent_MakeAvailable(com_microsoft_seal) diff --git a/setup.py b/setup.py index 3153ad77..b04cb1e9 100644 --- a/setup.py +++ b/setup.py @@ -64,7 +64,7 @@ def build_extension(self, ext): build_args += ["--", "/m", "/p:TrackFileAccess=false"] else: cmake_args += ["-DCMAKE_BUILD_TYPE=" + cfg] - build_args += ["--", "-j", "2"] + build_args += ["--", "-j"] env = os.environ.copy() env["CXXFLAGS"] = '{} -DVERSION_INFO=\\"{}\\"'.format( diff --git a/tenseal/deps.bzl b/tenseal/deps.bzl index a87c8728..b9b4feef 100644 --- a/tenseal/deps.bzl +++ b/tenseal/deps.bzl @@ -26,9 +26,9 @@ def tenseal_deps(): http_archive( name = "com_microsoft_seal", build_file = "//third_party:seal.BUILD", - strip_prefix = "SEAL-3.7.2", - sha256 = "12676de5766b8e2d641d6e45e92114ccdf8debd6f6d44b42a2ecc39a59b0bf13", - urls = ["https://github.com/microsoft/SEAL/archive/v3.7.2.tar.gz"], + strip_prefix = "SEAL-4.0.0", + sha256 = "616653498ba8f3e0cd23abef1d451c6e161a63bd88922f43de4b3595348b5c7e", + urls = ["https://github.com/microsoft/SEAL/archive/v4.0.0.tar.gz"], ) if "com_xtensorstack_xtensor" not in native.existing_rules(): diff --git a/tenseal/sealapi/sealapi_modulus.cpp b/tenseal/sealapi/sealapi_modulus.cpp index 9e34ba8e..fcb438d9 100644 --- a/tenseal/sealapi/sealapi_modulus.cpp +++ b/tenseal/sealapi/sealapi_modulus.cpp @@ -64,7 +64,8 @@ void bind_seal_modulus(pybind11::module &m) { py::class_(m, "CoeffModulus") .def_static("MaxBitCount", &CoeffModulus::MaxBitCount) .def_static("BFVDefault", &CoeffModulus::BFVDefault) - .def_static("Create", &CoeffModulus::Create); + .def_static("Create", py::overload_cast>( + &CoeffModulus::Create)); py::class_(m, "PlainModulus") .def_static("Batching", py::overload_cast( diff --git a/tenseal/version.py b/tenseal/version.py index 4ad67eb7..771bc6e6 100644 --- a/tenseal/version.py +++ b/tenseal/version.py @@ -1 +1 @@ -__version__ = "0.3.8" +__version__ = "0.3.9" diff --git a/tests/python/sealapi/test_sanity.py b/tests/python/sealapi/test_sanity.py index f51e4614..0bef5673 100644 --- a/tests/python/sealapi/test_sanity.py +++ b/tests/python/sealapi/test_sanity.py @@ -23,8 +23,8 @@ def test_serialization_sanity(): header = sealapi.Serialization.SEALHeader() assert header.magic == 0xA15E assert header.header_size == 0x10 - assert header.version_major == 3 - assert header.version_minor == 0x7 + assert header.version_major == 4 + assert header.version_minor == 0 assert header.compr_mode == sealapi.COMPR_MODE_TYPE.NONE assert header.size == 0 assert header.reserved == 0 diff --git a/third_party/seal.BUILD b/third_party/seal.BUILD index 23f0b68c..a88f2d92 100644 --- a/third_party/seal.BUILD +++ b/third_party/seal.BUILD @@ -23,8 +23,8 @@ cmake_external( "make", "make install", ], - out_include_dir = "include/SEAL-3.7", - static_libraries = ["libseal-3.7.a"], + out_include_dir = "include/SEAL-4.0", + static_libraries = ["libseal-4.0.a"], visibility = ["//visibility:public"], ) @@ -44,8 +44,8 @@ cmake_external( install_prefix = "native/src", lib_source = ":src", make_commands = ["make"], - out_include_dir = "include/SEAL-3.7", - static_libraries = ["libseal-3.7.a"], + out_include_dir = "include/SEAL-4.0", + static_libraries = ["libseal-4.0.a"], visibility = ["//visibility:public"], )