From d8e3f1d5f634c72e3d792adfd4280735d23eb4c2 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Wed, 24 Mar 2021 09:45:30 -0700 Subject: [PATCH] [dns-types] declare 'Ecdsa256KeyRecord' as 'Equatable' (#6335) --- src/core/net/dns_types.hpp | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/core/net/dns_types.hpp b/src/core/net/dns_types.hpp index 69fa90a75..b9d40cb6a 100644 --- a/src/core/net/dns_types.hpp +++ b/src/core/net/dns_types.hpp @@ -41,6 +41,7 @@ #include "common/clearable.hpp" #include "common/encoding.hpp" +#include "common/equatable.hpp" #include "common/message.hpp" #include "crypto/ecdsa.hpp" #include "net/ip6_address.hpp" @@ -2025,7 +2026,7 @@ private: #if OPENTHREAD_CONFIG_SRP_SERVER_ENABLE OT_TOOL_PACKED_BEGIN -class Ecdsa256KeyRecord : public KeyRecord, public Clearable +class Ecdsa256KeyRecord : public KeyRecord, public Clearable, public Equatable { public: /** @@ -2052,26 +2053,6 @@ public: */ const Crypto::Ecdsa::P256::PublicKey &GetKey(void) const { return mKey; } - /** - * This comparator tells whether two Ecdsa256KeyRecord objects are equal. - * - * @param[in] aOther The other Ecdsa256KeyRecord object. - * - * @returns TRUE if they are equal, FALSE if not. - * - */ - bool operator==(const Ecdsa256KeyRecord &aOther) const { return memcmp(this, &aOther, sizeof(*this)) == 0; } - - /** - * This comparator tells whether two Ecdsa256KeyRecord objects are not equal. - * - * @param[in] aOther The other Ecdsa256KeyRecord object. - * - * @returns TRUE if they are not equal, FALSE if equal. - * - */ - bool operator!=(const Ecdsa256KeyRecord &aOther) const { return !(*this == aOther); } - private: Crypto::Ecdsa::P256::PublicKey mKey; } OT_TOOL_PACKED_END;