|
|
@ -525,20 +525,26 @@ namespace openssl { |
|
|
|
public: |
|
|
|
public: |
|
|
|
BigNum(): |
|
|
|
BigNum(): |
|
|
|
_bn(BN_new()) { |
|
|
|
_bn(BN_new()) { |
|
|
|
|
|
|
|
OPENSSL_LOG("log"); |
|
|
|
} |
|
|
|
} |
|
|
|
BigNum(const std::string& num): |
|
|
|
BigNum(const std::string& num): |
|
|
|
_bn(BN_bin2bn((const unsigned char*)num.data(), num.size(), 0)) { |
|
|
|
_bn(BN_bin2bn((const unsigned char*)num.data(), num.size(), 0)) { |
|
|
|
|
|
|
|
OPENSSL_LOG("log"); |
|
|
|
} |
|
|
|
} |
|
|
|
~BigNum() { |
|
|
|
~BigNum() { |
|
|
|
|
|
|
|
OPENSSL_LOG("log"); |
|
|
|
BN_free(_bn); |
|
|
|
BN_free(_bn); |
|
|
|
} |
|
|
|
} |
|
|
|
int size() const { |
|
|
|
int size() const { |
|
|
|
|
|
|
|
OPENSSL_LOG("log"); |
|
|
|
return size(_bn); |
|
|
|
return size(_bn); |
|
|
|
} |
|
|
|
} |
|
|
|
static int size(BIGNUM* n) { |
|
|
|
static int size(BIGNUM* n) { |
|
|
|
|
|
|
|
OPENSSL_LOG("log"); |
|
|
|
return BN_num_bytes(n); |
|
|
|
return BN_num_bytes(n); |
|
|
|
} |
|
|
|
} |
|
|
|
std::string string() const { |
|
|
|
std::string string() const { |
|
|
|
|
|
|
|
OPENSSL_LOG("log"); |
|
|
|
return string(_bn); |
|
|
|
return string(_bn); |
|
|
|
} |
|
|
|
} |
|
|
|
static std::string string(BIGNUM* a) { |
|
|
|
static std::string string(BIGNUM* a) { |
|
|
|