aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Cryptography/BigNumber.cpp
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2011-10-18 14:59:23 +0200
committerSpp <spp@jorge.gr>2011-10-18 14:59:23 +0200
commite3f8588a227cbf9108f396131a199d75868bf539 (patch)
tree7af85d79ae50f08a965cd5f601542ea6959519ed /src/server/shared/Cryptography/BigNumber.cpp
parentb5e8a192b121b8ec297885e04566758c236d9191 (diff)
Minor changes here and there:
- Cosmetic changes - 'Engrish fix' - Initialization of some vars - Remove some not needed includes
Diffstat (limited to 'src/server/shared/Cryptography/BigNumber.cpp')
-rwxr-xr-xsrc/server/shared/Cryptography/BigNumber.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/server/shared/Cryptography/BigNumber.cpp b/src/server/shared/Cryptography/BigNumber.cpp
index 6149a680594..76cb74d5e13 100755
--- a/src/server/shared/Cryptography/BigNumber.cpp
+++ b/src/server/shared/Cryptography/BigNumber.cpp
@@ -18,31 +18,30 @@
#include "Cryptography/BigNumber.h"
#include <openssl/bn.h>
+#include <openssl/crypto.h>
#include <algorithm>
BigNumber::BigNumber()
-{
- _bn = BN_new();
- _array = NULL;
-}
+ : _bn(BN_new())
+ , _array(NULL)
+{ }
BigNumber::BigNumber(const BigNumber &bn)
-{
- _bn = BN_dup(bn._bn);
- _array = NULL;
-}
+ : _bn(BN_dup(bn._bn))
+ , _array(NULL)
+{ }
BigNumber::BigNumber(uint32 val)
+ : _bn(BN_new())
+ , _array(NULL)
{
- _bn = BN_new();
BN_set_word(_bn, val);
- _array = NULL;
}
BigNumber::~BigNumber()
{
BN_free(_bn);
- if (_array) delete[] _array;
+ delete[] _array;
}
void BigNumber::SetDword(uint32 val)
@@ -76,6 +75,8 @@ void BigNumber::SetRand(int numbits)
BigNumber BigNumber::operator=(const BigNumber &bn)
{
+ if (this == &bn)
+ return *this;
BN_copy(_bn, bn._bn);
return *this;
}