AssociativeContainerOfOpaqueTypes.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include "openfhe/core/lattice/hal/lat-backend.h"
  3. #include "openfhe/pke/key/evalkey-fwd.h"
  4. #include "EvalKey.h"
  5. #include <cstdint>
  6. #include <map>
  7. #include <unordered_map>
  8. // cxx currently does not support std::unordered_map and std::map
  9. namespace openfhe
  10. {
  11. using DCRTPoly = lbcrypto::DCRTPoly;
  12. class UnorderedMapFromIndexToDCRTPoly final
  13. {
  14. std::unordered_map<uint32_t, DCRTPoly> m_indexToDCRTPolyUnorderedMap;
  15. public:
  16. explicit UnorderedMapFromIndexToDCRTPoly(
  17. std::unordered_map<uint32_t, DCRTPoly> indexToDCRTPolyUnorderedMap);
  18. [[nodiscard]] std::unordered_map<uint32_t, DCRTPoly>& GetInternal();
  19. };
  20. using EvalKeyImpl = lbcrypto::EvalKeyImpl<lbcrypto::DCRTPoly>;
  21. class MapFromIndexToEvalKey final
  22. {
  23. std::shared_ptr<std::map<uint32_t, std::shared_ptr<EvalKeyImpl>>>
  24. m_sharedPtrToindexToEvalKeyDCRTPolyMap;
  25. public:
  26. explicit MapFromIndexToEvalKey(
  27. const std::shared_ptr<std::map<uint32_t, std::shared_ptr<EvalKeyImpl>>>
  28. indexToEvalKeyDCRTPolyMap);
  29. [[nodiscard]] const std::map<uint32_t, std::shared_ptr<EvalKeyImpl>>& GetInternalMap() const;
  30. [[nodiscard]] std::shared_ptr<std::map<uint32_t, std::shared_ptr<EvalKeyImpl>>>
  31. GetInternal() const;
  32. };
  33. } // openfhe