I am trying to convert a benchmark to homomorphic domain, and I'm using Palisade library for that due to its support of multiple schemes like BFV, BGV, CKKS. I am currently using BFV scheme.
There is a line in the code-
y = x >> 6.
This line in my encrypted domain should look something like this, given Enc(x)-
Enc(y) = Enc(x) >> 6.
I see that division is not supported in Palisade, and think this is also the case with Microsoft SEAL library.
Can someone please guide how to go about this operation in Palisade?
I tried this (but this assumes that bits of x are known, which is not the case as we only know Enc(x))-
If the breakup of the input integer into binary bits is known - Say we are given integer x=233 and its binary representation as 'vector<int64_t> v= {1 1 1 0 1 0 0 1 }'. We can encrypt this vector into HE domain and get ciphertext1. Then, say we want to do- x>>6. For this, we can do-
Plaintext plaintext1;
cryptoContext->Decrypt(keyPair.secretKey, ciphertext1, &plaintext1);
plaintext1->SetLength(v.size()-6);
vector<int64_t> v_final=plaintext1->GetPackedValue(); // gives {1 1}