AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
SessionKeyGenerator< Hash > Class Template Reference

#include "SessionKeyGenerator.h"

Public Member Functions

template<typename C >
 SessionKeyGenerator (C const &buf)
 
void Generate (uint8 *buf, uint32 sz)
 

Private Attributes

Hash::Digest o0 {}
 
Hash::Digest o1 {}
 
Hash::Digest o2 {}
 
Hash::Digest::const_iterator o0it
 

Detailed Description

template<typename Hash>
class SessionKeyGenerator< Hash >

Constructor & Destructor Documentation

◆ SessionKeyGenerator()

template<typename Hash >
template<typename C >
SessionKeyGenerator< Hash >::SessionKeyGenerator ( C const &  buf)
inline
26 :
27 o0it(o0.begin())
28 {
29 uint8 const* data = std::data(buf);
30 std::size_t const len = std::size(buf);
31 std::size_t const halflen = (len / 2);
32
33 o1 = Hash::GetDigestOf(data, halflen);
34 o2 = Hash::GetDigestOf(data + halflen, len - halflen);
35 o0 = Hash::GetDigestOf(o1, o0, o2);
36 }
std::uint8_t uint8
Definition: Define.h:109
Hash::Digest o0
Definition: SessionKeyGenerator.h:53
Hash::Digest o1
Definition: SessionKeyGenerator.h:54
Hash::Digest o2
Definition: SessionKeyGenerator.h:55
Hash::Digest::const_iterator o0it
Definition: SessionKeyGenerator.h:56

References SessionKeyGenerator< Hash >::o0, SessionKeyGenerator< Hash >::o1, and SessionKeyGenerator< Hash >::o2.

Member Function Documentation

◆ Generate()

template<typename Hash >
void SessionKeyGenerator< Hash >::Generate ( uint8 buf,
uint32  sz 
)
inline
39 {
40 for (uint32 i = 0; i < sz; ++i)
41 {
42 if (o0it == o0.end())
43 {
44 o0 = Hash::GetDigestOf(o1, o0, o2);
45 o0it = o0.begin();
46 }
47
48 buf[i] = *(o0it++);
49 }
50 }
std::uint32_t uint32
Definition: Define.h:107

References SessionKeyGenerator< Hash >::o0, SessionKeyGenerator< Hash >::o0it, SessionKeyGenerator< Hash >::o1, and SessionKeyGenerator< Hash >::o2.

Referenced by WardenMac::Init(), and WardenWin::Init().

Member Data Documentation

◆ o0

template<typename Hash >
Hash::Digest SessionKeyGenerator< Hash >::o0 {}
private

◆ o0it

template<typename Hash >
Hash::Digest::const_iterator SessionKeyGenerator< Hash >::o0it
private

◆ o1

template<typename Hash >
Hash::Digest SessionKeyGenerator< Hash >::o1 {}
private

◆ o2

template<typename Hash >
Hash::Digest SessionKeyGenerator< Hash >::o2 {}
private