![]() |
TrinityCore
|
#include <BigNumber.h>
Public Member Functions | |
| BigNumber () | |
| BigNumber (BigNumber const &bn) | |
| BigNumber (uint32 v) | |
| BigNumber (int32 v) | |
| BigNumber (std::string const &v) | |
| template<BigNumberBinaryInput Container> | |
| BigNumber (Container const &binary, bool littleEndian=true) | |
| ~BigNumber () | |
| void | SetDword (int32) |
| void | SetDword (uint32) |
| void | SetQword (uint64) |
| void | SetBinary (uint8 const *bytes, int32 len, bool littleEndian=true) |
| template<BigNumberBinaryInput Container> | |
| void | SetBinary (Container const &binary, bool littleEndian=true) |
| bool | SetDecStr (char const *str) |
| bool | SetDecStr (std::string const &str) |
| 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 |
| int32 | CompareTo (BigNumber const &bn) const |
| bool | operator== (BigNumber const &bn) const |
| std::strong_ordering | operator<=> (BigNumber const &other) const |
| bool | IsZero () const |
| bool | IsNegative () const |
| BigNumber | ModExp (BigNumber const &bn1, BigNumber const &bn2) const |
| BigNumber | Exp (BigNumber const &) const |
| int32 | GetNumBytes () const |
| int32 | GetNumBits () const |
| struct bignum_st * | BN () |
| struct bignum_st const * | BN () const |
| uint32 | AsDword () const |
| void | GetBytes (uint8 *buf, 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 |
Definition at line 34 of file BigNumber.h.
| BigNumber::BigNumber | ( | ) |
Definition at line 24 of file BigNumber.cpp.
| BigNumber::BigNumber | ( | BigNumber const & | bn | ) |
Definition at line 28 of file BigNumber.cpp.
|
inline |
Definition at line 39 of file BigNumber.h.
|
inline |
Definition at line 40 of file BigNumber.h.
|
inline |
Definition at line 41 of file BigNumber.h.
|
inline |
Definition at line 43 of file BigNumber.h.
| BigNumber::~BigNumber | ( | ) |
Definition at line 32 of file BigNumber.cpp.
References _bn.
| std::string BigNumber::AsDecStr | ( | ) | const |
Definition at line 218 of file BigNumber.cpp.
References _bn.
| uint32 BigNumber::AsDword | ( | ) | const |
Definition at line 180 of file BigNumber.cpp.
References _bn.
| std::string BigNumber::AsHexStr | ( | ) | const |
Definition at line 210 of file BigNumber.cpp.
References _bn.
|
inline |
Definition at line 125 of file BigNumber.h.
|
inline |
Definition at line 126 of file BigNumber.h.
Definition at line 141 of file BigNumber.cpp.
References _bn.
Definition at line 146 of file BigNumber.cpp.
References _bn.
| void BigNumber::GetBytes | ( | uint8 * | buf, |
| size_t | bufsize, | ||
| bool | littleEndian = true |
||
| ) | const |
Definition at line 195 of file BigNumber.cpp.
Referenced by ToByteVector().
| int32 BigNumber::GetNumBits | ( | ) | const |
Definition at line 175 of file BigNumber.cpp.
References _bn.
Referenced by Trinity::Crypto::SRP::SRP6::CalculatePrivateB(), and Trinity::Crypto::SRP::BnetSRP6Base::GetBrokenEvidenceVector().
| int32 BigNumber::GetNumBytes | ( | ) | const |
| bool BigNumber::IsNegative | ( | ) | const |
Definition at line 190 of file BigNumber.cpp.
References _bn.
| bool BigNumber::IsZero | ( | ) | const |
Definition at line 185 of file BigNumber.cpp.
References _bn.
Definition at line 158 of file BigNumber.cpp.
References _bn.
Referenced by Trinity::Crypto::SRP::SRP6::CalculatePublicB(), Trinity::Crypto::SRP::SRP6::CalculateVerifier(), Trinity::Crypto::SRP::BnetSRP6Base::DoVerifyClientEvidence(), Trinity::Crypto::SRP::GruntSRP6::DoVerifyClientEvidence(), and Battlenet::LoginRESTService::MigrateLegacyPasswordHashes().
Definition at line 91 of file BigNumber.h.
Definition at line 124 of file BigNumber.cpp.
References _bn.
Definition at line 77 of file BigNumber.h.
Definition at line 102 of file BigNumber.cpp.
References _bn.
Definition at line 63 of file BigNumber.h.
Definition at line 90 of file BigNumber.cpp.
References _bn.
Definition at line 70 of file BigNumber.h.
Definition at line 96 of file BigNumber.cpp.
References _bn.
Definition at line 84 of file BigNumber.h.
Definition at line 113 of file BigNumber.cpp.
References _bn.
|
inline |
Definition at line 98 of file BigNumber.h.
| BigNumber & BigNumber::operator<<= | ( | int | n | ) |
Definition at line 135 of file BigNumber.cpp.
References _bn.
|
inline |
Definition at line 106 of file BigNumber.h.
Definition at line 81 of file BigNumber.cpp.
References _bn.
|
inline |
Definition at line 105 of file BigNumber.h.
|
inline |
Definition at line 56 of file BigNumber.cpp.
References _bn.
| bool BigNumber::SetDecStr | ( | char const * | str | ) |
|
inline |
| void BigNumber::SetDword | ( | int32 | val | ) |
Definition at line 37 of file BigNumber.cpp.
References _bn, and SetDword().
Referenced by SetDword().
| void BigNumber::SetDword | ( | uint32 | val | ) |
Definition at line 44 of file BigNumber.cpp.
References _bn.
| bool BigNumber::SetHexStr | ( | char const * | str | ) |
|
inline |
| void BigNumber::SetQword | ( | uint64 | val | ) |
Definition at line 49 of file BigNumber.cpp.
References _bn.
| void BigNumber::SetRand | ( | int32 | numbits | ) |
Definition at line 76 of file BigNumber.cpp.
References _bn.
Referenced by SecretMgr::AttemptTransition(), Trinity::Crypto::SRP::SRP6::CalculatePrivateB(), and main().
|
inline |
Definition at line 134 of file BigNumber.h.
Referenced by Trinity::Crypto::AEDecrypt(), Trinity::Crypto::AEEncryptWithRandomIV(), Trinity::Crypto::SRP::GruntSRP6::CalculateServerEvidence(), Trinity::Crypto::SRP::BnetSRP6v1< CryptoHash >::CalculateU(), Trinity::Crypto::SRP::BnetSRP6v2< CryptoHash >::CalculateU(), Trinity::Crypto::SRP::GruntSRP6::DoVerifyClientEvidence(), and IpLocationStore::Load().
Definition at line 201 of file BigNumber.cpp.
References GetBytes(), and GetNumBytes().
Referenced by Trinity::Crypto::SRP::SRP6::CalculateVerifier(), Trinity::Crypto::SRP::BnetSRP6Base::GetBrokenEvidenceVector(), Trinity::Crypto::Argon2::Hash(), and Battlenet::LoginRESTService::MigrateLegacyPasswordHashes().
|
private |
Definition at line 145 of file BigNumber.h.
Referenced by AsDecStr(), AsDword(), AsHexStr(), CompareTo(), Exp(), GetBytes(), GetNumBits(), GetNumBytes(), IsNegative(), IsZero(), ModExp(), operator%=(), operator*=(), operator+=(), operator-=(), operator/=(), operator<<=(), operator=(), SetBinary(), SetDecStr(), SetDword(), SetDword(), SetHexStr(), SetQword(), SetRand(), and ~BigNumber().