mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-12-03 15:22:34 -08:00
Use the libgcrypt SALSA20 cipher if available.
This commit is contained in:
1 parent
eee909e948
commit
0b6b149351
5 files changed
+33
-6
No files matched your search
@@ -17,6 +17,7 @@
|
||||
|
||||
#include "SymmetricCipherGcrypt.h"
|
||||
|
||||
#include "config-keepassx.h"
|
||||
#include "crypto/Crypto.h"
|
||||
|
||||
SymmetricCipherGcrypt::SymmetricCipherGcrypt(SymmetricCipher::Algorithm algo, SymmetricCipher::Mode mode,
|
||||
@@ -43,6 +44,11 @@ int SymmetricCipherGcrypt::gcryptAlgo(SymmetricCipher::Algorithm algo)
|
||||
case SymmetricCipher::Twofish:
|
||||
return GCRY_CIPHER_TWOFISH;
|
||||
|
||||
#ifdef GCRYPT_HAS_SALSA20
|
||||
case SymmetricCipher::Salsa20:
|
||||
return GCRY_CIPHER_SALSA20;
|
||||
#endif
|
||||
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
return -1;
|
||||
@@ -58,6 +64,9 @@ int SymmetricCipherGcrypt::gcryptMode(SymmetricCipher::Mode mode)
|
||||
case SymmetricCipher::Cbc:
|
||||
return GCRY_CIPHER_MODE_CBC;
|
||||
|
||||
case SymmetricCipher::Stream:
|
||||
return GCRY_CIPHER_MODE_STREAM;
|
||||
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
return -1;
|
||||
|
||||
Reference in new issue
Block a user