Skip to content

Commit 2eab6c5

Browse files
Lars Silvénlarssilven
authored andcommitted
No memory allocation for each C_DecryptUpdate.
Before this change the allocated memory was growing after each C_DecryptUpdate.
1 parent 4be49e3 commit 2eab6c5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/lib/crypto/SymmetricAlgorithm.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ bool SymmetricAlgorithm::decryptUpdate(const ByteString& encryptedData, ByteStri
121121
}
122122

123123
currentBufferSize += encryptedData.size();
124-
currentAEADBuffer += encryptedData;
124+
if (currentCipherMode == SymMode::GCM) {
125+
currentAEADBuffer += encryptedData;
126+
}
125127

126128
return true;
127129
}

0 commit comments

Comments
 (0)