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/ARC4.cpp2
-rw-r--r--src/server/shared/Cryptography/ARC4.h2
-rw-r--r--src/server/shared/Cryptography/Authentication/AuthCrypt.cpp2
-rw-r--r--src/server/shared/Cryptography/Authentication/AuthCrypt.h2
-rw-r--r--src/server/shared/Cryptography/BigNumber.cpp31
-rw-r--r--src/server/shared/Cryptography/BigNumber.h44
-rw-r--r--src/server/shared/Cryptography/HMACSHA1.cpp2
-rw-r--r--src/server/shared/Cryptography/HMACSHA1.h2
-rw-r--r--src/server/shared/Cryptography/SHA1.cpp2
-rw-r--r--src/server/shared/Cryptography/SHA1.h2
-rw-r--r--src/server/shared/Cryptography/WardenKeyGeneration.h2
11 files changed, 49 insertions, 44 deletions
diff --git a/src/server/shared/Cryptography/ARC4.cpp b/src/server/shared/Cryptography/ARC4.cpp
index 5b2cf7a0a93..6395ff99bfa 100644
--- a/src/server/shared/Cryptography/ARC4.cpp
+++ b/src/server/shared/Cryptography/ARC4.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/ARC4.h b/src/server/shared/Cryptography/ARC4.h
index 541135e52f2..0804971f696 100644
--- a/src/server/shared/Cryptography/ARC4.h
+++ b/src/server/shared/Cryptography/ARC4.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp b/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp
index 5b4ffabd4f6..0f68fcb6c37 100644
--- a/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp
+++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/Authentication/AuthCrypt.h b/src/server/shared/Cryptography/Authentication/AuthCrypt.h
index b40ce8ac40c..200681afd08 100644
--- a/src/server/shared/Cryptography/Authentication/AuthCrypt.h
+++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/BigNumber.cpp b/src/server/shared/Cryptography/BigNumber.cpp
index def0a7fd02e..37778cceab8 100644
--- a/src/server/shared/Cryptography/BigNumber.cpp
+++ b/src/server/shared/Cryptography/BigNumber.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@ BigNumber::BigNumber()
, _array(NULL)
{ }
-BigNumber::BigNumber(const BigNumber &bn)
+BigNumber::BigNumber(BigNumber const& bn)
: _bn(BN_dup(bn._bn))
, _array(NULL)
{ }
@@ -58,44 +58,45 @@ void BigNumber::SetQword(uint64 val)
BN_add_word(_bn, (uint32)(val & 0xFFFFFFFF));
}
-void BigNumber::SetBinary(const uint8 *bytes, int len)
+void BigNumber::SetBinary(uint8 const* bytes, int32 len)
{
uint8 t[1000];
for (int i = 0; i < len; i++) t[i] = bytes[len - 1 - i];
BN_bin2bn(t, len, _bn);
}
-void BigNumber::SetHexStr(const char *str)
+void BigNumber::SetHexStr(char const* str)
{
BN_hex2bn(&_bn, str);
}
-void BigNumber::SetRand(int numbits)
+void BigNumber::SetRand(int32 numbits)
{
BN_rand(_bn, numbits, 0, 1);
}
-BigNumber& BigNumber::operator=(const BigNumber &bn)
+BigNumber& BigNumber::operator=(BigNumber const& bn)
{
if (this == &bn)
return *this;
+
BN_copy(_bn, bn._bn);
return *this;
}
-BigNumber BigNumber::operator+=(const BigNumber &bn)
+BigNumber BigNumber::operator+=(BigNumber const& bn)
{
BN_add(_bn, _bn, bn._bn);
return *this;
}
-BigNumber BigNumber::operator-=(const BigNumber &bn)
+BigNumber BigNumber::operator-=(BigNumber const& bn)
{
BN_sub(_bn, _bn, bn._bn);
return *this;
}
-BigNumber BigNumber::operator*=(const BigNumber &bn)
+BigNumber BigNumber::operator*=(BigNumber const& bn)
{
BN_CTX *bnctx;
@@ -106,7 +107,7 @@ BigNumber BigNumber::operator*=(const BigNumber &bn)
return *this;
}
-BigNumber BigNumber::operator/=(const BigNumber &bn)
+BigNumber BigNumber::operator/=(BigNumber const& bn)
{
BN_CTX *bnctx;
@@ -117,7 +118,7 @@ BigNumber BigNumber::operator/=(const BigNumber &bn)
return *this;
}
-BigNumber BigNumber::operator%=(const BigNumber &bn)
+BigNumber BigNumber::operator%=(BigNumber const& bn)
{
BN_CTX *bnctx;
@@ -128,7 +129,7 @@ BigNumber BigNumber::operator%=(const BigNumber &bn)
return *this;
}
-BigNumber BigNumber::Exp(const BigNumber &bn)
+BigNumber BigNumber::Exp(BigNumber const& bn)
{
BigNumber ret;
BN_CTX *bnctx;
@@ -140,7 +141,7 @@ BigNumber BigNumber::Exp(const BigNumber &bn)
return ret;
}
-BigNumber BigNumber::ModExp(const BigNumber &bn1, const BigNumber &bn2)
+BigNumber BigNumber::ModExp(BigNumber const& bn1, BigNumber const& bn2)
{
BigNumber ret;
BN_CTX *bnctx;
@@ -152,7 +153,7 @@ BigNumber BigNumber::ModExp(const BigNumber &bn1, const BigNumber &bn2)
return ret;
}
-int BigNumber::GetNumBytes(void)
+int32 BigNumber::GetNumBytes(void)
{
return BN_num_bytes(_bn);
}
@@ -167,7 +168,7 @@ bool BigNumber::isZero() const
return BN_is_zero(_bn);
}
-uint8 *BigNumber::AsByteArray(int minSize, bool reverse)
+uint8* BigNumber::AsByteArray(int32 minSize, bool reverse)
{
int length = (minSize >= GetNumBytes()) ? minSize : GetNumBytes();
diff --git a/src/server/shared/Cryptography/BigNumber.h b/src/server/shared/Cryptography/BigNumber.h
index 36a618056a5..fe56fd7e6f9 100644
--- a/src/server/shared/Cryptography/BigNumber.h
+++ b/src/server/shared/Cryptography/BigNumber.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -28,45 +28,49 @@ class BigNumber
{
public:
BigNumber();
- BigNumber(const BigNumber &bn);
+ BigNumber(BigNumber const& bn);
BigNumber(uint32);
~BigNumber();
void SetDword(uint32);
void SetQword(uint64);
- void SetBinary(const uint8 *bytes, int len);
- void SetHexStr(const char *str);
+ void SetBinary(uint8 const* bytes, int32 len);
+ void SetHexStr(char const* str);
- void SetRand(int numbits);
+ void SetRand(int32 numbits);
- BigNumber& operator=(const BigNumber &bn);
+ BigNumber& operator=(BigNumber const& bn);
- BigNumber operator+=(const BigNumber &bn);
- BigNumber operator+(const BigNumber &bn)
+ BigNumber operator+=(BigNumber const& bn);
+ BigNumber operator+(BigNumber const& bn)
{
BigNumber t(*this);
return t += bn;
}
- BigNumber operator-=(const BigNumber &bn);
- BigNumber operator-(const BigNumber &bn)
+
+ BigNumber operator-=(BigNumber const& bn);
+ BigNumber operator-(BigNumber const& bn)
{
BigNumber t(*this);
return t -= bn;
}
- BigNumber operator*=(const BigNumber &bn);
- BigNumber operator*(const BigNumber &bn)
+
+ BigNumber operator*=(BigNumber const& bn);
+ BigNumber operator*(BigNumber const& bn)
{
BigNumber t(*this);
return t *= bn;
}
- BigNumber operator/=(const BigNumber &bn);
- BigNumber operator/(const BigNumber &bn)
+
+ BigNumber operator/=(BigNumber const& bn);
+ BigNumber operator/(BigNumber const& bn)
{
BigNumber t(*this);
return t /= bn;
}
- BigNumber operator%=(const BigNumber &bn);
- BigNumber operator%(const BigNumber &bn)
+
+ BigNumber operator%=(BigNumber const& bn);
+ BigNumber operator%(BigNumber const& bn)
{
BigNumber t(*this);
return t %= bn;
@@ -74,15 +78,15 @@ class BigNumber
bool isZero() const;
- BigNumber ModExp(const BigNumber &bn1, const BigNumber &bn2);
- BigNumber Exp(const BigNumber &);
+ BigNumber ModExp(BigNumber const& bn1, BigNumber const& bn2);
+ BigNumber Exp(BigNumber const&);
- int GetNumBytes(void);
+ int32 GetNumBytes(void);
struct bignum_st *BN() { return _bn; }
uint32 AsDword();
- uint8* AsByteArray(int minSize = 0, bool reverse = true);
+ uint8* AsByteArray(int32 minSize = 0, bool reverse = true);
char * AsHexStr() const;
char * AsDecStr() const;
diff --git a/src/server/shared/Cryptography/HMACSHA1.cpp b/src/server/shared/Cryptography/HMACSHA1.cpp
index c9de1191464..ab50eb9981a 100644
--- a/src/server/shared/Cryptography/HMACSHA1.cpp
+++ b/src/server/shared/Cryptography/HMACSHA1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/HMACSHA1.h b/src/server/shared/Cryptography/HMACSHA1.h
index 4b7667968ca..e09e7fdb43c 100644
--- a/src/server/shared/Cryptography/HMACSHA1.h
+++ b/src/server/shared/Cryptography/HMACSHA1.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/SHA1.cpp b/src/server/shared/Cryptography/SHA1.cpp
index 2af8e4d4cbe..d02e9711014 100644
--- a/src/server/shared/Cryptography/SHA1.cpp
+++ b/src/server/shared/Cryptography/SHA1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/SHA1.h b/src/server/shared/Cryptography/SHA1.h
index 7c77defebfa..a4232f4e75f 100644
--- a/src/server/shared/Cryptography/SHA1.h
+++ b/src/server/shared/Cryptography/SHA1.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/WardenKeyGeneration.h b/src/server/shared/Cryptography/WardenKeyGeneration.h
index f0a9905b6fe..5c04da38dc9 100644
--- a/src/server/shared/Cryptography/WardenKeyGeneration.h
+++ b/src/server/shared/Cryptography/WardenKeyGeneration.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it