OverSim
SHA1.cc File Reference
#include "SHA1.h"

Go to the source code of this file.

Macros

#define _CRT_SECURE_NO_WARNINGS
#define SHA1_MAX_FILE_BUFFER   (32 * 20 * 820)
#define ROL32(p_val32, p_nBits)   (((p_val32)<<(p_nBits))|((p_val32)>>(32-(p_nBits))))
#define SHABLK0(i)
#define SHABLK(i)
#define S_R0(v, w, x, y, z, i)   {z+=((w&(x^y))^y)+SHABLK0(i)+0x5A827999+ROL32(v,5);w=ROL32(w,30);}
#define S_R1(v, w, x, y, z, i)   {z+=((w&(x^y))^y)+SHABLK(i)+0x5A827999+ROL32(v,5);w=ROL32(w,30);}
#define S_R2(v, w, x, y, z, i)   {z+=(w^x^y)+SHABLK(i)+0x6ED9EBA1+ROL32(v,5);w=ROL32(w,30);}
#define S_R3(v, w, x, y, z, i)   {z+=(((w|x)&y)|(w&x))+SHABLK(i)+0x8F1BBCDC+ROL32(v,5);w=ROL32(w,30);}
#define S_R4(v, w, x, y, z, i)   {z+=(w^x^y)+SHABLK(i)+0xCA62C1D6+ROL32(v,5);w=ROL32(w,30);}

Macro Definition Documentation

#define _CRT_SECURE_NO_WARNINGS

Definition at line 11 of file SHA1.cc.

#define ROL32 (   p_val32,
  p_nBits 
)    (((p_val32)<<(p_nBits))|((p_val32)>>(32-(p_nBits))))

Definition at line 21 of file SHA1.cc.

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

Definition at line 36 of file SHA1.cc.

Referenced by CSHA1::Transform().

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

Definition at line 37 of file SHA1.cc.

Referenced by CSHA1::Transform().

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

Definition at line 38 of file SHA1.cc.

Referenced by CSHA1::Transform().

#define S_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 39 of file SHA1.cc.

Referenced by CSHA1::Transform().

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

Definition at line 40 of file SHA1.cc.

Referenced by CSHA1::Transform().

#define SHA1_MAX_FILE_BUFFER   (32 * 20 * 820)

Definition at line 14 of file SHA1.cc.

Referenced by CSHA1::HashFile().

#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 32 of file SHA1.cc.

#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 26 of file SHA1.cc.