Skip to content

Code to be corrected #681

Open
Open
@dsuponitskiy

Description

@dsuponitskiy
  1. src/binfhe/include/rgsw-cryptoparameters.h: in RingGSWCryptoParams() instead of "if ((method == LMKCDEY) & (numAutoKeys == 0))" there should be "if ((method == LMKCDEY) && (numAutoKeys == 0))"
  2. src/pke/lib/encoding/packedencoding.cpp: bool PackedEncoding::Encode(): "size_t i;" is declared twice outside of the loop in this function. Should not be outside the corresponding loops
  3. Add
    #include "math/hal/basicint.h" // for MAX_MODULUS_SIZE
    to constants.h and remove
    #include "math/math-hal.h"
    #include "lattice/constants-lattice.h"

    Add #include "lattice/constants-lattice.h" to rlwe-cryptoparameters.h
  4. Replace "DCRTPoly" with "Element" in multiple files and discuss the changes with a scientist. Examples:
    src/pke/include/schemebase/base-parametergeneration.h
    src/pke/include/schemebase/base-leveledshe.h
    src/pke/include/schemebase/base-scheme.h
    src/pke/lib/schemebase/base-leveledshe.cpp
  5. Make ParamsGenBGVRNS(), ParamsGenCKKSRNS() and ParamsGenBFVRNS() non-virtual in base-scheme.h.
  6. utils/exception.h: make all get functions const for OpenFHEException
  7. Remove _MAKE_UNIQUE and make_unique from src/core/include/utils/memory.h and remove includes of memory.h where they are not needed
  8. FindInVector() is defined in 2 different classes: DiscreteGaussianGeneratorImpl and in BaseSampler. The function return values differ by 1.
  9. Add "std::" to ceil(), floor(), log2(), pow(), sqrt() etc.
  10. src/pke/include/scheme/ckksrns/ckksrns-fhe.h: - Make both m_paramsEnc and m_paramsDec in CKKSBootstrapPrecom std::vector<uint32_t>. The current type is std::vector<int32_t>.
    • Make all data members of class CKKSBootstrapPrecom private
  11. Change the name COMPRESSION_LEVEL (constants.h) to Camel case
  12. Add either NOT_SET or INVALID_VALUE to all enums in constants.h
  13. See if we can replace the __builtin_*() functions with __FILE__, __LINE__ and __FUNCTION__ in OpenFHEException as the functions are available with gcc only - This can not be done as the macros are replaced with information from exception.h by the preprocessor at compile time.
  14. Remove the return value (eval_key_map) from EvalSumRowsKeyGen()/EvalSumColsKeyGen() and the EvalKey parameter from EvalSumRows()/EvalSumCols()
  15. Serialize/Deserialize functions should be "void" instead of returning true/false. Errors should be handled with exceptions
  16. Check if SerializeToFile() and SerializeToString() can be removed from src/pke/include/cryptocontext-ser.h, so the functions from src/core/include/utils/serial.h could be directly used
  17. Remove PublicKey from the parameter list #645
  18. Mark MATHBACKEND=2 deprecated #678
  19. Mark classes from "utils/exception.h" deprecated, so we can remove OPENFHE_THROW_OLD along with them. Is ThreadException used at all? #680
  20. Some suggestions #800
  21. Remove OPENFHE_THROW_OLD and all old exception types
  22. Rename the function member PrintValue() to GetFormattedValues() and move it simple implementation to PlaintextImpl "precision". Use it in operator<<(). The function should be overloaded in CKKSPackedEncoding only. Also check doprint(), PrintParameters() and print() (in src/pke/include/metadata.h). GetFormattedValues() should stay public in case someone needs to change the precision (like in openfhe-python).
  23. Replace sharingScheme types "additive" and "shamir" with enums
  24. Get rid of "int"
  25. Add a check for nullptr after "dynamic_pointer_cast"
  26. src/pke/lib/scheme/ckksrns/ckksrns-cryptoparameters.cpp: simplify the logic involving "if" statements with "COMPOSITESCALING..." in PrecomputeCRTTables()
  27. src/pke/lib/scheme/ckksrns/ckksrns-parametergeneration.cpp: simplify the "if" statement to call CompositePrimeModuliGen/SinglePrimeModuliGen
  28. Total cleanup for src/pke/lib/scheme/ckksrns/ckksrns-parametergeneration.cpp in Composite Prime Moduli Sampling and Scaling Factor Calculations (#910 phase 2)  #929
  29. Move all *Core() and *CoreInPlace() functions to the protected/private class sections. Function examples: EvalMultCoreInPlace()
  30. Remove "this->" for class data members. If a data member is available in the base class only, then the scope resolution operator should be used
  31. Do not call getters from the function members of the same class, use data members directly
  32. Move some data to Plaintext from its derived classes and update Plaintext's constructors
  33. Add the "m_" prefix to all class data members
  34. Check input parameters on the cryptocontext.h, ciphertext.h and plaintext.h level. All other pke code should not validate input parameters.
  35. cryptocontext.h: refactor MakePlaintext(), especially the part where "Plaintext p" is created.
  36. Functions should not return const references to integer types or const integers eg, const NativeInteger& or const NativeInteger.
  37. Get rid of "#define PROFILE" in those files where it is not needed
  38. src/pke/include/scheme/ckksrns/gen-cryptocontext-ckksrns-internal.h: move all prameter validations to src/pke/lib/scheme/gen-cryptocontext-params-validation.cpp
  39. src/pke/lib/scheme/ckksrns/ckksrns-leveledshe.cpp:void LeveledSHECKKSRNS::EvalMultCoreInPlace(): combine both loops and thus get rid of 2 temporary vectors (cvRe and cvIm)
  40. Review all instances of the OPENFHE_THROW macro and get rid of unnecessarily created std::string for their error messages.
  41. Remove "enum" from function return types. It's not recommended to have it
  42. Move all data from the unittest source files to *.csv
  43. Create serialization helper functions in the private section of the class as some save/load have became too long. example: src/pke/include/schemebase/rlwe-cryptoparameters.h
  44. DISCUSS with Yuriy and Carlo how we use ConstCiphertext (and all other Const.. aliases) and what they should exactly mean

Metadata

Metadata

Labels

bugSomething isn't workingcleanupCode cleanup

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions