|
@ -231,6 +231,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan |
|
|
{ |
|
|
{ |
|
|
calc_NXTaddr(G.LP_NXTaddr,userpub.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); |
|
|
calc_NXTaddr(G.LP_NXTaddr,userpub.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); |
|
|
conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); |
|
|
conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); |
|
|
|
|
|
privkey.bytes[0] &= 248, privkey.bytes[31] &= 127, privkey.bytes[31] |= 64; |
|
|
//vcalc_sha256(0,checkkey.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase));
|
|
|
//vcalc_sha256(0,checkkey.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase));
|
|
|
//printf("SHA256.(%s) ",bits256_str(pstr,checkkey));
|
|
|
//printf("SHA256.(%s) ",bits256_str(pstr,checkkey));
|
|
|
//printf("privkey.(%s)\n",bits256_str(pstr,privkey));
|
|
|
//printf("privkey.(%s)\n",bits256_str(pstr,privkey));
|
|
@ -238,10 +239,13 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
bitcoin_wif2priv(coin->wiftaddr,&tmptype,&privkey,wifstr); |
|
|
bitcoin_wif2priv(coin->wiftaddr,&tmptype,&privkey,wifstr); |
|
|
|
|
|
privkey.bytes[0] &= 248, privkey.bytes[31] &= 127, privkey.bytes[31] |= 64; |
|
|
|
|
|
bitcoin_priv2wif(coin->wiftaddr,tmpstr,privkey,coin->wiftype); |
|
|
|
|
|
if ( strcmp(tmpstr,wifstr) != 0 ) |
|
|
|
|
|
printf("converted %s != %s\n",tmpstr,wifstr); |
|
|
nxtaddr = conv_NXTpassword(privkey.bytes,pubkeyp->bytes,0,0); |
|
|
nxtaddr = conv_NXTpassword(privkey.bytes,pubkeyp->bytes,0,0); |
|
|
RS_encode(G.LP_NXTaddr,nxtaddr); |
|
|
RS_encode(G.LP_NXTaddr,nxtaddr); |
|
|
} |
|
|
} |
|
|
privkey.bytes[0] &= 248, privkey.bytes[31] &= 127, privkey.bytes[31] |= 64; |
|
|
|
|
|
bitcoin_priv2pub(ctx,coin->pubkey33,coin->smartaddr,privkey,coin->taddr,coin->pubtype); |
|
|
bitcoin_priv2pub(ctx,coin->pubkey33,coin->smartaddr,privkey,coin->taddr,coin->pubtype); |
|
|
if ( coin->counter == 0 ) |
|
|
if ( coin->counter == 0 ) |
|
|
{ |
|
|
{ |
|
|