Formatting the code.

This commit is contained in:
Louis-Bertrand Varin 2018-03-31 16:01:30 -04:00
parent 74efc57369
commit 8324d03f0a
294 changed files with 3796 additions and 3740 deletions

View file

@ -35,7 +35,6 @@ void TestKeePass2RandomStream::test()
const QByteArray key("\x11\x22\x33\x44\x55\x66\x77\x88");
const int Size = 128;
SymmetricCipher cipher(SymmetricCipher::Salsa20, SymmetricCipher::Stream, SymmetricCipher::Encrypt);
QVERIFY(cipher.init(CryptoHash::hash(key, CryptoHash::Sha256), KeePass2::INNER_STREAM_SALSA20_IV));
@ -55,7 +54,6 @@ void TestKeePass2RandomStream::test()
cipherData[i] = data[i] ^ cipherPad[i];
}
KeePass2RandomStream randomStream(KeePass2::ProtectedStreamAlgo::Salsa20);
bool ok;
QVERIFY(randomStream.init(key));
@ -72,13 +70,11 @@ void TestKeePass2RandomStream::test()
randomStreamData.append(randomStream.process(data.mid(64, 64), &ok));
QVERIFY(ok);
SymmetricCipher cipherEncrypt(SymmetricCipher::Salsa20, SymmetricCipher::Stream, SymmetricCipher::Encrypt);
QVERIFY(cipherEncrypt.init(CryptoHash::hash(key, CryptoHash::Sha256), KeePass2::INNER_STREAM_SALSA20_IV));
QByteArray cipherDataEncrypt = cipherEncrypt.process(data, &ok);
QVERIFY(ok);
QCOMPARE(randomStreamData.size(), Size);
QCOMPARE(cipherData, cipherDataEncrypt);
QCOMPARE(randomStreamData, cipherData);