Strophe 0.13
XMPP client library
sha256.c File Reference

Macros

#define Ch(x, y, z)
 
#define Maj(x, y, z)
 
#define S(x, n)
 
#define R(x, n)
 
#define Sigma0(x)
 
#define Sigma1(x)
 
#define Gamma0(x)
 
#define Gamma1(x)
 
#define RND(a, b, c, d, e, f, g, h, i, ki)
 

Functions

static void sha256_compress (sha256_context *md, const uint8_t *buf)
 
void sha256_init (sha256_context *md)
 
void sha256_process (sha256_context *md, const uint8_t *in, size_t inlen)
 
void sha256_done (sha256_context *md, uint8_t *out)
 
void sha256_hash (const uint8_t *data, size_t len, uint8_t *digest)
 

Macro Definition Documentation

◆ Ch

#define Ch ( x,
y,
z )
Value:
(z ^ (x & (y ^ z)))

◆ Maj

#define Maj ( x,
y,
z )
Value:
(((x | y) & z) | (x & y))

◆ S

#define S ( x,
n )
Value:
RORc((x), (n))
#define RORc(x, y)
Definition sha.h:99

◆ R

#define R ( x,
n )
Value:
(((x)&0xFFFFFFFFUL) >> (n))

◆ Sigma0

#define Sigma0 ( x)
Value:
(S(x, 2) ^ S(x, 13) ^ S(x, 22))
#define S(x, n)
Definition sha256.c:11

◆ Sigma1

#define Sigma1 ( x)
Value:
(S(x, 6) ^ S(x, 11) ^ S(x, 25))

◆ Gamma0

#define Gamma0 ( x)
Value:
(S(x, 7) ^ S(x, 18) ^ R(x, 3))
#define R(x, n)
Definition sha256.c:12

◆ Gamma1

#define Gamma1 ( x)
Value:
(S(x, 17) ^ S(x, 19) ^ R(x, 10))

◆ RND

#define RND ( a,
b,
c,
d,
e,
f,
g,
h,
i,
ki )
Value:
t0 = h + Sigma1(e) + Ch(e, f, g) + ki + W[i]; \
t1 = Sigma0(a) + Maj(a, b, c); \
d += t0; \
h = t0 + t1;
#define Maj(x, y, z)
Definition sha256.c:10
#define Sigma0(x)
Definition sha256.c:13
#define Sigma1(x)
Definition sha256.c:14
#define Ch(x, y, z)
Definition sha256.c:9

Function Documentation

◆ sha256_compress()

static void sha256_compress ( sha256_context * md,
const uint8_t * buf )
static

◆ sha256_init()

void sha256_init ( sha256_context * md)

◆ sha256_process()

void sha256_process ( sha256_context * md,
const uint8_t * in,
size_t inlen )

◆ sha256_done()

void sha256_done ( sha256_context * md,
uint8_t * out )

◆ sha256_hash()

void sha256_hash ( const uint8_t * data,
size_t len,
uint8_t * digest )