homenc / HElib

HElib is an open-source software library that implements homomorphic encryption. It supports the BGV scheme with bootstrapping and the Approximate Number CKKS scheme. HElib also includes optimizations for efficient homomorphic evaluation, focusing on effective use of ciphertext packing techniques and on the Gentry-Halevi-Smart optimizations.
https://homenc.github.io/HElib
Other
3.11k stars 760 forks source link

Rotation with redundant slots #441

Open DylanWangWQF opened 3 years ago

DylanWangWQF commented 3 years ago

Sorry, @fionser I closed the issue in SEAL. My question is: I want to get the exact number of slots in the ciphertext to get a cyclic rotation. Or implement the below rotations with redundant slots. For example, given a ctxt with 16 slots, (1, 2, 3, ..., 16). The expected rotationrotate(ctxt, -2) should be (3, ..., 16, 1, 2). But if we get a ctxt with 20 slots. Rotate it directly, we get (3, ..., 16, 0, 0, 0, 0, 1, 2), how can I get (3, ..., 16, 1, 2, 0, 0, 0, 0). I have to rotate the ctxt several times and make some additions?