Inquiry about the existence of the SetMultiHopModSize function in the OpenFHE library

Dear members of the community,

I’m currently working on a project using the OpenFHE library. I’m referring to a pre-hra-secure.cpp file developed by someone else based on OpenFHE. The author of this file mentioned that the SetMultiHopModSize function used in the code worked properly in version 1.2.0.

I’ve attempted to use this function in my code to set the multi-hop modulus size. However, I can’t find the definition of the SetMultiHopModSize function in the OpenFHE library version 1.2.0 that I’m currently using. I’ve not only searched in the current version but also looked back through versions prior to 1.2.0, yet I still haven’t found this function.

I’d like to ask the community if the SetMultiHopModSize function ever existed in the OpenFHE library. If it did, in which version was it removed, and is there an alternative function that can achieve the same functionality?

Relevant code snippet

bool run_demo_pre(void) {
    // Generate parameters.
    TimeVar t;  // timer for tic toc
    std::cout << "setting up the HRA-secure BGV PRE cryptosystem" << std::endl;
    TIC(t);

    double t1;

    uint32_t plaintextModulus = 2;  // can encode shorts

    uint32_t numHops = 13;
    uint32_t qmodulus = 27;  // Hypothetical qmodulus value

    CCParams<CryptoContextBGVRNS> parameters;
    parameters.SetPlaintextModulus(plaintextModulus);
    parameters.SetScalingTechnique(FIXEDMANUAL);
    parameters.SetPRENumHops(numHops);
    parameters.SetStatisticalSecurity(40);
    parameters.SetNumAdversarialQueries(1048576);
    parameters.SetRingDim(32768);
    parameters.SetPREMode(NOISE_FLOODING_HRA);
    parameters.SetKeySwitchTechnique(HYBRID);
    parameters.SetMultiplicativeDepth(0);
    // The line I added, trying to use the SetMultiHopModSize function
    parameters.SetMultiHopModSize(qmodulus); 
    // parameters.SetNumLargeDigits(3);
    // parameters.SetKeySwitchTechnique(BV);
    // parameters.SetDigitSize(15);

    CryptoContext<DCRTPoly> cc = GenCryptoContext(parameters);
    // ... Other code ...
}

My attempts

  • I used the command grep -r "SetMultiHopModSize" . to recursively search for the function in the local code repository, but I didn’t find its definition.
  • I also searched for the function in different version release tags on the GitHub repository, yet I still couldn’t find any useful information.

Environment information

  • Operating system: Ubuntu 20.04
  • OpenFHE library version: 1.2.0
  • Compiler: g++ 9.4.0

Thank you for taking the time to read my question. I’m looking forward to your help!

SetMultiHopModSize existed in an older (intermediate) version of OpenFHE. The prior (hardly usable) version was revised in the following commit: Many changes in the HRA-secure PRE implementation based on BGV (#792) · openfheorg/openfhe-development@8a373ce · GitHub. This commit was included in v1.2.0. SetMultiHopModSize was replaced with PRENumHops. Please refer to openfhe-development/src/pke/examples/pre-hra-secure.cpp at v1.2.4 · openfheorg/openfhe-development · GitHub for a proper way of instantiating the HRA-secure PRE. This example is based on the design described in HRA-Secure Homomorphic Lattice-Based Proxy Re-Encryption with Tight Security