hamm
November 29, 2022, 8:11am
1
Plaintext serverPlaintext;
serverCC->Decrypt(serverKP.secretKey, serverCiphertext, &serverPlaintext);
serverPlaintext->SetLength(batchSize);
return (double)serverPlaintext[0];
The code is as above, I want to extract each element in the decrypted plaintext vector, but simple subscripts cannot. Is there any way to do it? My mother tongue is not English, please excuse any mistakes.
iquah
November 29, 2022, 1:55pm
2
Like the following
Plaintext serverPlaintext;
serverCC->Decrypt(serverKP.secretKey, serverCiphertext, &serverPlaintext);
serverPlaintext->SetLength(batchSize);
auto myVec = serverPlaintext->GetX(); // <-------- What you're looking for
Where GetX
depends on your scheme
CKKS: GetCKKSPackedValue
, which returns a vector of complex values
CKKS: GetRealPackedValue
, which returns a vector of real values
BFV/ BGV: GetPackedValue
, which returns a vector of ints
3 Likes