Closed mikespittal closed 6 years ago
Yes, you can use the replication interfaces of HElib for that purpose.
//! @brief The value in slot #pos is replicated in all other slots.
//! On an n-slot ciphertext, this algorithm performs O(log n) 1D rotations.
void replicate(const EncryptedArray& ea, Ctxt& ctx, long pos);
This returns in ctx an encryption of the same bit in all the slots (which, I'm pretty sure, means that decrypting it will give you a polynomial which is just 0 or 1).
That said, unpacking is usually an inefficient way of computing stuff. It is very likely that there are faster ways of achieving whatever it is your application calls for. You can take a look at the HElib interfaces for linear transformations (matmul), permutations, binary arithmetic, etc.
I have a range of l-bits (mod 2) packed into a single Ctxt using the encrypted array (ea), that represents an l-bit integer.
Is there any way I can 'get' the Ctxt that encrypts the MSB of that l-bit integer? (converting a packed cipher text into a set of unpacked cipher texts)
Any help will be really appreciated!!