I encountered the following error in the program I wrote myself.
terminate called after throwing an instance of 'lbcrypto::OpenFHEException'
what(): /home/wrn/openfhe-development/src/binfhe/include/lwe-cryptoparameters.h:l.79:LWECryptoParams(): q_KS (modulus for key switching) can not be zero
I wonder why the error points to the folder created by git clone rather than the folder after the make install command.And this error did not appear in 1.4.0
Bootstrapping Crypto Params
Discrete key used: UNIFORM_TERNARY
Approx Bootstrap depth: 8
Levels before bootstrap: 14
Final Bootstrap Depth: 31
terminate called after throwing an instance of 'lbcrypto::OpenFHEException'
what(): /home/wrn/openfhe-development/src/pke/lib/scheme/gen-cryptocontext-params-validation.cpp:l.49:validateParametersForCryptocontext(): scalingModSize should be less than 28
For the second error, looks like you are trying to use the logistic regression example when OpenFHE was compiled using NATIVE_SIZE=32. The logistic regression examples should be used when NATIVE_SIZE is set to 64. In v1.2.0, we do more validation. So it is possible that this error would not come up in an older version. But regardless, the logreg example will not work for NATIVE_SIZE=32 (as this mode does not support CKKS bootstrapping).
For the first error, it is hard to tell anything without seeing a minimal working example. It looks like the error happens during BinFHEContext generation. Could you post here the code you use up to BinFHEContext generation. The error itself looks valid.
Could you provide more information on the error related to the following line?
cc.GenerateBinFHEContext(TOY, true);
For example, I built v1.2.0, changed the line for generating the BinFHEContext in eval-function.cpp to yours, and everything still works correctly for me. I am trying to understand if there is a bug here or the API was not used correctly. It would help if you could include the full (minimally working) example that generates this error.
I’m sorry, after setting NATIVE_SIZE=64, I cannot reproduce the error anymore. Now, the parameter no longer causes an error, whether it has a value of true or false. Perhaps it has something to do with NATIVE_SIZE?
Thanks. It does make sense that the BinFHE cryptocontext generation does not work when you supply the second argument as a Boolean value. The programmable bootstrapping functionality for plaintext moduli > 2 is supported only for NATIVE_SIZE=64. In summary, the is the intended behavior of the library.