From 91374b381eaf9c5b91a8fe0d33b47e75b89975a5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 28 Sep 2016 10:32:52 -0300 Subject: [PATCH] test --- basilisk/basilisk_swap.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/basilisk/basilisk_swap.c b/basilisk/basilisk_swap.c index e2c2e400e..b6d9bf8b5 100755 --- a/basilisk/basilisk_swap.c +++ b/basilisk/basilisk_swap.c @@ -97,7 +97,7 @@ void revcalc_rmd160_sha256(uint8_t rmd160[20],bits256 revhash) bits256 hash; int32_t i; for (i=0; i<32; i++) hash.bytes[i] = revhash.bytes[31-i]; - calc_rmd160_sha256(rmd160,revhash.bytes,sizeof(revhash)); + calc_rmd160_sha256(rmd160,hash.bytes,sizeof(hash)); } bits256 revcalc_sha256(bits256 revhash) @@ -171,7 +171,7 @@ int32_t basilisk_bobscript(uint8_t *rmd160,uint8_t *redeemscript,int32_t *redeem *secretstartp = n + 2; if ( 1 ) { - if ( 0 && bits256_nonz(privkey) != 0 ) + if ( 1 && bits256_nonz(privkey) != 0 ) { uint8_t bufA[20],bufB[20]; revcalc_rmd160_sha256(bufA,privkey); @@ -182,6 +182,12 @@ int32_t basilisk_bobscript(uint8_t *rmd160,uint8_t *redeemscript,int32_t *redeem printf("MATCHES BUFB\n"); else printf("secret160 matches neither\n"); memcpy(secret160,bufA,20); + for (i=0; i<20; i++) + printf("%02x",bufA[i]); + printf(" <- revcalc\n"); + for (i=0; i<20; i++) + printf("%02x",bufB[i]); + printf(" <- calc\n"); } n = bitcoin_secret160verify(redeemscript,n,secret160); }