TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SessionKeyGenerator< Hash > Class Template Reference

#include <SessionKeyGeneration.h>

Public Member Functions

 SessionKeyGenerator (uint8 *buff, uint32 size)
 
void Generate (uint8 *buf, uint32 sz)
 

Private Member Functions

void FillUp ()
 

Private Attributes

Hash sh
 
uint32 taken
 
uint8 o0 [Hash::DigestLength::value]
 
uint8 o1 [Hash::DigestLength::value]
 
uint8 o2 [Hash::DigestLength::value]
 

Constructor & Destructor Documentation

template<class Hash >
SessionKeyGenerator< Hash >::SessionKeyGenerator ( uint8 buff,
uint32  size 
)
inline
29  {
30  uint32 halfSize = size / 2;
31 
32  sh.Initialize();
33  sh.UpdateData(buff, halfSize);
34  sh.Finalize();
35 
36  memcpy(o1, sh.GetDigest(), Hash::DigestLength::value);
37 
38  sh.Initialize();
39  sh.UpdateData(buff + halfSize, size - halfSize);
40  sh.Finalize();
41 
42  memcpy(o2, sh.GetDigest(), Hash::DigestLength::value);
43 
44  memset(o0, 0x00, Hash::DigestLength::value);
45 
46  FillUp();
47  }
uint8 o1[Hash::DigestLength::value]
Definition: SessionKeyGeneration.h:78
Hash sh
Definition: SessionKeyGeneration.h:75
uint8 o0[Hash::DigestLength::value]
Definition: SessionKeyGeneration.h:77
uint32_t uint32
Definition: Define.h:150
void FillUp()
Definition: SessionKeyGeneration.h:62
const FieldDescriptor value
Definition: descriptor.h:1522
uint8 o2[Hash::DigestLength::value]
Definition: SessionKeyGeneration.h:79

+ Here is the call graph for this function:

Member Function Documentation

template<class Hash >
void SessionKeyGenerator< Hash >::FillUp ( )
inlineprivate
63  {
64  sh.Initialize();
65  sh.UpdateData(o1, Hash::DigestLength::value);
66  sh.UpdateData(o0, Hash::DigestLength::value);
67  sh.UpdateData(o2, Hash::DigestLength::value);
68  sh.Finalize();
69 
70  memcpy(o0, sh.GetDigest(), Hash::DigestLength::value);
71 
72  taken = 0;
73  }
uint8 o1[Hash::DigestLength::value]
Definition: SessionKeyGeneration.h:78
Hash sh
Definition: SessionKeyGeneration.h:75
uint8 o0[Hash::DigestLength::value]
Definition: SessionKeyGeneration.h:77
uint32 taken
Definition: SessionKeyGeneration.h:76
const FieldDescriptor value
Definition: descriptor.h:1522
uint8 o2[Hash::DigestLength::value]
Definition: SessionKeyGeneration.h:79

+ Here is the caller graph for this function:

template<class Hash >
void SessionKeyGenerator< Hash >::Generate ( uint8 buf,
uint32  sz 
)
inline
50  {
51  for (uint32 i = 0; i < sz; ++i)
52  {
54  FillUp();
55 
56  buf[i] = o0[taken];
57  taken++;
58  }
59  }
uint8 o0[Hash::DigestLength::value]
Definition: SessionKeyGeneration.h:77
uint32 taken
Definition: SessionKeyGeneration.h:76
uint32_t uint32
Definition: Define.h:150
void FillUp()
Definition: SessionKeyGeneration.h:62
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

template<class Hash >
uint8 SessionKeyGenerator< Hash >::o0[Hash::DigestLength::value]
private
template<class Hash >
uint8 SessionKeyGenerator< Hash >::o1[Hash::DigestLength::value]
private
template<class Hash >
uint8 SessionKeyGenerator< Hash >::o2[Hash::DigestLength::value]
private
template<class Hash >
Hash SessionKeyGenerator< Hash >::sh
private
template<class Hash >
uint32 SessionKeyGenerator< Hash >::taken
private

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