|
|
@ -228,10 +228,13 @@ public:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::vector<unsigned char> vch2(vch.size() + 4);
|
|
|
|
std::vector<unsigned char> vch2(vch.size() + 4);
|
|
|
|
unsigned int nSize = vch.size();
|
|
|
|
unsigned int nSize = vch.size();
|
|
|
|
|
|
|
|
// BIGNUM's byte stream format expects 4 bytes of
|
|
|
|
|
|
|
|
// big endian size data info at the front
|
|
|
|
vch2[0] = (nSize >> 24) & 0xff;
|
|
|
|
vch2[0] = (nSize >> 24) & 0xff;
|
|
|
|
vch2[1] = (nSize >> 16) & 0xff;
|
|
|
|
vch2[1] = (nSize >> 16) & 0xff;
|
|
|
|
vch2[2] = (nSize >> 8) & 0xff;
|
|
|
|
vch2[2] = (nSize >> 8) & 0xff;
|
|
|
|
vch2[3] = (nSize >> 0) & 0xff;
|
|
|
|
vch2[3] = (nSize >> 0) & 0xff;
|
|
|
|
|
|
|
|
// swap data to big endian
|
|
|
|
reverse_copy(vch.begin(), vch.end(), vch2.begin() + 4);
|
|
|
|
reverse_copy(vch.begin(), vch.end(), vch2.begin() + 4);
|
|
|
|
BN_mpi2bn(&vch2[0], vch2.size(), this);
|
|
|
|
BN_mpi2bn(&vch2[0], vch2.size(), this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|