I am using the default parameter setting for multiplying BFV ciphertexts.
I am implementing the same code at openfhe-development/src/pke/examples/simple-integers.cpp at main · openfheorg/openfhe-development · GitHub
I changed the multiplicative depth from 2 to 3 and by binary tree multiplication it should multiply 8 ciphertext-ciphertext multiplication but i can only multiply 4 ciphertext-ciphertext multiplication.
What is the default ciphertext-ciphertext multiplication in BFV encryption mechanism.
How are you performing the multiplication? Is it like this
auto ciphertextMul12 = cryptoContext->EvalMult(ciphertext1, ciphertext2);
auto ciphertextMul34 = cryptoContext->EvalMult(ciphertext3, ciphertext4);
auto ciphertextMul56 = cryptoContext->EvalMult(ciphertext5, ciphertext6);
auto ciphertextMul78 = cryptoContext->EvalMult(ciphertext7, ciphertext8);
auto ciphertextMul1234 = cryptoContext->EvalMult(ciphertextMul12, ciphertextMul34);
auto ciphertextMul5678 = cryptoContext->EvalMult(ciphertextMul56, ciphertextMul78);
auto ciphertextMultResult = cryptoContext->EvalMult(ciphertextMul1234, ciphertextMul5678);```
Please post a minimum working example such that we identify the issue.
Thanks for your response .
Below is the snippet of my code. when i giving total plaintext as 4 then it works correctly but on giving higher vaule it gives incorrect result.
The way you are doing the multiplication requires a multiplicative depth of numPlaintexts - 1. To achieve a smaller multiplicative depth, you have to multiply ciphertexts in a binary tree shape, the way I showed in my previous post.