Vector operations on vectors with different lenghts

Hello,

I have two vectors:

    vector<double> lat = {52.5212};
    vector<double> lats = {52.5115, 52.5122, 52.5125, 52.5121, 52.5195, 52.5132, 52.5105, 52.5047};

    auto subtraction = clientCC->EvalSub(ctLats, ctLat);

I want to subtract the value in lat from all values in lats homomorphically.

The results from the pseudocode above is:

(-0.0097, 52.5122, 52.5125, 52.5121, 52.5195, 52.5132, 52.5105, 52.5047, ... ); Estimated precision: 37 bits

The first element is obviously correct. My first thought was to create vector of same size like lats like:
vector<double> latConstants = {52.5212, 52.5212, 52.5212, 52.5212, 52.5212, 52.5212, 52.5212, 52.5212};

and then do the same EvalSub operation again. The problem is that lat is not existing in plaintext in the process. I only have Enc(lat) and i dont know how to get from Enc(lat) to Enc(latConstants)
What are your thoughts?

Please read about SIMD capabilities and homomorphic rotations, for instance, from the webinars or by searching in the forum.

If you have your ciphertext encrypting ct = [lat, 0, 0, … ], you can obtain an encryption of ct_rep = [lat, lat, lat, …], by repeatedly rotating and summing: ct_rep = ct + EvalAtIndex(ct, -1); ct_rep = ct_rep + EvalAtIndex(ct_rep, -2); etc (it is you can also do it with a linear number of rotations but it is more efficient to do it with a logarithmic number of rotations). This is done internally by the EvalSum() function.

Thank you very much! Your information was very useful. Espacially the way how the EvalSum() function works =)