Can you provide further details on the crypto-parameters you used, including the polynomial approximation algorithm, range, and polynomial degree?
To ensure a fair comparison, make sure you use the same (or very similar) cryptographic parameters in both libraries, particularly the ring dimension and ciphertext coefficient modulus.
I already check the parameters. Both have the same ring dimension and Plaintext modulus. (emmm, I set the same ring dimension .The coefficient modulus may be different?)
The major difference I foresee behind the performance gap might be the Key Switching (HKS) algorithm used. OpenFHE uses the Hybrid Key-Switching (HKS) algorithm by default, whereas SEAL uses the Brakerski-Vaikuntanathan (BV) key-switching. HKS switching is proven to be more efficient at large multiplicative depths (See this for reference).
However, several other factors could also contribute. These are entirely different implementations with different software architectures, making the root cause potentially difficult to pinpoint.
On a related note, were you using memory pools with SEAL?
OK, thank you。
I don’t use the memory pool actually. I will try to use it. Then I also want to know that may be The default setting of OpenFHE enables multi-threading(compare to seal). is that right? thank you so much.
Thank you!!!
I have another question, I just set the parameters as simply as below, will it use HKS? Doesn’t HKS require a special modulus to use? In what situations does OpenFHE use HKS?
Step1:set the params
CCParams<CryptoContextBGVRNS> params;
params.SetSecurityLevel(HEStd_NotSet);
params.SetRingDim(32768);
params.SetMultiplicativeDepth(16);
params.SetPlaintextModulus(4293918721);
It is used by default for most of the schemes. HKS is recommended for large-multiplicative-depth computations like your case. You can set it as follows: parameters.SetKeySwitchTechnique(HYBRID)
In low-multiplicative-depth (< 5), the BV method might be more efficient.