Proper sessions part 1
[link.git] / Includes / SHA512.hpp
blobcb07f4e1d89e94890e31649f3db277698b8b8653
1 #ifndef SHA512
3 #include <string>
5 namespace SHA512 {
6 std::string hash(const std::string input);
7 };
9 #define Ch(x,y,z) ((x&y)^(~x&z))
10 #define Maj(x,y,z) ((x&y)^(x&z)^(y&z))
11 #define RotR(x, n) ((x>>n)|(x<<((sizeof(x)<<3)-n)))
12 #define Sig0(x) ((RotR(x, 28))^(RotR(x,34))^(RotR(x, 39)))
13 #define Sig1(x) ((RotR(x, 14))^(RotR(x,18))^(RotR(x, 41)))
14 #define sig0(x) (RotR(x, 1)^RotR(x,8)^(x>>7))
15 #define sig1(x) (RotR(x, 19)^RotR(x,61)^(x>>6))
17 #endif