reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Sha1.cxx File Reference
#include "Sha1.hxx"
#include <sstream>
#include <iomanip>
#include <fstream>

Go to the source code of this file.

Macros

#define rol(value, bits)   (((value) << (bits)) | (((value) & 0xffffffff) >> (32 - (bits))))
 
#define blk(i)   (block[i&15] = rol(block[(i+13)&15] ^ block[(i+8)&15] ^ block[(i+2)&15] ^ block[i&15],1))
 
#define R0(v, w, x, y, z, i)   z += ((w&(x^y))^y) + block[i] + 0x5a827999 + rol(v,5); w=rol(w,30);
 
#define R1(v, w, x, y, z, i)   z += ((w&(x^y))^y) + blk(i) + 0x5a827999 + rol(v,5); w=rol(w,30);
 
#define R2(v, w, x, y, z, i)   z += (w^x^y) + blk(i) + 0x6ed9eba1 + rol(v,5); w=rol(w,30);
 
#define R3(v, w, x, y, z, i)   z += (((w|x)&y)|(w&x)) + blk(i) + 0x8f1bbcdc + rol(v,5); w=rol(w,30);
 
#define R4(v, w, x, y, z, i)   z += (w^x^y) + blk(i) + 0xca62c1d6 + rol(v,5); w=rol(w,30);
 

Macro Definition Documentation

◆ blk

#define blk (   i)    (block[i&15] = rol(block[(i+13)&15] ^ block[(i+8)&15] ^ block[(i+2)&15] ^ block[i&15],1))

◆ R0

#define R0 (   v,
  w,
  x,
  y,
  z,
  i 
)    z += ((w&(x^y))^y) + block[i] + 0x5a827999 + rol(v,5); w=rol(w,30);

◆ R1

#define R1 (   v,
  w,
  x,
  y,
  z,
  i 
)    z += ((w&(x^y))^y) + blk(i) + 0x5a827999 + rol(v,5); w=rol(w,30);

◆ R2

#define R2 (   v,
  w,
  x,
  y,
  z,
  i 
)    z += (w^x^y) + blk(i) + 0x6ed9eba1 + rol(v,5); w=rol(w,30);

◆ R3

#define R3 (   v,
  w,
  x,
  y,
  z,
  i 
)    z += (((w|x)&y)|(w&x)) + blk(i) + 0x8f1bbcdc + rol(v,5); w=rol(w,30);

◆ R4

#define R4 (   v,
  w,
  x,
  y,
  z,
  i 
)    z += (w^x^y) + blk(i) + 0xca62c1d6 + rol(v,5); w=rol(w,30);

◆ rol

#define rol (   value,
  bits 
)    (((value) << (bits)) | (((value) & 0xffffffff) >> (32 - (bits))))