aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Cryptography
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/shared/Cryptography')
-rw-r--r--src/server/shared/Cryptography/BigNumber.cpp7
-rw-r--r--src/server/shared/Cryptography/BigNumber.h3
2 files changed, 8 insertions, 2 deletions
diff --git a/src/server/shared/Cryptography/BigNumber.cpp b/src/server/shared/Cryptography/BigNumber.cpp
index b68c91001ae..eae92a58ee3 100644
--- a/src/server/shared/Cryptography/BigNumber.cpp
+++ b/src/server/shared/Cryptography/BigNumber.cpp
@@ -164,11 +164,16 @@ uint32 BigNumber::AsDword()
return (uint32)BN_get_word(_bn);
}
-bool BigNumber::isZero() const
+bool BigNumber::IsZero() const
{
return BN_is_zero(_bn);
}
+bool BigNumber::IsNegative() const
+{
+ return BN_is_negative(_bn);
+}
+
std::unique_ptr<uint8[]> BigNumber::AsByteArray(int32 minSize, bool littleEndian)
{
int length = (minSize >= GetNumBytes()) ? minSize : GetNumBytes();
diff --git a/src/server/shared/Cryptography/BigNumber.h b/src/server/shared/Cryptography/BigNumber.h
index df19ba60b71..aebe16021d6 100644
--- a/src/server/shared/Cryptography/BigNumber.h
+++ b/src/server/shared/Cryptography/BigNumber.h
@@ -77,7 +77,8 @@ class BigNumber
return t %= bn;
}
- bool isZero() const;
+ bool IsZero() const;
+ bool IsNegative() const;
BigNumber ModExp(BigNumber const& bn1, BigNumber const& bn2);
BigNumber Exp(BigNumber const&);