Rotation in BFV

Hi guys, I got a question regarding the rotation in BFV.

Suppose we have a ciphertext with 8192 slots encrypted using BFV, e.g., C = Enc([1, 2, 3, 4, …, 8192]).

Then we rotate this ciphertext for 1 step and get C’ = EvalRotate(C, 1).

I wanted to get C’ = Enc([8192, 1, 2, 3, 4, …, 8191]) but I noticed that the result is rotated in “2 batches”:
C’ = Enc([4096, 1, 2, 3, 4, …, 4095, 8192, 4097, 4098, 4099, …, 8191]).
That is, both the first and the second half of C are rotated by one step.

Is it possible to disable this feature and just rotate the whole ciphertext by one step? Or can I change the “batch number” and get C’ = Enc([128, 1, 2, 3, …, 127, 256, 129, 130, …, 255, …])?

Thanks in advance!

The rotation in two batches (half the ring dimension each) is related to the underlying plaintext algebra for power-of-two-cyclotomic rings. If this is not desired, you can clone the first batch to the second half, and then you will get regular rotations at the expense of reducing the number of slots by a factor of two. The batch size cannot be changed.

Is it possible to swap the first and second batches, as implemented in seal?

If N is the ring dimension, rotating the vector by N/2 should swap the batches (rows).

1 Like