mirror of
https://github.com/feather-wallet/feather.git
synced 2024-12-22 11:39:25 +00:00
dice: domain separate by number of sides
This commit is contained in:
parent
a131bbc165
commit
9f109e8c42
1 changed files with 3 additions and 1 deletions
|
@ -100,8 +100,10 @@ SeedDiceDialog::SeedDiceDialog(QWidget *parent)
|
|||
|
||||
data.append(random, POLYSEED_RANDBYTES);
|
||||
|
||||
int sides = ui->radio_coinflip->isChecked() ? 2 : ui->spin_sides->value();
|
||||
QByteArray salt = "POLYSEED-" + QString::number(sides).toUtf8(); // domain separate by number of sides
|
||||
|
||||
// Polyseed requests 19 bytes of random data and discards two bits (for a total of 150 bits)
|
||||
QByteArray salt = "POLYSEED";
|
||||
m_key = QPasswordDigestor::deriveKeyPbkdf2(QCryptographicHash::Sha256, data, salt, 2048, 19);
|
||||
|
||||
sodium_memzero(data.data(), data.size());
|
||||
|
|
Loading…
Reference in a new issue