#include "Hash.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "picosha2.h"
Go to the source code of this file.
|
| #define | RMDsize 160 |
| |
| #define | BYTES_TO_DWORD(strptr) |
| |
| #define | ROL(x, n) (((x) << (n)) | ((x) >> (32-(n)))) |
| |
| #define | F(x, y, z) ((x) ^ (y) ^ (z)) |
| |
| #define | G(x, y, z) (((x) & (y)) | (~(x) & (z))) |
| |
| #define | H(x, y, z) (((x) | ~(y)) ^ (z)) |
| |
| #define | I(x, y, z) (((x) & (z)) | ((y) & ~(z))) |
| |
| #define | J(x, y, z) ((x) ^ ((y) | ~(z))) |
| |
| #define | FF(a, b, c, d, e, x, s) |
| |
| #define | GG(a, b, c, d, e, x, s) |
| |
| #define | HH(a, b, c, d, e, x, s) |
| |
| #define | II(a, b, c, d, e, x, s) |
| |
| #define | JJ(a, b, c, d, e, x, s) |
| |
| #define | FFF(a, b, c, d, e, x, s) |
| |
| #define | GGG(a, b, c, d, e, x, s) |
| |
| #define | HHH(a, b, c, d, e, x, s) |
| |
| #define | III(a, b, c, d, e, x, s) |
| |
| #define | JJJ(a, b, c, d, e, x, s) |
| |
- Author
- Gav Wood i@gav.nosp@m.wood.nosp@m..com
- Date
- 2014
Definition in file Hash.cpp.
| #define BYTES_TO_DWORD |
( |
|
strptr | ) |
|
Value:(((uint32_t) *((strptr)+3) << 24) | \
((uint32_t) *((strptr)+2) << 16) | \
((uint32_t) *((strptr)+1) << 8) | \
((uint32_t) *(strptr)))
Definition at line 68 of file Hash.cpp.
| #define F |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| ((x) ^ (y) ^ (z)) |
| #define FF |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(
a) +=
F((
b), (
c), (
d)) + (
x);\
}
Definition at line 86 of file Hash.cpp.
| #define FFF |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
| #define G |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| (((x) & (y)) | (~(x) & (z))) |
| #define GG |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(
a) +=
G((
b), (
c), (
d)) + (
x) + 0x5a827999
UL;\
}
Definition at line 91 of file Hash.cpp.
| #define GGG |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(
a) +=
G((
b), (
c), (
d)) + (
x) + 0x7a6d76e9
UL;\
}
Definition at line 116 of file Hash.cpp.
| #define H |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| (((x) | ~(y)) ^ (z)) |
| #define HH |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(
a) +=
H((
b), (
c), (
d)) + (
x) + 0x6ed9eba1
UL;\
}
Definition at line 96 of file Hash.cpp.
| #define HHH |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(
a) +=
H((
b), (
c), (
d)) + (
x) + 0x6d703ef3
UL;\
}
Definition at line 121 of file Hash.cpp.
| #define I |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| (((x) & (z)) | ((y) & ~(z))) |
| #define II |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(
a) +=
I((
b), (
c), (
d)) + (
x) + 0x8f1bbcdc
UL;\
}
Definition at line 101 of file Hash.cpp.
| #define III |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(
a) +=
I((
b), (
c), (
d)) + (
x) + 0x5c4dd124
UL;\
}
Definition at line 126 of file Hash.cpp.
| #define J |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| ((x) ^ ((y) | ~(z))) |
| #define JJ |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(
a) +=
J((
b), (
c), (
d)) + (
x) + 0xa953fd4e
UL;\
}
Definition at line 106 of file Hash.cpp.
| #define JJJ |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(
a) +=
J((
b), (
c), (
d)) + (
x) + 0x50a28be6
UL;\
}
Definition at line 131 of file Hash.cpp.
| #define ROL |
( |
|
x, |
|
|
|
n |
|
) |
| (((x) << (n)) | ((x) >> (32-(n)))) |