SerialDeserial.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 SerializePrivateKeyToFile(const std::string& privateKeyLocation,
  35. const PrivateKeyDCRTPoly& privateKey, const SerialMode serialMode);
  36. bool DeserializePrivateKeyFromFile(const std::string& privateKeyLocation,
  37. PrivateKeyDCRTPoly& privateKey, const SerialMode serialMode);
  38. bool SerializeCiphertextToFile(const std::string& ciphertextLocation,
  39. const CiphertextDCRTPoly& ciphertext, const SerialMode serialMode);
  40. bool DeserializeCiphertextFromFile(const std::string& ciphertextLocation,
  41. CiphertextDCRTPoly& ciphertext, const SerialMode serialMode);
  42. } // openfhe