Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/TestCryptoHash.cpp')
-rw-r--r--tests/TestCryptoHash.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/TestCryptoHash.cpp b/tests/TestCryptoHash.cpp
index c166f5595..914bcf193 100644
--- a/tests/TestCryptoHash.cpp
+++ b/tests/TestCryptoHash.cpp
@@ -16,8 +16,7 @@
*/
#include "TestCryptoHash.h"
-
-#include <QTest>
+#include "TestGlobal.h"
#include "crypto/Crypto.h"
#include "crypto/CryptoHash.h"
@@ -44,4 +43,17 @@ void TestCryptoHash::test()
cryptoHash3.addData(QString("ssX").toLatin1());
QCOMPARE(cryptoHash3.result(),
QByteArray::fromHex("0b56e5f65263e747af4a833bd7dd7ad26a64d7a4de7c68e52364893dca0766b4"));
+
+ CryptoHash cryptoHash2(CryptoHash::Sha512);
+ QCOMPARE(cryptoHash2.result(),
+ QByteArray::fromHex("cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"));
+
+ QByteArray result3 = CryptoHash::hash(source2, CryptoHash::Sha512);
+ QCOMPARE(result3, QByteArray::fromHex("0d41b612584ed39ff72944c29494573e40f4bb95283455fae2e0be1e3565aa9f48057d59e6ffd777970e282871c25a549a2763e5b724794f312c97021c42f91d"));
+
+ CryptoHash cryptoHash4(CryptoHash::Sha512);
+ cryptoHash4.addData(QString("KeePa").toLatin1());
+ cryptoHash4.addData(QString("ssX").toLatin1());
+ QCOMPARE(cryptoHash4.result(),
+ QByteArray::fromHex("0d41b612584ed39ff72944c29494573e40f4bb95283455fae2e0be1e3565aa9f48057d59e6ffd777970e282871c25a549a2763e5b724794f312c97021c42f91d"));
}