Fix crypto implementation compilation errors
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user