|
|
#define | F0(x, y, z) (z ^ (x & (y ^ z))) |
| |
|
#define | F1(x, y, z) (x ^ y ^ z) |
| |
|
#define | F2(x, y, z) ((x & y) | (z & (x | y))) |
| |
|
#define | F3(x, y, z) (x ^ y ^ z) |
| |
|
#define | ROL(x, y) ( (((uint32_t)(x)<<(uint32_t)((y)&31)) | (((uint32_t)(x)&0xFFFFFFFFUL)>>(uint32_t)((32-((y)&31))&31))) & 0xFFFFFFFFUL) |
| |
|
#define | ROR(x, y) ( ((((uint32_t)(x)&0xFFFFFFFFUL)>>(uint32_t)((y)&31)) | ((uint32_t)(x)<<(uint32_t)((32-((y)&31))&31))) & 0xFFFFFFFFUL) |
| |
|
#define | ROLc(x, y) ( (((uint32_t)(x)<<(uint32_t)((y)&31)) | (((uint32_t)(x)&0xFFFFFFFFUL)>>(uint32_t)((32-((y)&31))&31))) & 0xFFFFFFFFUL) |
| |
|
#define | RORc(x, y) ( ((((uint32_t)(x)&0xFFFFFFFFUL)>>(uint32_t)((y)&31)) | ((uint32_t)(x)<<(uint32_t)((32-((y)&31))&31))) & 0xFFFFFFFFUL) |
| |
| #define | STORE64H(x, y) |
| |
| #define | STORE32H(x, y) |
| |
| #define | LOAD32H(x, y) |
| |
|
#define | MIN(x, y) ( ((x)<(y))?(x):(y) ) |
| |
|
#define | FF0(a, b, c, d, e, i) e = (ROLc(a, 5) + F0(b,c,d) + e + W[i] + 0x5a827999UL); b = ROLc(b, 30); |
| |
|
#define | FF1(a, b, c, d, e, i) e = (ROLc(a, 5) + F1(b,c,d) + e + W[i] + 0x6ed9eba1UL); b = ROLc(b, 30); |
| |
|
#define | FF2(a, b, c, d, e, i) e = (ROLc(a, 5) + F2(b,c,d) + e + W[i] + 0x8f1bbcdcUL); b = ROLc(b, 30); |
| |
|
#define | FF3(a, b, c, d, e, i) e = (ROLc(a, 5) + F3(b,c,d) + e + W[i] + 0xca62c1d6UL); b = ROLc(b, 30); |
| |
|
|
constexpr Sha1Status | Detail::sha1Compress (Sha1State &md, const unsigned char *buffer) |
| |
| template<bool HasTrailingZero = false, std::uint32_t N> |
| constexpr Sha1Status | Detail::sha1Process (Sha1State &md, const unsigned char(&in)[N]) |
| | Process a block of memory though the hash. More...
|
| |
| constexpr Sha1Status | Detail::sha1Done (Sha1State &md, unsigned char *const out) |
| | Terminate the hash to get the digest. More...
|
| |
| template<bool HasTrailingZero = false, std::size_t N> |
| constexpr std::array< unsigned char, 20 > | ct_sha1 (const unsigned char(&in)[N]) |
| | Calculates the SHA-1 digest in compile-time if the arguments are constexpr. More...
|
| |
Compile time SHA-1 hash calculation.
- Author
- Martin Kraner
- Date
- 04/03/2019
- Version
- 1.0