RigsofRods
Soft-body Physics Simulation
Macros
SHA1.cpp File Reference
#include "SHA1.h"
+ Include dependency graph for SHA1.cpp:

Go to the source code of this file.

Macros

#define SHA1_MAX_FILE_BUFFER   8000
 
#define ROL32(_val32, _nBits)   (((_val32)<<(_nBits))|((_val32)>>(32-(_nBits))))
 
#define SHABLK0(i)
 
#define SHABLK(i)
 
#define _R0(v, w, x, y, z, i)   { z+=((w&(x^y))^y)+SHABLK0(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); }
 
#define _R1(v, w, x, y, z, i)   { z+=((w&(x^y))^y)+SHABLK(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); }
 
#define _R2(v, w, x, y, z, i)   { z+=(w^x^y)+SHABLK(i)+0x6ED9EBA1+ROL32(v,5); w=ROL32(w,30); }
 
#define _R3(v, w, x, y, z, i)   { z+=(((w|x)&y)|(w&x))+SHABLK(i)+0x8F1BBCDC+ROL32(v,5); w=ROL32(w,30); }
 
#define _R4(v, w, x, y, z, i)   { z+=(w^x^y)+SHABLK(i)+0xCA62C1D6+ROL32(v,5); w=ROL32(w,30); }
 

Macro Definition Documentation

◆ _R0

#define _R0 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=((w&(x^y))^y)+SHABLK0(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); }

Definition at line 63 of file SHA1.cpp.

◆ _R1

#define _R1 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=((w&(x^y))^y)+SHABLK(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); }

Definition at line 64 of file SHA1.cpp.

◆ _R2

#define _R2 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=(w^x^y)+SHABLK(i)+0x6ED9EBA1+ROL32(v,5); w=ROL32(w,30); }

Definition at line 65 of file SHA1.cpp.

◆ _R3

#define _R3 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=(((w|x)&y)|(w&x))+SHABLK(i)+0x8F1BBCDC+ROL32(v,5); w=ROL32(w,30); }

Definition at line 66 of file SHA1.cpp.

◆ _R4

#define _R4 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=(w^x^y)+SHABLK(i)+0xCA62C1D6+ROL32(v,5); w=ROL32(w,30); }

Definition at line 67 of file SHA1.cpp.

◆ ROL32

#define ROL32 (   _val32,
  _nBits 
)    (((_val32)<<(_nBits))|((_val32)>>(32-(_nBits))))

Definition at line 48 of file SHA1.cpp.

◆ SHA1_MAX_FILE_BUFFER

#define SHA1_MAX_FILE_BUFFER   8000

Definition at line 40 of file SHA1.cpp.

◆ SHABLK

#define SHABLK (   i)
Value:
(m_block->l[i&15] = ROL32(m_block->l[(i+13)&15] ^ m_block->l[(i+8)&15] \
^ m_block->l[(i+2)&15] ^ m_block->l[i&15],1))

Definition at line 59 of file SHA1.cpp.

◆ SHABLK0

#define SHABLK0 (   i)
Value:
(m_block->l[i] = \
(ROL32(m_block->l[i],24) & 0xFF00FF00) | (ROL32(m_block->l[i],8) & 0x00FF00FF))

Definition at line 53 of file SHA1.cpp.

ROL32
#define ROL32(_val32, _nBits)
Definition: SHA1.cpp:48