TrinityCore
Loading...
Searching...
No Matches
Trinity::Crypto::SRP6 Class Reference

#include <SRP6.h>

Public Types

using Salt = std::array< uint8, SALT_LENGTH >
 
using Verifier = std::array< uint8, VERIFIER_LENGTH >
 
using EphemeralKey = std::array< uint8, EPHEMERAL_KEY_LENGTH >
 

Public Member Functions

 SRP6 (std::string const &username, Salt const &salt, Verifier const &verifier)
 
std::optional< SessionKeyVerifyChallengeResponse (EphemeralKey const &A, SHA1::Digest const &clientM)
 

Static Public Member Functions

static std::pair< Salt, VerifierMakeRegistrationData (std::string const &username, std::string const &password)
 
static bool CheckLogin (std::string const &username, std::string const &password, Salt const &salt, Verifier const &verifier)
 
static SHA1::Digest GetSessionVerifier (EphemeralKey const &A, SHA1::Digest const &clientM, SessionKey const &K)
 

Public Attributes

Salt const s
 
EphemeralKey const B
 

Static Public Attributes

static constexpr size_t SALT_LENGTH = 32
 
static constexpr size_t VERIFIER_LENGTH = 32
 
static constexpr size_t EPHEMERAL_KEY_LENGTH = 32
 
static std::array< uint8, 1 > const g = { 7 }
 
static std::array< uint8, 32 > const N = HexStrToByteArray<32>("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7", true)
 

Static Private Member Functions

static Verifier CalculateVerifier (std::string const &username, std::string const &password, Salt const &salt)
 
static SessionKey SHA1Interleave (EphemeralKey const &S)
 
static EphemeralKey _B (BigNumber const &b, BigNumber const &v)
 

Private Attributes

bool _used = false
 
SHA1::Digest const _I
 
BigNumber const _b
 
BigNumber const _v
 

Static Private Attributes

static BigNumber const _g
 
static BigNumber const _N
 

Detailed Description

Definition at line 31 of file SRP6.h.

Member Typedef Documentation

◆ EphemeralKey

Definition at line 39 of file SRP6.h.

◆ Salt

Definition at line 35 of file SRP6.h.

◆ Verifier

Definition at line 37 of file SRP6.h.

Constructor & Destructor Documentation

◆ SRP6()

SRP6::SRP6 ( std::string const &  username,
Salt const &  salt,
Verifier const &  verifier 
)

Definition at line 81 of file SRP6.cpp.

Member Function Documentation

◆ _B()

static EphemeralKey Trinity::Crypto::SRP6::_B ( BigNumber const &  b,
BigNumber const &  v 
)
inlinestaticprivate

Definition at line 70 of file SRP6.h.

+ Here is the call graph for this function:

◆ CalculateVerifier()

SRP6::Verifier SRP6::CalculateVerifier ( std::string const &  username,
std::string const &  password,
SRP6::Salt const &  salt 
)
staticprivate

Definition at line 40 of file SRP6.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckLogin()

static bool Trinity::Crypto::SRP6::CheckLogin ( std::string const &  username,
std::string const &  password,
Salt const &  salt,
Verifier const &  verifier 
)
inlinestatic

Definition at line 47 of file SRP6.h.

+ Here is the caller graph for this function:

◆ GetSessionVerifier()

static SHA1::Digest Trinity::Crypto::SRP6::GetSessionVerifier ( EphemeralKey const &  A,
SHA1::Digest const &  clientM,
SessionKey const &  K 
)
inlinestatic

Definition at line 52 of file SRP6.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeRegistrationData()

std::pair< SRP6::Salt, SRP6::Verifier > SRP6::MakeRegistrationData ( std::string const &  username,
std::string const &  password 
)
static

Definition at line 32 of file SRP6.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SHA1Interleave()

SessionKey SRP6::SHA1Interleave ( SRP6::EphemeralKey const &  S)
staticprivate

Definition at line 51 of file SRP6.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VerifyChallengeResponse()

std::optional< SessionKey > SRP6::VerifyChallengeResponse ( EphemeralKey const &  A,
SHA1::Digest const &  clientM 
)

Definition at line 84 of file SRP6.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ _b

BigNumber const Trinity::Crypto::SRP6::_b
private

Definition at line 74 of file SRP6.h.

◆ _g

BigNumber const SRP6::_g
staticprivate

Definition at line 67 of file SRP6.h.

◆ _I

SHA1::Digest const Trinity::Crypto::SRP6::_I
private

Definition at line 73 of file SRP6.h.

◆ _N

BigNumber const SRP6::_N
staticprivate

Definition at line 68 of file SRP6.h.

◆ _used

bool Trinity::Crypto::SRP6::_used = false
private

Definition at line 61 of file SRP6.h.

◆ _v

BigNumber const Trinity::Crypto::SRP6::_v
private

Definition at line 75 of file SRP6.h.

◆ B

EphemeralKey const Trinity::Crypto::SRP6::B

Definition at line 79 of file SRP6.h.

◆ EPHEMERAL_KEY_LENGTH

constexpr size_t Trinity::Crypto::SRP6::EPHEMERAL_KEY_LENGTH = 32
staticconstexpr

Definition at line 38 of file SRP6.h.

◆ g

std::array< uint8, 1 > const SRP6::g = { 7 }
static

Definition at line 41 of file SRP6.h.

◆ N

std::array< uint8, 32 > const SRP6::N = HexStrToByteArray<32>("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7", true)
static

Definition at line 42 of file SRP6.h.

◆ s

Salt const Trinity::Crypto::SRP6::s

Definition at line 78 of file SRP6.h.

◆ SALT_LENGTH

constexpr size_t Trinity::Crypto::SRP6::SALT_LENGTH = 32
staticconstexpr

Definition at line 34 of file SRP6.h.

◆ VERIFIER_LENGTH

constexpr size_t Trinity::Crypto::SRP6::VERIFIER_LENGTH = 32
staticconstexpr

Definition at line 36 of file SRP6.h.


The documentation for this class was generated from the following files: