mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-12 18:49:07 +00:00
gui: fixup after ECDSA updates
This commit is contained in:
parent
ea16aa0b86
commit
749cf8b75f
@ -4,7 +4,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
TARGET = gui
|
||||
TEMPLATE = app
|
||||
|
||||
SOURCES += ../bip32.c ../bip39.c ../sha2.c ../pbkdf2.c ../hmac.c ../rand.c ../bignum.c ../ecdsa.c ../ripemd160.c ../base58.c ../secp256k1.c mainwindow.cpp main.cpp
|
||||
SOURCES += ../bip32.c ../bip39.c ../sha2.c ../pbkdf2.c ../hmac.c ../rand.c ../bignum.c ../ecdsa.c ../ripemd160.c ../base58.c ../secp256k1.c ../nist256p1.c mainwindow.cpp main.cpp
|
||||
|
||||
HEADERS += mainwindow.h ../bip32.h ../bip39.h
|
||||
|
||||
|
@ -45,7 +45,8 @@ void MainWindow::on_spinAccount_valueChanged(int arg1)
|
||||
{
|
||||
if (!root_set) return;
|
||||
const char addr_version = 0x00, wif_version = 0x80;
|
||||
char buf[128];
|
||||
const size_t buflen = 128;
|
||||
char buf[buflen + 1];
|
||||
HDNode node;
|
||||
// external chain
|
||||
for (int chain = 0; chain < 2; chain++) {
|
||||
@ -54,14 +55,14 @@ void MainWindow::on_spinAccount_valueChanged(int arg1)
|
||||
hdnode_private_ckd(&node, 44 | 0x80000000);
|
||||
hdnode_private_ckd(&node, 0 | 0x80000000); // bitcoin
|
||||
hdnode_private_ckd(&node, (arg1 - 1) | 0x80000000);
|
||||
hdnode_serialize_private(&node, buf); QString xprv = QString(buf); ui->lineXprv->setText(xprv);
|
||||
hdnode_serialize_public(&node, buf); QString xpub = QString(buf); ui->lineXpub->setText(xpub);
|
||||
hdnode_serialize_private(&node, buf, buflen); QString xprv = QString(buf); ui->lineXprv->setText(xprv);
|
||||
hdnode_serialize_public(&node, buf, buflen); QString xpub = QString(buf); ui->lineXpub->setText(xpub);
|
||||
hdnode_private_ckd(&node, chain); // external / internal
|
||||
for (int i = 0; i < 100; i++) {
|
||||
HDNode node2 = node;
|
||||
hdnode_private_ckd(&node2, i);
|
||||
ecdsa_get_address(node2.public_key, addr_version, buf); QString address = QString(buf);
|
||||
ecdsa_get_wif(node2.private_key, wif_version, buf); QString wif = QString(buf);
|
||||
ecdsa_get_address(node2.public_key, addr_version, buf, buflen); QString address = QString(buf);
|
||||
ecdsa_get_wif(node2.private_key, wif_version, buf, buflen); QString wif = QString(buf);
|
||||
list->setItem(i, 0, new QTableWidgetItem(address));
|
||||
list->setItem(i, 1, new QTableWidgetItem(wif));
|
||||
list->setItem(i, 2, new QTableWidgetItem("0.0"));
|
||||
|
Loading…
Reference in New Issue
Block a user