SNode.C
Loading...
Searching...
No Matches
sha1.cpp File Reference

Go to the source code of this file.

Namespaces

namespace  utils

Macros

#define SHA1_ROL(value, bits)
#define SHA1_BLK(i)
#define SHA1_R0(v, w, x, y, z, i)
#define SHA1_R1(v, w, x, y, z, i)
#define SHA1_R2(v, w, x, y, z, i)
#define SHA1_R3(v, w, x, y, z, i)
#define SHA1_R4(v, w, x, y, z, i)

Functions

static std::vector< unsigned char > utils::transform_to_binary (const std::string &string)
std::vector< unsigned char > utils::sha1 (const std::string &string)

Macro Definition Documentation

◆ SHA1_BLK

#define SHA1_BLK ( i)
Value:
(block[i & 15] = SHA1_ROL(block[(i + 13) & 15] ^ block[(i + 8) & 15] ^ block[(i + 2) & 15] ^ block[i & 15], 1))
#define SHA1_ROL(value, bits)
Definition sha1.cpp:33

Definition at line 34 of file sha1.cpp.

◆ SHA1_R0

#define SHA1_R0 ( v,
w,
x,
y,
z,
i )
Value:
z += ((w & (x ^ y)) ^ y) + block[i] + 0x5a827999 + SHA1_ROL(v, 5); \
w = SHA1_ROL(w, 30);

Definition at line 37 of file sha1.cpp.

37#define SHA1_R0(v, w, x, y, z, i) \
38 z += ((w & (x ^ y)) ^ y) + block[i] + 0x5a827999 + SHA1_ROL(v, 5); \
39 w = SHA1_ROL(w, 30);

◆ SHA1_R1

#define SHA1_R1 ( v,
w,
x,
y,
z,
i )
Value:
z += ((w & (x ^ y)) ^ y) + SHA1_BLK(i) + 0x5a827999 + SHA1_ROL(v, 5); \
w = SHA1_ROL(w, 30);
#define SHA1_BLK(i)
Definition sha1.cpp:34

Definition at line 40 of file sha1.cpp.

40#define SHA1_R1(v, w, x, y, z, i) \
41 z += ((w & (x ^ y)) ^ y) + SHA1_BLK(i) + 0x5a827999 + SHA1_ROL(v, 5); \
42 w = SHA1_ROL(w, 30);

◆ SHA1_R2

#define SHA1_R2 ( v,
w,
x,
y,
z,
i )
Value:
z += (w ^ x ^ y) + SHA1_BLK(i) + 0x6ed9eba1 + SHA1_ROL(v, 5); \
w = SHA1_ROL(w, 30);

Definition at line 43 of file sha1.cpp.

43#define SHA1_R2(v, w, x, y, z, i) \
44 z += (w ^ x ^ y) + SHA1_BLK(i) + 0x6ed9eba1 + SHA1_ROL(v, 5); \
45 w = SHA1_ROL(w, 30);

◆ SHA1_R3

#define SHA1_R3 ( v,
w,
x,
y,
z,
i )
Value:
z += (((w | x) & y) | (w & x)) + SHA1_BLK(i) + 0x8f1bbcdc + SHA1_ROL(v, 5); \
w = SHA1_ROL(w, 30);

Definition at line 46 of file sha1.cpp.

46#define SHA1_R3(v, w, x, y, z, i) \
47 z += (((w | x) & y) | (w & x)) + SHA1_BLK(i) + 0x8f1bbcdc + SHA1_ROL(v, 5); \
48 w = SHA1_ROL(w, 30);

◆ SHA1_R4

#define SHA1_R4 ( v,
w,
x,
y,
z,
i )
Value:
z += (w ^ x ^ y) + SHA1_BLK(i) + 0xca62c1d6 + SHA1_ROL(v, 5); \
w = SHA1_ROL(w, 30);

Definition at line 49 of file sha1.cpp.

49#define SHA1_R4(v, w, x, y, z, i) \
50 z += (w ^ x ^ y) + SHA1_BLK(i) + 0xca62c1d6 + SHA1_ROL(v, 5); \
51 w = SHA1_ROL(w, 30);

◆ SHA1_ROL

#define SHA1_ROL ( value,
bits )
Value:
(((value) << (bits)) | (((value) & 0xffffffff) >> (32 - (bits))))

Definition at line 33 of file sha1.cpp.