48 using Factory = std::function<std::unique_ptr<Cipher<16>>(
49 const uint8_t* key,
const std::array<uint8_t, 16>& init_vector)>;
59 const std::array<uint8_t, 16>& init_vector)
const;
67 mutable std::mutex mutex_;
68 std::map<Database::Cipher, Factory> factories_;
Block and stream cipher abstractions for KeePass encryption.
Process-wide registry for 16-byte block ciphers.
Definition cipher_registry.hh:45
bool Contains(Database::Cipher cipher) const
Returns whether a block-cipher factory is registered for cipher.
static CipherRegistry & Instance()
Returns the process-wide registry.
void Register(Database::Cipher cipher, Factory factory)
Registers/overwrites the factory for a payload cipher id.
std::unique_ptr< Cipher< 16 > > Create(Database::Cipher cipher, const uint8_t *key, const std::array< uint8_t, 16 > &init_vector) const
Creates a block cipher, or throws UnsupportedFeatureError.
std::function< std::unique_ptr< Cipher< 16 > >(const uint8_t *key, const std::array< uint8_t, 16 > &init_vector)> Factory
Creates a block cipher for the given 32-byte key and IV.
Definition cipher_registry.hh:49
Cipher
Cipher algorithms supported for encrypting the database payload.
Definition database.hh:77
In-memory representation of a KeePass database.
Visibility/export macro for the shared library.
#define LIBKEEPASS_API
Marks a class, function or variable as part of the public ABI.
Definition export.hh:43