diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-05-26 12:50:30 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-05-29 08:17:56 +0200 |
commit | c2d87291dbf8bd240e3e96138ec52aa5da22416b (patch) | |
tree | 86cc1e5473383780ac9343ec8aeea578cd0356ff /autotests | |
parent | 841846ea5efad80ce20e0d42b1885def224e58ad (diff) | |
download | libquotient-c2d87291dbf8bd240e3e96138ec52aa5da22416b.tar.gz libquotient-c2d87291dbf8bd240e3e96138ec52aa5da22416b.zip |
Move encryptFile/decryptFile out of EncryptedFileMetadata
These are not operations on EncryptedFileMetadata but rather on
a combination of EncryptedFileMetadata and ciphertext. If C++ had
multimethods these could be bound to such a combination.
Diffstat (limited to 'autotests')
-rw-r--r-- | autotests/testfilecrypto.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/autotests/testfilecrypto.cpp b/autotests/testfilecrypto.cpp index b86114a4..29521060 100644 --- a/autotests/testfilecrypto.cpp +++ b/autotests/testfilecrypto.cpp @@ -12,8 +12,8 @@ using namespace Quotient; void TestFileCrypto::encryptDecryptData() { QByteArray data = "ABCDEF"; - auto [file, cipherText] = EncryptedFileMetadata::encryptFile(data); - auto decrypted = file.decryptFile(cipherText); + auto [file, cipherText] = encryptFile(data); + auto decrypted = decryptFile(cipherText, file); // AES CTR produces ciphertext of the same size as the original QCOMPARE(cipherText.size(), data.size()); QCOMPARE(decrypted.size(), data.size()); |