jl777 8 years ago
parent
commit
04877f8392
  1. 2
      basilisk/basilisk.h
  2. 2
      basilisk/basilisk_swap.c
  3. 32
      iguana/iguana_interpreter.c

2
basilisk/basilisk.h

@ -16,7 +16,7 @@
#ifndef H_BASILISK_H
#define H_BASILISK_H
#define BASILISK_DISABLESENDTX
//#define BASILISK_DISABLESENDTX
#define BASILISK_DISABLEWAITTX
#include "../iguana/iguana777.h"

2
basilisk/basilisk_swap.c

@ -331,7 +331,7 @@ int32_t basilisk_swapuserdata(uint8_t *userdata,int32_t pushpriv,bits256 privkey
{
userdata[len++] = sizeof(privkey);
for (i=0; i<sizeof(privkey); i++)
userdata[len++] = privkey.bytes[sizeof(privkey) - 1 - i];
userdata[len++] = privkey.bytes[i];//sizeof(privkey) - 1 - i];
}
userdata[len++] = 0x51 * ifpath; // ifpath == 1 -> if path, 0 -> else path
return(len);

32
iguana/iguana_interpreter.c

@ -1337,38 +1337,38 @@ int32_t bitcoin_assembler(struct iguana_info *coin,cJSON *logarray,uint8_t scrip
}
else if ( (op->flags & IGUANA_CRYPTOFLAG) != 0 )
{
uint8_t rmd160[20],revrmd160[20]; bits256 hash,revhash;
uint8_t rmd160[20]; bits256 hash; //,revrmd160[20]; bits256 hash,revhash;
datalen = iguana_databuf(databuf,args[0]);
switch ( op->opcode )
{
case IGUANA_OP_RIPEMD160:
calc_rmd160(0,revrmd160,databuf,datalen);
for (i=0; i<20; i++)
rmd160[i] = revrmd160[19-i];
calc_rmd160(0,rmd160,databuf,datalen);
//for (i=0; i<20; i++)
// rmd160[i] = revrmd160[19-i];
iguana_pushdata(stacks,0,rmd160,sizeof(rmd160));
break;
case IGUANA_OP_SHA1:
calc_sha1(0,revrmd160,databuf,datalen);
for (i=0; i<20; i++)
rmd160[i] = revrmd160[19-i];
calc_sha1(0,rmd160,databuf,datalen);
//for (i=0; i<20; i++)
// rmd160[i] = revrmd160[19-i];
iguana_pushdata(stacks,0,rmd160,sizeof(rmd160));
break;
case IGUANA_OP_HASH160:
calc_rmd160_sha256(revrmd160,databuf,datalen);
for (i=0; i<20; i++)
rmd160[i] = revrmd160[19-i];
calc_rmd160_sha256(rmd160,databuf,datalen);
//for (i=0; i<20; i++)
// rmd160[i] = revrmd160[19-i];
iguana_pushdata(stacks,0,rmd160,sizeof(rmd160));
break;
case IGUANA_OP_SHA256:
vcalc_sha256(0,revhash.bytes,databuf,datalen);
for (i=0; i<32; i++)
hash.bytes[i] = revhash.bytes[31-i];
vcalc_sha256(0,hash.bytes,databuf,datalen);
//for (i=0; i<32; i++)
// hash.bytes[i] = revhash.bytes[31-i];
iguana_pushdata(stacks,0,hash.bytes,sizeof(hash));
break;
case IGUANA_OP_HASH256:
revhash = bits256_doublesha256(0,databuf,datalen);
for (i=0; i<32; i++)
hash.bytes[i] = revhash.bytes[31-i];
hash = bits256_doublesha256(0,databuf,datalen);
//for (i=0; i<32; i++)
// hash.bytes[i] = revhash.bytes[31-i];
iguana_pushdata(stacks,0,hash.bytes,sizeof(hash));
break;
case IGUANA_OP_CHECKSIG: case IGUANA_OP_CHECKSIGVERIFY:

Loading…
Cancel
Save