AssociativeContainers.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #pragma once
  2. #include "openfhe/core/lattice/hal/lat-backend.h"
  3. #include "openfhe/pke/key/evalkey-fwd.h"
  4. #include <map>
  5. #include <set>
  6. #include <unordered_map>
  7. // cxx currently does not support std::unordered_map and std::map
  8. namespace openfhe
  9. {
  10. using EvalKeyImpl = lbcrypto::EvalKeyImpl<lbcrypto::DCRTPoly>;
  11. class MapFromIndexToEvalKey final
  12. {
  13. std::shared_ptr<std::map<uint32_t, std::shared_ptr<EvalKeyImpl>>>
  14. m_sharedPtrToindexToEvalKeyDCRTPolyMap;
  15. public:
  16. MapFromIndexToEvalKey(std::shared_ptr<std::map<uint32_t, std::shared_ptr<EvalKeyImpl>>>&&
  17. indexToEvalKeyDCRTPolyMap) noexcept;
  18. [[nodiscard]] const std::shared_ptr<std::map<uint32_t, std::shared_ptr<EvalKeyImpl>>>&
  19. GetRef() const noexcept;
  20. };
  21. class MapFromStringToMapFromIndexToEvalKey final
  22. {
  23. std::map<std::string, std::shared_ptr<std::map<uint32_t, std::shared_ptr<EvalKeyImpl>>>>
  24. m_stringToMapFromIndexToEvalKeyMap;
  25. public:
  26. explicit MapFromStringToMapFromIndexToEvalKey(
  27. std::map<std::string, std::shared_ptr<std::map<uint32_t, std::shared_ptr<EvalKeyImpl>>>>
  28. stringToMapFromIndexToEvalKeyMap);
  29. };
  30. class MapFromStringToVectorOfEvalKeys final
  31. {
  32. std::map<std::string, std::vector<std::shared_ptr<EvalKeyImpl>>> m_stringToVectorOfEvalKeysMap;
  33. public:
  34. explicit MapFromStringToVectorOfEvalKeys(
  35. std::map<std::string, std::vector<std::shared_ptr<EvalKeyImpl>>>
  36. stringToVectorOfEvalKeysMap);
  37. };
  38. class SetOfUints final
  39. {
  40. std::set<uint32_t> m_uintsSet;
  41. public:
  42. explicit SetOfUints(std::set<uint32_t>&& uintsSet) noexcept;
  43. [[nodiscard]] const std::set<uint32_t>& GetRef() const noexcept;
  44. };
  45. class UnorderedMapFromIndexToDCRTPoly final
  46. {
  47. std::unordered_map<uint32_t, lbcrypto::DCRTPoly> m_indexToDCRTPolyUnorderedMap;
  48. public:
  49. UnorderedMapFromIndexToDCRTPoly(
  50. std::unordered_map<uint32_t, lbcrypto::DCRTPoly>&& indexToDCRTPolyUnorderedMap) noexcept;
  51. [[nodiscard]] std::unordered_map<uint32_t, lbcrypto::DCRTPoly>& GetRef() noexcept;
  52. };
  53. } // openfhe