Accessing Specific Plaintext Indexes


So after computing additions and rotation on ciphertexts and decrypting the final ciphertext, I get the following Plaintext: ( 77 62 44 23 ... ) .

My question is if there is any way for me to access only the first value. In the documentation of Plaintext, there is no reference to methods or attributes that I can interact with.

That’s because you need to first get the underlying coefficients. Something like the following should work:

    cc->Decrypt(keys.secretKey, yourCiphertext, &result);

    std::vector<std::complex<double>> res = result->GetCKKSPackedValue();
    for (auto &el: res){
        std::cout << el << ",";

In your case you’d do something like res[0]

Thanks a lot. It makes sense!