Browse Source

Test

etomic
jl777 7 years ago
parent
commit
26edba6ae1
  1. 19
      iguana/exchanges/LP_privkey.c
  2. 1
      iguana/exchanges/mm.c

19
iguana/exchanges/LP_privkey.c

@ -374,4 +374,21 @@ int32_t LP_passphrase_init(char *passphrase,char *gui)
return(0);
}
void LP_privkey_tests()
{
char wifstr[64],str[65],str2[65]; bits256 privkey,checkkey; int32_t i; uint8_t tmptype;
for (i=0; i<10000000; i++)
{
privkey = rand256(0);
bitcoin_priv2wif(0,wifstr,privkey,0);
bitcoin_wif2priv(0,&tmptype,&checkkey,wifstr);
if ( bits256_cmp(privkey,checkkey) != 0 )
{
printf("i.%d: %s != %s\n",i,bits256_str(str,privkey),bits256_str(str2,checkkey));
exit(-1);
}
if ( (i % 1000000) == 0 )
fprintf(stderr,"%.1f%% ",100.*(double)i/10000000);
}
printf("%d privkeys checked\n",i);
}

1
iguana/exchanges/mm.c

@ -122,6 +122,7 @@ int main(int argc, const char * argv[])
#else
if ( argc == 1 )
{
LP_privkey_tests();
LP_NXT_redeems();
sleep(3);
return(0);

Loading…
Cancel
Save