Skip to content

Commit c7d0e40

Browse files
author
Greg Hewett
committed
fixes for recent integration
1 parent 0e6ce41 commit c7d0e40

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

include/mls/messages.h

+2
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,8 @@ struct PublicMessage
592592

593593
friend tls::ostream& operator<<(tls::ostream& str, const PublicMessage& obj);
594594
friend tls::istream& operator>>(tls::istream& str, PublicMessage& obj);
595+
friend bool operator==(const PublicMessage& lhs, const PublicMessage& rhs);
596+
friend bool operator!=(const PublicMessage& lhs, const PublicMessage& rhs);
595597

596598
private:
597599
GroupContent content;

lib/bytes/include/bytes/bytes.h

+2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ struct bytes
7979
auto& at(size_t pos) { return _data.at(pos); }
8080

8181
void resize(size_t count) { _data.resize(count); }
82+
void reserve(size_t len) { _data.reserve(len); }
83+
void push_back(uint8_t byte) { _data.push_back(byte); }
8284

8385
// Equality operators
8486
bool operator==(const bytes& other) const;

src/messages.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,19 @@ operator>>(tls::istream& str, PublicMessage& obj)
630630
return str;
631631
}
632632

633+
bool
634+
operator==(const PublicMessage& lhs, const PublicMessage& rhs)
635+
{
636+
return lhs.content == rhs.content && lhs.auth == rhs.auth &&
637+
lhs.membership_tag == rhs.membership_tag;
638+
}
639+
640+
bool
641+
operator!=(const PublicMessage& lhs, const PublicMessage& rhs)
642+
{
643+
return !(lhs == rhs);
644+
}
645+
633646
static bytes
634647
marshal_ciphertext_content(const GroupContent& content,
635648
const GroupContentAuthData& auth,

0 commit comments

Comments
 (0)