Use the libgcrypt SALSA20 cipher if available.
This commit is contained in:
@@ -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