mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-27 18:10:31 -05:00
Formatting the code.
This commit is contained in:
parent
74efc57369
commit
8324d03f0a
294 changed files with 3796 additions and 3740 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue