Minor bug and typo fixes. Most importantly:
- Switched to using RNS rounding instead of RNS flooring to fix the CKKS accuracy issue reported in issue 52.
- Added support for QUIET option in CMake (
find_package(seal QUIET)
). - Using
[[nodiscard]]
attribute when compiling as C++17. - Fixed a bug in
Evaluator::multiply_many
where the input vector was changed.
Minor bug and typo fixes. Most importantly:
- A bug was fixed that introduced significant extra inaccuracy in CKKS when compiled on Linux, at least with some versions of glibc; Windows and macOS were not affected.
- A bug was fixed where, on 32-bit platforms, some versions of GCC resolved the util::reverse_bits function to the incorrect overload.
In this version, we have significantly improved the usability of the CKKS scheme in Microsoft SEAL and many of these improvements apply to the BFV scheme as well. Homomorphic operations that are based on key switching, i.e., relinearization and rotation, do not consume any noise budget (BFV) or impact accuracy (CKKS). The implementations of these operations are significantly simplified and unified, and no longer use bit decomposition, so decomposition bit count is gone. Moreover, fresh ciphertexts now have lower noise. These changes have an effect on the API and it will be especially worthwhile for users of older versions of the library to study the examples and comments in native/examples/3_levels.cpp (C++) or dotnet/examples/3_Levels.cs (C#).
The setup of EncryptionParameters
has been made both easier and safer
(see API Changes below).
The examples in native/examples/
and
dotnet/examples/
have been redesigned to better teach
the multiple technical concepts required to use Microsoft SEAL correctly and
efficiently, and more compactly demonstrate the API.
Deleted header files:
native/defaultparameters.h
New header files:
kswitchkeys.h
: new base class forRelinKeys
andGaloisKeys
)modulus.h
: static helper functions for parameter selectionvalcheck.h
: object validity check functionalityutil/rlwe.h
In class SEALContext
:
- Replaced
context_data(parms_id_type)
withget_context_data(parms_id_type)
; - Removed
context_data()
; - Added
key_context_data()
,key_parms_id()
,first_context_data()
, andlast_context_data()
; - Added
using_keyswitching()
that indicates whether key switching is upported in thisSEALContext
; Create(...)
in C++, and constructor in C#, now accepts an optional security level based on HomomorphicEncryption.org security standard, causing it to enforce the specified security level. By default a 128-bit security level is used.- Added
prev_context_data()
method to classContextData
(doubly linked modulus switching chain); - In C#
SEALContext
now has a public constructor.
Parameter selection:
- Removed the
DefaultParams
class; - Default
coeff_modulus
for the BFV scheme are now accessed through the functionCoeffModulus::BFVDefault(...)
. These moduli are not recommended for the CKKS scheme; - Customized
coeff_modulus
for the CKKS scheme can be created usingCoeffModulus::Create(...)
which takes thepoly_modulus_degree
and a vector of bit-lengths of the prime factors as arguments. It samples suitable primes close to 2^bit_length and returns a vector ofSmallModulus
elements. PlainModulus::Batching(...)
can be used to sample a prime forplain_modulus
that supportsBatchEncoder
for the BFV scheme.
Other important changes:
- Removed
size_capacity
function and data members fromCiphertext
class; - Moved all validation methods such as
is_valid_for
andis_metadata_valid_for
tovalcheck.h
; - Removed argument
decomposition_bit_count
from methodsrelin_keys(...)
andgalois_keys(...)
in classKeyGenerator
; - It is no longer possible to create more than one relinearization key. This is to simplify the API and reduce confusion. We have never seen a real use-case where more relinearization keys would be a good idea;
- Added methods to generate an encryption of zero to
Encryptor
; - Added comparison methods and primality check for
SmallModulus
; - Classes
RelinKeys
andGaloisKeys
are now derived from a common base classKSwitchKeys
; - GoogleTest framework is now included as a Git submodule;
- Numerous bugs have been fixed, particularly in the .NET wrappers.