Skip to content

Commit

Permalink
fixes for recent integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Hewett committed Sep 7, 2023
1 parent 0e6ce41 commit c7d0e40
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/mls/messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,8 @@ struct PublicMessage

friend tls::ostream& operator<<(tls::ostream& str, const PublicMessage& obj);
friend tls::istream& operator>>(tls::istream& str, PublicMessage& obj);
friend bool operator==(const PublicMessage& lhs, const PublicMessage& rhs);
friend bool operator!=(const PublicMessage& lhs, const PublicMessage& rhs);

private:
GroupContent content;
Expand Down
2 changes: 2 additions & 0 deletions lib/bytes/include/bytes/bytes.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ struct bytes
auto& at(size_t pos) { return _data.at(pos); }

void resize(size_t count) { _data.resize(count); }
void reserve(size_t len) { _data.reserve(len); }
void push_back(uint8_t byte) { _data.push_back(byte); }

// Equality operators
bool operator==(const bytes& other) const;
Expand Down
13 changes: 13 additions & 0 deletions src/messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,19 @@ operator>>(tls::istream& str, PublicMessage& obj)
return str;
}

bool
operator==(const PublicMessage& lhs, const PublicMessage& rhs)
{
return lhs.content == rhs.content && lhs.auth == rhs.auth &&
lhs.membership_tag == rhs.membership_tag;
}

bool
operator!=(const PublicMessage& lhs, const PublicMessage& rhs)
{
return !(lhs == rhs);
}

static bytes
marshal_ciphertext_content(const GroupContent& content,
const GroupContentAuthData& auth,
Expand Down

0 comments on commit c7d0e40

Please sign in to comment.