mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Untie the dependencies between NewcoinAddress and BIGNUM.
This commit is contained in:
@@ -503,12 +503,33 @@ BIGNUM* NewcoinAddress::getFamilyGeneratorBN() const
|
||||
throw std::runtime_error(str(boost::format("bad source: %d") % int(nVersion)));
|
||||
}
|
||||
|
||||
assert(vchData.size() <= (256 / 8));
|
||||
BIGNUM* ret = BN_bin2bn(&vchData[0], vchData.size(), NULL);
|
||||
assert(ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint256 NewcoinAddress::getFamilyGeneratorU() const
|
||||
{
|
||||
switch (nVersion) {
|
||||
case VER_NONE:
|
||||
throw std::runtime_error("unset source");
|
||||
|
||||
case VER_FAMILY_GENERATOR:
|
||||
// Do nothing.
|
||||
break;
|
||||
|
||||
default:
|
||||
throw std::runtime_error(str(boost::format("bad source: %d") % int(nVersion)));
|
||||
}
|
||||
|
||||
assert(vchData.size() <= (256 / 8));
|
||||
uint256 ret;
|
||||
memcpy(ret.begin() + (ret.size() - vchData.size()), &vchData[0], vchData.size());
|
||||
return ret;
|
||||
}
|
||||
|
||||
const std::vector<unsigned char>& NewcoinAddress::getFamilyGenerator() const
|
||||
{
|
||||
switch (nVersion) {
|
||||
|
||||
Reference in New Issue
Block a user