mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-29 00:47:32 -04:00
Add support for various algorithms for kdbx4
* Add SHA512 support to CryptoHash * Add ChaCha20 support * Add HMAC support * Add new HmacBlockStream, used in KDBX 4 * Add support for ChaCha20 protected stream
This commit is contained in:
parent
4532108678
commit
6a0d05e1ef
23 changed files with 616 additions and 25 deletions
|
@ -21,11 +21,13 @@
|
|||
#include <QByteArray>
|
||||
|
||||
#include "crypto/SymmetricCipher.h"
|
||||
#include "KeePass2.h"
|
||||
|
||||
class KeePass2RandomStream
|
||||
{
|
||||
public:
|
||||
KeePass2RandomStream();
|
||||
KeePass2RandomStream(KeePass2::ProtectedStreamAlgo algo);
|
||||
|
||||
bool init(const QByteArray& key);
|
||||
QByteArray randomBytes(int size, bool* ok);
|
||||
QByteArray process(const QByteArray& data, bool* ok);
|
||||
|
@ -38,6 +40,8 @@ private:
|
|||
SymmetricCipher m_cipher;
|
||||
QByteArray m_buffer;
|
||||
int m_offset;
|
||||
|
||||
static SymmetricCipher::Algorithm mapAlgo(KeePass2::ProtectedStreamAlgo algo);
|
||||
};
|
||||
|
||||
#endif // KEEPASSX_KEEPASS2RANDOMSTREAM_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue