aboutsummaryrefslogtreecommitdiff
path: root/src/common/Cryptography/BigNumber.cpp
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-07-29 00:07:41 +0200
committerGitHub <noreply@github.com>2020-07-29 00:07:41 +0200
commit7f7fa8b23d71297f75ff4ca3c1d6e38333a5cc76 (patch)
tree18a47372b2ac3e086e0e96074562af6a1172b223 /src/common/Cryptography/BigNumber.cpp
parent210f552ac56979430f1349006c1945b29883a2bc (diff)
Core/Authserver: Split SRP6 into its own file (PR #25131)
Diffstat (limited to 'src/common/Cryptography/BigNumber.cpp')
-rw-r--r--src/common/Cryptography/BigNumber.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/common/Cryptography/BigNumber.cpp b/src/common/Cryptography/BigNumber.cpp
index 5b4e2942453..62e459c6dce 100644
--- a/src/common/Cryptography/BigNumber.cpp
+++ b/src/common/Cryptography/BigNumber.cpp
@@ -27,7 +27,7 @@ BigNumber::BigNumber()
{ }
BigNumber::BigNumber(BigNumber const& bn)
- : _bn(BN_dup(bn._bn))
+ : _bn(BN_dup(bn.BN()))
{ }
BigNumber::~BigNumber()
@@ -35,6 +35,13 @@ BigNumber::~BigNumber()
BN_free(_bn);
}
+void BigNumber::SetDword(int32 val)
+{
+ SetDword(uint32(abs(val)));
+ if (val < 0)
+ BN_set_negative(_bn, 1);
+}
+
void BigNumber::SetDword(uint32 val)
{
BN_set_word(_bn, val);