SerialDeserial.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include "bits/stringfwd.h"
  3. #include "SerialMode.h" // SerialMode
  4. namespace openfhe
  5. {
  6. class CiphertextDCRTPoly;
  7. class CryptoContextDCRTPoly;
  8. class PublicKeyDCRTPoly;
  9. bool SerializeCryptoContextToFile(const std::string& ccLocation,
  10. const CryptoContextDCRTPoly& cryptoContext, const SerialMode serialMode);
  11. bool DeserializeCryptoContextFromFile(const std::string& ccLocation,
  12. CryptoContextDCRTPoly& cryptoContext, const SerialMode serialMode);
  13. bool SerializeEvalMultKeyToFile(const std::string& multKeyLocation,
  14. const CryptoContextDCRTPoly& cryptoContext, const SerialMode serialMode);
  15. bool SerializeEvalMultKeyByIdToFile(const std::string& multKeyLocation,
  16. const SerialMode serialMode, const std::string& id);
  17. bool DeserializeEvalMultKeyFromFile(const std::string& multKeyLocation,
  18. const SerialMode serialMode);
  19. bool SerializeEvalSumKeyToFile(const std::string& sumKeyLocation,
  20. const CryptoContextDCRTPoly& cryptoContext, const SerialMode serialMode);
  21. bool SerializeEvalSumKeyByIdToFile(const std::string& sumKeyLocation,
  22. const SerialMode serialMode, const std::string& id);
  23. bool DeserializeEvalSumKeyFromFile(const std::string& sumKeyLocation, const SerialMode serialMode);
  24. bool SerializeEvalAutomorphismKeyToFile(const std::string& automorphismKeyLocation,
  25. const CryptoContextDCRTPoly& cryptoContext, const SerialMode serialMode);
  26. bool SerializeEvalAutomorphismKeyByIdToFile(const std::string& automorphismKeyLocation,
  27. const SerialMode serialMode, const std::string& id);
  28. bool DeserializeEvalAutomorphismKeyFromFile(const std::string& automorphismKeyLocation,
  29. const SerialMode serialMode);
  30. bool SerializePublicKeyToFile(const std::string& publicKeyLocation,
  31. const PublicKeyDCRTPoly& publicKey, const SerialMode serialMode);
  32. bool DeserializePublicKeyFromFile(const std::string& publicKeyLocation,
  33. PublicKeyDCRTPoly& publicKey, const SerialMode serialMode);
  34. bool SerializeCiphertextToFile(const std::string& ciphertextLocation,
  35. const CiphertextDCRTPoly& ciphertext, const SerialMode serialMode);
  36. bool DeserializeCiphertextFromFile(const std::string& ciphertextLocation,
  37. CiphertextDCRTPoly& ciphertext, const SerialMode serialMode);
  38. } // openfhe