Fix crypto implementation compilation errors

This commit is contained in:
2025-08-28 09:42:45 +02:00
parent b1acb0ba81
commit b384a6a404

View File

@ -77,7 +77,7 @@ std::vector<unsigned char> Crypto::decrypt(const std::vector<unsigned char>& cip
std::vector<unsigned char> plaintext(ciphertext.size());
// Perform decryption and authentication
DecryptionResult result = decryption.DecryptAndVerify(
bool valid = decryption.DecryptAndVerify(
plaintext.data(),
auth_tag.data(),
auth_tag.size(),
@ -89,13 +89,10 @@ std::vector<unsigned char> Crypto::decrypt(const std::vector<unsigned char>& cip
ciphertext.size()
);
if(!result.isValidCoding) {
if(!valid) {
throw std::runtime_error("Authentication failed during decryption");
}
// Resize to actual plaintext size
plaintext.resize(result.messageLength);
return plaintext;
}
catch(const Exception& e) {