I am currently trying to implement matrix multiplication methods using the Microsoft SEAL library. I have created a vector<vector<double>>
as input matrix and encoded it with CKKSEncoder
. However the encoder packs an entire vector into a single Plaintext
so I just have a vector<Plaintext>
which makes me lose the 2D structure (and then of course I'll have a vector<Ciphertext>
after encryption). Having a 1D vector allows me to access only the rows entirely but not the columns.
I managed to transpose the matrices before encoding. This allowed me to multiply component-wise the rows of the first matrix and columns (rows in transposed form) of the second matrix but I am unable to sum the elements of the resulting vector together since it's packed into a single Ciphertext. I just need to figure out how to make the vector dot product work in SEAL to perform matrix multiplication. Am I missing something or is my method wrong?