aboutsummaryrefslogtreecommitdiff
path: root/src/common/Cryptography/BigNumber.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/Cryptography/BigNumber.cpp')
-rw-r--r--src/common/Cryptography/BigNumber.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/Cryptography/BigNumber.cpp b/src/common/Cryptography/BigNumber.cpp
index f220ca319be..66071006a7f 100644
--- a/src/common/Cryptography/BigNumber.cpp
+++ b/src/common/Cryptography/BigNumber.cpp
@@ -61,6 +61,12 @@ void BigNumber::SetBinary(uint8 const* bytes, int32 len, bool littleEndian)
BN_bin2bn(bytes, len, _bn);
}
+bool BigNumber::SetDecStr(char const* str)
+{
+ int n = BN_dec2bn(&_bn, str);
+ return n > 0;
+}
+
bool BigNumber::SetHexStr(char const* str)
{
int n = BN_hex2bn(&_bn, str);