Skip to content

Commit b8cf254

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 5c50a67 commit b8cf254

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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)