If I package three vectors into one ciphertext, how can the server split them into three ciphertexts after receiving the ciphertext

If I package three vectors into one ciphertext, how can the server split them into three ciphertexts after receiving the ciphertext

You’ll have to mask them out by multiplying with a vector of 0’s and 1’s

Can you give an example?such as
vector a1={1,2,3,4,5};
vector a2={1,2,3,4,5};
vector a3={1,2,3,4,5};
vector<vector > a4;
a4.push_back(a1);
a4.push_back(a2);
a4.push_back(a3);
ciphertext c=encrypt(a4);
server split ciphertext into three ciphertext as c1,c2,c3

I suggest you to take advantage of batching and to use them in a single ciphertext.

Anyway, you could do something like this:

vector mask1 = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,0};
vector mask2 = {0, 0, 0 ,0 ,0 1, 1, 1, 1, 1, 0, 0, 0, 0, 0};
vector mask3 = {0, 0, 0, 0, 0, 0, 0, 0, 0 ,0, 1, 1, 1, 1, 1};

c1 = c \times mask1
c2 = c \times mask2
c3 = c \times mask3

1 Like

thank you! I will try

Additionally if you need them as separate vector CT, and want them to be indexed the same you could rotate c2 left by the vector length, and c3 left by 2xvector length, Remembering that the rotation happens over the entire ciphertext vector.