Question for Coefficient Packing for CKKS and File Not Found Error in Scheme-Switching branch

Hi, I have a couple of questions related to packing functions and scheme-switching, and I would appreciate your insights and assistance.

First, I am curious about the compatibility of the CoefPackedPlaintext method with the CKKS scheme. Specifically, I am interested in using CoefPackedPlaintext to encode an integer vector into coefficients and perform switching using CKKS-FHEW. If I directly uses that packing in CKKS, it outputs sizeQl error like:
“terminating due to uncaught exception of type lbcrypto::math_error: …/openfhe-development/src/pke/lib/scheme/ckksrns/ckksrns-pke.cpp:63 sizeQl 3!= 1. If sizeQl = 0, consider increasing the depth. If sizeQl > 1, check parameters (this is unsupported for NativePoly).”

Second, I have encountered a “file not found” error while attempting to run the scheme-switching branch. When I try to run my won code calling openfhe, the error occurs like:

In file included from /usr/local/include/openfhe/pke/openfhe.h:54:
/usr/local/include/openfhe/pke/cryptocontext.h:54:10: fatal error: '../../binfhe/include/binfhecontext.h' file not found
#include "../../binfhe/include/binfhecontext.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Currently I believe there is some changed directory in the branch since it works well if I reinstall the library with main branch.

I’m looking forward to hearing your answers. Thank you for your time in advance!

The scheme-switching branch is still under development and is not yet ready for use. We plan to add the CKKS-FHEW scheme switching capability in v1.1.0, which is scheduled to be released by the end of July.

Thank you for the information. I’m eagerly looking forward to the release of v1.1!

Regarding my first question about the Coefficient packing method for CKKS, I would like to inquire about its compatibility. The current CoefPackedPlaintext function only supports encoding an int64_t vector. However, I think it is possible in theory to encode integer vector into CKKS. I would greatly appreciate your explanation with current library structure and the reason of above error in decryption. Thanks!

Hi @swanhong CoefPackedPlaintext is currently supported only for BGV and BFV (for the case where numbers modulo t are encoded). We have not seen yet a need for a coefficient encoding in CKKS (as a user feature). All use cases we have seen typically work with the CKKSPackedEncoding encoding.

The coefficient encoding internally comes up in CKKS bootstrapping or scheme switching from CKKS ↔ FHEW, but these are handled automatically by the library using methods like SlotsToCoef (still operating on plaintexts encoded with CKKSPackedEncoding) I suggest waiting for the v1.1 release where you will see how scheme switching is done.

Thanks @ypolyakov I will definitely be on the lookout for the updated version. Appreciated!