before buffers were cleard becouse of constructors
of ByteArrays now i need to clear them myself
This commit is contained in:
nikola 2024-07-05 16:54:42 +02:00
parent bddcd66e28
commit 0a37b65539

@ -122,6 +122,8 @@ bool Aes256::encrypt(const std::string &key, const Buffer &plain, Buffer &encryp
{
Aes256 aes(key);
encrypted.clear();
aes.encrypt_start(plain.taken, encrypted);
aes.encrypt_continue(plain, encrypted);
aes.encrypt_end(encrypted);
@ -133,6 +135,8 @@ bool Aes256::decrypt(const std::string &key, const Buffer &encrypted, Buffer &pl
{
Aes256 aes(key);
plain.clear();
aes.decrypt_start(encrypted.taken);
aes.decrypt_continue(encrypted, plain);
aes.decrypt_end(plain);