1
0
Fork 0
forked from lthn/blockchain

crypto: more of point_t::operator== and !=

This commit is contained in:
sowle 2023-04-08 03:17:21 +02:00
parent 447b09f400
commit db873c8dc2
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -815,12 +815,32 @@ namespace crypto
return false;
return true;
};
}
friend bool operator!=(const point_t& lhs, const point_t& rhs)
{
return !(lhs == rhs);
};
}
friend bool operator==(const point_t& lhs, const public_key& rhs)
{
return lhs.to_public_key() == rhs;
}
friend bool operator!=(const point_t& lhs, const public_key& rhs)
{
return !(lhs == rhs);
}
friend bool operator==(const public_key& lhs, const point_t& rhs)
{
return lhs == rhs.to_public_key();
}
friend bool operator!=(const public_key& lhs, const point_t& rhs)
{
return !(lhs == rhs);
}
friend std::ostream& operator<<(std::ostream& ss, const point_t &v)
{