Support for compiling on 32-bit platforms. The main issue was BN_ULONG size and not using 'long' where

'long long' or 'uint64' should be used.
This commit is contained in:
JoelKatz
2013-01-15 23:47:42 -08:00
parent 0d7f8cbe13
commit 271bf901ec
5 changed files with 142 additions and 74 deletions

View File

@@ -51,7 +51,7 @@ inline std::string EncodeBase58(const unsigned char* pbegin, const unsigned char
if (!BN_div(&dv, &rem, &bn, &bn58, pctx))
throw bignum_error("EncodeBase58 : BN_div failed");
bn = dv;
unsigned int c = rem.getulong();
unsigned int c = rem.getuint();
str += ALPHABET[c];
}
@@ -91,7 +91,7 @@ inline bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet)
return false;
break;
}
bnChar.setulong(p1 - ALPHABET);
bnChar.setuint(p1 - ALPHABET);
if (!BN_mul(&bn, &bn, &bn58, pctx))
throw bignum_error("DecodeBase58 : BN_mul failed");
bn += bnChar;