EGCiphertext.cpp 661 B

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