Release 3.5.0
Hotfix - 4/30/2020
- Fixed a critical bug (Issue 166) in
Evaluator::multiply_plain_inplace
. Thanks s0l0ist!
Hotfix - 4/29/2020
- Switched to using Microsoft GSL v3.0.1 and fixed minor GSL related issues in
CMakeLists.txt
. - Fixed some typos in README.md.
- Fixes bugs in ADO pipelines files.
New Features
- Microsoft SEAL officially supports Android (Xamarin.Android) on ARM64.
- Microsoft SEAL is a CMake project (UNIX-like systems only):
- There is now a top-level
CMakeLists.txt
that builds all native components. - The following CMake targets are created:
SEAL::seal
(static library),SEAL::seal_shared
(shared library; optional),SEAL::sealc
(C export library; optional). - Examples and unit tests are built if enabled through CMake (see README.md).
- ZLIB is downloaded and compiled by CMake and automatically included in the library.
- Microsoft GSL is downloaded by CMake. Its header files are copied to
native/src/gsl
and installed with Microsoft SEAL. - Google Test is downloaded and compiled by CMake.
- There is now a top-level
- Improved serialization:
Serialization::SEALHeader
layout has been changed. SEAL 3.4 objects can still be loaded by SEAL 3.5, and the headers are automatically converted to SEAL 3.5 format.Serialization::SEALHeader
captures version number information.- Added examples for serialization.
- The seeded versions of
Encryptor
's symmetric-key encryption andKeyGenerator
'sRelinKeys
andGaloisKeys
generation now outputSerializable
objects. See more details in API Changes below.
For Library Developers and Contributors
We have created a set of C++ iterators that easily allows looping over polynomials in a ciphertext, over RNS components in a polynomial, and over coefficients in an RNS component. There are also a few other iterators that can come in handy. Currently Evaluator
fully utilizes these, and in the future the rest of the library will as well.
The iterators are primarily intended to be used with std::for_each_n
to simplify existing code and help with code correctness. Please see native/src/seal/util/iterator.h for guidance on how to use these.
We have also completely rewritten the RNS tools that were previously in the util::BaseConverter
class. This functionality is now split between two classes: util::BaseConverter
whose sole purpose is to perform the FastBConv
computation of [BEHZ16] and util::RNSTool
that handles almost everything else. RNS bases are now represented by the new util::RNSBase
class.
API Changes
The following changes are explained in C++ syntax and are introduced to .NET wrappers similarly:
- New generic class
Serializable
wrapsCiphertext
,RelinKeys
, andGaloisKeys
objects to provide a more flexible approach to the functionality provided in release 3.4 byKeyGenerator::[relin|galois]_keys_save
andEncryptor::encrypt_[zero_]symmetric_save
functions. Specifically, these functions have been removed and replaced with overloads ofKeyGenerator::[relin|galois]_keys
andEncryptor::encrypt_[zero_]symmetric
that returnSerializable
objects. TheKeyGenerator::[relin|galois]_keys
methods in release 3.4 are renamed toKeyGenerator::[relin|galois]_keys_local
. TheSerializable
objects cannot be used directly by the API, and are only intended to be serialized, which activates the compression functionalities introduced earlier in release 3.4. SmallModulus
class is renamed toModulus
, and is relocated to native/src/seal/modulus.h.*coeff_mod_count*
methods are renamed to*coeff_modulus_size*
, which applies to many classes.parameter_error_name
andparameter_error_message
methods are added toEncryptionParameterQualifiers
andSEALContext
classes to explain why anEncryptionParameters
object is invalid.- The data members and layout of
Serialization::SEALHeader
have changed.
The following changes are specific to C++:
- New bounds in native/src/seal/util/defines.h:
SEAL_POLY_MOD_DEGREE_MAX
is increased to 131072; values bigger than 32768 require the security check to be disabled by passingsec_level_type::none
toSEALContext::Create
.SEAL_COEFF_MOD_COUNT_MAX
is increased to 64.SEAL_MOD_BIT_COUNT_MAX
andSEAL_MOD_BIT_COUNT_MIN
are added and set to 61 and 2, respectively.SEAL_INTERNAL_MOD_BIT_COUNT
is added and set to 61.
EncryptionParameterQualifiers
now has an error codeparameter_error
that interprets the reason why anEncryptionParameters
object is invalid.bool parameters_set()
is added to replace the previousbool parameters_set
member.
The following changes are specific to .NET:
- Version numbers are retrievable in .NET through
SEALVersion
class.
Other Changes
- Releases are now listed on releases page.
- The native library can serialize (save and load) objects larger than 4 GB. Please be aware that compressed serialization requires an additional temporary buffer roughly the size of the object to be allocated, and the streambuffer for the output stream may consume some non-trivial amount of memory as well. In the .NET library, objects are limited to 2 GB, and loading an object larger than 2 GB will throw an exception.(Issue 142)
- Larger-than-suggested parameters are supported for expert users. To enable that, please adjust
SEAL_POLY_MOD_DEGREE_MAX
andSEAL_COEFF_MOD_COUNT_MAX
in native/src/seal/util/defines.h.(Issue 150, Issue 84) - Serialization now clearly indicates an insufficient buffer size error.(Issue 117)
- Unsupported compression mode now throws
std::invalid_argument
(native) orArgumentException
(.NET). - There is now a
.clang-format
for automated formatting of C++ (.cpp
and.h
) files. Executetools/scripts/clang-format-all.sh
for easy formatting (UNIX-like systems only). This is compatible with clang-format-9 and above. Formatting for C# is not yet supported.(Issue 93) - The C export library previously in
dotnet/native/
is moved to native/src/seal/c/ and renamed to SEAL_C to support building of wrapper libraries in languages like .NET, Java, Python, etc. - The .NET wrapper library targets .NET Standard 2.0, but the .NET example and test projects use C# 8.0 and require .NET Core 3.x. Therefore, Visual Studio 2017 is no longer supported for building the .NET example and test projects.
- Fixed issue when compiling in FreeBSD.(PR 113)
- A bug in the [BEHZ16]-style RNS operations is fixed; proper unit tests are added.
- Performance of methods in
Evaluator
are in general improved.(PR 148) This is compiler-dependent, however, and currently Clang seems to produce the fastest running code for Microsoft SEAL.
File Changes
Renamed files and directories:
- dotnet/examples/7_Performance.cs was previously
dotnet/examples/6_Performance.cs
- native/examples/7_performance.cpp was previously
native/examples/6_performance.cpp
- native/src/seal/c/ was previously
dotnet/native/sealnet
. - native/src/seal/util/ntt.h was previously
native/src/seal/util/smallntt.h
. - native/src/seal/util/ntt.cpp was previously
native/src/seal/util/smallntt.cpp
. - native/tests/seal/util/ntt.cpp was previously
native/tests/seal/util/smallntt.cpp
.
New files:
- android/
- dotnet/examples/6_Serialization.cs
- dotnet/src/Serializable.cs
- dotnet/src/Version.cs
- dotnet/tests/SerializationTests.cs
- native/examples/6_serialization.cpp
- native/src/seal/c/version.h
- native/src/seal/c/version.cpp
- native/src/seal/util/galois.h
- native/src/seal/util/galois.cpp
- native/src/seal/util/hash.cpp
- native/src/seal/util/iterator.h
- native/src/seal/util/rns.h
- native/src/seal/util/rns.cpp
- native/src/seal/util/streambuf.h
- native/src/seal/util/streambuf.cpp
- native/src/seal/serializable.h
- native/tests/seal/util/iterator.cpp
- native/tests/seal/util/galois.cpp
- native/tests/seal/util/rns.cpp
Removed files:
dotnet/src/SmallModulus.cs
is merged to dotnet/src/ModulusTests.cs.dotnet/tests/SmallModulusTests.cs
is merged to dotnet/tests/ModulusTests.cs.native/src/seal/util/baseconverter.h
native/src/seal/util/baseconverter.cpp
native/src/seal/smallmodulus.h
is merged to native/src/seal/modulus.h.native/src/seal/smallmodulus.cpp
is merged to native/src/seal/modulus.cpp.native/src/seal/c/smallmodulus.h
is merged to native/src/seal/c/modulus.h.native/src/seal/c/smallmodulus.cpp
is merged to native/src/seal/c/modulus.cpp.native/tests/seal/smallmodulus.cpp
is merged to native/tests/seal/modulus.cpp.native/tests/seal/util/baseconverter.cpp