EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ShaModule.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ShaModule
 Sha1 module for username + password hashes. More...
 
struct  ShaModule::SHAobject
 

Macros

#define TestEndianness(variable)
 
#define PCT_LITTLE_ENDIAN   1
 
#define PCT_BIG_ENDIAN   0
 
#define SHA_BLOCKSIZE   64
 
#define SHA_DIGESTSIZE   20
 
#define UNRAVEL
 
#define f1(x, y, z)   (z ^ (x & (y ^ z))) /* Rounds 0-19 */
 
#define f2(x, y, z)   (x ^ y ^ z) /* Rounds 20-39 */
 
#define f3(x, y, z)   ((x & y) | (z & (x | y))) /* Rounds 40-59 */
 
#define f4(x, y, z)   (x ^ y ^ z) /* Rounds 60-79 */
 
#define CONST1   0x5a827999L /* Rounds 0-19 */
 
#define CONST2   0x6ed9eba1L /* Rounds 20-39 */
 
#define CONST3   0x8f1bbcdcL /* Rounds 40-59 */
 
#define CONST4   0xca62c1d6L /* Rounds 60-79 */
 
#define R32(x, n)   ((x << n) | (x >> (32 - n)))
 
#define FG(n)
 
#define FA(n)   T = R32(A,5) + f##n(B,C,D) + E + *WP++ + CONST##n; B = R32(B,30)
 
#define FB(n)   E = R32(T,5) + f##n(A,B,C) + D + *WP++ + CONST##n; A = R32(A,30)
 
#define FC(n)   D = R32(E,5) + f##n(T,A,B) + C + *WP++ + CONST##n; T = R32(T,30)
 
#define FD(n)   C = R32(D,5) + f##n(E,T,A) + B + *WP++ + CONST##n; E = R32(E,30)
 
#define FE(n)   B = R32(C,5) + f##n(D,E,T) + A + *WP++ + CONST##n; D = R32(D,30)
 
#define FT(n)   A = R32(B,5) + f##n(C,D,E) + T + *WP++ + CONST##n; C = R32(C,30)
 

Macro Definition Documentation

#define CONST1   0x5a827999L /* Rounds 0-19 */

Definition at line 146 of file ShaModule.h.

#define CONST2   0x6ed9eba1L /* Rounds 20-39 */

Definition at line 147 of file ShaModule.h.

#define CONST3   0x8f1bbcdcL /* Rounds 40-59 */

Definition at line 148 of file ShaModule.h.

#define CONST4   0xca62c1d6L /* Rounds 60-79 */

Definition at line 149 of file ShaModule.h.

#define f1 (   x,
  y,
 
)    (z ^ (x & (y ^ z))) /* Rounds 0-19 */

Definition at line 138 of file ShaModule.h.

#define f2 (   x,
  y,
 
)    (x ^ y ^ z) /* Rounds 20-39 */

Definition at line 139 of file ShaModule.h.

#define f3 (   x,
  y,
 
)    ((x & y) | (z & (x | y))) /* Rounds 40-59 */

Definition at line 141 of file ShaModule.h.

#define f4 (   x,
  y,
 
)    (x ^ y ^ z) /* Rounds 60-79 */

Definition at line 142 of file ShaModule.h.

#define FA (   n)    T = R32(A,5) + f##n(B,C,D) + E + *WP++ + CONST##n; B = R32(B,30)

Definition at line 163 of file ShaModule.h.

Referenced by ShaModule::sha_transform().

#define FB (   n)    E = R32(T,5) + f##n(A,B,C) + D + *WP++ + CONST##n; A = R32(A,30)

Definition at line 166 of file ShaModule.h.

Referenced by ShaModule::sha_transform().

#define FC (   n)    D = R32(E,5) + f##n(T,A,B) + C + *WP++ + CONST##n; T = R32(T,30)

Definition at line 169 of file ShaModule.h.

Referenced by ShaModule::sha_transform().

#define FD (   n)    C = R32(D,5) + f##n(E,T,A) + B + *WP++ + CONST##n; E = R32(E,30)

Definition at line 172 of file ShaModule.h.

Referenced by ShaModule::sha_transform().

#define FE (   n)    B = R32(C,5) + f##n(D,E,T) + A + *WP++ + CONST##n; D = R32(D,30)

Definition at line 175 of file ShaModule.h.

Referenced by ShaModule::sha_transform().

#define FG (   n)
Value:
T = R32(A,5) + f##n(B,C,D) + E + *WP++ + CONST##n; \
E = D; D = C; C = R32(B,30); B = A; A = T
const double E
Definition: Trig.h:19
#define R32(x, n)
Definition: ShaModule.h:153

Definition at line 157 of file ShaModule.h.

Referenced by ShaModule::sha_transform().

#define FT (   n)    A = R32(B,5) + f##n(C,D,E) + T + *WP++ + CONST##n; C = R32(C,30)

Definition at line 178 of file ShaModule.h.

Referenced by ShaModule::sha_transform().

#define PCT_BIG_ENDIAN   0

Definition at line 57 of file ShaModule.h.

Referenced by ShaModule::longReverse().

#define PCT_LITTLE_ENDIAN   1

Definition at line 56 of file ShaModule.h.

#define R32 (   x,
 
)    ((x << n) | (x >> (32 - n)))

Definition at line 153 of file ShaModule.h.

Referenced by ShaModule::sha_transform().

#define SHA_BLOCKSIZE   64

Definition at line 65 of file ShaModule.h.

Referenced by ShaModule::sha_final(), and ShaModule::sha_update().

#define SHA_DIGESTSIZE   20
#define TestEndianness (   variable)
Value:
{int i=1; variable=PCT_BIG_ENDIAN;\
if (*((char*)&i)==1) variable=PCT_LITTLE_ENDIAN;}
#define PCT_BIG_ENDIAN
Definition: ShaModule.h:57
if(sConfig.world.saveOnMove)
#define PCT_LITTLE_ENDIAN
Definition: ShaModule.h:56

Definition at line 53 of file ShaModule.h.

Referenced by ShaModule::sha_init().

#define UNRAVEL

Definition at line 130 of file ShaModule.h.