#include "Hash.h"
#include <secp256k1_sha256.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.
◆ BYTES_TO_DWORD
| #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 69 of file Hash.cpp.
| #define F |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| ((x) ^ (y) ^ (z)) |
◆ FF
| #define FF |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(a) +=
F((b), (c), (d)) + (x);\
(a) =
ROL((a), (s)) + (e);\
}
Definition at line 87 of file Hash.cpp.
◆ FFF
| #define FFF |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(a) +=
F((b), (c), (d)) + (x);\
(a) =
ROL((a), (s)) + (e);\
}
Definition at line 112 of file Hash.cpp.
| #define G |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| (((x) & (y)) | (~(x) & (z))) |
◆ GG
| #define GG |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(a) +=
G((b), (c), (d)) + (x) + 0x5a827999UL;\
(a) =
ROL((a), (s)) + (e);\
}
Definition at line 92 of file Hash.cpp.
◆ GGG
| #define GGG |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(a) +=
G((b), (c), (d)) + (x) + 0x7a6d76e9UL;\
(a) =
ROL((a), (s)) + (e);\
}
Definition at line 117 of file Hash.cpp.
| #define H |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| (((x) | ~(y)) ^ (z)) |
◆ HH
| #define HH |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(a) +=
H((b), (c), (d)) + (x) + 0x6ed9eba1UL;\
(a) =
ROL((a), (s)) + (e);\
}
Definition at line 97 of file Hash.cpp.
◆ HHH
| #define HHH |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(a) +=
H((b), (c), (d)) + (x) + 0x6d703ef3UL;\
(a) =
ROL((a), (s)) + (e);\
}
Definition at line 122 of file Hash.cpp.
| #define I |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| (((x) & (z)) | ((y) & ~(z))) |
◆ II
| #define II |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(a) +=
I((b), (c), (d)) + (x) + 0x8f1bbcdcUL;\
(a) =
ROL((a), (s)) + (e);\
}
Definition at line 102 of file Hash.cpp.
◆ III
| #define III |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(a) +=
I((b), (c), (d)) + (x) + 0x5c4dd124UL;\
(a) =
ROL((a), (s)) + (e);\
}
Definition at line 127 of file Hash.cpp.
| #define J |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| ((x) ^ ((y) | ~(z))) |
◆ JJ
| #define JJ |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(a) +=
J((b), (c), (d)) + (x) + 0xa953fd4eUL;\
(a) =
ROL((a), (s)) + (e);\
}
Definition at line 107 of file Hash.cpp.
◆ JJJ
| #define JJJ |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
x, |
|
|
|
s |
|
) |
| |
Value:{\
(a) +=
J((b), (c), (d)) + (x) + 0x50a28be6UL;\
(a) =
ROL((a), (s)) + (e);\
}
Definition at line 132 of file Hash.cpp.
◆ RMDsize
◆ ROL
| #define ROL |
( |
|
x, |
|
|
|
n |
|
) |
| (((x) << (n)) | ((x) >> (32-(n)))) |