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:
-rw-r--r--src/crypto/SymmetricCipher.h2
-rw-r--r--src/crypto/SymmetricCipherBackend.h2
-rw-r--r--src/crypto/SymmetricCipherGcrypt.cpp6
-rw-r--r--src/crypto/SymmetricCipherGcrypt.h2
-rw-r--r--src/crypto/SymmetricCipherSalsa20.cpp4
-rw-r--r--src/crypto/SymmetricCipherSalsa20.h2
-rw-r--r--src/keys/CompositeKey.cpp4
-rw-r--r--src/keys/CompositeKey.h4
8 files changed, 13 insertions, 13 deletions
diff --git a/src/crypto/SymmetricCipher.h b/src/crypto/SymmetricCipher.h
index c5a6f7ece..c5c67543a 100644
--- a/src/crypto/SymmetricCipher.h
+++ b/src/crypto/SymmetricCipher.h
@@ -57,7 +57,7 @@ public:
m_backend->processInPlace(data);
}
- inline void processInPlace(QByteArray& data, int rounds) {
+ inline void processInPlace(QByteArray& data, quint64 rounds) {
Q_ASSERT(rounds > 0);
m_backend->processInPlace(data, rounds);
}
diff --git a/src/crypto/SymmetricCipherBackend.h b/src/crypto/SymmetricCipherBackend.h
index 64a545003..7b737839b 100644
--- a/src/crypto/SymmetricCipherBackend.h
+++ b/src/crypto/SymmetricCipherBackend.h
@@ -30,7 +30,7 @@ public:
virtual QByteArray process(const QByteArray& data) = 0;
virtual void processInPlace(QByteArray& data) = 0;
- virtual void processInPlace(QByteArray& data, int rounds) = 0;
+ virtual void processInPlace(QByteArray& data, quint64 rounds) = 0;
virtual void reset() = 0;
virtual int blockSize() const = 0;
diff --git a/src/crypto/SymmetricCipherGcrypt.cpp b/src/crypto/SymmetricCipherGcrypt.cpp
index ba5c1455b..fabe3c4d9 100644
--- a/src/crypto/SymmetricCipherGcrypt.cpp
+++ b/src/crypto/SymmetricCipherGcrypt.cpp
@@ -113,20 +113,20 @@ void SymmetricCipherGcrypt::processInPlace(QByteArray& data)
Q_ASSERT(error == 0);
}
-void SymmetricCipherGcrypt::processInPlace(QByteArray& data, int rounds)
+void SymmetricCipherGcrypt::processInPlace(QByteArray& data, quint64 rounds)
{
// TODO check block size
gcry_error_t error;
if (m_direction == SymmetricCipher::Decrypt) {
- for (int i = 0; i != rounds; ++i) {
+ for (quint64 i = 0; i != rounds; ++i) {
error = gcry_cipher_decrypt(m_ctx, data.data(), data.size(), 0, 0);
Q_ASSERT(error == 0);
}
}
else {
- for (int i = 0; i != rounds; ++i) {
+ for (quint64 i = 0; i != rounds; ++i) {
error = gcry_cipher_encrypt(m_ctx, data.data(), data.size(), 0, 0);
Q_ASSERT(error == 0);
}
diff --git a/src/crypto/SymmetricCipherGcrypt.h b/src/crypto/SymmetricCipherGcrypt.h
index ccf84ada6..3af7c705b 100644
--- a/src/crypto/SymmetricCipherGcrypt.h
+++ b/src/crypto/SymmetricCipherGcrypt.h
@@ -35,7 +35,7 @@ public:
QByteArray process(const QByteArray& data);
void processInPlace(QByteArray& data);
- void processInPlace(QByteArray& data, int rounds);
+ void processInPlace(QByteArray& data, quint64 rounds);
void reset();
int blockSize() const;
diff --git a/src/crypto/SymmetricCipherSalsa20.cpp b/src/crypto/SymmetricCipherSalsa20.cpp
index 53aa18baf..d8adb05dc 100644
--- a/src/crypto/SymmetricCipherSalsa20.cpp
+++ b/src/crypto/SymmetricCipherSalsa20.cpp
@@ -74,11 +74,11 @@ void SymmetricCipherSalsa20::processInPlace(QByteArray& data)
reinterpret_cast<u8*>(data.data()), data.size());
}
-void SymmetricCipherSalsa20::processInPlace(QByteArray& data, int rounds)
+void SymmetricCipherSalsa20::processInPlace(QByteArray& data, quint64 rounds)
{
Q_ASSERT((data.size() < blockSize()) || ((data.size() % blockSize()) == 0));
- for (int i = 0; i != rounds; ++i) {
+ for (quint64 i = 0; i != rounds; ++i) {
ECRYPT_encrypt_bytes(&m_ctx, reinterpret_cast<const u8*>(data.constData()),
reinterpret_cast<u8*>(data.data()), data.size());
}
diff --git a/src/crypto/SymmetricCipherSalsa20.h b/src/crypto/SymmetricCipherSalsa20.h
index d0ba39849..ea91e71e7 100644
--- a/src/crypto/SymmetricCipherSalsa20.h
+++ b/src/crypto/SymmetricCipherSalsa20.h
@@ -37,7 +37,7 @@ public:
QByteArray process(const QByteArray& data);
void processInPlace(QByteArray& data);
- void processInPlace(QByteArray& data, int rounds);
+ void processInPlace(QByteArray& data, quint64 rounds);
void reset();
int blockSize() const;
diff --git a/src/keys/CompositeKey.cpp b/src/keys/CompositeKey.cpp
index 0dbcacce9..33a638b08 100644
--- a/src/keys/CompositeKey.cpp
+++ b/src/keys/CompositeKey.cpp
@@ -71,7 +71,7 @@ QByteArray CompositeKey::rawKey() const
return cryptoHash.result();
}
-QByteArray CompositeKey::transform(const QByteArray& seed, int rounds) const
+QByteArray CompositeKey::transform(const QByteArray& seed, quint64 rounds) const
{
Q_ASSERT(seed.size() == 32);
Q_ASSERT(rounds > 0);
@@ -89,7 +89,7 @@ QByteArray CompositeKey::transform(const QByteArray& seed, int rounds) const
}
QByteArray CompositeKey::transformKeyRaw(const QByteArray& key, const QByteArray& seed,
- int rounds) {
+ quint64 rounds) {
QByteArray iv(16, 0);
SymmetricCipher cipher(SymmetricCipher::Aes256, SymmetricCipher::Ecb,
SymmetricCipher::Encrypt, seed, iv);
diff --git a/src/keys/CompositeKey.h b/src/keys/CompositeKey.h
index e95d521fd..c95dcfd84 100644
--- a/src/keys/CompositeKey.h
+++ b/src/keys/CompositeKey.h
@@ -33,14 +33,14 @@ public:
CompositeKey& operator=(const CompositeKey& key);
QByteArray rawKey() const;
- QByteArray transform(const QByteArray& seed, int rounds) const;
+ QByteArray transform(const QByteArray& seed, quint64 rounds) const;
void addKey(const Key& key);
static int transformKeyBenchmark(int msec);
private:
static QByteArray transformKeyRaw(const QByteArray& key, const QByteArray& seed,
- int rounds);
+ quint64 rounds);
QList<Key*> m_keys;
};