RTEMS CPU Kit with SuperCore  4.11.3
Macros | Functions
sha256c.c File Reference
#include <sys/cdefs.h>
#include <sys/endian.h>
#include <sys/types.h>
#include <string.h>
#include "sha256.h"
Include dependency graph for sha256c.c:

Macros

#define be32enc_vect(dst, src, len)   memcpy((void *)dst, (const void *)src, (size_t)len)
 
#define be32dec_vect(dst, src, len)   memcpy((void *)dst, (const void *)src, (size_t)len)
 
#define Ch(x, y, z)   ((x & (y ^ z)) ^ z)
 
#define Maj(x, y, z)   ((x & (y | z)) | (y & z))
 
#define SHR(x, n)   (x >> n)
 
#define ROTR(x, n)   ((x >> n) | (x << (32 - n)))
 
#define S0(x)   (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
 
#define S1(x)   (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
 
#define s0(x)   (ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3))
 
#define s1(x)   (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10))
 
#define RND(a, b, c, d, e, f, g, h, k)
 
#define RNDr(S, W, i, k)
 

Functions

 __FBSDID ("$FreeBSD$")
 
void SHA256_Init (SHA256_CTX *ctx)
 
void SHA256_Update (SHA256_CTX *ctx, const void *in, size_t len)
 
void SHA256_Final (unsigned char digest[32], SHA256_CTX *ctx)
 

Macro Definition Documentation

◆ RND

#define RND (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
 
)
Value:
t0 = h + S1(e) + Ch(e, f, g) + k; \
t1 = S0(a) + Maj(a, b, c); \
d += t0; \
h = t0 + t1;

◆ RNDr

#define RNDr (   S,
  W,
  i,
 
)
Value:
RND(S[(64 - i) % 8], S[(65 - i) % 8], \
S[(66 - i) % 8], S[(67 - i) % 8], \
S[(68 - i) % 8], S[(69 - i) % 8], \
S[(70 - i) % 8], S[(71 - i) % 8], \
W[i] + k)