diff --git a/iguana/iguana_secp.c b/iguana/iguana_secp.c index 79b0a3477..8fbf81f52 100755 --- a/iguana/iguana_secp.c +++ b/iguana/iguana_secp.c @@ -23,92 +23,6 @@ static const char base58_chars[] = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; -void bn_mpi2bn(BIGNUM *vo,uint8_t *data,int32_t datalen) -{ - uint8_t vch2[64 + 4]; uint32_t i,vch2_len = (int32_t)datalen + 4; - if ( datalen < sizeof(vch2) ) - { - vch2[0] = (datalen >> 24) & 0xff; - vch2[1] = (datalen >> 16) & 0xff; - vch2[2] = (datalen >> 8) & 0xff; - vch2[3] = (datalen >> 0) & 0xff; - for (i=0; i= 4 && sz < sizeof(s_be) ) // get MPI format size - { - BN_bn2mpi(v,s_be); - // copy-swap MPI to little endian, sans 32-bit size prefix - sz -= 4; - for (i=0; i= 2 && revdata[len - 1] == 0 && revdata[len - 2] >= 0x80 ) - len--; - zeroes = 0; - for (p=coinaddr; *p==base58_chars[0]; p++) - zeroes++; - be_sz = (uint32_t)len + (uint32_t)zeroes; - memset(data,0,be_sz); - for (i=0; i> 24) & 0xff; + vch2[1] = (datalen >> 16) & 0xff; + vch2[2] = (datalen >> 8) & 0xff; + vch2[3] = (datalen >> 0) & 0xff; + for (i=0; i= 4 && sz < sizeof(s_be) ) // get MPI format size + { + BN_bn2mpi(v,s_be); + // copy-swap MPI to little endian, sans 32-bit size prefix + sz -= 4; + for (i=0; i= 2 && revdata[len - 1] == 0 && revdata[len - 2] >= 0x80 ) + len--; + zeroes = 0; + for (p=coinaddr; *p==base58_chars[0]; p++) + zeroes++; + be_sz = (uint32_t)len + (uint32_t)zeroes; + memset(data,0,be_sz); + for (i=0; i