Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Group] Decryption optimization #14974

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
optimization
  • Loading branch information
jepenven-silabs committed Feb 9, 2022
commit 8fce7326f2c793dfc3358fef8db4379ad8389fbc
5 changes: 5 additions & 0 deletions src/transport/SessionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,11 @@ void SessionManager::SecureGroupMessageDispatch(const PacketHeader & packetHeade
bool decrypted = false;
while (!decrypted && iter->Next(groupContext))
{
// Optimization to reduce number of decryption attempt
jepenven-silabs marked this conversation as resolved.
Show resolved Hide resolved
if (groupId != groupContext.group_id)
jepenven-silabs marked this conversation as resolved.
Show resolved Hide resolved
{
continue;
}
msgCopy = msg.CloneData();
decrypted =
(CHIP_NO_ERROR == SecureMessageCodec::Decrypt(CryptoContext(groupContext.key), payloadHeader, packetHeader, msgCopy));
Expand Down