openfheorg / openfhe-development

This is the development repository for the OpenFHE library. The current (stable) version is v1.2.0 (released on June 25, 2024).
BSD 2-Clause "Simplified" License
663 stars 170 forks source link

Exception is not being caught in `MakePackedPlaintext` #727

Closed mdvillagra closed 1 month ago

mdvillagra commented 3 months ago

When the plaintext modulus and cyclotomic number do not satisfy the condition that $m$ divides $q-1$, there is an error

Please provide a primeModulus(q) and a cyclotomic number(m) satisfying the condition: (q-1)/m is an integer.

and immediately the program aborts.

I don't know if the exception is being thrown correctly in this line, because the code below fails to catch the exception.

try
{
   plaintext_number = cryptoContext->MakePackedPlaintext(number);
}
catch (const std::exception &e)
{
    std::cerr << e.what() << std::endl;
}
yspolyakov commented 1 month ago

Please ask this question in the OpenFHE discourse forum: https://openfhe.discourse.group/ The issues are only for reporting bugs, requests, etc.