Browse Source

test

etomic
jl777 8 years ago
parent
commit
d1b84b6e0e
  1. 6
      iguana/dpow/dpow_network.c
  2. 1
      iguana/iguana_secp.c

6
iguana/dpow/dpow_network.c

@ -46,9 +46,9 @@ int32_t signed_nn_send(void *ctx,bits256 privkey,int32_t sock,void *packet,int32
printf(" signed pubkey\n"); printf(" signed pubkey\n");
} }
sentbytes = nn_send(sock,sigpacket,size + sizeof(*sigpacket),0); sentbytes = nn_send(sock,sigpacket,size + sizeof(*sigpacket),0);
for (i=0; i<size+sizeof(*sigpacket); i++) //for (i=0; i<size+sizeof(*sigpacket); i++)
printf("%02x",((uint8_t *)sigpacket)[i]); // printf("%02x",((uint8_t *)sigpacket)[i]);
printf(" <- nnsend\n"); //printf(" <- nnsend\n");
return(sentbytes - siglen); return(sentbytes - siglen);
} else printf("couldnt find nonce\n"); } else printf("couldnt find nonce\n");
free(sigpacket); free(sigpacket);

1
iguana/iguana_secp.c

@ -167,6 +167,7 @@ int32_t bitcoin_recoververify(void *ctx,char *symbol,uint8_t *sig,bits256 messag
if ( secp256k1_ecdsa_recover(ctx,&PUB,&rSIG,messagehash2.bytes) != 0 ) if ( secp256k1_ecdsa_recover(ctx,&PUB,&rSIG,messagehash2.bytes) != 0 )
{ {
plen = 33; plen = 33;
memset(pubkey,0,33);
secp256k1_ec_pubkey_serialize(ctx,pubkey,&plen,&PUB,SECP256K1_EC_COMPRESSED);//plen == 65 ? SECP256K1_EC_UNCOMPRESSED : SECP256K1_EC_COMPRESSED); secp256k1_ec_pubkey_serialize(ctx,pubkey,&plen,&PUB,SECP256K1_EC_COMPRESSED);//plen == 65 ? SECP256K1_EC_UNCOMPRESSED : SECP256K1_EC_COMPRESSED);
if ( secp256k1_ecdsa_verify(ctx,&SIG,messagehash2.bytes,&PUB) != 0 ) if ( secp256k1_ecdsa_verify(ctx,&SIG,messagehash2.bytes,&PUB) != 0 )
{ {

Loading…
Cancel
Save