I'm using Microsoft's homomorphic encryption library seal to calculate the dot product of two ciphertext vectors. I found that when the size of the ciphertext vector is 600, it takes about 12 seconds. I don't know if there is a way to improve the efficiency of my code, or is this the upper limit of the calculation speed of homomorphic encryption?
...
EncryptionParameters parms(scheme_type::BFV);
size_t poly_modulus_degree = 8192;
parms.set_poly_modulus_degree(poly_modulus_degree);
parms.set_coeff_modulus(CoeffModulus::BFVDefault(poly_modulus_degree));
parms.set_plain_modulus(1ll<<20);
auto context = SEALContext::Create(parms);
...
for(int i=1;i<=M;i++){
for(int j=i;j<=M;j++){
for(int k=1;k<=N;k++){
...
evaluator.multiply_inplace(ca,cb);
evaluator.add_inplace(c_sum,ca);
...
}
}
}