EGCiphertext.cpp 667 B

12345678910111213141516171819202122232425262728293031323334
  1. #include "EGCiphertext.hpp"
  2. EGCiphertext::EGCiphertext()
  3. { /* */ }
  4. EGCiphertext::EGCiphertext(
  5. const Twistpoint& mask,
  6. const Twistpoint& encryptedMessage)
  7. : mask(mask), encryptedMessage(encryptedMessage)
  8. { /* */ }
  9. bool EGCiphertext::operator==(
  10. const EGCiphertext& other) const
  11. {
  12. return mask == other.mask && encryptedMessage == other.encryptedMessage;
  13. }
  14. std::ostream& operator<<(
  15. std::ostream& os,
  16. const EGCiphertext& output)
  17. {
  18. os << output.mask << output.encryptedMessage;
  19. return os;
  20. }
  21. std::istream& operator>>(
  22. std::istream& is,
  23. EGCiphertext& input)
  24. {
  25. is >> input.mask >> input.encryptedMessage;
  26. return is;
  27. }