Ciphertext.h 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include "openfhe/core/lattice/hal/lat-backend.h"
  3. #include "openfhe/pke/ciphertext-fwd.h"
  4. #include "SerialMode.h" // SerialMode
  5. namespace openfhe
  6. {
  7. using CiphertextImpl = lbcrypto::CiphertextImpl<lbcrypto::DCRTPoly>;
  8. class CiphertextDCRTPoly final
  9. {
  10. std::shared_ptr<CiphertextImpl> m_ciphertext;
  11. public:
  12. friend bool SerializeCiphertextToFile(const std::string& ciphertextLocation,
  13. const CiphertextDCRTPoly& ciphertext, const SerialMode serialMode);
  14. friend bool DeserializeCiphertextFromFile(const std::string& ciphertextLocation,
  15. CiphertextDCRTPoly& ciphertext, const SerialMode serialMode);
  16. CiphertextDCRTPoly() = default;
  17. explicit CiphertextDCRTPoly(const std::shared_ptr<CiphertextImpl>& ciphertext);
  18. CiphertextDCRTPoly(const CiphertextDCRTPoly&) = delete;
  19. CiphertextDCRTPoly(CiphertextDCRTPoly&&) = delete;
  20. CiphertextDCRTPoly& operator=(const CiphertextDCRTPoly&) = delete;
  21. CiphertextDCRTPoly& operator=(CiphertextDCRTPoly&&) = delete;
  22. [[nodiscard]] std::shared_ptr<CiphertextImpl> GetInternal() const;
  23. };
  24. [[nodiscard]] std::unique_ptr<CiphertextDCRTPoly> GenNullCiphertext();
  25. } // openfhe