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

756: Fixed EvalSumColsKeyGen() bug #768

Closed dsuponitskiy closed 1 month ago

dsuponitskiy commented 2 months ago
  1. Renamed the input parameter "rowSize" to numRows for EvalSumRows() or to numCols for EvalSumCols().
  2. Replaced condition checks "SCHEME::CKKSRNS_SCHEME == schemeID" with "isCKKS(schemeID)".
  3. Removed the unused input parameter "PublicKey publicKey" from protected/private functions
  4. Replaced "usint" with "uint32_t"
  5. Corrected some doxygen function documentations
  6. Added a protected static helper function as a function members of Cryptocontext returning a pointer to a subset of the EvalAutomorphismKey map: GetPartialEvalAutomorphismKeyMapPtr(). This subset is built based on keyID and indexList
  7. Added SerializeEvalAutomorphismKey() to serialize a subset of the EvalAutomorphismKey map given keyID and indexList.
  8. Added DeserializeEvalAutomorphismKey() to deserialize the entire (or partial) serialized EvalAutomorphismKey map, extract the keys by the given keyID and indexList only, add the extracted keys to the key map and discard the rest of the deserialized map of keys.
  9. All "GenerateIndices..." functions return "std::unordered_set" instead of "std::vector".
  10. Added an additional internal variable to EvalSumRowsKeyGen() and to EvalSumColsKeyGen() in order to keep track of ALL required key indices and in order to returns ALL of the necessary keys.
  11. EvalSumColsKeyGen() also generates (if they have not been generated yet) and returns all keys generated by EvalSumKeyGen() in addition to the keys EvalSumColsKeyGen() is supposed to generate by itself. For that a new function GenerateIndexListForEvalSum() was created.
  12. Got rid of unnecessary variables and operations and slightly reorganized the code
  13. Added unit tests