LLVM 20.0.0git
Namespaces | Macros
SHA256.cpp File Reference
#include "llvm/Support/SHA256.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/SwapByteOrder.h"
#include <string.h>

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Macros

#define SHR(x, c)   ((x) >> (c))
 
#define ROTR(x, n)   (((x) >> n) | ((x) << (32 - (n))))
 
#define CH(x, y, z)   (((x) & (y)) ^ (~(x) & (z)))
 
#define MAJ(x, y, z)   (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
 
#define SIGMA_0(x)   (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
 
#define SIGMA_1(x)   (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
 
#define SIGMA_2(x)   (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10))
 
#define SIGMA_3(x)   (ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3))
 
#define F_EXPAND(A, B, C, D, E, F, G, H, M1, M2, M3, M4, k)
 

Macro Definition Documentation

◆ CH

#define CH (   x,
  y,
 
)    (((x) & (y)) ^ (~(x) & (z)))

Definition at line 34 of file SHA256.cpp.

◆ F_EXPAND

#define F_EXPAND (   A,
  B,
  C,
  D,
  E,
  F,
  G,
  H,
  M1,
  M2,
  M3,
  M4,
 
)
Value:
do { \
H += SIGMA_1(E) + CH(E, F, G) + M1 + k; \
D += H; \
H += SIGMA_0(A) + MAJ(A, B, C); \
M1 += SIGMA_2(M2) + M3 + SIGMA_3(M4); \
} while (0);
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define F(x, y, z)
Definition: MD5.cpp:55
#define G(x, y, z)
Definition: MD5.cpp:56
#define H(x, y, z)
Definition: MD5.cpp:57
#define CH(x, y, z)
Definition: SHA256.cpp:34
#define SIGMA_3(x)
Definition: SHA256.cpp:41
#define SIGMA_1(x)
Definition: SHA256.cpp:38
#define SIGMA_2(x)
Definition: SHA256.cpp:40
#define MAJ(x, y, z)
Definition: SHA256.cpp:35
#define SIGMA_0(x)
Definition: SHA256.cpp:37

Definition at line 43 of file SHA256.cpp.

◆ MAJ

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

Definition at line 35 of file SHA256.cpp.

◆ ROTR

#define ROTR (   x,
 
)    (((x) >> n) | ((x) << (32 - (n))))

Definition at line 32 of file SHA256.cpp.

◆ SHR

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

Definition at line 31 of file SHA256.cpp.

◆ SIGMA_0

#define SIGMA_0 (   x)    (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))

Definition at line 37 of file SHA256.cpp.

◆ SIGMA_1

#define SIGMA_1 (   x)    (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))

Definition at line 38 of file SHA256.cpp.

◆ SIGMA_2

#define SIGMA_2 (   x)    (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10))

Definition at line 40 of file SHA256.cpp.

◆ SIGMA_3

#define SIGMA_3 (   x)    (ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3))

Definition at line 41 of file SHA256.cpp.