Ciphertext.h 1007 B

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include "openfhe/core/lattice/hal/lat-backend.h"
  3. #include "openfhe/pke/ciphertext-fwd.h"
  4. namespace openfhe
  5. {
  6. using CiphertextImpl = lbcrypto::CiphertextImpl<lbcrypto::DCRTPoly>;
  7. class CiphertextDCRTPoly final
  8. {
  9. std::shared_ptr<CiphertextImpl> m_ciphertext;
  10. public:
  11. CiphertextDCRTPoly() = default;
  12. CiphertextDCRTPoly(std::shared_ptr<CiphertextImpl>&& ciphertext) noexcept;
  13. CiphertextDCRTPoly(const CiphertextDCRTPoly&) = delete;
  14. CiphertextDCRTPoly(CiphertextDCRTPoly&&) = delete;
  15. CiphertextDCRTPoly& operator=(const CiphertextDCRTPoly&) = delete;
  16. CiphertextDCRTPoly& operator=(CiphertextDCRTPoly&&) = delete;
  17. [[nodiscard]] std::shared_ptr<CiphertextImpl> GetInternal() const noexcept;
  18. [[nodiscard]] std::shared_ptr<CiphertextImpl>& GetRef() noexcept;
  19. [[nodiscard]] const std::shared_ptr<CiphertextImpl>& GetRef() const noexcept;
  20. };
  21. // Generator functions
  22. [[nodiscard]] std::unique_ptr<CiphertextDCRTPoly> DCRTPolyGenNullCiphertext();
  23. } // openfhe