All notable changes to this library are documented in this file.
Changes affecting the entire library:
-
Extensive refactoring of the
Ring
object (see below). -
Refactored how polynomials and their derivative structs (e.g. ciphertexts and keys) are instantiated. They now all have the following methods:
.FromBuffer
which allow to assign a new backing to the receiver from an[]uint64
slice.BufferSize
which returns the minimum size of the[]uint64
slice to provide to.FromBuffer
-
Calling
New<Something>
will internally call the two here above methods -
Removed the package
ring/ringqp
: all instances ofRingQP
have been replaced by separate calls toRingQ
andRingP
. New associated structs have been designed to replace the oldringqp.Poly
(see changes to thering
package) -
Refactored all sampling (see changes to
utils/sampling
), improves related performance by a speedup factor of up to 2x -
Replaced most instances of
[]*<object>
by[]<object>
, for example[]*big.Float -> []big.Float
-
Optimized the buffers and their size of many objects.
-
he
:- Linear Transformations:
- Generalized implementation of linear transformation such that package specific code (e.g.
heint
orhefloat
) is not necessary anymore. - Significantly improved the search for the best giant step size, which is not anymore constrained to a power of two:
- Added
OptimalLinearTransformationGiantStep
which replacesFindBestBSGSRatio
and returns much more optimal values (not constrained to be a power of two anymore) that properly minimize the number of Galois elements. - Removed the
LogBSGSRatio
from theLinearTransformationParameters
:- Removed the
LogBSGSRatio
field. - Removed the
Naive
field. - Added the
GiantStep
field.
- Removed the
- LinearTransformationParameters:
- Added
GaloisElements
: returns the set of Galois elements necessary to evaluate the diagonalized matrix.
- Added
- LinearTransformation:
- Removed the
LogBabyStepGianStepRatio
field. - Removed the
N1
field. - Added the
GiantStep
field.
- Removed the
- Diagonals (diagonalized matrix):
- Added
Add
: add two diagonalized matrices together. - Added
Mul
: multiply ttwo diagonalized matrices together. - Added
Indexes
: returns the indexes of the non-zero diagonals of the diagonalized matrix. - Added
GaloisElements
: returns the set of Galois elements necessary to evaluate the diagonalized matrix. - Added
At
: returns a specific diagonal of the diagonalized matrix. - Added `Evaluate: evaluates the diagonalized matrix on a vector.
- Added
- Permutation (permutation matrix):
- Added
Indexes
: returns the indexes of the non-zero diagonals of the permutation. - Added
Diagonals
: returns the diagonalized matrix of the permutation. - Added
GaloisElements
: returns the set of Galois elements necessary to evaluate the permutation.
- Added
- Generalized implementation of linear transformation such that package specific code (e.g.
- Improved relinearization patterns when evaluating a polynomial with the flag
lazy=true
- Polynomial Evaluation:
- The output of polynomial evaluation is not rescaled anymore, enabling more optimal noise management.
- Added
EncodedPolynomial
type, a pre-encodedVectorPolynomial
intorlwe.Plaintext
. PolynomialVector
:- Simplified the field
Mapping
which now takes a single slices as mapping, instead of a map of slices. - Added
Evaluate
.
- Simplified the field
- Linear Transformations:
-
heint
:- Added support for prime power plaintext modulus.
- Merged
schemes/bgv/
intoheint
. - Removed package specific code for linear transformations (this functionality now solely depends on the
he
package).
-
hefloat
:-
Bootstrapping:
- Added EvalRound+
- Reworked
Parameters
andParametersLiteral
. - Fixed wrong returned
MinimumInputLevel
. - Added API to estimate the failure probability:
FailureProbability
returns PR[||I(X)|| > K].FindSuitableK
returns the smallest K satisfying PR[||I(X)|| > K] <= 2^{logfailure}.ModifiedIrwinHall
estimates PR[||I(X)|| > K].
-
Evaluator:
- Added
MatchScalesForMul
- Added
-
InverseEvaluator:
- Changed
log2Min
andlog2Max
toMin
andMax
respectively. This enables a more human friendly parameterization. - Added
InvSqrt
, which returns 1/sqrt(x) by Newton iterations. Contrary to the GoldschmidtDivision algorithm, it can be used to refine a value already close to the ideal value, enabling composition with polynomial approximation. - GoldschmidtDivision takes as operand the number of iterations instead of automatically estimating them.
- IntervalNormalization uses one less level per iteration (2 instead of 3), and use one less bootstrapping per iteration if using the Conjugate Invariant ring.
- Changed
-
Added affine transformation for EvalMod1.
-
Merged
schemes/ckks
intohefloat
. -
Removed package specific code for linear transformations (this functionality now solely depends on the
he
package). -
Improved statistics, which now also display the standard deviation as well as the error statistics.
-
hefloat/bootstrapping
:- Improved serialization support for
bootstrapping.ParametersLiteral
.
- Improved serialization support for
-
-
mhe
:- General rework, uniformization and simplification of the API of all protocols.
- Greatly reduced code and code complexity of all protocols:
- Protocols use the
rlwe.Encryptor
instead of re-implementing encryption routines - Shares are now standardized using the new structs defined in the
ring
package
- Protocols use the
- New non-interactive protocols:
mhe.CircularCiphertextProtocol
: non-interactive generation ofRLWE(ms)
.mhe.CircularGadgetCiphertextProtocol
: non-interactive generation ofGRLWE(ms)
.- These two protocols enable a fully non-interactive setup for
heint
,hefloat
andhebin
.
- Improved the interactive relinearization key gen protocol (https://eprint.iacr.org/2021/1085).
- Added full support for deterministic share generation.
-
core
:-
Removed
core
. -
rlwe
:- Moved out of
core
. - Expanded the API of the
Encryptor
to support deterministic encryption and be able to perform key-switching. - Added support for signed digit decomposition.
- Parameters can be specified with any combination of (
Q
,LogQ
) and (P
,LogP
). - Added
NoiseCiphertext
, which returns the base 2 logarithm of the standard deviation of the residual noise in anrlwe.Ciphertext
. - Removed field
nbPi
inDecomposeNTT
. - Added Optimizing HE operations via Level-aware Key-switching Framework.
- Moved out of
-
rgsw
:- Moved out of
core
. - Added support for
RGSWxRGSW
product. - Added
.FromGadgetCiphertext
which produces anrgsw.Ciphertext
from anrlwe.GadgetCiphertext
. - Added signed digit decomposition.
- Moved out of
-
-
schemes
:bfv
: removed.bgv
: merged intohe/heint
.ckks
: merged intohe/hefloat
.
-
examples
:- Refactored all examples.
-
ring
:Ring
:- Renamed
Ring
toRNSRing
andSubRing
toRing
. - Renamed
Poly
toRNSPoly
which is now a slice ofPoly
and added typePoly
, a slice of[]uint64
. - Greatly simplified struct
RNSRing
which is now simply[]*Ring
. - Updated vectorized operations to accept slices that are not multiples of 8 (and not trigger buffer overflows).
- Added
Modulus
which returns the modulus of the ring (.AtLevel(level).Modulus()
replaces.ModulusAtLevel[level]
). - Added
RescaleConstants
which returns the rescaling constant for a given level (.RescaleConstants(level)
replacesRescaleConstants[level]
). - Added
Concat
which returns the concatenation of two rings. - Added
AddModuli
which returns an instance of a ring with additional moduli.
- Renamed
BasisExtender
:- Removed and replaced by methods on the
RNSRing
type. Constants are now computed on the fly.
- Removed and replaced by methods on the
- Refactored the samplers which now take a
sampling.Source
as random coins generator. ring.Poly
is now a reslice of an 1D[]uint64
backing array instead of a collection of independently allocated 1D arrays.- Added
Point
,Vector
andMatrix
structs with many associated methods. - Added the
Stats
method which returns log2(std) and mean of a Poly.
-
utils
:-
Removed many slices utilities, which are now available through the native package
slice
. -
Removed
Min
andMax
which now have native supported in Go asmin
andmax
. -
structs
:- Added
Copyer
interface and support (TODO review copy/clone).
- Added
-
sampling
:- Replaced the blake2b based XOF (
sampling.PRNG
) by themath/rand/v2
ChaCha8-based CSPRNG (sampling.Source
). - The
sampling.Source
struct is now used for all sampling the library.
- Replaced the blake2b based XOF (
-
bignum
:- Refactored and fixed many bugs in the multi-interval Remez minimax polynomial approximation algorithm which now properly works when doing multi-interval approximations.
- Added
Log2ErfC
which returns the base 2 logarithm of the complementary error function. - Added
Stats([]big.Int, prec)
, which returns the base 2 logarithm of the standard deviation and the mean - Added
ToComplexSlice
to cast a numerical slice to a[]bignum.Complex
.
-
concurrency
:- New package providing basic support for concurrency.
-
Others:
- Improved issue template
- Fork of Lattigo v5.0.2