Allow adjusting number of rounds for the key derivation function

This commit is contained in:
stoffu
2018-07-06 18:39:58 +09:00
parent 45781ab4a1
commit c840e2b664
7 changed files with 56 additions and 21 deletions

View File

@@ -33,7 +33,7 @@ public:
static WalletManager * instance();
// wizard: createWallet path;
Q_INVOKABLE Wallet * createWallet(const QString &path, const QString &password,
const QString &language, NetworkType::Type nettype = NetworkType::MAINNET);
const QString &language, NetworkType::Type nettype = NetworkType::MAINNET, quint64 kdfRounds = 1);
/*!
* \brief openWallet - opens wallet by given path
@@ -42,17 +42,17 @@ public:
* \param nettype - type of network the wallet is running on
* \return wallet object pointer
*/
Q_INVOKABLE Wallet * openWallet(const QString &path, const QString &password, NetworkType::Type nettype = NetworkType::MAINNET);
Q_INVOKABLE Wallet * openWallet(const QString &path, const QString &password, NetworkType::Type nettype = NetworkType::MAINNET, quint64 kdfRounds = 1);
/*!
* \brief openWalletAsync - asynchronous version of "openWallet". Returns immediately. "walletOpened" signal
* emitted when wallet opened;
*/
Q_INVOKABLE void openWalletAsync(const QString &path, const QString &password, NetworkType::Type nettype = NetworkType::MAINNET);
Q_INVOKABLE void openWalletAsync(const QString &path, const QString &password, NetworkType::Type nettype = NetworkType::MAINNET, quint64 kdfRounds = 1);
// wizard: recoveryWallet path; hint: internally it recorvers wallet and set password = ""
Q_INVOKABLE Wallet * recoveryWallet(const QString &path, const QString &memo,
NetworkType::Type nettype = NetworkType::MAINNET, quint64 restoreHeight = 0);
NetworkType::Type nettype = NetworkType::MAINNET, quint64 restoreHeight = 0, quint64 kdfRounds = 1);
Q_INVOKABLE Wallet * createWalletFromKeys(const QString &path,
const QString &language,
@@ -60,7 +60,8 @@ public:
const QString &address,
const QString &viewkey,
const QString &spendkey = "",
quint64 restoreHeight = 0);
quint64 restoreHeight = 0,
quint64 kdfRounds = 1);
Q_INVOKABLE Wallet * createWalletFromDevice(const QString &path,
const QString &password,