AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "BigNumber.h"
Public Member Functions | |
BigNumber () | |
BigNumber (BigNumber const &bn) | |
BigNumber (uint32 v) | |
BigNumber (int32 v) | |
BigNumber (std::string const &v) | |
template<std::size_t Size> | |
BigNumber (std::array< uint8, Size > const &v, bool littleEndian=true) | |
~BigNumber () | |
void | SetDword (int32) |
void | SetDword (uint32) |
void | SetQword (uint64) |
void | SetBinary (uint8 const *bytes, int32 len, bool littleEndian=true) |
template<typename Container > | |
auto | SetBinary (Container const &c, bool littleEndian=true) -> std::enable_if_t<!std::is_pointer_v< std::decay_t< Container > > > |
bool | SetHexStr (char const *str) |
bool | SetHexStr (std::string const &str) |
void | SetRand (int32 numbits) |
BigNumber & | operator= (BigNumber const &bn) |
BigNumber & | operator+= (BigNumber const &bn) |
BigNumber | operator+ (BigNumber const &bn) const |
BigNumber & | operator-= (BigNumber const &bn) |
BigNumber | operator- (BigNumber const &bn) const |
BigNumber & | operator*= (BigNumber const &bn) |
BigNumber | operator* (BigNumber const &bn) const |
BigNumber & | operator/= (BigNumber const &bn) |
BigNumber | operator/ (BigNumber const &bn) const |
BigNumber & | operator%= (BigNumber const &bn) |
BigNumber | operator% (BigNumber const &bn) const |
BigNumber & | operator<<= (int n) |
BigNumber | operator<< (int n) const |
int | CompareTo (BigNumber const &bn) const |
bool | operator<= (BigNumber const &bn) const |
bool | operator== (BigNumber const &bn) const |
bool | operator>= (BigNumber const &bn) const |
bool | operator< (BigNumber const &bn) const |
bool | operator> (BigNumber const &bn) const |
bool | IsZero () const |
bool | IsNegative () const |
BigNumber | ModExp (BigNumber const &bn1, BigNumber const &bn2) const |
BigNumber | Exp (BigNumber const &) const |
int32 | GetNumBytes () const |
struct bignum_st * | BN () |
struct bignum_st const * | BN () const |
uint32 | AsDword () const |
void | GetBytes (uint8 *buf, std::size_t bufsize, bool littleEndian=true) const |
std::vector< uint8 > | ToByteVector (int32 minSize=0, bool littleEndian=true) const |
template<std::size_t Size> | |
std::array< uint8, Size > | ToByteArray (bool littleEndian=true) const |
std::string | AsHexStr () const |
std::string | AsDecStr () const |
Private Attributes | |
struct bignum_st * | _bn |
BigNumber::BigNumber | ( | ) |
|
inline |
|
inline |
|
inline |
std::string BigNumber::AsDecStr | ( | ) | const |
uint32 BigNumber::AsDword | ( | ) | const |
std::string BigNumber::AsHexStr | ( | ) | const |
|
inline |
|
inline |
int BigNumber::CompareTo | ( | BigNumber const & | bn | ) | const |
void BigNumber::GetBytes | ( | uint8 * | buf, |
std::size_t | bufsize, | ||
bool | littleEndian = true |
||
) | const |
Referenced by ToByteVector().
int32 BigNumber::GetNumBytes | ( | ) | const |
References _bn.
Referenced by GetCheckPacketSize(), and ToByteVector().
References _bn.
Referenced by Acore::Crypto::SRP6::_B(), Acore::Crypto::SRP6::CalculateVerifier(), and Acore::Crypto::SRP6::VerifyChallengeResponse().
|
inline |
|
inline |
BigNumber & BigNumber::operator<<= | ( | int | n | ) |
|
inline |
References SetBinary().
Referenced by SetBinary().
void BigNumber::SetDword | ( | int32 | val | ) |
References _bn, and SetDword().
Referenced by SetDword().
bool BigNumber::SetHexStr | ( | char const * | str | ) |
References _bn.
Referenced by GetHexFromConfig(), and WardenCheckMgr::LoadWardenChecks().
|
inline |
void BigNumber::SetQword | ( | uint64 | val | ) |
void BigNumber::SetRand | ( | int32 | numbits | ) |
References _bn.
Referenced by SecretMgr::AttemptTransition(), and main().
|
inline |
Referenced by Acore::Crypto::AEDecrypt(), Acore::Crypto::AEEncryptWithRandomIV(), Acore::Crypto::SRP6::CalculateVerifier(), and WardenWin::HandleData().
References GetBytes(), and GetNumBytes().
Referenced by WardenWin::HandleData(), Acore::Crypto::Argon2::Hash(), and WardenWin::RequestChecks().
|
private |
Referenced by AsDecStr(), AsDword(), AsHexStr(), CompareTo(), Exp(), GetBytes(), GetNumBytes(), IsNegative(), IsZero(), ModExp(), operator%=(), operator*=(), operator+=(), operator-=(), operator/=(), operator<<=(), operator=(), SetBinary(), SetDword(), SetHexStr(), SetQword(), SetRand(), and ~BigNumber().