Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cHashSHA512.cpp File Reference
#include "pch.h"
#include "Hash/cHashSHA512.h"
#include "GrayCore/include/cBits.h"

Namespaces

 GrayLib
 

Macros

#define SHR(x, n)   (x >> n)
 
#define S0(x)   (cBits::Rotr<UINT64>(x, 1) ^ cBits::Rotr<UINT64>(x, 8) ^ SHR(x, 7))
 
#define S1(x)   (cBits::Rotr<UINT64>(x,19) ^ cBits::Rotr<UINT64>(x,61) ^ SHR(x, 6))
 
#define S2(x)   (cBits::Rotr<UINT64>(x,28) ^ cBits::Rotr<UINT64>(x,34) ^ cBits::Rotr<UINT64>(x,39))
 
#define S3(x)   (cBits::Rotr<UINT64>(x,14) ^ cBits::Rotr<UINT64>(x,18) ^ cBits::Rotr<UINT64>(x,41))
 
#define F0(x, y, z)   ((x & y) | (z & (x | y)))
 
#define F1(x, y, z)   (z ^ (x & (y ^ z)))
 
#define P(a, b, c, d, e, f, g, h, x, K)
 

Detailed Description

FIPS-180-2 compliant SHA-384/512 implementation The SHA-512 Secure Hash Standard was published by NIST in 2002. http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf

Macro Definition Documentation

◆ F0

#define F0 (   x,
  y,
 
)    ((x & y) | (z & (x | y)))

◆ F1

#define F1 (   x,
  y,
 
)    (z ^ (x & (y ^ z)))

◆ P

#define P (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  x,
  K 
)
Value:
{ \
UINT64 temp1 = h + S3(e) + F1(e,f,g) + K + x; \
UINT64 temp2 = S2(a) + F0(a,b,c); \
d += temp1; h = temp1 + temp2; i++; \
}
Using X files without the sources and the makefile How to use you just create a debug directory e g
Definition: Readme.txt:21
#define K
#define F1(x, y, z)
#define S2(x)
#define F0(x, y, z)
#define S3(x)

◆ S0

#define S0 (   x)    (cBits::Rotr<UINT64>(x, 1) ^ cBits::Rotr<UINT64>(x, 8) ^ SHR(x, 7))

◆ S1

#define S1 (   x)    (cBits::Rotr<UINT64>(x,19) ^ cBits::Rotr<UINT64>(x,61) ^ SHR(x, 6))

◆ S2

#define S2 (   x)    (cBits::Rotr<UINT64>(x,28) ^ cBits::Rotr<UINT64>(x,34) ^ cBits::Rotr<UINT64>(x,39))

◆ S3

#define S3 (   x)    (cBits::Rotr<UINT64>(x,14) ^ cBits::Rotr<UINT64>(x,18) ^ cBits::Rotr<UINT64>(x,41))

◆ SHR

#define SHR (   x,
 
)    (x >> n)