Fboemer/eval add inplace
-
See #252
-
Implements in-place addition by adding
EvalAddInPlace
for ciphertext-ciphertext addition to the core cryptocontext API, and implementing in in CKKS, BFVrns, BGVrns, and Null schemes.- This speeds up Addition by avoiding an unnecessary allocation of and copy to a new ciphertext
-
Primitives such as
AutomaticLevelReduceInPlace
/LevelReduceInternalInPlace
in CKKS may be useful in implementing other operations in-place in the future. -
Lib-benchmark shows significant speedup on HE ciphertext-ciphertext addition in-place
------------------------------------------------------------
Benchmark Time CPU Iterations
------------------------------------------------------------
BFVrns_Add 15.5 us 15.4 us 272136
BFVrns_AddInPlace 13.1 us 13.0 us 322618
CKKS_Add 15.6 us 15.5 us 270203
CKKS_AddInPlace 13.1 us 13.1 us 321676
BGVrns_Add 22.2 us 22.2 us 189182
BGVrns_AddInPlace 15.8 us 15.8 us 266131
Edited by Fabian Boemer