Skip to content

Commit

Permalink
No memory allocation for each C_DecryptUpdate.
Browse files Browse the repository at this point in the history
Before this change the allocated memory was growing after each
C_DecryptUpdate.
  • Loading branch information
Lars Silvén authored and larssilven committed Dec 13, 2024
1 parent 5c50a67 commit b8cf254
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/crypto/SymmetricAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ bool SymmetricAlgorithm::decryptUpdate(const ByteString& encryptedData, ByteStri
}

currentBufferSize += encryptedData.size();
currentAEADBuffer += encryptedData;
if (currentCipherMode == SymMode::GCM) {
currentAEADBuffer += encryptedData;
}

return true;
}
Expand Down

0 comments on commit b8cf254

Please sign in to comment.